コード例 #1
0
ファイル: test_damage.py プロジェクト: dvp2015/neml
  def setUp(self):
    self.E = 92000.0
    self.nu = 0.3

    self.s0 = 180.0
    self.Kp = 1000.0
    self.H = 1000.0

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

    surface = surfaces.IsoKinJ2()
    iso = hardening.LinearIsotropicHardeningRule(self.s0, self.Kp)
    kin = hardening.LinearKinematicHardeningRule(self.H)
    hrule = hardening.CombinedHardeningRule(iso, kin)

    flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

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

    self.fn = interpolate.PolynomialInterpolate([-6.653e-9,2.952e-4,-6.197e-1])
    self.C = 32.06

    self.lmr = larsonmiller.LarsonMillerRelation(self.fn, self.C)
    self.effective = damage.VonMisesEffectiveStress()

    self.model = damage.LarsonMillerCreepDamageModel_sd(
        self.elastic, self.lmr, self.effective, self.bmodel)

    self.stress = np.array([100,-50.0,300.0,-99,50.0,125.0])
    self.T = 100.0

    self.s_np1 = self.stress
    self.s_n = np.array([-25,150,250,-25,-100,25])

    self.d_np1 = 0.5
    self.d_n = 0.4

    self.e_np1 = np.array([0.1,-0.01,0.15,-0.05,-0.1,0.15])
    self.e_n = np.array([-0.05,0.025,-0.1,0.2,0.11,0.13])

    self.T_np1 = self.T
    self.T_n = 90.0

    self.t_np1 = 1.0
    self.t_n = 0.0
    self.dt = self.t_np1 - self.t_n

    self.u_n = 0.0
    self.p_n = 0.0
  
    # This is a rather boring baseline history state to probe, but I can't
    # think of a better way to get a "generic" history from a generic model
    self.hist_n = np.array([self.d_n] + list(self.bmodel.init_store()))
    self.x_trial = np.array([50,-25,150,-150,190,100.0] + [0.41])

    self.nsteps = 10
    self.etarget = np.array([0.1,-0.025,0.02,0.015,-0.02,-0.05])
    self.ttarget = 10.0
コード例 #2
0
ファイル: test_parse.py プロジェクト: khhsu0724/neml
    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)
コード例 #3
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])
コード例 #4
0
    def setUp(self):
        self.fn = interpolate.PolynomialInterpolate(
            [-6.653e-9, 2.952e-4, -6.197e-1])
        self.C = 32.06

        self.lmr = larsonmiller.LarsonMillerRelation(self.fn, self.C)

        self.T = 550 + 273.15
コード例 #5
0
ファイル: test_parse.py プロジェクト: khhsu0724/neml
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_yaguchi")

        mu_poly = [-0.11834615, 115.5, 48807.69]
        K_poly = [-0.256417, 250.25, 105750.0]

        shear = interpolate.PolynomialInterpolate(mu_poly)
        bulk = interpolate.PolynomialInterpolate(K_poly)
        elastic = elasticity.IsotropicLinearElasticModel(
            shear, "shear", bulk, "bulk")

        vmodel = visco_flow.YaguchiGr91FlowRule()

        flow = general_flow.TVPFlowRule(elastic, vmodel)

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

        self.T = 500.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.1, 0, 0, 0, 0, 0])
コード例 #6
0
ファイル: test_creep.py プロジェクト: dvp2015/neml
 def setUp(self):
   # Polynomial coefficients: log(creep rate) = np.polyval(poly, log(stress))
   self.poly = [2.5, -50.0, 365.0, -1200.0, 1500.0]
   self.ifn = interpolate.PolynomialInterpolate(self.poly)
   
   # Model only has one input parameter (the interpolation formula)
   self.model = creep.GenericCreep(self.ifn)
   
   self.T = 300.0  # Temperature to test at
   self.e = 0.1    # Effective strain to test at
   self.s = 150.0  # Effective stress to test at
   self.t = 10.0   # Time to test at
