def setUp(self): self.strength = 35.0 self.H = history.History() self.H.add_scalar("strength") self.H.set_scalar("strength", self.strength) self.tau0 = 10.0 self.tau_sat = 50.0 self.b = 2.5 self.strengthmodel = slipharden.VoceSlipHardening( self.tau_sat, self.b, self.tau0) self.g0 = 1.0 self.n = 3.0 self.slipmodel = sliprules.PowerLawSlipRule(self.strengthmodel, self.g0, self.n) self.imodel = inelasticity.AsaroInelasticity(self.slipmodel) self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.S = tensors.Symmetric( np.array([[100.0, -25.0, 10.0], [-25.0, -17.0, 15.0], [10.0, 15.0, 35.0]])) self.T = 300.0 self.mu = 29000.0 self.E = 120000.0 self.nu = 0.3 self.emodel = elasticity.CubicLinearElasticModel( self.E, self.nu, self.mu, "moduli") self.dn = np.array([[4.1, 2.8, -1.2], [3.1, 7.1, 0.2], [4, 2, 3]]) self.dn = 0.5 * (self.dn + self.dn.T) self.d = tensors.Symmetric(self.dn) self.wn = np.array([[-9.36416517, 2.95527444, 8.70983194], [-1.54693052, 8.7905658, -5.10895168], [-8.52740468, -0.7741642, 2.89544992]]) self.wn = 0.5 * (self.wn - self.wn.T) self.w = tensors.Skew(self.wn) self.model = kinematics.StandardKinematicModel(self.emodel, self.imodel) self.fspin = self.model.spin(self.S, self.d, self.w, self.Q, self.H, self.L, self.T, history.History()) self.fixed = self.model.decouple(self.S, self.d, self.w, self.Q, self.H, self.L, self.T, history.History())
def setUp(self): self.N = 10 self.tau0 = 10.0 self.tau_sat = 50.0 self.b = 2.5 self.strengthmodel = slipharden.VoceSlipHardening(self.tau_sat, self.b, self.tau0) self.g0 = 1.0 self.n = 3.0 self.slipmodel = sliprules.PowerLawSlipRule(self.strengthmodel, self.g0, self.n) self.imodel = inelasticity.AsaroInelasticity(self.slipmodel) self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1,1,0],[1,1,1]) self.Q = rotations.Orientation(35.0,17.0,14.0, angle_type = "degrees") self.mu = 29000.0 self.E = 120000.0 self.nu = 0.3 self.emodel = elasticity.CubicLinearElasticModel(self.E, self.nu, self.mu, "moduli") self.kmodel = kinematics.StandardKinematicModel(self.emodel, self.imodel) self.model = singlecrystal.SingleCrystalModel(self.kmodel, self.L, miter = 120) self.orientations = rotations.random_orientations(self.N) self.D = np.array([0.01,-0.002,-0.003,0.012,-0.04,0.01]) self.W = np.array([0.02,-0.02,0.03]) self.T = 300.0 self.dt = 2.0
def setUp(self): self.tau0 = 10.0 self.tau_sat = 50.0 self.b = 2.5 self.strengthmodel = slipharden.VoceSlipHardening( self.tau_sat, self.b, self.tau0) self.g0 = 1.0 self.n = 3.0 self.slipmodel = sliprules.PowerLawSlipRule(self.strengthmodel, self.g0, self.n) self.imodel = inelasticity.AsaroInelasticity(self.slipmodel) self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.mu = 29000.0 self.E = 120000.0 self.nu = 0.3 self.emodel = elasticity.CubicLinearElasticModel( self.E, self.nu, self.mu, "moduli") self.kmodel = kinematics.StandardKinematicModel( self.emodel, self.imodel) self.model = singlecrystal.SingleCrystalModel(self.kmodel, self.L, initial_rotation=self.Q) self.model_no_rot = singlecrystal.SingleCrystalModel( self.kmodel, self.L, initial_rotation=self.Q, update_rotation=False, verbose=False) self.T = 300.0 self.stress_n = np.array([120.0, -60.0, 170.0, 35.0, 80.0, -90.0]) self.stress_np1 = np.array([15.0, -40.0, 120.0, 70.0, -10.0, -50.0]) self.d = np.array([0.1, -0.2, 0.25, 0.11, -0.05, 0.075]) self.w = np.array([0.1, 0.2, -0.2]) self.strength_n = 25.0 self.strength_np1 = 30.0 self.S_np1 = tensors.Symmetric(common.usym(self.stress_np1)) self.S_n = tensors.Symmetric(common.usym(self.stress_n)) self.D = tensors.Symmetric(common.usym(self.d)) self.W = tensors.Skew(common.uskew(self.w)) self.strength_n = 25.0 self.strength_np1 = 30.0 self.H_n = history.History() self.H_n.add_scalar("strength") self.H_n.set_scalar("strength", self.strength_n) self.H_np1 = history.History() self.H_np1.add_scalar("strength") self.H_np1.set_scalar("strength", self.strength_np1) self.dt = 2.0 self.fixed = self.kmodel.decouple(self.S_n, self.D, self.W, self.Q, self.H_n, self.L, self.T, history.History()) self.ts = singlecrystal.SCTrialState(self.D, self.W, self.S_n, self.H_n, self.Q, self.L, self.T, self.dt, self.fixed) self.x = np.zeros((self.model.nparams, )) self.x[:6] = self.stress_np1 self.x[6] = self.strength_np1 self.Ddir = np.array([0.01, -0.005, -0.003, 0.01, 0.02, -0.003]) * 2 self.Wdir = np.array([0.02, -0.03, 0.01]) * 2 self.nsteps = 10
mu = 29000.0 E = 120000.0 nu = 0.3 c = 40 beta = 3.0 emodel = elasticity.CubicLinearElasticModel(E, nu, mu, "moduli") strengthmodel = slipharden.VoceSlipHardening(sat, b, t0) slipmodel = sliprules.PowerLawSlipRule(strengthmodel, g0, n) imodel = inelasticity.AsaroInelasticity(slipmodel) base_kin = kinematics.StandardKinematicModel(emodel, imodel) base_cp_model = singlecrystal.SingleCrystalModel(base_kin, lattice) base_model = polycrystal.TaylorModel(base_cp_model, orientations, nthreads=nthreads) base_kin = kinematics.StandardKinematicModel(emodel, imodel) base_cp_model = singlecrystal.SingleCrystalModel(base_kin, lattice) base_model = polycrystal.TaylorModel(base_cp_model, orientations, nthreads=nthreads) dmodel = crystaldamage.WorkPlaneDamage() func = crystaldamage.SigmoidTransformation(c, beta) dmg_fun = crystaldamage.PlanarDamageModel(dmodel, func, func, lattice) dmg_kin = kinematics.DamagedStandardKinematicModel(emodel, imodel, dmg_fun)
def make_model(smodel): imodel = inelasticity.AsaroInelasticity(smodel) emodel = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, "poissons") kmodel = kinematics.StandardKinematicModel(emodel, imodel) model = singlecrystal.SingleCrystalModel(kmodel, lattice) return polycrystal.TaylorModel(model, orientations, nthreads = nthreads)
t0 = alpha*mu*burg*np.sqrt(rho) ts = 100.0 b = 0.4 g0 = 1.0 n = 6.7 N = 100 nthreads = 20 strengthmodel = slipharden.VoceSlipHardening(ts, b, t0) slipmodel = sliprules.PowerLawSlipRule(strengthmodel, g0, n) imodel = inelasticity.AsaroInelasticity(slipmodel) emodel = elasticity.IsotropicLinearElasticModel(E, "youngs", nu, "poissons") kmodel = kinematics.StandardKinematicModel(emodel, imodel) lattice = crystallography.CubicLattice(1.0) lattice.add_slip_system([1,1,0],[1,1,1]) model = singlecrystal.SingleCrystalModel(kmodel, lattice, verbose = False) orientations = rotations.random_orientations(N) dt = emax / erate / steps pmodel = polycrystal.TaylorModel(model, orientations, nthreads = nthreads) res = drivers.uniaxial_test(pmodel, erate, emax = emax, nsteps = steps) strains.append(res['strain'])