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)
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 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)
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])
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
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 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.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
import numpy as np if __name__ == "__main__": E = 1000.0 nu = 0.27 mu = E / (2 * (1.0 + nu)) K = E / (3 * (1 - 2 * nu)) s0 = 10.0 elastic = elasticity.IsotropicLinearElasticModel(mu, "shear", K, "bulk") surface = surfaces.IsoJ2() model = models.SmallStrainPerfectPlasticity(elastic, surface, s0) erate = 1.0e-2 strain = 0.02 res = drivers.uniaxial_test(model, erate, emax=strain) ye = s0 / E energy = 0.5 * ye * s0 + (strain - ye) * s0 work = (strain - ye) * s0 print("Strain energy: %f/%f" % (res['energy_density'][-1], energy)) print("Plastic work: %f/%f" % (res['plastic_work'][-1], work)) plt.plot(res['strain'], res['stress'], 'k-') plt.show()
import numpy as np if __name__ == "__main__": E = 150000.0 nu = 0.3 sY = 150.0 h = 1.0e-2 l = 1.0 emodel = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, "poissons") surface = surfaces.IsoJ2I1(h, l) model = models.SmallStrainPerfectPlasticity(emodel, surface, sY) res_tension = drivers.uniaxial_test(model, 1.0e-2) res_compres = drivers.uniaxial_test(model, 1.0e-2, sdir=np.array([-1, 0, 0, 0, 0, 0])) plt.plot(res_tension['strain'], res_tension['stress'], 'k-') plt.plot(res_compres['strain'], res_compres['stress'], 'r-') plt.show() E = 150000.0 nu = 0.3 sY = 150.0 h = 1.0e-2