22 "Compute stress using a fixed smeared cracking model. Uses automatic differentiation");
25 "The material objects used to compute softening behavior for loading a crack." 26 "Either 1 or 3 models must be specified. If a single model is specified, it is" 27 "used for all directions. If 3 models are specified, they will be used for the" 28 "3 crack directions in sequence");
31 "The stress threshold beyond which cracking occurs. Negative values prevent cracking.");
34 "prescribed_crack_directions", direction,
"Prescribed directions of first cracks");
36 "max_cracks", 3,
"The maximum number of cracks allowed at a material point.");
39 "cracking_neg_fraction <= 1 & cracking_neg_fraction >= 0",
40 "The fraction of the cracking strain at which " 41 "a transition begins during decreasing " 42 "strain to the original stiffness.");
44 "max_stress_correction",
46 "Maximum permitted correction to the predicted stress as a ratio of the " 47 "stress change to the predicted stress from the previous step's damage level. " 48 "Values less than 1 will improve robustness, but not be as accurate.");
51 "shear_retention_factor",
53 "shear_retention_factor>=0 & shear_retention_factor<=1.0",
54 "Fraction of original shear stiffness to be retained after cracking");
55 params.
set<std::vector<MaterialName>>(
"inelastic_models") = {};
57 MooseEnum crackedElasticityType(
"DIAGONAL FULL",
"DIAGONAL");
59 "DIAGONAL",
"Zero out terms coupling with directions orthogonal to a crack (legacy)");
61 "FULL",
"Consistently scale all entries based on damage (recommended)");
63 "cracked_elasticity_type",
64 crackedElasticityType,
65 "Method to modify the local elasticity tensor to account for cracking");
72 _cracking_stress(adCoupledValue(
"cracking_stress")),
73 _max_cracks(getParam<unsigned
int>(
"max_cracks")),
74 _cracking_neg_fraction(getParam<
Real>(
"cracking_neg_fraction")),
75 _shear_retention_factor(getParam<
Real>(
"shear_retention_factor")),
76 _max_stress_correction(getParam<
Real>(
"max_stress_correction")),
77 _cracked_elasticity_type(
79 _crack_damage(declareADProperty<
RealVectorValue>(_base_name +
"crack_damage")),
80 _crack_damage_old(getMaterialPropertyOld<
RealVectorValue>(_base_name +
"crack_damage")),
81 _crack_flags(declareADProperty<
RealVectorValue>(_base_name +
"crack_flags")),
82 _crack_rotation(declareADProperty<
RankTwoTensor>(_base_name +
"crack_rotation")),
83 _crack_rotation_old(getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"crack_rotation")),
84 _crack_initiation_strain(
85 declareADProperty<
RealVectorValue>(_base_name +
"crack_initiation_strain")),
86 _crack_initiation_strain_old(
87 getMaterialPropertyOld<
RealVectorValue>(_base_name +
"crack_initiation_strain")),
88 _crack_max_strain(declareADProperty<
RealVectorValue>(_base_name +
"crack_max_strain")),
89 _crack_max_strain_old(getMaterialPropertyOld<
RealVectorValue>(_base_name +
"crack_max_strain"))
92 getParam<MultiMooseEnum>(
"prescribed_crack_directions");
93 if (prescribed_crack_directions.
size() > 0)
95 if (prescribed_crack_directions.
size() > 3)
96 mooseError(
"A maximum of three crack directions may be specified");
97 for (
unsigned int i = 0; i < prescribed_crack_directions.
size(); ++i)
99 for (
unsigned int j = 0;
j < i; ++
j)
100 if (prescribed_crack_directions[i] == prescribed_crack_directions[
j])
101 mooseError(
"Entries in 'prescribed_crack_directions' cannot be repeated");
103 static_cast<unsigned int>(prescribed_crack_directions.
get(i)));
109 std::set<unsigned int> available_dirs = {0, 1, 2};
111 if (available_dirs.erase(dir) != 1)
113 if (available_dirs.size() != 1)
114 mooseError(
"Error in finding remaining available crack direction");
120 "cracked_elasticity_type",
121 "Defaulting to the legacy option of 'DIAGONAL', but the 'FULL' option is preferred");
174 mooseError(
"Number of prescribed crack directions cannot be 2");
195 mooseError(
"ADComputeSmearedCrackingStress requires that the elasticity tensor be " 196 "guaranteed isotropic");
198 std::vector<MaterialName> soft_matls = getParam<std::vector<MaterialName>>(
"softening_models");
199 for (
auto soft_matl : soft_matls)
206 paramError(
"softening_models",
"Model " + soft_matl +
" is not a softening model");
215 paramError(
"softening_models",
"Either 1 or 3 softening models must be specified");
233 model->propagateQpStatefulProperties();
259 const ADReal youngs_modulus =
262 bool cracking_locally_active =
false;
266 if (cracking_stress > 0)
273 for (
unsigned int i = 0; i < 3; ++i)
279 stiffness_ratio_local(i) = 1.0;
287 const ADReal a = (Ec - Eo) / (4 * etr);
288 const ADReal b = (Ec + Eo) / 2;
290 stiffness_ratio_local(i) = (2.0 *
a * etr +
b) / Eo;
291 cracking_locally_active =
true;
296 cracking_locally_active =
true;
301 if (cracking_locally_active)
310 const ADReal c01 = (c0_coupled && c1_coupled ? 1.0 : 0.0);
311 const ADReal c02 = (c0_coupled && c2_coupled ? 1.0 : 0.0);
312 const ADReal c12 = (c1_coupled && c2_coupled ? 1.0 : 0.0);
314 const ADReal c01_shear_retention =
316 const ADReal c02_shear_retention =
318 const ADReal c12_shear_retention =
322 : stiffness_ratio_local(0) * youngs_modulus);
326 : stiffness_ratio_local(1) * youngs_modulus);
329 : stiffness_ratio_local(2) * youngs_modulus);
336 const ADReal & c0 = stiffness_ratio_local(0);
337 const ADReal & c1 = stiffness_ratio_local(1);
338 const ADReal & c2 = stiffness_ratio_local(2);
340 const ADReal c01 = c0 * c1;
341 const ADReal c02 = c0 * c2;
342 const ADReal c12 = c1 * c2;
368 if (!cracking_locally_active)
375 const ADReal youngs_modulus =
380 if (cracking_stress > 0)
385 for (
unsigned i = 0; i < 3; ++i)
396 for (
unsigned i = 0; i < 3; ++i)
406 sigmaPrime.
rotate(
R.transpose());
408 unsigned int num_cracks = 0;
409 for (
unsigned int i = 0; i < 3; ++i)
418 for (
unsigned int i = 0; i < 3; ++i)
420 sigma(i) = sigmaPrime(i, i);
425 const bool met_stress_criterion = (
sigma(i) > cracking_stress);
427 const bool allowed_to_crack = (pre_existing_crack || num_cracks <
_max_cracks);
428 bool new_crack =
false;
430 cracked |= pre_existing_crack;
433 if (met_stress_criterion && !pre_existing_crack && allowed_to_crack)
447 if (new_crack || (pre_existing_crack && loading_existing_crack))
452 strain_in_crack_dir(i),
467 const ADReal a = (Ec - Eo) / (4.0 * etr);
468 const ADReal b = 0.5 * (Ec + Eo);
469 const ADReal c = 0.25 * (Ec - Eo) * etr;
470 sigma(i) = (
a * strain_in_crack_dir(i) +
b) * strain_in_crack_dir(i) +
c;
492 if (num_known_dirs == 0)
494 std::vector<ADReal> eigval(3, 0.0);
506 strain_in_crack_dir(0) = eigval[2];
507 strain_in_crack_dir(1) = eigval[1];
508 strain_in_crack_dir(2) = eigval[0];
510 else if (num_known_dirs == 1)
526 e2x2(0, 0) = ePrime(1, 1);
527 e2x2(1, 0) = ePrime(2, 1);
528 e2x2(0, 1) = ePrime(1, 2);
529 e2x2(1, 1) = ePrime(2, 2);
534 e2x2.
eigen(e_val2x1, e_vec2x2);
538 1.0, 0.0, 0.0, 0.0, e_vec2x2(0, 1), e_vec2x2(1, 1), 0.0, e_vec2x2(0, 0), e_vec2x2(1, 0));
542 strain_in_crack_dir(0) = ePrime(0, 0);
543 strain_in_crack_dir(1) = e_val2x1(1, 0);
544 strain_in_crack_dir(2) = e_val2x1(0, 0);
546 else if (num_known_dirs == 2 || num_known_dirs == 3)
554 strain_in_crack_dir(0) = ePrime(0, 0);
555 strain_in_crack_dir(1) = ePrime(1, 1);
556 strain_in_crack_dir(2) = ePrime(2, 2);
559 mooseError(
"Invalid number of known crack directions");
565 unsigned int num_known_dirs = 0;
566 for (
unsigned int i = 0; i < 3; ++i)
571 return num_known_dirs;
584 for (
unsigned int i = 0; i < 3; ++i)
587 const ADReal stress_correction_ratio = (tensor(i, i) -
sigma(i)) / tensor(i, i);
593 tensor(i, i) =
sigma(i);
603 for (
unsigned int i = 0; i < 3; ++i)
void updateStressTensorForCracking(ADRankTwoTensor &tensor, const ADRealVectorValue &sigma)
Updates the full stress tensor to account for the effect of cracking using the provided stresses in t...
virtual void computeQpStress() override
const ADReal _cracking_neg_fraction
Defines transition to changed stiffness during unloading.
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
ADMaterialProperty< RealVectorValue > & _crack_initiation_strain
void paramError(const std::string ¶m, Args... args) const
registerMooseObject("SolidMechanicsApp", ADComputeSmearedCrackingStress)
const MaterialProperty< RankTwoTensor > & _inelastic_strain_old
old value of inelastic strain
ADMaterialProperty< RankTwoTensor > & _inelastic_strain
The sum of the inelastic strains that come from the plastic models.
ADMaterialProperty< R2 > & _stress
The stress tensor to be calculated.
const MaterialProperty< RealVectorValue > & _crack_max_strain_old
virtual void computeQpStressIntermediateConfiguration()
Compute the stress for the current QP, but do not rotate tensors from the intermediate configuration ...
ADComputeMultipleInelasticStress computes the stress and a decomposition of the strain into elastic a...
const bool _perform_finite_strain_rotations
after updateQpState, rotate the stress, elastic_strain, and inelastic_strain using _rotation_incremen...
const ADReal _shear_retention_factor
Controls the amount of shear retained.
enum ADComputeSmearedCrackingStress::CrackedElasticityType _cracked_elasticity_type
std::vector< ADSmearedCrackSofteningBase * > _softening_models
The user-supplied list of softening models to be used in the 3 crack directions.
unsigned int size() const
std::vector< unsigned int > _prescribed_crack_directions
User-prescribed cracking directions.
const unsigned int _max_cracks
Maximum number of cracks permitted at a material point.
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method)
static RankTwoTensorTempl Identity()
void eigen(ColumnMajorMatrixTempl< Real > &eval, ColumnMajorMatrixTempl< Real > &evec) const
static InputParameters validParams()
void rotate(const RankTwoTensorTempl< T > &R)
virtual unsigned int getNumKnownCrackDirs() const
Get the number of known crack directions.
ADMaterialProperty< RealVectorValue > & _crack_damage
const MaterialProperty< RankTwoTensor > & _crack_rotation_old
const ADMaterialProperty< RankTwoTensor > & _rotation_increment
void updateLocalElasticityTensor()
Update the local elasticity tensor (_local_elasticity_tensor) due to the effects of cracking...
const MaterialProperty< RealVectorValue > & _crack_initiation_strain_old
ADMaterialProperty< RealVectorValue > & _crack_flags
Vector of values going from 1 to 0 as crack damage accumulates.
const ADMaterialProperty< R4 > & _elasticity_tensor
Elasticity tensor material property.
const std::string _elasticity_tensor_name
Name of the elasticity tensor material property.
libMesh::VectorValue< T > column(const unsigned int i) const
bool absoluteFuzzyLessThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
ADMaterialProperty< RealVectorValue > & _crack_max_strain
ADSmearedCrackSofteningBase is the base class for a set of models that define the softening behavior ...
ADComputeSmearedCrackingStress computes the stress for a finite strain material with smeared cracking...
std::string stringify(const T &t)
void rotate(const TypeTensor< T > &R)
virtual void initQpStatefulProperties() override
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-")
virtual void initQpStatefulProperties() override
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
std::vector< ADStressUpdateBase * > _models
The user supplied list of inelastic models to use in the simulation.
static InputParameters validParams()
static const std::string R
ADRankFourTensor _local_elasticity_tensor
Variables used by multiple methods within the calculation for a single material point.
unsigned int get(unsigned int i) const
bool previouslyCracked()
Check to see whether there was cracking in any diretion in the previous time step.
ADComputeSmearedCrackingStress(const InputParameters ¶meters)
const ADMaterialProperty< R2 > & _strain_increment
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addDocumentation(const std::string &name, const std::string &doc)
CrackedElasticityType
Enum defining the method used to adjust the elasticity tensor for cracking.
virtual void initialSetup() override
void mooseError(Args &&... args) const
virtual void updateCrackingStateAndStress()
Update all cracking-related state variables and the stress tensor due to cracking in all directions...
ADMaterialProperty< RankTwoTensor > & _crack_rotation
std::vector< ADReal > _local_elastic_vector
Vector helper to update local elasticity tensor.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const ADReal _max_stress_correction
Controls the maximum amount that the damaged elastic stress is corrected to folow the release model d...
ADMaterialProperty< R2 > & _elastic_strain
void paramWarning(const std::string ¶m, Args... args) const
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
const MaterialProperty< RealVectorValue > & _crack_damage_old
const ADVariableValue & _cracking_stress
Input parameters for smeared crack models.
const MaterialProperty< R2 > & _elastic_strain_old
The old elastic strain is used to calculate the old stress in the case of variable elasticity tensors...
virtual void initialSetup() override
bool isParamSetByUser(const std::string &name) const
MaterialProperty< Real > & _material_timestep_limit
void ErrorVector unsigned int
void computeCrackStrainAndOrientation(ADRealVectorValue &strain_in_crack_dir)
Compute the crack strain in the crack coordinate system.
virtual void finiteStrainRotation()
Rotate _elastic_strain, _stress, and _inelastic_strain to the new configuration.