11#include "libmesh/utility.h"
20 "resid_abs_tol", 1e-10,
"Absolute Tolerance for flow rate residual equation");
22 "resid_rel_tol", 1e-6,
"Relative Tolerance for flow rate residual equation");
23 params.
addParam<
unsigned int>(
"maxiters", 50,
"Maximum iteration for flow rate update");
24 params.
addParam<
unsigned int>(
"max_substep_iteration", 1,
"Maximum number of substep iteration");
25 params.
addParam<std::vector<UserObjectName>>(
26 "flow_rate_user_objects",
27 "List of User object names that computes flow rate and derivatives");
28 params.
addParam<std::vector<UserObjectName>>(
29 "strength_user_objects",
30 "List of User object names that computes strength variables and derivatives");
31 params.
addParam<std::vector<UserObjectName>>(
32 "internal_var_user_objects",
33 "List of User object names that integrates internal variables and computes derivatives");
34 params.
addParam<std::vector<UserObjectName>>(
35 "internal_var_rate_user_objects",
36 "List of User object names that computes internal variable rates and derivatives");
38 "multiple flow models defined by flowratemodel type user objects");
46 _resid_abs_tol(getParam<Real>(
"resid_abs_tol")),
47 _resid_rel_tol(getParam<Real>(
"resid_rel_tol")),
48 _maxiters(getParam<unsigned
int>(
"maxiters")),
49 _max_substep_iter(getParam<unsigned
int>(
"max_substep_iteration")),
50 _flow_rate_uo_names(isParamValid(
"flow_rate_user_objects")
51 ? getParam<
std::vector<UserObjectName>>(
"flow_rate_user_objects")
52 :
std::vector<UserObjectName>(0)),
53 _strength_uo_names(isParamValid(
"strength_user_objects")
54 ? getParam<
std::vector<UserObjectName>>(
"strength_user_objects")
55 :
std::vector<UserObjectName>(0)),
56 _int_var_uo_names(isParamValid(
"internal_var_user_objects")
57 ? getParam<
std::vector<UserObjectName>>(
"internal_var_user_objects")
58 :
std::vector<UserObjectName>(0)),
59 _int_var_rate_uo_names(
60 isParamValid(
"internal_var_rate_user_objects")
61 ? getParam<
std::vector<UserObjectName>>(
"internal_var_rate_user_objects")
62 :
std::vector<UserObjectName>(0)),
63 _pk2_prop_name(_base_name +
"pk2"),
66 _fp_old(getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"fp")),
68 _elasticity_tensor_name(_base_name +
"elasticity_tensor"),
69 _elasticity_tensor(getMaterialPropertyByName<
RankFourTensor>(_elasticity_tensor_name)),
70 _deformation_gradient(getMaterialProperty<
RankTwoTensor>(_base_name +
"deformation_gradient")),
71 _deformation_gradient_old(
72 getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"deformation_gradient")),
73 _rotation_increment(getMaterialProperty<
RankTwoTensor>(_base_name +
"rotation_increment"))
111 const std::vector<UserObjectName> & uo_names,
unsigned int & uo_num)
113 uo_num = uo_names.size();
122 uo_prop.resize(uo_num);
123 for (
unsigned int i = 0; i < uo_num; ++i)
124 uo_prop[i] = &declareProperty<T>(uo_names[i]);
130 const std::vector<UserObjectName> & uo_names,
134 uo_prop_old.resize(uo_num);
135 for (
unsigned int i = 0; i < uo_num; ++i)
136 uo_prop_old[i] = &getMaterialPropertyOld<T>(uo_names[i]);
143 std::vector<const T *> & uo)
148 mooseError(
"Specify atleast one user object of type",
typeid(
T).
name());
150 for (
unsigned int i = 0; i < uo_num; ++i)
151 uo[i] = &getUserObjectByName<T>(uo_names[i]);
188 _fp[_qp].setToIdentity();
212 unsigned int num_substep = 1;
213 unsigned int substep_iter = 1;
224 for (
unsigned int istep = 0; istep < num_substep; ++istep)
237 mooseError(
"Constitutive failure with substepping at quadrature point ",
318 unsigned int iter = 0;
331 rnormst[iter] = rnorm;
350 rnormst[iter] = rnorm;
420 DenseMatrix<Real> dflowrate_dflowrate;
431 _jac(i, j) -= dflowrate_dflowrate(i, j);
483 _ee = 0.5 * (
_ce[_qp] - iden);
531 for (
unsigned int i = 0; i < var.size(); ++i)
532 val += Utility::pow<2>(var[i]);
533 return std::sqrt(val);
549 usingTensorIndices(i_, j_, k_, l_);
registerMooseObject("SolidMechanicsApp", FiniteStrainHyperElasticViscoPlastic)
void mooseError(Args &&... args)
void ErrorVector unsigned int
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
ComputeStressBase is the base class for stress tensors computed from MOOSE's strain calculators.
static InputParameters validParams()
This class solves the viscoplastic flow rate equations in the total form Involves 4 different types o...
void initNumUserObjects(const std::vector< UserObjectName > &, unsigned int &)
This function calculates the number of each user object type.
RankTwoTensor _fp_tmp_inv
virtual void initQpStatefulProperties()
Initializes state.
virtual void preSolveFlowrate()
Sets state for solve (Inside substepping)
std::vector< DenseVector< Real > > _dintvarrate_dflowrate
Jacobian variables.
DenseMatrix< Real > _dflowrate_dstrength
virtual void computeElasticRightCauchyGreenTensor()
Computes elastic Right Cauchy Green Tensor.
virtual bool solveQp()
Solve state.
FiniteStrainHyperElasticViscoPlastic(const InputParameters ¶meters)
virtual void computeDeeDce()
Computes derivative of elastic strain w.r.t elastic Right Cauchy Green Tensor.
std::vector< MaterialProperty< Real > * > _flow_rate_prop
std::vector< Real > _int_var_old
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
DenseVector< Real > _flow_rate
virtual bool computeIntVarRates()
This function call user objects to calculate rate of internal variables.
std::vector< MaterialProperty< Real > * > _strength_prop
std::vector< UserObjectName > _flow_rate_uo_names
Names of flow rate user objects.
std::vector< MaterialProperty< Real > * > _int_var_stateful_prop
virtual void computeElasticPlasticDeformGrad()
Computes elastic and plastic deformation gradients.
virtual bool computeFlowDirection()
Calls user objects to compute flow directions.
RankTwoTensor _fp_tmp_old_inv
DenseVector< Real > _dflow_rate
unsigned int _num_strength_uos
Number of strength user objects.
virtual void computeIntVarDerivatives()
This function call user objects to compute dintvar/dintvar_rate and dintvar/dflowrate.
virtual void initUOVariables()
This function initializes the properties, stateful properties and user objects The properties and sta...
virtual void computeElasticStrain()
Computes elastic Lagrangian strain.
unsigned int _num_int_var_uos
Number of internal variable user objects.
virtual bool computeStrength()
This function call user objects to compute strength.
virtual void preSolveQp()
Sets state for solve.
DenseMatrix< Real > _dintvarrate_dintvar
std::vector< UserObjectName > _int_var_uo_names
Names of internal variable user objects.
virtual void recoverOldState()
This function restores the the old stateful properties after a successful solve.
virtual void initJacobianVariables()
This function initialize variables required for Jacobian calculation.
std::vector< const HEVPInternalVarUOBase * > _int_var_uo
Internal variable user objects.
unsigned int _num_int_var_rate_uos
Number of internal variable rate user objects.
static InputParameters validParams()
std::vector< UserObjectName > _strength_uo_names
Names of strength user objects.
const MaterialProperty< RankTwoTensor > & _rotation_increment
DenseMatrix< Real > _dintvar_dintvar
virtual void computeDpk2Dfpinv()
Computes derivative of PK2 stress wrt inverse of plastic deformation gradient.
std::vector< MaterialProperty< Real > * > _int_var_rate_prop
const MaterialProperty< RankTwoTensor > & _fp_old
virtual bool computeFlowRateFunction()
Calls user objects to compute flow rates.
std::string _pk2_prop_name
virtual bool computeIntVar()
This function call user objects to integrate internal variables.
virtual void computeIntVarRateDerivatives()
This function call user objects to compute dintvar_rate/dintvar and dintvarrate/dflowrate.
DenseVector< Real > _resid
DenseVector< Real > _dintvar_dintvar_x
RankFourTensor _dfe_dfpinv
virtual bool computeFlowRateResidual()
Computes flow rate residual vector.
void initUserObjects(const std::vector< UserObjectName > &, unsigned int, std::vector< const T * > &)
This function initializes user objects.
std::vector< RankTwoTensor > _dflowrate_dpk2
virtual void computeQpJacobian()
This function computes the Jacobian.
MaterialProperty< RankTwoTensor > & _pk2
std::vector< RankTwoTensor > _dpk2_dflowrate
const MaterialProperty< RankTwoTensor > & _deformation_gradient_old
MaterialProperty< RankTwoTensor > & _fp
virtual void computeFlowRateJacobian()
Computes flow rate Jacobian matrix.
unsigned int _num_flow_rate_uos
Number of flow rate user objects.
virtual void computeQpStress()
This function computes the Cauchy stress.
virtual void postSolveFlowrate()
Update state for output (Inside substepping)
std::vector< RankTwoTensor > _flow_dirn
virtual void computePK2StressAndDerivative()
Computes PK2 stress and derivative w.r.t elastic Right Cauchy Green Tensor.
std::vector< DenseVector< Real > > _dintvar_dflowrate_tmp
void initProp(const std::vector< UserObjectName > &, unsigned int, std::vector< MaterialProperty< T > * > &)
This function initializes properties for each user object.
Real _resid_rel_tol
Relative tolerance for residual convergence check.
std::vector< UserObjectName > _int_var_rate_uo_names
Names of internal variable rate user objects.
virtual void postSolveQp()
Update state for output (Outside substepping)
MaterialProperty< RankTwoTensor > & _ce
std::vector< const HEVPStrengthUOBase * > _strength_uo
Strength user objects.
RankFourTensor _dpk2_dfpinv
DenseMatrix< Real > _dintvar_dintvarrate
std::vector< const MaterialProperty< Real > * > _int_var_stateful_prop_old
void computeStrengthDerivatives()
This function call user objects to compute dstrength/dintvar.
unsigned int _maxiters
Maximum number of iterations.
virtual void saveOldState()
This function saves the old stateful properties that is modified during sub stepping.
RankFourTensor _df_dstretch_inc
virtual void updateFlowRate()
Update flow rate.
const MaterialProperty< RankTwoTensor > & _deformation_gradient
virtual bool solveFlowrate()
Solve for flow rate and state.
DenseMatrix< Real > _dstrength_dintvar
unsigned int _max_substep_iter
Maximum number of substep iterations.
std::vector< const HEVPFlowRateUOBase * > _flow_rate_uo
Flow rate user objects.
virtual Real computeNorm(const std::vector< Real > &)
Computes norm of residual vector.
std::vector< const HEVPInternalVarRateUOBase * > _int_var_rate_uo
Internal variable rate user objects.
std::vector< RankTwoTensor > _dfpinv_dflowrate
void initPropOld(const std::vector< UserObjectName > &, unsigned int, std::vector< const MaterialProperty< T > * > &)
This function initializes old for stateful properties associated with user object Only user objects t...
DenseMatrix< Real > _dintvar_dflowrate
Real _resid_abs_tol
Absolute tolerance for residual convergence check.
RankFourTensorTempl< T > times(const RankTwoTensorTempl< T > &b) const
RankTwoTensorTempl< T > inverse() const
RankTwoTensorTempl< T > transpose() const
void vector_mult(DenseVector< T > &dest, const DenseVector< T > &arg) const
void resize(const unsigned int new_m, const unsigned int new_n)
void lu_solve(const DenseVector< T > &b, DenseVector< T > &x)
virtual void right_multiply(const DenseMatrixBase< T > &M2) override final
virtual void zero() override final
static constexpr std::size_t dim