コード例 #7
0
    def setUp(self):
        vmodel = visco_flow.YaguchiGr91FlowRule()

        E_poly = np.array([-3.077e-1, 3.003e2, 1.269e5])
        nu = 0.3

        mu_poly = list(E_poly / (2 * (1 + nu)))
        K_poly = list(E_poly / (3 * (1 - 2 * nu)))

        shear = interpolate.PolynomialInterpolate(mu_poly)
        bulk = interpolate.PolynomialInterpolate(K_poly)
        self.elastic = elasticity.IsotropicLinearElasticModel(
            shear, "shear", bulk, "bulk")

        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 = 550.0
        self.nsteps = 100
コード例 #8
0
ファイル: test_damage.py プロジェクト: dvp2015/neml
  def setUp(self):
    self.E = 92000.0
    self.nu = 0.3

    self.s0 = 180.0
    self.Kp = 1000.0
    self.H = 1000.0

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

    surface = surfaces.IsoKinJ2()
    iso = hardening.LinearIsotropicHardeningRule(self.s0, self.Kp)
    kin = hardening.LinearKinematicHardeningRule(self.H)
    hrule = hardening.CombinedHardeningRule(iso, kin)

    flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

    self.bmodel = models.SmallStrainRateIndependentPlasticity(self.elastic, 
        flow)
    
    self.fn = interpolate.PolynomialInterpolate([0.1,5.0, 1e-8])
    self.n = 2.1

    self.model = damage.NEMLWorkDamagedModel_sd(
        self.elastic, self.fn, self.n, self.bmodel, verbose = False)

    self.stress = np.array([100,-50.0,300.0,-99,50.0,125.0]) * 0.75
    self.T = 100.0

    self.s_np1 = self.stress
    self.s_n = np.array([-25,150,250,-25,-100,25]) * 0.0

    self.d_np1 = 0.2
    self.d_n = 0.1

    self.e_np1 = np.array([0.1,-0.01,0.15,-0.05,-0.1,0.15]) * 0.75
    self.e_n = np.array([-0.05,0.025,-0.1,0.2,0.11,0.13]) * 0.0

    self.T_np1 = self.T
    self.T_n = 90.0

    self.t_np1 = 5000.0
    self.t_n = 0.9

    self.u_n = 0.0
    self.p_n = 0.0
  
    # This is a rather boring baseline history state to probe, but I can't
    # think of a better way to get a "generic" history from a generic model
    self.hist_n = np.array([self.d_n] + list(self.bmodel.init_store()))
    self.x_trial = np.array([50,-25,150,-150,190,100.0] + [0.41])

    self.nsteps = 10
    self.etarget = np.array([0.1,-0.025,0.02,0.015,-0.02,-0.05])
    self.ttarget = 2.0

    self.ee = np.dot(self.elastic.S(self.T_np1), self.s_np1*(1.0-self.d_np1) - self.s_n*(1.0-self.d_n))
    self.de = self.e_np1 - self.e_n
    self.dp = self.de - self.ee
    self.dt = self.t_np1 - self.t_n
    self.Wdot = np.dot(self.s_np1*(1.0-self.d_np1), self.dp) / self.dt
コード例 #9
0
ファイル: small_strain_drivers.py プロジェクト: dschwen/neml
    plt.xlabel("Strain (mm/mm)")
    plt.ylabel("Stress (MPa)")
    plt.title("Isochronous stress-strain curve")
    plt.tight_layout()
    plt.show()

    # Need a temperature sensitive model for this one!
    vmodel = visco_flow.YaguchiGr91FlowRule()

    E_poly = np.array([-3.077e-1, 3.003e2, 1.269e5])
    nu = 0.3

    mu_poly = list(E_poly / (2 * (1 + nu)))
    K_poly = list(E_poly / (3 * (1 - 2 * nu)))

    shear = interpolate.PolynomialInterpolate(mu_poly)
    bulk = interpolate.PolynomialInterpolate(K_poly)
    elastic = elasticity.IsotropicLinearElasticModel(shear, "shear", bulk,
                                                     "bulk")

    flow = general_flow.TVPFlowRule(elastic, vmodel)

    model = models.GeneralIntegrator(elastic, flow)

    # Thermomechanical
    time = list(np.linspace(0, 1000))
    Ts = list(np.linspace(500 + 273.15, 600 + 273.15))
    strains = list(np.linspace(0.0, 0.02))

    time = time + time[::-1][1:]
    Ts = Ts + Ts[::-1][1:]
