예제 #1
0
def plastic_model(E, Y, a, nu=0.3):
    elmodel = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
                                                     "poissons")

    surf = surfaces.IsoJ2()

    return models.SmallStrainPerfectPlasticity(elmodel, surf, Y, alpha=a)
예제 #2
0
    def setUp(self):
        self.hist0 = np.zeros((6, ))

        self.A = 1.85e-10
        self.n = 2.5

        self.smodel = creep.PowerLawCreep(self.A, self.n)
        self.cmodel = creep.J2CreepModel(self.smodel)

        self.E = 150000.0
        self.nu = 0.3
        self.sY = 200.0

        self.elastic = elasticity.IsotropicLinearElasticModel(
            self.E, "youngs", self.nu, "poissons")
        self.surface = surfaces.IsoJ2()

        self.pmodel = models.SmallStrainPerfectPlasticity(
            self.elastic, self.surface, self.sY)

        self.model = models.SmallStrainCreepPlasticity(self.elastic,
                                                       self.pmodel,
                                                       self.cmodel)

        self.efinal = np.array([0.1, -0.05, 0.02, -0.05, 0.1, -0.15])
        self.tfinal = 10.0
        self.T = 300.0
        self.nsteps = 10
예제 #3
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_j2isocomb")

        E = 150000.0
        nu = 0.3

        ys = 100.0
        H = 100.0
        r = 100.0
        d = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            E, "youngs", nu, "poissons")

        surface = surfaces.IsoJ2()
        hrule1 = hardening.LinearIsotropicHardeningRule(ys, H)
        hrule2 = hardening.VoceIsotropicHardeningRule(0.0, r, d)
        hrule = hardening.CombinedIsotropicHardeningRule([hrule1, hrule2])
        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        self.model2 = models.SmallStrainRateIndependentPlasticity(
            elastic, flow)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.1, 0, 0, 0, 0, 0])
예제 #4
0
    def setUp(self):
        self.hist0 = np.zeros((7, ))

        self.E = 92000.0
        self.nu = 0.3

        self.mu = self.E / (2 * (1 + self.nu))
        self.K = self.E / (3 * (1 - 2 * self.nu))

        self.s0 = 180.0
        self.R = 150.0
        self.d = 10.0

        self.elastic = elasticity.IsotropicLinearElasticModel(
            self.mu, "shear", self.K, "bulk")

        surface = surfaces.IsoJ2()
        hrule = hardening.VoceIsotropicHardeningRule(self.s0, self.R, self.d)
        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        self.model = models.SmallStrainRateIndependentPlasticity(
            self.elastic, flow, check_kt=False)

        self.efinal = np.array([0.1, -0.05, 0.02, -0.03, 0.1, -0.15])
        self.tfinal = 10.0
        self.T = 300.0
        self.nsteps = 10
예제 #5
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml",
                                      "test_creep_plasticity")

        A = 1.85e-10
        n = 2.5

        smodel = creep.PowerLawCreep(A, n)
        cmodel = creep.J2CreepModel(smodel)

        E = 150000.0
        nu = 0.3
        sY = 200.0
        H = E / 50.0

        elastic = elasticity.IsotropicLinearElasticModel(
            E, "youngs", nu, "poissons")
        surface = surfaces.IsoJ2()
        iso = hardening.LinearIsotropicHardeningRule(sY, H)
        flow = ri_flow.RateIndependentAssociativeFlow(surface, iso)

        pmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)

        self.model2 = models.SmallStrainCreepPlasticity(
            elastic, pmodel, cmodel)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.1, 0, 0, 0, 0, 0])
예제 #6
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_powerdamage")

        E = 92000.0
        nu = 0.3

        s0 = 180.0
        Kp = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            E, "youngs", nu, "poissons")

        surface = surfaces.IsoJ2()
        hrule = hardening.LinearIsotropicHardeningRule(s0, Kp)

        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        bmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)

        a = 2.2
        A = 2e-5
        self.model2 = damage.NEMLPowerLawDamagedModel_sd(elastic, A, a, bmodel)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.05, 0, 0, 0, 0, 0])
