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();
116 template <
typename T>
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]);
127 template <
typename T>
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]);
139 template <
typename T>
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]);
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;
431 _jac(i,
j) -= dflowrate_dflowrate(i,
j);
531 for (
unsigned int i = 0; i < var.size(); ++i)
532 val += Utility::pow<2>(var[i]);
549 usingTensorIndices(i_, j_, k_, l_);
const MooseArray< Point > & _q_point
registerMooseObject("SolidMechanicsApp", FiniteStrainHyperElasticViscoPlastic)
DenseVector< Real > _dintvar_dintvar_x
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
unsigned int _num_flow_rate_uos
Number of flow rate user objects.
unsigned int _maxiters
Maximum number of iterations.
virtual void recoverOldState()
This function restores the the old stateful properties after a successful solve.
virtual void preSolveQp()
Sets state for solve.
RankTwoTensorTempl< Real > inverse() const
const MaterialProperty< RankTwoTensor > & _deformation_gradient_old
RankTwoTensor _fp_tmp_old_inv
This class solves the viscoplastic flow rate equations in the total form Involves 4 different types o...
ComputeStressBase is the base class for stress tensors computed from MOOSE's strain calculators...
std::vector< MaterialProperty< Real > * > _flow_rate_prop
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...
DenseVector< Real > _resid
std::string _pk2_prop_name
std::vector< Real > _int_var_old
DenseMatrix< Real > _dflowrate_dstrength
unsigned int _num_int_var_rate_uos
Number of internal variable rate user objects.
std::vector< DenseVector< Real > > _dintvar_dflowrate_tmp
virtual void computeElasticStrain()
Computes elastic Lagrangian strain.
static InputParameters validParams()
virtual void zero() override final
void initNumUserObjects(const std::vector< UserObjectName > &, unsigned int &)
This function calculates the number of each user object type.
std::vector< RankTwoTensor > _flow_dirn
unsigned int _max_substep_iter
Maximum number of substep iterations.
std::vector< UserObjectName > _strength_uo_names
Names of strength user objects.
virtual void initUOVariables()
This function initializes the properties, stateful properties and user objects The properties and sta...
std::vector< RankTwoTensor > _dfpinv_dflowrate
DenseMatrix< Real > _dintvar_dintvar
virtual void updateFlowRate()
Update flow rate.
virtual void computeDpk2Dfpinv()
Computes derivative of PK2 stress wrt inverse of plastic deformation gradient.
RankFourTensor _df_dstretch_inc
const MaterialProperty< RankTwoTensor > & _fp_old
virtual void computeDeeDce()
Computes derivative of elastic strain w.r.t elastic Right Cauchy Green Tensor.
static constexpr std::size_t dim
unsigned int _num_int_var_uos
Number of internal variable user objects.
std::vector< DenseVector< Real > > _dintvarrate_dflowrate
Jacobian variables.
Real _resid_abs_tol
Absolute tolerance for residual convergence check.
virtual bool solveFlowrate()
Solve for flow rate and state.
virtual void computeQpJacobian()
This function computes the Jacobian.
RankFourTensor _dpk2_dfpinv
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
DenseMatrix< Real > _dintvar_dflowrate
virtual void postSolveQp()
Update state for output (Outside substepping)
std::vector< UserObjectName > _flow_rate_uo_names
Names of flow rate user objects.
void computeStrengthDerivatives()
This function call user objects to compute dstrength/dintvar.
virtual const std::string & name() const
virtual void computeIntVarRateDerivatives()
This function call user objects to compute dintvar_rate/dintvar and dintvarrate/dflowrate.
MaterialProperty< RankTwoTensor > & _pk2
virtual void initJacobianVariables()
This function initialize variables required for Jacobian calculation.
RankFourTensor _dfe_dfpinv
std::vector< const MaterialProperty< Real > * > _int_var_stateful_prop_old
std::vector< UserObjectName > _int_var_uo_names
Names of internal variable user objects.
MaterialProperty< RankTwoTensor > & _ce
virtual bool computeFlowRateResidual()
Computes flow rate residual vector.
virtual void computeFlowRateJacobian()
Computes flow rate Jacobian matrix.
std::vector< const HEVPInternalVarUOBase * > _int_var_uo
Internal variable user objects.
RankTwoTensor _fp_tmp_inv
virtual void preSolveFlowrate()
Sets state for solve (Inside substepping)
DenseVector< Real > _dflow_rate
virtual bool solveQp()
Solve state.
DenseVector< Real > _flow_rate
virtual void computeIntVarDerivatives()
This function call user objects to compute dintvar/dintvar_rate and dintvar/dflowrate.
std::vector< const HEVPStrengthUOBase * > _strength_uo
Strength user objects.
std::vector< RankTwoTensor > _dpk2_dflowrate
virtual Real computeNorm(const std::vector< Real > &)
Computes norm of residual vector.
virtual void computeElasticPlasticDeformGrad()
Computes elastic and plastic deformation gradients.
virtual void computeQpStress()
This function computes the Cauchy stress.
DenseMatrix< Real > _dintvar_dintvarrate
unsigned int _num_strength_uos
Number of strength user objects.
MaterialProperty< RankTwoTensor > & _fp
std::vector< RankTwoTensor > _dflowrate_dpk2
DenseMatrix< Real > _dstrength_dintvar
std::vector< UserObjectName > _int_var_rate_uo_names
Names of internal variable rate user objects.
static InputParameters validParams()
std::vector< const HEVPInternalVarRateUOBase * > _int_var_rate_uo
Internal variable rate user objects.
virtual bool computeFlowDirection()
Calls user objects to compute flow directions.
void initProp(const std::vector< UserObjectName > &, unsigned int, std::vector< MaterialProperty< T > *> &)
This function initializes properties for each user object.
virtual void postSolveFlowrate()
Update state for output (Inside substepping)
const MaterialProperty< RankTwoTensor > & _rotation_increment
RankTwoTensorTempl< Real > transpose() const
void lu_solve(const DenseVector< Real > &b, DenseVector< Real > &x)
std::vector< MaterialProperty< Real > * > _int_var_stateful_prop
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const HEVPFlowRateUOBase * > _flow_rate_uo
Flow rate user objects.
virtual void saveOldState()
This function saves the old stateful properties that is modified during sub stepping.
RankFourTensorTempl< Real > times(const RankTwoTensorTempl< Real > &b) const
virtual void right_multiply(const DenseMatrixBase< Real > &M2) override final
void resize(const unsigned int new_m, const unsigned int new_n)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
const MaterialProperty< RankTwoTensor > & _deformation_gradient
virtual void computeElasticRightCauchyGreenTensor()
Computes elastic Right Cauchy Green Tensor.
void initUserObjects(const std::vector< UserObjectName > &, unsigned int, std::vector< const T *> &)
This function initializes user objects.
virtual void computePK2StressAndDerivative()
Computes PK2 stress and derivative w.r.t elastic Right Cauchy Green Tensor.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
virtual bool computeFlowRateFunction()
Calls user objects to compute flow rates.
virtual bool computeIntVar()
This function call user objects to integrate internal variables.
std::vector< MaterialProperty< Real > * > _int_var_rate_prop
DenseMatrix< Real > _dintvarrate_dintvar
Real _resid_rel_tol
Relative tolerance for residual convergence check.
FiniteStrainHyperElasticViscoPlastic(const InputParameters ¶meters)
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
MooseUnits pow(const MooseUnits &, int)
static const std::string k
void ErrorVector unsigned int
virtual bool computeStrength()
This function call user objects to compute strength.
virtual void initQpStatefulProperties()
Initializes state.
void vector_mult(DenseVector< Real > &dest, const DenseVector< Real > &arg) const
virtual bool computeIntVarRates()
This function call user objects to calculate rate of internal variables.
std::vector< MaterialProperty< Real > * > _strength_prop