コード例 #10
0
    def setUp(self):
        # Fully-defined perfectly plastic model
        Epoly = [-78.2759, 236951.0]
        nu = 0.3
        A = -9.6187
        B = -1.4819
        C = -5.0486
        g0 = 0.3708

        b = 0.248 * 1.0e-6
        kboltz = 1.38064e-23 * 1000.0
        eps0 = 1.0e10

        # Temperature range over which to consider (K)
        Tmin = 550.0
        Tmax = 950.0
        Trange = np.linspace(Tmin, Tmax)

        # Elastic
        E_m = interpolate.PolynomialInterpolate(Epoly)
        nu_m = interpolate.ConstantInterpolate(nu)
        elastic_m = elasticity.IsotropicLinearElasticModel(
            E_m, "youngs", nu_m, "poissons")
        self.elastic = elastic_m

        # Rate sensitivity interpolates values
        mu_values = np.array([elastic_m.G(T) for T in Trange])
        n_values = -mu_values * b**3.0 / (kboltz * Trange * A)
        eta_values = np.exp(B) * eps0**(kboltz * Trange * A /
                                        (mu_values * b**3.0)) * mu_values

        # Rate independent interpolate values
        flow_stress = mu_values * np.exp(C)

        # Common objects
        surface = surfaces.IsoKinJ2()
        hmodulus = interpolate.PolynomialInterpolate([-10.0, 12000.0])

        # Setup visco model
        n_interp = interpolate.PiecewiseLinearInterpolate(
            list(Trange), list(n_values))
        eta_interp = interpolate.PiecewiseLinearInterpolate(
            list(Trange), list(eta_values))
        eta_m = visco_flow.ConstantFluidity(eta_interp)

        iso_rd = hardening.LinearIsotropicHardeningRule(
            interpolate.ConstantInterpolate(0.0), hmodulus)
        hard_rd = hardening.Chaboche(
            iso_rd, [interpolate.ConstantInterpolate(0.0)],
            [hardening.ConstantGamma(interpolate.ConstantInterpolate(0.0))],
            [interpolate.ConstantInterpolate(0.0)],
            [interpolate.ConstantInterpolate(1.0)])

        visco_rd = visco_flow.ChabocheFlowRule(surface, hard_rd, eta_m,
                                               n_interp)
        general_rd = general_flow.TVPFlowRule(elastic_m, visco_rd)

        rate_dependent = models.GeneralIntegrator(elastic_m, general_rd)

        # Setup rate independent
        sy_interp = interpolate.PiecewiseLinearInterpolate(
            list(Trange), list(flow_stress))
        iso_ri = hardening.LinearIsotropicHardeningRule(sy_interp, hmodulus)
        hard_ri = hardening.Chaboche(
            iso_ri, [interpolate.ConstantInterpolate(0.0)],
            [hardening.ConstantGamma(interpolate.ConstantInterpolate(0.0))],
            [interpolate.ConstantInterpolate(0.0)],
            [interpolate.ConstantInterpolate(1.0)])
        flow_ri = ri_flow.RateIndependentNonAssociativeHardening(
            surface, hard_ri)

        rate_independent = models.SmallStrainRateIndependentPlasticity(
            elastic_m, flow_ri)

        # Combined model
        self.model = models.KMRegimeModel(elastic_m,
                                          [rate_independent, rate_dependent],
                                          [g0], kboltz, b, eps0)

        self.efinal = np.array([0.05, 0, 0, 0.02, 0, -0.01])
        self.tfinal = 10.0
        self.T = 700.0
        self.nsteps = 100