예제 #7
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_pcreep")

        E = [-100, 100000]
        nu = 0.3

        youngs = interpolate.PolynomialInterpolate(E)
        poissons = interpolate.ConstantInterpolate(nu)
        elastic = elasticity.IsotropicLinearElasticModel(
            youngs, "youngs", poissons, "poissons")

        surface = surfaces.IsoJ2()

        Ts = [100.0, 300.0, 500.0, 700.0]
        Sys = [1000.0, 120.0, 60.0, 30.0]

        yields = interpolate.PiecewiseLinearInterpolate(Ts, Sys)

        pmodel = models.SmallStrainPerfectPlasticity(elastic, surface, yields)

        self.T = 550.0
        self.tmax = 10.0
        self.nsteps = 50.0
        self.emax = np.array([0.1, 0.05, 0, -0.025, 0, 0])

        A = 1.85e-10
        n = 2.5

        smodel = creep.PowerLawCreep(A, n)
        cmodel = creep.J2CreepModel(smodel)

        self.model2 = models.SmallStrainCreepPlasticity(
            elastic, pmodel, cmodel)
예제 #8
0
파일: test_parse.py 프로젝트: dvp2015/neml
    def setUp(self):
        string_rep = '<test_j2iso type="SmallStrainRateIndependentPlasticity"><elastic type="IsotropicLinearElasticModel"><m1>103561.64383561644</m1><m1_type>youngs</m1_type><m2>0.2945205479452055</m2><m2_type>poissons</m2_type></elastic><flow type="RateIndependentAssociativeFlow"><surface type="IsoJ2"/><hardening type="LinearIsotropicHardeningRule"><s0>100.0</s0><K>1000.0</K></hardening></flow></test_j2iso>'

        self.model1 = parse.parse_string(string_rep)

        mu = 40000.0
        K = 84000.0

        ys = 100.0
        H = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            mu, "shear", K, "bulk")

        surface = surfaces.IsoJ2()
        hrule = hardening.LinearIsotropicHardeningRule(ys, H)
        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        self.model2 = models.SmallStrainRateIndependentPlasticity(
            elastic, flow)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100
        self.emax = np.array([0.1, 0, 0, 0, 0, 0])
예제 #9
0
def example4():
  # T is in hours, strain in percent, stress in MPa
  A = 1.85e-10
  n = 2.5
  m = 0.3

  smodel = creep.PowerLawCreep(A, n)
  cmodel = creep.J2CreepModel(smodel)

  E = 150000.0
  nu = 0.3
  sY = 200.0
  H = E / 25.0

  elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
      "poissons")
  surface = surfaces.IsoJ2()
  iso = hardening.LinearIsotropicHardeningRule(sY, H)
  flow = ri_flow.RateIndependentAssociativeFlow(surface, iso)

  pmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)
  model = models.SmallStrainCreepPlasticity(elastic, pmodel, cmodel)

  res = drivers.creep(model, 205.0, 3600.0, 100.0, verbose = False, 
      nsteps_up = 500)
  plt.plot(res['strain'], res['stress'])
  plt.show()
예제 #10
0
파일: test_parse.py 프로젝트: dvp2015/neml
    def setUp(self):
        self.model1 = parse.parse_xml(localize("examples.xml"), "test_perfect")

        E = [-100, 100000]
        nu = 0.3

        youngs = interpolate.PolynomialInterpolate(E)
        poissons = interpolate.ConstantInterpolate(nu)
        elastic = elasticity.IsotropicLinearElasticModel(
            youngs, "youngs", poissons, "poissons")

        surface = surfaces.IsoJ2()

        Ts = [100.0, 300.0, 500.0, 700.0]
        Sys = [1000.0, 120.0, 60.0, 30.0]

        yields = interpolate.PiecewiseLinearInterpolate(Ts, Sys)

        self.model2 = models.SmallStrainPerfectPlasticity(
            elastic, surface, yields)

        self.T = 550.0
        self.tmax = 10.0
        self.nsteps = 50
        self.emax = np.array([0.1, 0.05, 0, -0.025, 0, 0])
