def verify_warp3d():
    E = 30000.0
    nu = 0.3

    sy = 100.0
    Q = 50.0
    b = 100.0

    C = 1000.0
    g = 10.0

    mu = E / (2 * (1.0 + nu))
    K = E / (3 * (1 - 2 * nu))

    elastic = elasticity.IsotropicLinearElasticModel(mu, "shear", K, "bulk")
    surface = surfaces.IsoKinJ2()
    iso = hardening.VoceIsotropicHardeningRule(sy, Q, b)
    hrule = hardening.Chaboche(iso, [C], [hardening.ConstantGamma(g)], [0.0],
                               [1.0])

    flow = ri_flow.RateIndependentNonAssociativeHardening(surface, hrule)
    model = models.SmallStrainRateIndependentPlasticity(elastic,
                                                        flow,
                                                        verbose=False)

    res = drivers.strain_cyclic(model, 0.0075, -1.0, 1.0e-4, 50)
    strain = res['strain']
    stress = res['stress']

    data_warp = np.load('data_fa_warp.npy')

    plt.plot(strain, stress, 'k-')
    plt.plot(data_warp[0], data_warp[1], 'r-')
    plt.show()
def verify_Cg():
    E = 30000.0
    nu = 0.3

    sy = 100.0
    Q = 0.0
    b = 0.0

    C = 1000.0
    g = 10.0

    mu = E / (2 * (1.0 + nu))
    K = E / (3 * (1 - 2 * nu))

    elastic = elasticity.IsotropicLinearElasticModel(mu, "shear", K, "bulk")
    surface = surfaces.IsoKinJ2()
    iso = hardening.VoceIsotropicHardeningRule(sy, Q, b)
    hrule = hardening.Chaboche(iso, [C], [hardening.ConstantGamma(g)], [0.0],
                               [1.0])

    flow = ri_flow.RateIndependentNonAssociativeHardening(surface, hrule)
    model = models.SmallStrainRateIndependentPlasticity(elastic,
                                                        flow,
                                                        verbose=False)

    res = drivers.strain_cyclic(model, 0.4, -1.0, 1.0e-4, 1)
    strain = res['strain']
    stress = res['stress']

    mv = np.max(np.abs(stress))
    hu = mv - sy

    print("C/y: %f / %f" % ((C / g), hu))
Example #3
0
    plt.figure()
    plt.plot(res['strain'], res['stress'], 'k-')
    plt.xlabel("Strain (mm/mm)")
    plt.ylabel("Stress (MPa)")
    plt.title("Uniaxial tension")
    plt.show()

    # Strain controlled-cyclic
    emax = 0.01
    R = -0.75
    erate = 1.0e-4
    ncycles = 5
    hold_time = [10 * 3600.0, 0]
    res = drivers.strain_cyclic(model,
                                emax,
                                R,
                                erate,
                                ncycles,
                                hold_time=hold_time)
    plt.figure()
    plt.plot(res['strain'], res['stress'], 'k-')
    plt.xlabel("Strain (mm/mm)")
    plt.ylabel("Stress (MPa)")
    plt.title("Strain-controlled cyclic")
    plt.show()

    # Strain controlled-cyclic with follow up
    emax = 0.01
    R = -0.75
    erate = 1.0e-4
    ncycles = 5
    hold_time = [10 * 3600.0, 0]
         unit_extrapolate=10,
         allowable_jump_stress=10.0,
         jump_delta_N=10,
         check_dmg=True)
     end = time.time()
     time_ext.append(end - start)
     plt.plot(res['cycles'],
              res['max'],
              '+',
              label='ext run {}'.format(r + 1))
     plt.plot(res['cycles'], res['min'], '+')
     start = time.time()
     res = drivers.strain_cyclic(model,
                                 emax[r],
                                 R[r],
                                 erate[r],
                                 int(ncycles[r]),
                                 hold_time=[hold_t[r], hold_c[r]],
                                 check_dmg=True)
     end = time.time()
     time_act.append(end - start)
     plt.plot(res['cycles'], res['max'], label='act run {}'.format(r + 1))
     plt.plot(res['cycles'], res['min'])
 plt.legend(loc='best')
 plt.xlabel('cycles')
 plt.ylabel('stress')
 plt.title('Extrapolation comparison with damage')
 plt.show()
 plt.scatter(np.arange(len(emax)), time_act, label='act')
 plt.scatter(np.arange(len(emax)), time_ext, marker='^', label='ext')
 plt.yscale('log')
