Beispiel #1
0
def simple_ex():
    E = 92000.0
    nu = 0.3

    s0 = 180.0
    Kp = 1000.0
    H = 1000.0

    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)

    bmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)

    A = 0.0e-6
    a = 2.2
    model_off = damage.NEMLPowerLawDamagedModel_sd(elastic, A, a, bmodel)

    A = 2e-5
    model_on = damage.NEMLPowerLawDamagedModel_sd(elastic, A, a, bmodel)

    res_off = drivers.uniaxial_test(model_off, 1.0e-2, emax=0.13)
    res_on = drivers.uniaxial_test(model_on, 1.0e-2, emax=0.13)

    plt.plot(res_off['strain'], res_off['stress'], 'k-')
    plt.plot(res_on['strain'], res_on['stress'], 'r-')
    plt.show()
Beispiel #2
0
    def setUp(self):
        self.model1 = parse.parse_xml("test/examples.xml", "test_powerdamage")

        E = 92000.0
        nu = 0.3

        s0 = 180.0
        Kp = 1000.0

        elastic = elasticity.IsotropicLinearElasticModel(
            E, "youngs", nu, "poissons")

        surface = surfaces.IsoJ2()
        hrule = hardening.LinearIsotropicHardeningRule(s0, Kp)

        flow = ri_flow.RateIndependentAssociativeFlow(surface, hrule)

        bmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)

        a = 2.2
        A = 2e-5
        self.model2 = damage.NEMLPowerLawDamagedModel_sd(elastic, A, a, bmodel)

        self.T = 300.0
        self.tmax = 10.0
        self.nsteps = 100.0
        self.emax = np.array([0.05, 0, 0, 0, 0, 0])
Beispiel #3
0
  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.A = 8.0e-6
    self.a = 2.2

    self.model = damage.NEMLPowerLawDamagedModel_sd(self.elastic, self.A, 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
Beispiel #4
0
def unload_ex():
    E = 92000.0
    nu = 0.3

    s0 = 180.0
    Kp = 1000.0
    H = 1000.0

    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)

    bmodel = models.SmallStrainRateIndependentPlasticity(elastic, flow)

    A = 2e-5
    a = 2.2
    model = damage.NEMLPowerLawDamagedModel_sd(elastic, A, a, bmodel)

    driver = drivers.Driver_sd(model)
    nsteps = 25
    sdir = np.array([1, 0, 0, 0, 0, 0])
    erate = 1.0e-5
    e_inc = 0.1 / nsteps
    for i in range(nsteps):
        einc, ainc = driver.erate_einc_step(sdir, erate, e_inc, 0.0)

    estrain = model.elastic_strains(driver.stress_int[-1], driver.T_int[-1],
                                    driver.stored[-1])

    print("Calculated elastic strain: %f" % estrain[0])

    nsteps = 20
    dt = 0.1
    rstress = driver.stress_int[-1]
    rstrain = driver.strain_int[-1][0]
    for m in np.linspace(0, 1.0, nsteps, endpoint=False)[::-1]:
        driver.stress_step(rstress * m, driver.t_int[-1] + dt,
                           driver.T_int[-1])

    fstrain = driver.strain_int[-1][0]

    print("Actual elastic strain: %f" % (rstrain - fstrain))

    print("Calculated final elastic strain: %f" % model.elastic_strains(
        driver.stress_int[-1], driver.T_int[-1], driver.stored[-1])[0])

    plt.plot(driver.strain[:, 0], driver.stress[:, 0])
    plt.show()
Beispiel #5
0
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()