예제 #11
0
 def test_perfect_plasicity(self):
     surface = surfaces.IsoJ2()
     sy = 100.0
     model = models.SmallStrainPerfectPlasticity(self.elastic1, surface, sy)
     self.are_equal(self.elastic1, model.elastic)
     model.set_elastic_model(self.elastic2)
     self.are_equal(self.elastic2, model.elastic)
예제 #12
0
    def setUp(self):
        self.hist0 = np.zeros((7, ))

        self.hist0 = np.zeros((7, ))

        self.E = 92000.0
        self.nu = 0.3

        self.mu = self.E / (2 * (1 + self.nu))
        self.K = self.E / (3 * (1 - 2 * self.nu))

        self.s0 = 180.0
        self.R = 150.0
        self.d = 10.0

        self.n = 2.0
        self.eta = 200.0

        self.elastic = elasticity.IsotropicLinearElasticModel(
            self.mu, "shear", self.K, "bulk")

        surface = surfaces.IsoJ2()
        hrule = hardening.VoceIsotropicHardeningRule(self.s0, self.R, self.d)
        g = visco_flow.GPowerLaw(self.n, self.eta)

        vmodel = visco_flow.PerzynaFlowRule(surface, hrule, g)

        flow = general_flow.TVPFlowRule(self.elastic, vmodel)
        self.model = models.GeneralIntegrator(self.elastic, flow)

        self.efinal = np.array([0.05, 0, 0, 0.02, 0, -0.01])
        self.tfinal = 10.0
        self.T = 300.0
        self.nsteps = 100
예제 #13
0
    def setUp(self):
        self.hist0 = np.zeros((13, ))

        self.A = 1.85e-10
        self.n = 2.5

        self.smodel = creep.PowerLawCreep(self.A, self.n)
        self.cmodel = creep.J2CreepModel(self.smodel)

        self.E = 150000.0
        self.nu = 0.3
        self.sY = 200.0
        self.H = self.E / 50.0

        self.elastic = elasticity.IsotropicLinearElasticModel(
            self.E, "youngs", self.nu, "poissons")

        self.surface = surfaces.IsoJ2()
        self.iso = hardening.LinearIsotropicHardeningRule(self.sY, self.H)
        self.flow = ri_flow.RateIndependentAssociativeFlow(
            self.surface, self.iso)

        self.pmodel = models.SmallStrainRateIndependentPlasticity(
            self.elastic, self.flow)

        self.model = models.SmallStrainCreepPlasticity(self.elastic,
                                                       self.pmodel,
                                                       self.cmodel)

        self.efinal = np.array([0.1, -0.05, 0.02, -0.03, 0.1, -0.15])
        self.tfinal = 10.0
        self.T = 300.0
        self.nsteps = 10
예제 #14
0
    def setUp(self):
        self.E = 100000.0
        self.nu = 0.29
        self.sY = 100.0
        self.H = 1200.0

        elastic = elasticity.IsotropicLinearElasticModel(
            self.E, "youngs", self.nu, "poissons")
        surf = surfaces.IsoJ2()
        hard = hardening.LinearIsotropicHardeningRule(self.sY, self.H)
        flow = ri_flow.RateIndependentAssociativeFlow(surf, hard)
        self.model = models.SmallStrainRateIndependentPlasticity(elastic, flow)

        self.conditions = [{
            'hist_n':
            self.model.init_store(),
            'stress_n':
            np.zeros((6, )),
            'd_n':
            np.zeros((6, )),
            'd_np1':
            np.array([0.1, 0.05, -0.025, 0.15, 0.2, -0.05]),
            'w_n':
            np.zeros((3, )),
            'w_np1':
            np.array([-0.15, 0.1, 0.05]),
            'dt':
            1.0,
            'T':
            300.0
        }, {
            'hist_n':
            self.model.init_store(),
            'stress_n':
            np.array([10.0, -5.0, 30.0, -5.0, 10.0, 15.0]),
            'd_n':
            np.zeros((6, )),
            'd_np1':
            np.array([0.05, 0.5, 0.25, 0.20, -0.2, 0.25]),
            'w_n':
            np.zeros((3, )),
            'w_np1':
            np.array([-0.15, 0.25, 0.05]),
            'dt':
            1.0,
            'T':
            300.0
        }]

        self.directions = [{
            'd': np.array([0.1, -0.15, 0.2, -0.05, 0.15, 0.25]),
            'w': np.array([0.25, -0.15, 0.1])
        }]

        self.nsteps = 10
        self.dt = 1.0
        self.T = 300.0
