https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeLagrangianStressBase.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
14{
16
17 params.addDeprecatedParam<bool>(
18 "large_kinematics",
19 false,
20 "Use a large displacement stress update.",
21 "large_kinematics is no longer set on the stress calculator; it is derived from the "
22 "ComputeLagrangianStrain calculator (the single source of truth) via the LARGE_KINEMATICS "
23 "guarantee. Remove it here and set it only on the strain calculator.");
24
25 params.addParam<std::string>("base_name", "Material property base name");
26
27 return params;
28}
29
31 : Material(parameters),
33 // Derived from the strain calculator's guarantee in initialSetup(); the local parameter is
34 // deprecated and only consulted for a consistency cross-check.
35 _large_kinematics(false),
36 _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
37 _cauchy_stress(declareProperty<RankTwoTensor>(_base_name + "cauchy_stress")),
38 _cauchy_jacobian(declareProperty<RankFourTensor>(_base_name + "cauchy_jacobian")),
39 _pk1_stress(declareProperty<RankTwoTensor>(_base_name + "pk1_stress")),
40 _pk1_jacobian(declareProperty<RankFourTensor>(_base_name + "pk1_jacobian")),
41 _pk1_jacobian_bypass_fbar(
42 declareProperty<RankFourTensor>(_base_name + "pk1_jacobian_bypass_fbar")),
43 _dpk1_d_grad_u(declareProperty<RankFourTensor>(_base_name + "dpk1_d_grad_u")),
44 _d_F_d_grad_u(getMaterialPropertyByName<RankFourTensor>(
45 _base_name + "d_deformation_gradient_d_grad_displacement")),
46 _inverse_unstabilized_deformation_gradient(getMaterialPropertyByName<RankTwoTensor>(
47 _base_name + "inverse_unstabilized_deformation_gradient")),
48 _det_unstabilized_deformation_gradient(
49 getMaterialPropertyByName<Real>(_base_name + "det_unstabilized_deformation_gradient")),
50 _d_deformation_gradient_increment_d_F(getMaterialPropertyByName<RankFourTensor>(
51 _base_name + "d_spatial_deformation_gradient_increment_d_deformation_gradient")),
52 _d_F_stab_d_F_ust(
53 getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_unstabilized")),
54 _d_F_stab_d_F_avg(
55 getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_average")),
56 _d_nl_fbar(declareProperty<RankFourTensor>(_base_name + "d_nl_fbar_operator"))
57{
58}
59
60void
62{
64
65 // Derive the kinematics regime from the strain calculator's LARGE_KINEMATICS guarantee -- the
66 // single source of truth. Block-restricted (per subdomain) and keyed by the base_name-prefixed
67 // deformation_gradient (so a given base_name matches its own strain calculator).
70
71 // The deprecated local parameter must not silently disagree with the strain calculator.
72 if (isParamSetByUser("large_kinematics") &&
73 getParam<bool>("large_kinematics") != _large_kinematics)
74 paramError("large_kinematics",
75 "large_kinematics disagrees with the ComputeLagrangianStrain calculator (which "
76 "computes ",
77 _large_kinematics ? "large" : "small",
78 " kinematics). large_kinematics is deprecated here; set it only on the strain "
79 "calculator.");
80}
81
82void
84{
85 // Actually no need to zero out the stresses as they aren't stateful (yet)
86}
87
88void
90{
91 // F_ust^{-1} and det(F_ust) are published once per qp by the strain calculator; reuse them
92 // instead of recomputing a 3x3 inverse + determinant here on every residual/Jacobian sweep.
96 // Small kinematics: PK1 = sigma (no wrap)
97 else
99}
100
101void
103{
104 // sigma depends on the displacements only through F_stab, so its part of dP/d(F_ust) carries
105 // the local F-bar factor d(F_stab)/d(F_ust)
107 {
108 usingTensorIndices(i_, j_, k_, l_);
110 const Real det_F_ust = _det_unstabilized_deformation_gradient[_qp];
111 // Geometric pieces of dPK1/d(F_ust) (independent of F-bar):
112 const RankFourTensor geom = _pk1_stress[_qp].outerProduct(F_ust_inv.transpose()) -
113 _pk1_stress[_qp].times<i_, l_, j_, k_>(F_ust_inv);
114 // sigma chain WITHOUT the F-bar `_d_F_stab_d_F_ust` factor -- for specialty kernels
115 // whose coupled variable adds to F_ust AFTER F-bar (WPS strain_zz, homogenization
116 // macro_grad), so the perturbation bypasses F-bar's chain.
117 _pk1_jacobian_bypass_fbar[_qp] = geom + det_F_ust * dsigma_dF_stab.singleProductJ(F_ust_inv);
118 // sigma chain WITH the F-bar chain -- the default `_pk1_jacobian` for disp Jacobian.
120 geom + det_F_ust * (dsigma_dF_stab * _d_F_stab_d_F_ust[_qp]).singleProductJ(F_ust_inv);
121 }
122 else
123 {
124 // Small kinematics: the F-bar chain enters via `_d_F_stab_d_F_ust` for the disp Jacobian
125 // path; specialty paths bypass it.
126 _pk1_jacobian[_qp] = dsigma_dF_stab * _d_F_stab_d_F_ust[_qp];
127 _pk1_jacobian_bypass_fbar[_qp] = dsigma_dF_stab;
128 }
129}
130
131void
133{
135 // Chain the kinematic policy into the PK1 Jacobian so the TL kernel consumes a single
136 // d(PK1)/d(grad u) property and doesn't need to know about the generalized-alpha weighting.
137 // For alpha = 1 (default) this is _pk1_jacobian itself. These are read only during Jacobian
138 // assembly, so skip the R4*R4 work on residual-only sweeps.
141 {
143
144 // Non-local F-bar operator, composed once per qp here (shared by all displacement kernels)
145 // instead of per-kernel in the assembly precalculate. `isPropertyActive`-gated so only the
146 // F-bar (stabilized) kernels pay for the R4*R4*R4 chain.
150 }
151}
@ LARGE_KINEMATICS
MaterialProperty< RankFourTensor > & _pk1_jacobian_bypass_fbar
Variant of _pk1_jacobian computed WITHOUT the F-bar chain factor _d_F_stab_d_F_ust in the sigma-via-d...
MaterialProperty< RankFourTensor > & _pk1_jacobian
The derivative of the 1st PK stress wrt the deformation gradient (F that the stress material consumes...
virtual void computeQpStressUpdate()=0
Provide for the actual stress updates.
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
d(spatial velocity gradient increment)/d(F_stab).
const MaterialProperty< RankTwoTensor > & _inverse_unstabilized_deformation_gradient
Inverse and determinant of the unstabilized deformation gradient (= F_actual at alpha = 1),...
MaterialProperty< RankFourTensor > & _dpk1_d_grad_u
The derivative of the 1st PK stress wrt the displacement gradient (grad u_{n+1}).
const MaterialProperty< Real > & _det_unstabilized_deformation_gradient
MaterialProperty< RankFourTensor > & _d_nl_fbar
Non-local F-bar operator D_nl = cauchy_jacobian : d(dL)/dF : d(F_stab)/d(F_avg), published so the Lag...
void pullBackCauchyStress()
Pull the Cauchy stress back to the 1st PK stress with the unstabilized deformation gradient,...
MaterialProperty< RankTwoTensor > & _pk1_stress
The 1st Piola-Kirchhoff stress.
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
const std::string _base_name
Prepend to the material properties.
virtual void initQpStatefulProperties() override
Initialize everything with zeros.
void pullBackCauchyJacobian(const RankFourTensor dsigma_dF_stab)
Set pk1_jacobian and pk1_jacobian_bypass_fbar of P = det(F_ust) sigma F_ust^{-T} from dsigma/d(F_stab...
MaterialProperty< RankFourTensor > & _cauchy_jacobian
The derivative of the Cauchy stress wrt the increment in the spatial velocity gradient.
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_avg
d(F_stab)/d(F_avg), the non-local F-bar partial. Read to compose _d_nl_fbar.
MaterialProperty< RankTwoTensor > & _cauchy_stress
The Cauchy stress.
virtual void computeQpProperties() override
Update all properties (here just the stress/derivatives)
ComputeLagrangianStressBase(const InputParameters &parameters)
bool _large_kinematics
If true use large deformations.
const MaterialProperty< RankFourTensor > & _d_F_d_grad_u
d(F)/d(grad u_{n+1}) (= alpha * IdentityFour for the generalized midpoint rule)
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_ust
d(F_stab)/d(F_ust).
Add-on class that provides the functionality to check if guarantees for material properties are provi...
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
bool isPropertyActive(const unsigned int prop_id) const
unsigned int _qp
FEProblemBase & _fe_problem
static InputParameters validParams()
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &name) const
RankFourTensorTempl< T > singleProductJ(const RankTwoTensorTempl< T > &) const
RankTwoTensorTempl< T > transpose() const
virtual void initialSetup()
const bool & currentlyComputingJacobian() const
const bool & currentlyComputingResidualAndJacobian() const