Go to the documentation of this file.
11 #include "libmesh/utility.h"
21 params.addParam<Real>(
22 "resid_abs_tol", 1e-10,
"Absolute Tolerance for flow rate residual equation");
23 params.addParam<Real>(
24 "resid_rel_tol", 1e-6,
"Relative Tolerance for flow rate residual equation");
25 params.addParam<
unsigned int>(
"maxiters", 50,
"Maximum iteration for flow rate update");
26 params.addParam<
unsigned int>(
"max_substep_iteration", 1,
"Maximum number of substep iteration");
27 params.addParam<std::vector<UserObjectName>>(
28 "flow_rate_user_objects",
29 "List of User object names that computes flow rate and derivatives");
30 params.addParam<std::vector<UserObjectName>>(
31 "strength_user_objects",
32 "List of User object names that computes strength variables and derivatives");
33 params.addParam<std::vector<UserObjectName>>(
34 "internal_var_user_objects",
35 "List of User object names that integrates internal variables and computes derivatives");
36 params.addParam<std::vector<UserObjectName>>(
37 "internal_var_rate_user_objects",
38 "List of User object names that computes internal variable rates and derivatives");
39 params.addClassDescription(
"Material class for hyper-elastic viscoplatic flow: Can handle "
40 "multiple flow models defined by flowratemodel type user objects");
46 const InputParameters & parameters)
48 _resid_abs_tol(getParam<Real>(
"resid_abs_tol")),
49 _resid_rel_tol(getParam<Real>(
"resid_rel_tol")),
50 _maxiters(getParam<unsigned int>(
"maxiters")),
51 _max_substep_iter(getParam<unsigned int>(
"max_substep_iteration")),
52 _flow_rate_uo_names(isParamValid(
"flow_rate_user_objects")
53 ? getParam<std::vector<UserObjectName>>(
"flow_rate_user_objects")
54 : std::vector<UserObjectName>(0)),
55 _strength_uo_names(isParamValid(
"strength_user_objects")
56 ? getParam<std::vector<UserObjectName>>(
"strength_user_objects")
57 : std::vector<UserObjectName>(0)),
58 _int_var_uo_names(isParamValid(
"internal_var_user_objects")
59 ? getParam<std::vector<UserObjectName>>(
"internal_var_user_objects")
60 : std::vector<UserObjectName>(0)),
61 _int_var_rate_uo_names(
62 isParamValid(
"internal_var_rate_user_objects")
63 ? getParam<std::vector<UserObjectName>>(
"internal_var_rate_user_objects")
64 : std::vector<UserObjectName>(0)),
65 _pk2_prop_name(_base_name +
"pk2"),
68 _fp_old(getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"fp")),
70 _elasticity_tensor_name(_base_name +
"elasticity_tensor"),
71 _elasticity_tensor(getMaterialPropertyByName<
RankFourTensor>(_elasticity_tensor_name)),
72 _deformation_gradient(getMaterialProperty<
RankTwoTensor>(_base_name +
"deformation_gradient")),
73 _deformation_gradient_old(
74 getMaterialPropertyOld<
RankTwoTensor>(_base_name +
"deformation_gradient")),
75 _rotation_increment(getMaterialProperty<
RankTwoTensor>(_base_name +
"rotation_increment"))
113 const std::vector<UserObjectName> & uo_names,
unsigned int & uo_num)
115 uo_num = uo_names.size();
118 template <
typename T>
122 std::vector<MaterialProperty<T> *> & uo_prop)
124 uo_prop.resize(uo_num);
125 for (
unsigned int i = 0; i < uo_num; ++i)
126 uo_prop[i] = &declareProperty<T>(uo_names[i]);
129 template <
typename T>
132 const std::vector<UserObjectName> & uo_names,
134 std::vector<
const MaterialProperty<T> *> & uo_prop_old)
136 uo_prop_old.resize(uo_num);
137 for (
unsigned int i = 0; i < uo_num; ++i)
138 uo_prop_old[i] = &getMaterialPropertyOld<T>(uo_names[i]);
141 template <
typename T>
145 std::vector<const T *> & uo)
150 mooseError(
"Specify atleast one user object of type",
typeid(T).
name());
152 for (
unsigned int i = 0; i < uo_num; ++i)
153 uo[i] = &getUserObjectByName<T>(uo_names[i]);
190 _fp[_qp].setToIdentity();
214 unsigned int num_substep = 1;
215 unsigned int substep_iter = 1;
226 for (
unsigned int istep = 0; istep < num_substep; ++istep)
239 mooseError(
"Constitutive failure with substepping at quadrature point ",
320 unsigned int iter = 0;
333 rnormst[iter] = rnorm;
352 rnormst[iter] = rnorm;
422 DenseMatrix<Real> dflowrate_dflowrate;
433 _jac(i, j) -= dflowrate_dflowrate(i, j);
470 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
471 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
472 for (
unsigned int k = 0; k < LIBMESH_DIM; ++k)
485 _ee = 0.5 * (
_ce[_qp] - iden);
493 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
494 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
521 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
522 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
523 for (
unsigned int k = 0; k < LIBMESH_DIM; ++k)
533 for (
unsigned int i = 0; i < var.size(); ++i)
534 val += Utility::pow<2>(var[i]);
535 return std::sqrt(val);
555 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
556 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
557 for (
unsigned int l = 0; l < LIBMESH_DIM; ++l)
565 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
566 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
567 for (
unsigned int l = 0; l < LIBMESH_DIM; ++l)
570 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
571 for (
unsigned int j = 0; j < LIBMESH_DIM; ++j)
572 for (
unsigned int k = 0; k < LIBMESH_DIM; ++k)
573 for (
unsigned int l = 0; l < LIBMESH_DIM; ++l)
std::vector< const HEVPInternalVarUOBase * > _int_var_uo
Internal variable user objects.
virtual bool solveFlowrate()
Solve for flow rate and state.
MaterialProperty< RankTwoTensor > & _ce
RankTwoTensor _fp_tmp_inv
virtual Real computeNorm(const std::vector< Real > &)
Computes norm of residual vector.
DenseMatrix< Real > _dflowrate_dstrength
registerMooseObject("TensorMechanicsApp", FiniteStrainHyperElasticViscoPlastic)
const MaterialProperty< RankTwoTensor > & _fp_old
virtual void updateFlowRate()
Update flow rate.
DenseVector< Real > _dintvar_dintvar_x
virtual void postSolveQp()
Update state for output (Outside substepping)
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
RankTwoTensor _fp_tmp_old_inv
DenseVector< Real > _dflow_rate
virtual bool computeFlowDirection()
Calls user objects to compute flow directions.
unsigned int _num_int_var_rate_uos
Number of internal variable rate user objects.
std::vector< DenseVector< Real > > _dintvarrate_dflowrate
Jacobian variables.
std::vector< const HEVPStrengthUOBase * > _strength_uo
Strength user objects.
virtual void computeElasticStrain()
Computes elastic Lagrangian strain.
virtual void computeIntVarRateDerivatives()
This function call user objects to compute dintvar_rate/dintvar and dintvarrate/dflowrate.
DenseMatrix< Real > _dstrength_dintvar
virtual void preSolveFlowrate()
Sets state for solve (Inside substepping)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
RankFourTensor _df_dstretch_inc
defineLegacyParams(FiniteStrainHyperElasticViscoPlastic)
virtual void computeQpJacobian()
This function computes the Jacobian.
std::vector< DenseVector< Real > > _dintvar_dflowrate_tmp
virtual void initQpStatefulProperties()
Initializes state.
virtual void saveOldState()
This function saves the old stateful properties that is modified during sub stepping.
const MaterialProperty< RankTwoTensor > & _rotation_increment
DenseMatrix< Real > _dintvar_dflowrate
std::vector< RankTwoTensor > _dpk2_dflowrate
virtual bool computeIntVarRates()
This function call user objects to calculate rate of internal variables.
static InputParameters validParams()
DenseMatrix< Real > _dintvar_dintvar
std::vector< const HEVPFlowRateUOBase * > _flow_rate_uo
Flow rate user objects.
FiniteStrainHyperElasticViscoPlastic(const InputParameters ¶meters)
std::vector< MaterialProperty< Real > * > _flow_rate_prop
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
ComputeStressBase is the base class for stress tensors.
unsigned int _maxiters
Maximum number of iterations.
void initNumUserObjects(const std::vector< UserObjectName > &, unsigned int &)
This function calculates the number of each user object type.
virtual bool computeFlowRateResidual()
Computes flow rate residual vector.
static InputParameters validParams()
virtual void preSolveQp()
Sets state for solve.
virtual void postSolveFlowrate()
Update state for output (Inside substepping)
DenseVector< Real > _flow_rate
virtual bool computeIntVar()
This function call user objects to integrate internal variables.
RankFourTensor _dpk2_dfpinv
std::vector< const HEVPInternalVarRateUOBase * > _int_var_rate_uo
Internal variable rate user objects.
std::vector< UserObjectName > _int_var_uo_names
Names of internal variable user objects.
std::vector< UserObjectName > _flow_rate_uo_names
Names of flow rate user objects.
std::string _pk2_prop_name
virtual bool computeStrength()
This function call user objects to compute strength.
virtual void initJacobianVariables()
This function initialize variables required for Jacobian calculation.
virtual void computeDeeDce()
Computes derivative of elastic strain w.r.t elastic Right Cauchy Green Tensor.
unsigned int _num_strength_uos
Number of strength user objects.
virtual void computeQpStress()
This function computes the Cauchy stress.
std::vector< Real > _int_var_old
virtual void recoverOldState()
This function restores the the old stateful properties after a successful solve.
std::vector< RankTwoTensor > _dflowrate_dpk2
const MaterialProperty< RankTwoTensor > & _deformation_gradient
virtual bool solveQp()
Solve state.
unsigned int _num_int_var_uos
Number of internal variable user objects.
virtual void computeIntVarDerivatives()
This function call user objects to compute dintvar/dintvar_rate and dintvar/dflowrate.
RankFourTensor _dfe_dfpinv
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...
std::vector< MaterialProperty< Real > * > _strength_prop
std::vector< const MaterialProperty< Real > * > _int_var_stateful_prop_old
unsigned int _max_substep_iter
Maximum number of substep iterations.
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.
std::vector< RankTwoTensor > _flow_dirn
unsigned int _num_flow_rate_uos
Number of flow rate user objects.
std::vector< RankTwoTensor > _dfpinv_dflowrate
virtual void computeElasticRightCauchyGreenTensor()
Computes elastic Right Cauchy Green Tensor.
void initProp(const std::vector< UserObjectName > &, unsigned int, std::vector< MaterialProperty< T > * > &)
This function initializes properties for each user object.
std::vector< UserObjectName > _strength_uo_names
Names of strength user objects.
const MaterialProperty< RankTwoTensor > & _deformation_gradient_old
virtual void computeFlowRateJacobian()
Computes flow rate Jacobian matrix.
DenseVector< Real > _resid
virtual void computeDpk2Dfpinv()
Computes derivative of PK2 stress wrt inverse of plastic deformation gradient.
virtual void computeElasticPlasticDeformGrad()
Computes elastic and plastic deformation gradients.
Real _resid_abs_tol
Absolute tolerance for residual convergence check.
virtual bool computeFlowRateFunction()
Calls user objects to compute flow rates.
std::vector< UserObjectName > _int_var_rate_uo_names
Names of internal variable rate user objects.
DenseMatrix< Real > _dintvarrate_dintvar
MaterialProperty< RankTwoTensor > & _pk2
Real _resid_rel_tol
Relative tolerance for residual convergence check.
virtual void initUOVariables()
This function initializes the properties, stateful properties and user objects The properties and sta...
MaterialProperty< RankTwoTensor > & _fp
This class solves the viscoplastic flow rate equations in the total form Involves 4 different types o...
DenseMatrix< Real > _dintvar_dintvarrate
void computeStrengthDerivatives()
This function call user objects to compute dstrength/dintvar.
std::vector< MaterialProperty< Real > * > _int_var_stateful_prop
std::vector< MaterialProperty< Real > * > _int_var_rate_prop