예제 #15
0
def single_material_generator(E, nu, sY, alpha):
    elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
                                                     "poissons")
    surface = surfaces.IsoJ2()
    model = models.SmallStrainPerfectPlasticity(elastic,
                                                surface,
                                                sY,
                                                alpha=alpha)

    return model
예제 #16
0
  def setUp(self):
    self.s0 = 200.0
    self.K = 15000.0

    self.surface = surfaces.IsoJ2()
    self.hardening = hardening.LinearIsotropicHardeningRule(self.s0, self.K)
    self.model = ri_flow.RateIndependentAssociativeFlow(self.surface, self.hardening)

    self.hist0 = np.zeros((1,))
    
    self.T = 300.0
예제 #17
0
def gen_material(E, nu, sY, alpha, A, n):
  """
    Generate a perfectly plastic + creep material model.
  """
  elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, 
      "poissons")
  surface = surfaces.IsoJ2()

  pmodel = models.SmallStrainPerfectPlasticity(elastic, surface, sY)
  smodel = creep.PowerLawCreep(A, n)
  cmodel = creep.J2CreepModel(smodel)

  return models.SmallStrainCreepPlasticity(elastic, pmodel, cmodel, alpha = alpha)
예제 #18
0
 def test_ri_plasticity(self):
     surface = surfaces.IsoJ2()
     sy = 100.0
     K = 1000.0
     H = 500.0
     hrule = hardening.CombinedHardeningRule(
         hardening.LinearIsotropicHardeningRule(sy, K),
         hardening.LinearKinematicHardeningRule(H))
     flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)
     model = models.SmallStrainRateIndependentPlasticity(
         self.elastic1, flow)
     self.are_equal(self.elastic1, model.elastic)
     model.set_elastic_model(self.elastic2)
     self.are_equal(self.elastic2, model.elastic)
예제 #19
0
    def setUp(self):
        self.s0 = 100.0
        self.Kp = 1500.0

        self.n = 2.0
        self.eta = 100.0

        self.surface = surfaces.IsoJ2()
        self.hrule = hardening.LinearIsotropicHardeningRule(self.s0, self.Kp)
        self.g = visco_flow.GPowerLaw(self.n, self.eta)

        self.model = visco_flow.PerzynaFlowRule(self.surface, self.hrule,
                                                self.g)

        self.hist0 = np.zeros((1, ))
        self.T = 300.0
예제 #20
0
    def setUp(self):
        E = 150000.0
        nu = 0.3

        ys = 100.0
        H = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            E, "youngs", nu, "poissons")

        surface = surfaces.IsoJ2()
        hrule = hardening.LinearIsotropicHardeningRule(ys, H)
        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        self.model = models.SmallStrainRateIndependentPlasticity(elastic, flow)

        self.nblock = 100
예제 #21
0
    def test_creep_plasticity(self):
        surface = surfaces.IsoJ2()
        sy = 100.0
        bmodel = models.SmallStrainPerfectPlasticity(self.elastic1, surface,
                                                     sy)
        A = 1.85e-10
        n = 12.0

        smodel = creep.PowerLawCreep(A, n)
        cmodel = creep.J2CreepModel(smodel)
        model = models.SmallStrainCreepPlasticity(self.elastic1, bmodel,
                                                  cmodel)

        self.very_close(model, self.emodel1)

        model.set_elastic_model(self.elastic2)

        self.very_close(model, self.emodel2)
예제 #22
0
    def setUp(self):
        self.s0 = 180.0
        self.R = 150.0
        self.d = 10.0

        self.n = 5.0
        self.eta = 20.0

        self.surface = surfaces.IsoJ2()
        self.hrule = hardening.VoceIsotropicHardeningRule(
            self.s0, self.R, self.d)
        self.g = visco_flow.GPowerLaw(self.n, self.eta)

        self.model = visco_flow.PerzynaFlowRule(self.surface, self.hrule,
                                                self.g)

        self.hist0 = np.zeros((1, ))
        self.T = 300.0
