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)
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
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])
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()
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
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)
def creep_ex(): E = 92000.0 nu = 0.3 s0 = 120.0 A = 1.0e-10 n = 3.0 Kp = E / 500 H = E / 500 smodel = creep.PowerLawCreep(A, n) cmodel = creep.J2CreepModel(smodel) elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, "poissons") surface = surfaces.IsoKinJ2() iso = hardening.LinearIsotropicHardeningRule(s0, Kp) kin = hardening.LinearKinematicHardeningRule(H) hrule = hardening.CombinedHardeningRule(iso, kin) flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule) pmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow) bmodel = models.SmallStrainCreepPlasticity(elastic, pmodel, cmodel) A_damg = 1.0e-2 a_damg = 1.0 model = damage.NEMLPowerLawDamagedModel_sd(elastic, A_damg, a_damg, bmodel, verbose=False) #res = drivers.uniaxial_test(model, 1.0e-2, emax = 0.25) #plt.plot(res['strain'], res['stress']) #plt.show() res = drivers.creep(model, 120.0, 1.0, 393.0, verbose=False) plt.plot(res['rtime'], res['rstrain']) plt.show() plt.loglog(res['rtime'], res['rrate']) plt.show()
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)
def setUp(self): self.A = 1.0e-10 self.m = 0.25 self.n = 5.0 self.smodel = creep.NortonBaileyCreep(self.A, self.m, self.n) self.model = creep.J2CreepModel(self.smodel) self.s = np.array([100.0, -25.0, -5.0, 20.0, 15.0, 3.0]) self.e = np.array([0.05, -0.01, -0.01, 0.025, 0.03, -0.01]) self.x = np.array([0.06, 0.01, 0.02, 0.01, 0.02, -0.05]) self.T = 300.0 self.t = 10.0 self.dt = 2.0 tr = np.sum(self.s[:3]) self.sdev = self.s - np.array([1, 1, 1, 0, 0, 0]) * tr / 3.0 self.se = np.sqrt(3.0 / 2.0) * la.norm(self.sdev) self.ee = np.sqrt(2.0 / 3.0) * la.norm(self.e)
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()
def example1(): # T is in hours, strain in percent, stress in MPa A = 1.85e-9 n = 2.5 m = 0.3 smodel = creep.NortonBaileyCreep(A, n, m) model = creep.J2CreepModel(smodel, verbose = False) stress = 150.0 temp = 300.0 times = np.linspace(0, 500, 100) # Function to integrate out the scalar model def scalar_rate(e, t): return smodel.g(stress, e[0], t, temp) estart = 0.01 strains = quad.odeint(scalar_rate, estart, times) plt.plot(times, strains, 'k-') vstrains = [] vstresses = [] stress = np.array([stress, 0, 0, 0, 0, 0]) vstresses.append(stress) vstrains.append(np.array([estart, -0.5*estart, -0.5*estart, 0, 0, 0])) for i in range(1, len(times)): strain_next, A_next = model.update(stress, vstrains[-1], temp, temp, times[i], times[i-1]) vstresses.append(vstresses[-1]) vstrains.append(strain_next) vstresses = np.array(vstresses) vstrains = np.array(vstrains) plt.plot(times, vstrains[:,0], 'r-') plt.show()
A = 1.0e-22 # Damage parameters xi = 0.478 phi = 1.914 S = 1.0e19 # Loading srate = 100.0 # Setup model emodel = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, "poissons") bmodel = models.SmallStrainElasticity(emodel) scmodel = creep.PowerLawCreep(A, n) cfmodel = creep.J2CreepModel(scmodel) cmodel = models.SmallStrainCreepPlasticity(emodel, bmodel, cfmodel) model = damage.ClassicalCreepDamageModel_sd(emodel, S, xi, phi, cmodel) model2 = damage.ModularCreepDamageModel_sd( emodel, S, xi, phi, damage.VonMisesEffectiveStress(), cmodel) # Computed life srange = np.linspace(s0 / 2, s0, 10) tfs = S**(xi) / (1 + phi) * srange**(-xi) slife = [] slife2 = [] for s, tf in zip(srange, tfs): res = drivers.creep(model, s,
n = 45.0 eta = 200.0 iso2 = hardening.LinearIsotropicHardeningRule(0, H) gpower = visco_flow.GPowerLaw(n, eta) vflow = visco_flow.PerzynaFlowRule(surface, iso2, gpower) gflow = general_flow.TVPFlowRule(elastic, vflow) model3 = models.GeneralIntegrator(elastic, gflow) # T is in hours, strain in percent, stress in MPa A = 1.85e-9 n = 2.5 m = 0.3 smodel = creep.NortonBaileyCreep(A, n, m) cmodel = creep.J2CreepModel(smodel) model4 = models.SmallStrainCreepPlasticity(elastic, model1, cmodel) erate = 1.0e-4 emax = 0.025 energy = emax * sY - 0.5 * sY * sY / E dissipated = energy - 0.5 * sY * sY / E res1 = drivers.uniaxial_test(model1, erate, emax=emax) res2 = drivers.uniaxial_test(model2, erate, emax=emax) res3 = drivers.uniaxial_test(model3, erate, emax=emax) res4 = drivers.uniaxial_test(model4, erate, emax=emax) print("")