コード例 #11
0
ファイル: test_interpolate.py プロジェクト: dvp2015/neml
 def setUp(self):
     self.n = 5
     self.coefs = list((ra.random((self.n, )) * 0.5 - 1.0) * 2.0)
     self.x = ra.random((1, ))[0]
     self.interpolate = interpolate.PolynomialInterpolate(self.coefs)
コード例 #12
0
    b = 0.248 * 1.0e-6
    kboltz = 1.38064e-23 * 1000.0
    eps0 = 1.0e10

    A = -9.774577
    B = -1.407274
    C = -5.060187
    g0 = 0.373716

    K = 150000.0 / 50.0
    h = 1.0e-2
    l = 1.0

    # Elastic
    E_m = interpolate.PolynomialInterpolate(E_poly)
    nu_m = interpolate.ConstantInterpolate(nu)
    elastic_m = elasticity.IsotropicLinearElasticModel(E_m, "youngs", nu_m,
                                                       "poissons")

    # Rate sensitivity interpolates
    Ts_rate = np.linspace(Tmin, Tmax, num=nrate_sens)
    n_values = []
    eta_values = []
    flow_stress_values = []
    for T in Ts_rate:
        mu = elastic_m.G(T)
        n_values.append(-mu * b**3.0 / (kboltz * T * A))
        eta_values.append(
            np.exp(B) * eps0**(kboltz * T * A / (mu * b**3.0)) * mu)
        flow_stress_values.append(mu * np.exp(C))
コード例 #13
0
    A = -9.6187
    B = -1.4819
    C = -5.0486
    g0 = 0.3708

    b = 0.248 * 1.0e-6
    kboltz = 1.38064e-23 * 1000.0
    eps0 = 1.0e10

    # Temperature range over which to consider (K)
    Tmin = 550.0
    Tmax = 950.0
    Trange = np.linspace(Tmin, Tmax)

    # Elastic
    E_m = interpolate.PolynomialInterpolate(Epoly)
    nu_m = interpolate.ConstantInterpolate(nu)
    elastic_m = elasticity.IsotropicLinearElasticModel(E_m, "youngs", nu_m,
                                                       "poissons")

    # Rate sensitivity interpolates values
    mu_values = np.array([elastic_m.G(T) for T in Trange])
    n_values = -mu_values * b**3.0 / (kboltz * Trange * A)
    eta_values = np.exp(B) * eps0**(kboltz * Trange * A /
                                    (mu_values * b**3.0)) * mu_values

    # Rate independent interpolate values
    flow_stress = mu_values * np.exp(C)

    # Common objects
    surface = surfaces.IsoKinJ2()
コード例 #14
0
            210508.843537, 209469.387755, 208429.931973, 207451.428571,
            206515.918367, 205580.408163, 204526.530612, 203279.183673,
            202031.836735, 200838.367347, 199902.857143, 198967.346939,
            198031.836735, 197096.326531, 196160.816327, 195225.306122,
            194053.061224, 192805.714286, 191558.367347, 190311.020408,
            189063.673469, 187816.326531, 186568.979592, 185321.632653,
            184074.285714, 182826.938776, 181579.591837, 180332.244898,
            179084.897959, 177546.938776, 175987.755102, 174428.571429,
            172643.265306, 170772.244898, 168901.22449, 166868.571429,
            164685.714286, 162502.857143, 160222.857143, 157728.163265,
            155233.469388, 152738.77551, 150244.081633, 147749.387755,
            145254.693878, 142760.0
        ]), "youngs", 0.3, "poissons")
    bmodel = parse.parse_xml("example.xml", "gr91_simple")

    fn = interpolate.PolynomialInterpolate(
        [-6.65303514e-09, 2.95224385e-04, -6.19561357e-01])
    C = 28.0
    lmr = larsonmiller.LarsonMillerRelation(fn, C)
    estress = damage.VonMisesEffectiveStress()
    model = damage.LarsonMillerCreepDamageModel_sd(emodel, lmr, estress,
                                                   bmodel)

    T = 550 + 273.15

    lmps = []

    for s in srange:
        res = drivers.creep(model,
                            s,
                            100.0,
                            300000 * 3600.0,