Real TensorMechanicsPlasticOrthotropic::yieldFunction(const RankTwoTensor & stress, Real intnl) const { const RankTwoTensor j2prime = _l1 * stress; const RankTwoTensor j3prime = _l2 * stress; return _b * stress.trace() + std::pow(std::pow(-j2prime.generalSecondInvariant(), 3.0 / 2.0) - j3prime.det(), 1.0 / 3.0) - yieldStrength(intnl); }
Real TensorMechanicsPlasticJ2::yieldFunction(const RankTwoTensor & stress, Real intnl) const { return std::sqrt(3.0 * stress.secondInvariant()) - yieldStrength(intnl); }
bool TensorMechanicsPlasticJ2::returnMap(const RankTwoTensor & trial_stress, Real intnl_old, const RankFourTensor & E_ijkl, Real ep_plastic_tolerance, RankTwoTensor & returned_stress, Real & returned_intnl, std::vector<Real> & dpm, RankTwoTensor & delta_dp, std::vector<Real> & yf, bool & trial_stress_inadmissible) const { if (!(_use_custom_returnMap)) return TensorMechanicsPlasticModel::returnMap(trial_stress, intnl_old, E_ijkl, ep_plastic_tolerance, returned_stress, returned_intnl, dpm, delta_dp, yf, trial_stress_inadmissible); yf.resize(1); Real yf_orig = yieldFunction(trial_stress, intnl_old); yf[0] = yf_orig; if (yf_orig < _f_tol) { // the trial_stress is admissible trial_stress_inadmissible = false; return true; } trial_stress_inadmissible = true; Real mu = E_ijkl(0, 1, 0, 1); // Perform a Newton-Raphson to find dpm when // residual = 3*mu*dpm - trial_equivalent_stress + yieldStrength(intnl_old + dpm) = 0 Real trial_equivalent_stress = yf_orig + yieldStrength(intnl_old); Real residual; Real jac; dpm[0] = 0; unsigned int iter = 0; do { residual = 3.0 * mu * dpm[0] - trial_equivalent_stress + yieldStrength(intnl_old + dpm[0]); jac = 3.0 * mu + dyieldStrength(intnl_old + dpm[0]); dpm[0] += -residual / jac; if (iter > _max_iters) // not converging return false; iter++; } while (residual * residual > _f_tol * _f_tol); // set the returned values yf[0] = 0; returned_intnl = intnl_old + dpm[0]; RankTwoTensor nn = 1.5 * trial_stress.deviatoric() / trial_equivalent_stress; // = dyieldFunction_dstress(trial_stress, intnl_old) = // the normal to the yield surface, at the trial // stress returned_stress = 2.0 / 3.0 * nn * yieldStrength(returned_intnl); returned_stress.addIa(1.0 / 3.0 * trial_stress.trace()); delta_dp = nn * dpm[0]; return true; }
void YieldStrength<EvalT, Traits>:: evaluateFields(typename Traits::EvalData workset) { bool print = false; //if (typeid(ScalarT) == typeid(RealType)) print = true; if (print) std::cout << " *** YieldStrength *** " << std::endl; int numCells = workset.numCells; if (is_constant) { for (int cell=0; cell < numCells; ++cell) { for (int qp=0; qp < numQPs; ++qp) { yieldStrength(cell,qp) = constant_value; } } } else { for (int cell=0; cell < numCells; ++cell) { for (int qp=0; qp < numQPs; ++qp) { Teuchos::Array<MeshScalarT> point(numDims); for (int i=0; i<numDims; i++) point[i] = Sacado::ScalarValue<MeshScalarT>::eval(coordVec(cell,qp,i)); yieldStrength(cell,qp) = exp_rf_kl->evaluate(point, rv); } } } if (isThermoElastic) { for (int cell=0; cell < numCells; ++cell) { for (int qp=0; qp < numQPs; ++qp) { yieldStrength(cell,qp) -= dYdT_value * (Temperature(cell,qp) - refTemp); if (print) { std::cout << " Y : " << yieldStrength(cell,qp) << std::endl; std::cout << " temp: " << Temperature(cell,qp) << std::endl; std::cout << " dYdT: " << dYdT_value << std::endl; std::cout << " refT: " << refTemp << std::endl; } } } } if (isDiffuseDeformation) { Albany::MDArray CLold = (*workset.stateArrayPtr)[CLname]; for (int cell=0; cell < numCells; ++cell) { for (int qp=0; qp < numQPs; ++qp) { // yieldStrength(cell,qp) = constant_value*( 1.0 + (zeta-1.0)*CL(cell,qp) ); yieldStrength(cell,qp) -= constant_value*(zeta-1.0)*(CL(cell,qp) -CLold(cell,qp) ); if (print) { std::cout << " Y : " << yieldStrength(cell,qp) << std::endl; std::cout << " CT : " << CT(cell,qp) << std::endl; std::cout << " zeta : " << zeta << std::endl; } } } } }