Example #5
0
                                                        flow,
                                                        verbose=False,
                                                        check_kt=False)

    # Uniaxial stress/strain curves at decades of strain rates
    erates = np.logspace(-6, 2, 9)
    for rate in erates:
        res = drivers.uniaxial_test(model, rate)
        plt.plot(res['strain'], res['stress'])

    plt.xlabel("Strain (-/-)")
    plt.ylabel("Stress (MPa)")
    plt.show()

    # A strain-controlled cyclic test
    res = drivers.strain_cyclic(model, 0.01, -0.25, 1.0e-4, 50)
    plt.plot(res['strain'], res['stress'], 'k-')
    plt.xlabel("Strain (-/-)")
    plt.ylabel("Stress (MPa)")
    plt.show()

    plt.plot(res['cycles'], res['max'], 'k-')
    plt.plot(res['cycles'], res['min'], 'k-')
    plt.plot(res['cycles'], res['mean'], 'k-')
    plt.xlabel("Cycle")
    plt.ylabel("Stress (MPa)")
    plt.show()

    # A stress-controlled cyclic test
    res = drivers.stress_cyclic(model, 525.0, -1.0, 5.0, 50, hold_time=100)
    plt.plot(res['strain'], res['stress'], 'k-')
Example #6
0
    elastic = elasticity.IsotropicLinearElasticModel(E, "youngs", nu,
                                                     "poissons")
    surface = surfaces.IsoJ2()

    pmodel = models.SmallStrainPerfectPlasticity(elastic, surface, sY)

    model = models.SmallStrainCreepPlasticity(elastic, pmodel, cmodel)

    res = drivers.creep(model, 200.0, 1.0e2, 1000.0, verbose=True)
    plt.plot(res['time'], res['strain'])
    plt.show()

    res = drivers.strain_cyclic(model,
                                0.01,
                                -1,
                                1.0e-4,
                                15,
                                verbose=True,
                                nsteps=25,
                                hold_time=[10.0, 0])
    plt.plot(res['strain'], res['stress'])
    plt.show()

    res = drivers.uniaxial_test(model,
                                1.0e-6,
                                sdir=np.array([1, -1, 0.5, -0.5, 0.1, -0.25]),
                                verbose=True)
    plt.plot(res['strain'], res['stress'])
    plt.show()
Example #7
0
  strength435 = sliprules.KinematicPowerLawSlipRule(h4, h3, h8, g0, n)

  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)
  
  # Perfect plasticity options
  smodels = [strength775, strength766]
  names = ["775", "766"]

  models = [make_model(s) for s in smodels]

  results = [drivers.strain_cyclic(m, emax, R, erate, ncycles, verbose = True)
      for m in models]
  
  plt.figure()
  plt.title("Various perfect plasticity options")
  for res, name in zip(results, names):
    plt.plot(res['strain'], res['stress'], label = name)
  plt.legend(loc='best')
  plt.xlabel("Strain (mm/mm)")
  plt.ylabel("Stress (MPa)")
  plt.show()
  
  # Pure isotropic options
  smodels = [strength771, strength722, strength735]
  names = ["771", "722", "735"]