예제 #23
0
    def test_rd(self):
        s0 = 10.0
        R = 150.0
        d = 10.0

        n = 3.0
        eta = 200.0

        surface = surfaces.IsoJ2()
        hrule = hardening.VoceIsotropicHardeningRule(s0, R, d)
        g = visco_flow.GPowerLaw(n, eta)

        vmodel = visco_flow.PerzynaFlowRule(surface, hrule, g)
        flow = general_flow.TVPFlowRule(self.elastic1, vmodel)
        model = models.GeneralIntegrator(self.elastic1, flow)

        self.very_close(model, self.emodel1)

        model.set_elastic_model(self.elastic2)

        self.very_close(model, self.emodel2)
예제 #24
0
    def setUp(self):
        self.hist0 = np.zeros((0, ))

        self.E = 92000.0
        self.nu = 0.3

        self.mu = self.E / (2 * (1 + self.nu))
        self.K = self.E / (3 * (1 - 2 * self.nu))

        self.s0 = 180.0

        self.elastic = elasticity.IsotropicLinearElasticModel(
            self.mu, "shear", self.K, "bulk")

        surface = surfaces.IsoJ2()
        self.model = models.SmallStrainPerfectPlasticity(
            self.elastic, surface, self.s0)

        self.efinal = np.array([0.1, -0.05, 0.02, -0.03, 0.1, -0.15])
        self.tfinal = 10.0
        self.T = 300.0
        self.nsteps = 10
예제 #25
0
def example3():
  # T is in hours, strain in percent, stress in MPa
  A = 1.85e-10
  n = 2.5

  smodel = creep.PowerLawCreep(A, n)
  cmodel = creep.J2CreepModel(smodel)

  E = 150000.0
  nu = 0.3
  sY = 200.0
  H = E / 50.0

  elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
      "poissons")
  surface = surfaces.IsoJ2()
  iso = hardening.LinearIsotropicHardeningRule(sY, H)
  flow = ri_flow.RateIndependentAssociativeFlow(surface, iso)

  pmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)
  
  smax = 250.0
  R = -0.5
  srate = 1.0 * 3600.0
  ncycles = 25
  hold = 25

  res1 = drivers.stress_cyclic(pmodel, smax, R, srate, ncycles, 
      hold_time = [0,hold])

  model = models.SmallStrainCreepPlasticity(elastic, pmodel, cmodel, verbose = False)

  res2 = drivers.stress_cyclic(model, smax, R, srate, ncycles, 
      hold_time = [0,hold], verbose = False)

  plt.plot(res1['strain'], res1['stress'], 'k-')
  plt.plot(res2['strain'], res2['stress'], 'r-')
  plt.show()
예제 #26
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_j2iso")

        mu = 40000.0
        K = 84000.0

        ys = 100.0
        H = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            mu, "shear", K, "bulk")

        surface = surfaces.IsoJ2()
        hrule = hardening.LinearIsotropicHardeningRule(ys, H)
        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        self.model2 = models.SmallStrainRateIndependentPlasticity(
            elastic, flow)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.1, 0, 0, 0, 0, 0])
예제 #27
0
파일: power-law.py 프로젝트: dvp2015/neml
from neml import solvers, models, elasticity, drivers, surfaces, hardening, ri_flow, parse

import matplotlib.pyplot as plt
import numpy as np

if __name__ == "__main__":
    E = 100000.0
    nu = 0.3
    s0 = 100.0
    A = 200.0
    n = 0.2

    elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
                                                     "poissons")

    surface = surfaces.IsoJ2()
    iso = hardening.PowerLawIsotropicHardeningRule(s0, A, n)

    flow = ri_flow.RateIndependentAssociativeFlow(surface, iso)
    model = models.SmallStrainRateIndependentPlasticity(elastic, flow)

    model2 = parse.parse_xml("example.xml", "powerlaw")

    erate = 1.0

    res = drivers.uniaxial_test(model, erate, emax=0.1)
    res2 = drivers.uniaxial_test(model2, erate, emax=0.1)
    plt.plot(res['strain'], res['stress'])
    plt.plot(res2['strain'], res2['stress'], ls='--')
    plt.show()