https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeLagrangianStressCustomPK2.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
13
16{
18 params.addRequiredParam<MaterialPropertyName>("custom_pk2_stress", "The name of the PK2 stress.");
19 params.addRequiredParam<MaterialPropertyName>(
20 "custom_pk2_jacobian", "The name of the PK2 Jacobian (w.r.t. the deformation gradient).");
21 return params;
22}
23
25 const InputParameters & parameters)
26 : ComputeLagrangianStressPK1(parameters),
27 _pk2(getMaterialProperty<RankTwoTensor>("custom_pk2_stress")),
28 _dpk2_dF(getMaterialProperty<RankFourTensor>("custom_pk2_jacobian"))
29{
30}
31
32void
34{
35 // Derives _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
37
39 mooseError("This material requires large kinematics; set large_kinematics = true on the "
40 "ComputeLagrangianStrain calculator.");
41}
42
43void
45{
46 // PK1 = F_ust * PK2(F_stab) -- F-bar enters only through PK2 via the strain calc's
47 // F-bar'd `_F` (which is what NEML2 sees as `forces/F`). The wrap uses F_ust so the
48 // residual matches the new convention.
50
51 // The R4 algebra for `_pk1_jacobian` / `_pk1_jacobian_bypass_fbar` is read only on
52 // Jacobian sweeps; skip it on residual-only sweeps.
55 return;
56
57 // dPK1/d(F_ust) = del_ik PK2_lj + F_ust * dPK2/d(F_stab) * d(F_stab)/d(F_ust).
58 usingTensorIndices(i_, j_, k_, l_);
59 const auto I = RankTwoTensor::Identity();
60 const RankFourTensor termA = I.template times<i_, k_, j_, l_>(_pk2[_qp].transpose());
61 // Default path: full F-bar local correction. Equals `_dpk2_dF` when F-bar is off (since
62 // `_d_F_stab_d_F_ust == IdentityFour` then).
63 const RankFourTensor dPK2_dFust = _dpk2_dF[_qp] * _d_F_stab_d_F_ust[_qp];
64 _pk1_jacobian[_qp] = termA + dPK2_dFust.singleProductI(_F_ust[_qp]);
65 // Bypass-F-bar variant for specialty kernels (WPS, homogenization).
67}
68
69void
71{
72 // sigma = (1/J_ust) F_ust * PK2(F_stab) * F_ust^T. Computed directly because the PK1
73 // base's sigma chain assumes `pk1_jacobian = constitutive dPK1/d(F_stab)`, but here PK1
74 // depends on F_ust directly (Term A above) -- already folded into _pk1_jacobian.
75 const Real J_ust = _F_ust[_qp].det();
76 _cauchy_stress[_qp] = _F_ust[_qp] * _pk2[_qp] * _F_ust[_qp].transpose() / J_ust;
77
80 return;
81
82 // cauchy_jacobian = dsigma/d(dL). sigma depends on dL only through PK2(F_stab(dL))
83 // (F_ust is constant w.r.t. dL since dL is computed from F_stab via the kinematic helper).
84 // dPK2/d(dL) = dPK2/d(F_stab) * d(F_stab)/d(dL) = _dpk2_dF *
85 // (_d_deformation_gradient_increment_d_F)^{-1}
86 const RankFourTensor dPK2_d_dL =
88 _cauchy_jacobian[_qp] = dPK2_d_dL.singleProductI(_F_ust[_qp]).singleProductJ(_F_ust[_qp]) / J_ust;
89}
registerMooseObject("SolidMechanicsApp", ComputeLagrangianStressCustomPK2)
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...
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
d(spatial velocity gradient increment)/d(F_stab).
MaterialProperty< RankTwoTensor > & _pk1_stress
The 1st Piola-Kirchhoff stress.
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
MaterialProperty< RankFourTensor > & _cauchy_jacobian
The derivative of the Cauchy stress wrt the increment in the spatial velocity gradient.
MaterialProperty< RankTwoTensor > & _cauchy_stress
The Cauchy stress.
bool _large_kinematics
If true use large deformations.
const MaterialProperty< RankTwoTensor > & _F_ust
Unstabilized deformation gradient (= F_actual at alpha = 1).
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_ust
d(F_stab)/d(F_ust).
Adapt a custom-defined PK2 stress and its Jacobian to provide the PK1 stress and its Jacobian.
ComputeLagrangianStressCustomPK2(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _pk2
2nd PK stress
void computeQpPK1Stress() override
Provide for the actual PK stress update (just PK1)
void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
void computeQpCauchyStress() override
Override the PK1-base sigma wrap because PK1 = F_ust * PK2 has direct F_ust dependence already accoun...
const MaterialProperty< RankFourTensor > & _dpk2_dF
2nd PK tangent dPK2/d(F_stab).
Native interface for providing the 1st Piola Kirchhoff stress.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
FEProblemBase & _fe_problem
void mooseError(Args &&... args) const
RankFourTensorTempl< T > inverse() const
RankFourTensorTempl< T > singleProductI(const RankTwoTensorTempl< T > &) const
static RankTwoTensorTempl Identity()
const bool & currentlyComputingJacobian() const
const bool & currentlyComputingResidualAndJacobian() const