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");
29 params.
addParam<Real>(
"relative_tolerance",
31 "Relative convergence tolerance for the stress "
32 "update iterations over the stress change "
33 "after all update materials are called");
34 params.
addParam<Real>(
"absolute_tolerance",
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.");
180 paramError(
"damage_model",
182 " is not compatible with ComputeMultipleInelasticStressBase");
185 for (
const auto model_number : index_range(
_models))
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.";
247 if (_fe_problem.currentlyComputingJacobian())
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");
299 for (
const auto i_rmm : make_range(1u,
_num_models))
306 unsigned model_number,
328 elastic_strain_increment,
329 combined_inelastic_strain_increment,
332 if (_fe_problem.currentlyComputingJacobian())
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();
365 const bool jac = _fe_problem.currentlyComputingJacobian();
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 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 mooseError(Args &&... args)
TangentCalculationMethod
TangentCalculationMethod is an enum that determines the calculation method for the tangent operator.
void ErrorVector unsigned int
ComputeFiniteStrainElasticStress computes the stress following elasticity theory for finite strains.
const std::string _elasticity_tensor_name
Name of the elasticity tensor material property.
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _rotation_increment
Rotation increment material property.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
const MaterialProperty< RankTwoTensor > & _stress_old
Old state of the stress tensor material property.
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
virtual void initQpStatefulProperties() override
MaterialProperty< RankTwoTensor > & _elastic_strain
Elastic strain material property.
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
TangentCalculationMethod _tangent_calculation_method
Calculation method for the tangent modulus.
virtual void finiteStrainRotation(const bool force_elasticity_rotation=false)
Rotate _elastic_strain, _stress, _inelastic_strain, and _Jacobian_mult to the new configuration.
static InputParameters validParams()
unsigned _num_models
number of plastic models
const MaterialProperty< RankTwoTensor > & _strain_increment
const bool _perform_finite_strain_rotations
after updateQpState, rotate the stress, elastic_strain, inelastic_strain and Jacobian_mult using _rot...
std::vector< Real > _inelastic_weights
_inelastic_strain = sum_i (_inelastic_weights_i * inelastic_strain_from_model_i)
std::vector< StressUpdateBase * > _models
The user supplied list of inelastic models to use in the simulation.
RankTwoTensor _undamaged_stress_old
virtual std::vector< MaterialName > getInelasticModelNames()=0
const bool _cycle_models
whether to cycle through the models, using only one model per timestep
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,...
virtual void initQpStatefulProperties() override
MaterialProperty< Real > & _material_timestep_limit
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...
std::vector< bool > _tangent_computation_flag
Flags to compute tangent during updateState call.
DamageBaseTempl< false > * _damage_model
Pointer to the damage model.
MaterialProperty< RankTwoTensor > & _inelastic_strain
The sum of the inelastic strains that come from the plastic models.
ComputeMultipleInelasticStressBase(const InputParameters ¶meters)
const RankFourTensor _identity_symmetric_four
Rank four symmetric identity tensor.
virtual void computeQpStressIntermediateConfiguration()
Compute the stress for the current QP, but do not rotate tensors from the intermediate configuration ...
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...
const MaterialProperty< RankTwoTensor > & _inelastic_strain_old
old value of inelastic strain
TangentOperatorEnum
what sort of Tangent operator to calculate
virtual void initialSetup() override
virtual void computeQpStress() override
Compute the stress and store it in the _stress material property for the current quadrature point.
enum ComputeMultipleInelasticStressBase::TangentOperatorEnum _tangent_operator_type
const MaterialProperty< RankTwoTensor > & _elastic_strain_old
Strain tensors.
bool _all_models_isotropic
are all inelastic models inherently isotropic? (not the case for e.g. weak plane plasticity models)
std::vector< RankFourTensor > _consistent_tangent_operator
the consistent tangent operators computed by each plastic model
bool _is_elasticity_tensor_guaranteed_isotropic
is the elasticity tensor guaranteed to be isotropic?
virtual void computeQpJacobianMult()
Using _elasticity_tensor[_qp] and the consistent tangent operators, _consistent_tangent_operator[....
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.
virtual void updateJacobianMultForDamage(RankFourTensor &jacobian_mult)=0
Update the material constitutive matrix.
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)
const std::string & name() const
RankFourTensorTempl< T > invSymm() const
RankTwoTensorTempl< T > transpose() const
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?
virtual bool isIsotropic()
Is the implmented model isotropic? The safe default is 'false'.