def __init__(self, l1, l2, l3, A1, A2, A3, mat1, mat2, mat3, T0): """ Parameters: l1 length of bar 1 l2 length of bar 2 l3 length of bar 3 A1 area of bar 1 A2 area of bar 2 A3 area of bar 3 mat1 material model for bar 1 mat2 material model for bar 2 mat3 material model for bar 3 T0 initial temperature Notes: l1 = 2 * l2 + l3 or l3 = l1 - 2 * l2 """ self.l1 = l1 self.l2 = l2 self.l3 = l3 self.A1 = A1 self.A2 = A2 self.A3 = A3 self.mat1 = uniaxial.UniaxialModel(mat1) self.mat2 = uniaxial.UniaxialModel(mat2) self.mat3 = uniaxial.UniaxialModel(mat3) self.s1 = [0.0] self.s2 = [0.0] self.s3 = [0.0] self.e1 = [0.0] self.e2 = [0.0] self.e3 = [0.0] self.em1 = [0.0] self.em2 = [0.0] self.em3 = [0.0] self.et1 = [0.0] self.et2 = [0.0] self.et3 = [0.0] self.h1 = [self.mat1.init_store()] self.h2 = [self.mat2.init_store()] self.h3 = [self.mat3.init_store()] self.T = [T0] self.t = [0.0] self.u = [0.0] self.p = [0.0]
def setUp(self): E = 200000.0 nu = 0.27 mu = E / (2 * (1.0 + nu)) K = E / (3 * (1 - 2 * nu)) s0 = 300.0 Kp = 0.0 c = [30000.0] r = [60.0] A = [0.0] n = [1.0] elastic = elasticity.IsotropicLinearElasticModel( mu, "shear", K, "bulk") surface = surfaces.IsoKinJ2() iso = hardening.LinearIsotropicHardeningRule(s0, Kp) gmodels = [hardening.ConstantGamma(g) for g in r] hrule = hardening.Chaboche(iso, c, gmodels, A, n) flow = ri_flow.RateIndependentNonAssociativeHardening(surface, hrule) self.model = models.SmallStrainRateIndependentPlasticity( elastic, flow, verbose=False, check_kt=False) self.umodel = uniaxial.UniaxialModel(self.model) self.de = 0.001 self.dt = 1.0 self.dT = 0.0 self.T0 = 0.0 self.nsteps = 100
def __init__(self, mat, A, l, T = lambda t: 0.0): """ Parameters: mat NEML small strain material model A bar cross-sectional area l bar length Optional: T bar temperature as a function of time, defaults to 0 """ self.mat = uniaxial.UniaxialModel(mat) self.A = A self.l = l self.T = T self.stress = np.zeros((1,)) self.strain = np.zeros((1,)) self.mstrain = np.zeros((1,)) self.estrain = np.zeros((1,)) self.tstrain = np.zeros((1,)) self.energy = np.zeros((1,)) self.dissipation = np.zeros((1,)) self.temperature = np.array([self.T(0)]) self.history = np.array([self.mat.init_store()]) self.stress_next = 0.0 self.strain_next = 0.0 self.mstrain_next = 0.0 self.estrain_next = 0.0 self.tstrain_next = 0.0 self.energy_next = 0.0 self.dissipation_next = 0.0 self.T_next = 0.0 self.history_next = np.empty(self.history[0].shape)
s0 = 300.0 Kp = 0.0 c = [30000.0] r = [60.0] elastic = elasticity.IsotropicLinearElasticModel(mu, "shear", K, "bulk") surface = surfaces.IsoKinJ2() iso = hardening.LinearIsotropicHardeningRule(s0, Kp) gmodels = [hardening.ConstantGamma(g) for g in r] hrule = hardening.Chaboche(iso, c, gmodels, [0.0] * len(c), [1.0] * len(c)) flow = ri_flow.RateIndependentNonAssociativeHardening(surface, hrule) model = models.SmallStrainRateIndependentPlasticity(elastic, flow, verbose = False, check_kt = False) umodel = uniaxial.UniaxialModel(model, verbose = True) hn = umodel.init_store() en = 0.0 sn = 0.0 un = 0.0 pn = 0.0 tn = 0.0 Tn = 0.0 dt = 1.0 dT = 0.0 es = [en] ss = [sn]