20 "strains and internal parameters) using an iterative process. "
21 "Combinations of creep models and plastic models may be used.");
22 params.
addParam<
unsigned int>(
"max_iterations",
24 "Maximum number of the stress update "
25 "iterations over the stress change after all "
26 "update materials are called");
27 params.
addParam<Real>(
"relative_tolerance",
29 "Relative convergence tolerance for the stress "
30 "update iterations over the stress change "
31 "after all update materials are called");
32 params.
addParam<Real>(
"absolute_tolerance",
34 "Absolute convergence tolerance for the stress "
35 "update iterations over the stress change "
36 "after all update materials are called");
38 "internal_solve_full_iteration_history",
40 "Set to true to output stress update iteration information over the stress change");
41 params.
addParam<
bool>(
"perform_finite_strain_rotations",
43 "Tensors are correctly rotated in "
44 "finite-strain simulations. For "
45 "optimal performance you can set "
46 "this to 'false' if you are only "
47 "ever using small strains");
50 "The material objects to use to calculate stress and inelastic strains. "
51 "Note: specify creep models first and plasticity models second.");
52 params.
addParam<std::vector<Real>>(
"combined_inelastic_strain_weights",
53 "The combined_inelastic_strain Material Property is a "
54 "weighted sum of the model inelastic strains. This parameter "
55 "is a vector of weights, of the same length as "
56 "inelastic_models. Default = '1 1 ... 1'. This "
57 "parameter is set to 1 if the number of models = 1");
59 "cycle_models",
false,
"At time step N use only inelastic model N % num_models.");
60 params.
addParam<MaterialName>(
"damage_model",
"Name of the damage model");
68 _max_iterations(parameters.get<unsigned
int>(
"max_iterations")),
69 _relative_tolerance(parameters.get<Real>(
"relative_tolerance")),
70 _absolute_tolerance(parameters.get<Real>(
"absolute_tolerance")),
71 _internal_solve_full_iteration_history(getParam<bool>(
"internal_solve_full_iteration_history")),
72 _perform_finite_strain_rotations(getParam<bool>(
"perform_finite_strain_rotations")),
73 _inelastic_strain(declareADProperty<
RankTwoTensor>(_base_name +
"combined_inelastic_strain")),
74 _inelastic_strain_old(
75 getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"combined_inelastic_strain")),
76 _num_models(getParam<
std::vector<MaterialName>>(
"inelastic_models").size()),
77 _inelastic_weights(isParamValid(
"combined_inelastic_strain_weights")
78 ? getParam<
std::vector<Real>>(
"combined_inelastic_strain_weights")
79 :
std::vector<Real>(_num_models, true)),
80 _cycle_models(getParam<bool>(
"cycle_models")),
81 _material_timestep_limit(declareProperty<Real>(_base_name +
"material_timestep_limit")),
82 _is_elasticity_tensor_guaranteed_isotropic(false)
85 paramError(
"combined_inelastic_strain_weights",
86 "must contain the same number of entries as inelastic_models ",
109 " is not compatible with ADComputeMultipleInelasticStress");
114 std::vector<MaterialName> models = getParam<std::vector<MaterialName>>(
"inelastic_models");
126 " requires an isotropic elasticity tensor, but the one supplied is not "
127 "guaranteed isotropic");
130 mooseError(
"Model " + models[i] +
" is not compatible with ADComputeMultipleInelasticStress");
181 "Damage models cannot be used with inelastic models and elastic anisotropic behavior");
197 elastic_strain_increment,
198 combined_inelastic_strain_increment);
200 updateQpState(elastic_strain_increment, combined_inelastic_strain_increment);
225 <<
"iteration output for ADComputeMultipleInelasticStress solve:"
226 <<
" time=" <<
_t <<
" int_pt=" <<
_qp << std::endl;
228 Real l2norm_delta_stress;
229 Real first_l2norm_delta_stress = 1.0;
230 unsigned int counter = 0;
232 std::vector<ADRankTwoTensor> inelastic_strain_increment;
235 for (
unsigned i_rmm = 0; i_rmm <
_models.size(); ++i_rmm)
236 inelastic_strain_increment[i_rmm].zero();
242 for (
unsigned i_rmm = 0; i_rmm <
_num_models; ++i_rmm)
250 for (
unsigned j_rmm = 0; j_rmm <
_num_models; ++j_rmm)
252 elastic_strain_increment -= inelastic_strain_increment[j_rmm];
262 "Damage models cannot be used with inelastic models and elastic anisotropic "
293 else if (stress_min(i, j) >
_stress[
_qp](i, j))
304 if (counter == 0 && l2norm_delta_stress > 0.0)
305 first_l2norm_delta_stress = l2norm_delta_stress;
309 _console <<
"stress iteration number = " << counter <<
"\n"
310 <<
" relative l2 norm delta stress = "
311 << (0 == first_l2norm_delta_stress ? 0
312 : l2norm_delta_stress / first_l2norm_delta_stress)
315 <<
" absolute l2 norm delta stress = " << l2norm_delta_stress <<
"\n"
327 "In ",
_name,
": Max stress iteration hit during ADComputeMultipleInelasticStress solve!");
329 combined_inelastic_strain_increment.zero();
330 for (
unsigned i_rmm = 0; i_rmm <
_num_models; ++i_rmm)
331 combined_inelastic_strain_increment +=
335 for (
unsigned i_rmm = 0; i_rmm <
_num_models; ++i_rmm)
346 unsigned model_number,
364 "Damage models cannot be used with inelastic models and elastic anisotropic behavior");
377 model_number, elastic_strain_increment, combined_inelastic_strain_increment);
383 for (
unsigned i_rmm = 0; i_rmm <
_num_models; ++i_rmm)
384 if (i_rmm != model_number)
385 _models[i_rmm]->propagateQpStatefulProperties();
390 unsigned model_number,
395 _models[model_number]->resetIncrementalMaterialProperties();
398 _models[model_number]->updateState(elastic_strain_increment,
399 inelastic_strain_increment,
405 else if (
_models[model_number]->substeppingCapabilityEnabled() &&
408 _models[model_number]->updateStateSubstep(elastic_strain_increment,
409 inelastic_strain_increment,
417 _models[model_number]->updateState(elastic_strain_increment,
418 inelastic_strain_increment,
registerMooseObject("SolidMechanicsApp", ADComputeMultipleInelasticStress)
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
void ErrorVector unsigned int
ADComputeFiniteStrainElasticStress computes the stress following elasticity theory for finite strains...
virtual void initQpStatefulProperties() override
static InputParameters validParams()
const MaterialProperty< R2 > & _elastic_strain_old
The old elastic strain is used to calculate the old stress in the case of variable elasticity tensors...
const ADMaterialProperty< R2 > & _strain_increment
const ADMaterialProperty< R4 > & _elasticity_tensor
Elasticity tensor material property.
ADMaterialProperty< RankTwoTensor > & _rotation_total
Rotation up to current step "n" to compute anisotropic elasticity tensor.
const ADMaterialProperty< RankTwoTensor > & _rotation_increment
const MaterialProperty< R2 > & _stress_old
The old stress tensor.
const std::string _elasticity_tensor_name
Name of the elasticity tensor material property.
const MaterialProperty< RankTwoTensor > & _rotation_total_old
Rotation up to "n - 1" (previous) step to compute anisotropic elasticity tensor.
ADComputeMultipleInelasticStress computes the stress and a decomposition of the strain into elastic a...
virtual void finiteStrainRotation()
Rotate _elastic_strain, _stress, and _inelastic_strain to the new configuration.
MaterialProperty< Real > & _material_timestep_limit
DamageBaseTempl< true > * _damage_model
Pointer to the damage model.
virtual void initialSetup() override
virtual void updateQpState(ADRankTwoTensor &elastic_strain_increment, ADRankTwoTensor &combined_inelastic_strain_increment)
Given the _strain_increment[_qp], iterate over all of the user-specified recompute materials in order...
const unsigned _num_models
number of plastic models
const bool _internal_solve_full_iteration_history
ADMaterialProperty< RankTwoTensor > & _inelastic_strain
The sum of the inelastic strains that come from the plastic models.
const unsigned int _max_iterations
Input parameters associated with the recompute iteration to return the stress state to the yield surf...
const std::vector< Real > _inelastic_weights
_inelastic_strain = sum_i (_inelastic_weights_i * inelastic_strain_from_model_i)
virtual void computeQpStress() override
virtual void updateQpStateSingleModel(unsigned model_number, ADRankTwoTensor &elastic_strain_increment, ADRankTwoTensor &combined_inelastic_strain_increment)
An optimised version of updateQpState that gets used when the number of plastic models is unity,...
std::vector< ADStressUpdateBase * > _models
The user supplied list of inelastic models to use in the simulation.
const bool _cycle_models
whether to cycle through the models, using only one model per timestep
virtual void computeAdmissibleState(unsigned model_number, ADRankTwoTensor &elastic_strain_increment, ADRankTwoTensor &inelastic_strain_increment)
Given a trial stress (_stress[_qp]) and a strain increment (elastic_strain_increment) let the model_n...
const Real _absolute_tolerance
virtual void computeQpStressIntermediateConfiguration()
Compute the stress for the current QP, but do not rotate tensors from the intermediate configuration ...
RankTwoTensor _undamaged_stress_old
const MaterialProperty< RankTwoTensor > & _inelastic_strain_old
old value of inelastic strain
virtual void initQpStatefulProperties() override
ADComputeMultipleInelasticStress(const InputParameters ¶meters)
static InputParameters validParams()
const bool _perform_finite_strain_rotations
after updateQpState, rotate the stress, elastic_strain, and inelastic_strain using _rotation_incremen...
const Real _relative_tolerance
bool _is_elasticity_tensor_guaranteed_isotropic
is the elasticity tensor guaranteed to be isotropic?
ADMaterialProperty< R2 > & _stress
The stress tensor to be calculated.
ADMaterialProperty< R2 > & _elastic_strain
const ConsoleStream _console
DamageBase is a base class for damage models, which modify the stress tensor computed by another mode...
virtual Real computeTimeStepLimit()
Compute the limiting value of the time step for this material.
void setQp(unsigned int qp)
Sets the value of the member variable _qp for use in inheriting classes.
virtual void finiteStrainRotation(const GenericRankTwoTensor< is_ad > &rotation_increment)
Perform any necessary rotation of internal variables for finite strain.
virtual void updateStressForDamage(GenericRankTwoTensor< is_ad > &stress_new)=0
Update the current stress tensor for effects of damage.
virtual void updateDamage()
Update the internal variable(s) that evolve the damage.
virtual void computeUndamagedOldStress(RankTwoTensor &stress_old)=0
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
MaterialBase & getMaterial(const std::string &name)
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
const std::string & _name
bool isParamValid(const std::string &name) const
void rotate(const TypeTensor< T > &R)
StressUpdateBase is a material that is not called by MOOSE because of the compute=false flag set in t...
virtual bool requiresIsotropicTensor()=0
Does the model require the elasticity tensor to be isotropic?
static constexpr std::size_t dim