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.W0 = 10.0 self.k0 = 0.0001 self.a = 2.0 self.model = damage.NEMLExponentialWorkDamagedModel_sd( self.elastic, self.W0, self.k0, self.a, self.bmodel) self.stress = np.array([100,-50.0,300.0,-99,50.0,125.0]) self.T = 100.0 self.d = 0.45 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.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
def test_damage(self): s0 = 180.0 Kp = 1000.0 H = 1000.0 surface = surfaces.IsoKinJ2() iso = hardening.LinearIsotropicHardeningRule(s0, Kp) kin = hardening.LinearKinematicHardeningRule(H) hrule = hardening.CombinedHardeningRule(iso, kin) flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule) bmodel = models.SmallStrainRateIndependentPlasticity( self.elastic1, flow) W0 = 10.0 k0 = 0.0001 a0 = 2.0 model1 = damage.NEMLExponentialWorkDamagedModel_sd( self.elastic1, W0, k0, a0, bmodel) W02 = 10.0 k02 = 0.001 a02 = 1.5 model2 = damage.NEMLExponentialWorkDamagedModel_sd( self.elastic1, W02, k02, a02, bmodel) model = damage.CombinedDamageModel_sd(self.elastic1, [model1, model2], bmodel) self.very_close(model, self.emodel1) model.set_elastic_model(self.elastic2) self.very_close(model, self.emodel2)