15 #include "libmesh/int_range.h" 22 "strains and internal parameters) using an iterative process. " 23 "Combinations of creep models and plastic models may be used.");
24 params.
addParam<
unsigned int>(
"max_iterations",
26 "Maximum number of the stress update " 27 "iterations over the stress change after all " 28 "update materials are called");
31 "Relative convergence tolerance for the stress " 32 "update iterations over the stress change " 33 "after all update materials are called");
36 "Absolute convergence tolerance for the stress " 37 "update iterations over the stress change " 38 "after all update materials are called");
40 "internal_solve_full_iteration_history",
42 "Set to true to output stress update iteration information over the stress change");
43 params.
addParam<
bool>(
"perform_finite_strain_rotations",
45 "Tensors are correctly rotated in " 46 "finite-strain simulations. For " 47 "optimal performance you can set " 48 "this to 'false' if you are only " 49 "ever using small strains");
50 MooseEnum tangent_operator(
"elastic nonlinear",
"nonlinear");
54 "Type of tangent operator to return. 'elastic': return the " 55 "elasticity tensor. 'nonlinear': return the full, general consistent tangent " 57 params.
addParam<std::vector<Real>>(
"combined_inelastic_strain_weights",
58 "The combined_inelastic_strain Material Property is a " 59 "weighted sum of the model inelastic strains. This parameter " 60 "is a vector of weights, of the same length as " 61 "inelastic_models. Default = '1 1 ... 1'. This " 62 "parameter is set to 1 if the number of models = 1");
64 "cycle_models",
false,
"At timestep N use only inelastic model N % num_models.");
65 params.
addParam<MaterialName>(
"damage_model",
"Name of the damage model");
73 _max_iterations(parameters.
get<unsigned
int>(
"max_iterations")),
74 _relative_tolerance(parameters.
get<
Real>(
"relative_tolerance")),
75 _absolute_tolerance(parameters.
get<
Real>(
"absolute_tolerance")),
76 _internal_solve_full_iteration_history(getParam<bool>(
"internal_solve_full_iteration_history")),
77 _perform_finite_strain_rotations(getParam<bool>(
"perform_finite_strain_rotations")),
78 _elastic_strain_old(getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"elastic_strain")),
79 _strain_increment(getMaterialProperty<
RankTwoTensor>(_base_name +
"strain_increment")),
80 _inelastic_strain(declareProperty<
RankTwoTensor>(_base_name +
"combined_inelastic_strain")),
81 _inelastic_strain_old(
82 getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"combined_inelastic_strain")),
85 _cycle_models(getParam<bool>(
"cycle_models")),
86 _material_timestep_limit(declareProperty<
Real>(_base_name +
"material_timestep_limit")),
87 _identity_symmetric_four(
RankFourTensor::initIdentitySymmetricFour),
88 _all_models_isotropic(true)
116 ? getParam<std::vector<Real>>(
"combined_inelastic_strain_weights")
120 mooseError(
"ComputeMultipleInelasticStressBase: combined_inelastic_strain_weights must contain " 122 "number of entries as inelastic_models ",
137 " requires an isotropic elasticity tensor, but the one supplied is not " 138 "guaranteed isotropic");
142 " is not compatible with ComputeMultipleInelasticStressBase");
154 bool full_present =
false;
155 bool partial_present =
false;
166 partial_present =
true;
171 if (full_present && partial_present)
174 ": Models that calculate the full tangent operator and the partial tangent " 175 "operator are being combined. Either set tangent_operator to elastic, implement " 176 "the corrent tangent formulations, or use different models.");
182 " is not compatible with ComputeMultipleInelasticStressBase");
187 const bool use_substep =
_models[model_number]->substeppingCapabilityRequested();
188 if (use_substep && !
_models[model_number]->substeppingCapabilityEnabled())
190 std::stringstream error_message;
191 error_message <<
"Usage of substepping has been requested, but the inelastic model " 192 <<
_models[model_number]->name() <<
" does not implement substepping yet.";
256 elastic_strain_increment,
257 combined_inelastic_strain_increment);
259 updateQpState(elastic_strain_increment, combined_inelastic_strain_increment);
275 if (force_elasticity_rotation ||
292 mooseAssert(
A.isSymmetric(),
"Tangent operator isn't symmetric");
306 unsigned model_number,
328 elastic_strain_increment,
329 combined_inelastic_strain_increment,
339 mooseAssert(
A.isSymmetric(),
"Tangent operator isn't symmetric");
351 if (i_rmm != model_number)
352 _models[i_rmm]->propagateQpStatefulProperties();
357 unsigned model_number,
363 _models[model_number]->resetIncrementalMaterialProperties();
367 _models[model_number]->updateState(elastic_strain_increment,
368 inelastic_strain_increment,
375 consistent_tangent_operator);
376 else if (
_models[model_number]->substeppingCapabilityEnabled() &&
378 _models[model_number]->updateStateSubstep(elastic_strain_increment,
379 inelastic_strain_increment,
386 consistent_tangent_operator);
388 _models[model_number]->updateState(elastic_strain_increment,
389 inelastic_strain_increment,
396 consistent_tangent_operator);
401 consistent_tangent_operator.
zero();
const bool _cycle_models
whether to cycle through the models, using only one model per timestep
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
bool _is_elasticity_tensor_guaranteed_isotropic
is the elasticity tensor guaranteed to be isotropic?
static InputParameters validParams()
const RankFourTensor _identity_symmetric_four
Rank four symmetric identity tensor.
virtual void computeQpJacobianMult()
Using _elasticity_tensor[_qp] and the consistent tangent operators, _consistent_tangent_operator[...] computed by the inelastic models, compute _Jacobian_mult[_qp].
FEProblemBase & _fe_problem
virtual bool requiresIsotropicTensor()=0
Does the model require the elasticity tensor to be isotropic?
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _rotation_increment
Rotation increment material property.
virtual std::vector< MaterialName > getInelasticModelNames()=0
const std::string & _name
void paramError(const std::string ¶m, Args... args) const
virtual void updateDamage()
Update the internal variable(s) that evolve the damage.
virtual void updateJacobianMultForDamage(RankFourTensor &jacobian_mult)=0
Update the material constitutive matrix.
virtual void finiteStrainRotation(const bool force_elasticity_rotation=false)
Rotate _elastic_strain, _stress, _inelastic_strain, and _Jacobian_mult to the new configuration...
RankTwoTensor _undamaged_stress_old
ComputeMultipleInelasticStressBase(const InputParameters ¶meters)
virtual void computeUndamagedOldStress(RankTwoTensor &stress_old)=0
virtual void updateQpStateSingleModel(unsigned model_number, RankTwoTensor &elastic_strain_increment, RankTwoTensor &combined_inelastic_strain_increment)
An optimised version of updateQpState that gets used when the number of plastic models is unity...
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
const MaterialProperty< RankTwoTensor > & _strain_increment
virtual void updateQpState(RankTwoTensor &elastic_strain_increment, RankTwoTensor &combined_inelastic_strain_increment)=0
Given the _strain_increment[_qp], iterate over all of the user-specified recompute materials in order...
virtual void initQpStatefulProperties() override
std::vector< StressUpdateBase * > _models
The user supplied list of inelastic models to use in the simulation.
void setQp(unsigned int qp)
Sets the value of the member variable _qp for use in inheriting classes.
const std::string _elasticity_tensor_name
Name of the elasticity tensor material property.
bool _all_models_isotropic
are all inelastic models inherently isotropic? (not the case for e.g. weak plane plasticity models) ...
virtual void computeAdmissibleState(unsigned model_number, RankTwoTensor &elastic_strain_increment, RankTwoTensor &inelastic_strain_increment, RankFourTensor &consistent_tangent_operator)
Given a trial stress (_stress[_qp]) and a strain increment (elastic_strain_increment) let the model_n...
virtual void updateStressForDamage(GenericRankTwoTensor< is_ad > &stress_new)=0
Update the current stress tensor for effects of damage.
std::vector< RankFourTensor > _consistent_tangent_operator
the consistent tangent operators computed by each plastic model
const std::string & name() const
virtual void initQpStatefulProperties() override
MaterialBase & getMaterial(const std::string &name)
TangentCalculationMethod _tangent_calculation_method
Calculation method for the tangent modulus.
DamageBaseTempl< false > * _damage_model
Pointer to the damage model.
std::vector< bool > _tangent_computation_flag
Flags to compute tangent during updateState call.
virtual bool isIsotropic()
Is the implmented model isotropic? The safe default is 'false'.
TangentOperatorEnum
what sort of Tangent operator to calculate
MaterialProperty< RankTwoTensor > & _inelastic_strain
The sum of the inelastic strains that come from the plastic models.
StressUpdateBase is a material that is not called by MOOSE because of the compute=false flag set in t...
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-")
ComputeFiniteStrainElasticStress computes the stress following elasticity theory for finite strains...
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
MaterialProperty< Real > & _material_timestep_limit
unsigned _num_models
number of plastic models
virtual void finiteStrainRotation(const GenericRankTwoTensor< is_ad > &rotation_increment)
Perform any necessary rotation of internal variables for finite strain.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _inelastic_weights
_inelastic_strain = sum_i (_inelastic_weights_i * inelastic_strain_from_model_i)
virtual void initialSetup() override
const MaterialProperty< RankTwoTensor > & _stress_old
Old state of the stress tensor material property.
virtual void computeQpStress() override
Compute the stress and store it in the _stress material property for the current quadrature point...
MaterialProperty< RankTwoTensor > & _elastic_strain
Elastic strain material property.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
const bool _perform_finite_strain_rotations
after updateQpState, rotate the stress, elastic_strain, inelastic_strain and Jacobian_mult using _rot...
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
bool isParamValid(const std::string &name) const
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
const bool & currentlyComputingJacobian() const
virtual void computeQpStressIntermediateConfiguration()
Compute the stress for the current QP, but do not rotate tensors from the intermediate configuration ...
const MaterialProperty< RankTwoTensor > & _inelastic_strain_old
old value of inelastic strain
TangentCalculationMethod
TangentCalculationMethod is an enum that determines the calculation method for the tangent operator...
enum ComputeMultipleInelasticStressBase::TangentOperatorEnum _tangent_operator_type
virtual Real computeTimeStepLimit()
Compute the limiting value of the time step for this material.
const MaterialProperty< RankTwoTensor > & _elastic_strain_old
Strain tensors.
void ErrorVector unsigned int
auto index_range(const T &sizable)
const Elem & get(const ElemType type_in)