Example #8
0
def koo():
  # Data from Koo & Kwon (2011)
  E = 157.0e3
  nu = 0.27

  sY = 0.0
  b = 3.0
  Q = -80.0 

  C1 = 135.0e3
  C2 = 123.0e3
  C3 = 4.0e3

  g1 = 100e3
  g2 = 0.85e3
  g3 = 1.0

  eta = 701.0

  n = 10.5

  mu = E / (2 * (1.0 + nu))
  K = E / (3 * (1 - 2 * nu))

  elastic = elasticity.IsotropicLinearElasticModel(mu, "shear", K, "bulk")

  surface = surfaces.IsoKinJ2()
  iso = hardening.VoceIsotropicHardeningRule(sY, Q, b)
  cs = [C1, C2, C3]
  gs = [hardening.ConstantGamma(g1), hardening.ConstantGamma(g2),
      hardening.ConstantGamma(g3)]
  hmodel = hardening.Chaboche(iso, cs, gs, [0.0]*len(cs), [1.0]*len(cs))

  fluidity = visco_flow.ConstantFluidity(eta)

  vmodel = visco_flow.ChabocheFlowRule(
      surface, hmodel, fluidity, n)

  flow = general_flow.TVPFlowRule(elastic, vmodel)

  model = models.GeneralIntegrator(elastic, flow)


  e500 = np.array([0.0058793164, 0.0052876081, 0.004710156, 0.0042916722, 0.0038731605, 0.0032237573, 0.0027900399, 0.0024864991, 0.0017489338, 0.000635346, -0.0006668255, -0.0017811254, -0.0034891722, -0.0044012326, -0.0059358454, -0.005661599, -0.0051996206, -0.0048027165, -0.0044347716, -0.0039945684, -0.0034388636, -0.0032440594, -0.0026585856, -0.002036857, -0.001161945, -0.0003736313, 0.0008344368, 0.0022454705, 0.0035554683, 0.0052854997])
  s500 = np.array([349.6965238343, 255.0932943767, 171.2928564634, 102.3697757811, 34.7967386021, -70.6166129529, -103.0909625627, -128.7931029969, -172.1191145041, -237.1093535238, -285.2558144812, -315.8199441656, -342.4341275638, -350.0133084444, -361.0726693423, -319.1748939033, -252.9445696747, -190.7753717856, -128.6110609317, -59.6843149729, 25.4625011672, 57.8965327357, 103.8969743143, 147.2034376803, 200.6779888803, 240.6374439409, 288.0930002819, 323.4323743399, 343.229143486, 357.0215788789]) 

  res = drivers.strain_cyclic(model, 0.006, -1.0, 1.0e-4, 130,
      verbose = False, nsteps = 50)
  plt.plot(res['strain'][-100:], res['stress'][-100:], 'k-')
  plt.plot(e500, s500, 'kx')
  plt.xlabel("Strain (-/-)")
  plt.ylabel("Stress (MPa)")
  plt.show()

  n500 = np.array([1.8000456006, 7.2646606231, 17.3775914892, 25.6289731945, 35.040864809, 43.9864865417, 54.6731673353, 69.3076477381, 83.9405590891, 98.1077889527, 112.0424068927, 126.7891398736])
  ns500 = sn500 = np.array([437.8476941068, 428.2481618804, 413.6055992266, 403.8518586317, 394.8643791744, 388.2393032756, 382.3835530687, 376.4641827161, 372.5718311079, 370.2817510291, 368.4971998147, 367.5615301197])

  plt.plot(res['cycles'], res['max'], 'k-')
  plt.plot(n500, ns500, 'kx')
  plt.xlabel("Cycle")
  plt.ylabel("Stress (MPa)")
  plt.show()
Example #9
0
  flow = general_flow.TVPFlowRule(elastic, vmodel)

  model = models.GeneralIntegrator(elastic, flow, verbose = False)
  
  # Uniaxial stress/strain curves at decades of strain rates
  erates = np.logspace(-6,2,9)
  for rate in erates:
    res = drivers.uniaxial_test(model, rate, verbose = False)
    plt.plot(res['strain'], res['stress'])
  
  plt.xlabel("Strain (-/-)")
  plt.ylabel("Stress (MPa)")
  plt.show()
  
  # A strain-controlled cyclic test
  res = drivers.strain_cyclic(model, 0.001, -0.25, 1.0e-4, 50,
      verbose = False)
  plt.plot(res['strain'], res['stress'], 'k-')
  plt.xlabel("Strain (-/-)")
  plt.ylabel("Stress (MPa)")
  plt.show()

  plt.plot(res['cycles'], res['max'], 'k-')
  plt.plot(res['cycles'], res['min'], 'k-')
  plt.plot(res['cycles'], res['mean'], 'k-')
  plt.xlabel("Cycle")
  plt.ylabel("Stress (MPa)")
  plt.show()
  
  # A stress-controlled cyclic test
  res = drivers.stress_cyclic(model, 100.0, -1.0, 5.0, 50,
      hold_time = 10, verbose = False)