www.mooseframework.org
GeneralizedKelvinVoigtModel.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<GeneralizedKelvinVoigtBase>();
15  params.addClassDescription(
16  "Generalized Kelvin-Voigt model composed of a serial assembly of unit Kelvin-Voigt modules");
17  params.addRequiredParam<Real>("young_modulus", "initial elastic modulus of the material");
18  params.addRequiredParam<Real>("poisson_ratio", "initial poisson ratio of the material");
19  params.addRequiredParam<std::vector<Real>>(
20  "creep_modulus", "list of the elastic moduli of the different springs in the material");
21  params.addRequiredParam<std::vector<Real>>(
22  "creep_viscosity",
23  "list of the characteristic times of the different dashpots in the material");
24  params.addParam<std::vector<Real>>(
25  "creep_ratio", "list of the poisson ratios of the different springs in the material");
26  params.set<bool>("force_recompute_properties") = false;
27  params.suppressParameter<bool>("force_recompute_properties");
28  return params;
29 }
30 
32  : GeneralizedKelvinVoigtBase(parameters),
33  _Ci(getParam<std::vector<Real>>("creep_modulus").size()),
34  _eta_i(getParam<std::vector<Real>>("creep_viscosity")),
35  _Si(getParam<std::vector<Real>>("creep_modulus").size())
36 {
37  Real young_modulus = getParam<Real>("young_modulus");
38  Real poisson_ratio = getParam<Real>("poisson_ratio");
39 
40  _C0.fillFromInputVector({young_modulus, poisson_ratio}, RankFourTensor::symmetric_isotropic_E_nu);
41  _S0 = _C0.invSymm();
42 
43  std::vector<Real> creep_modulus = getParam<std::vector<Real>>("creep_modulus");
44  std::vector<Real> creep_ratio;
45  if (isParamValid("creep_ratio"))
46  creep_ratio = getParam<std::vector<Real>>("creep_ratio");
47  else
48  creep_ratio.resize(_Ci.size(), poisson_ratio);
49 
50  if (creep_modulus.size() != _Ci.size())
51  mooseError("incompatible number of creep moduli and viscosities");
52  if (creep_ratio.size() != _Ci.size())
53  mooseError("incompatible number of creep ratios and viscosities");
54  if (!(_Ci.size() == _eta_i.size() || _Ci.size() + 1 == _eta_i.size()))
55  mooseError("incompatible number of creep ratios and viscosities");
56 
57  for (unsigned int i = 0; i < _Ci.size(); ++i)
58  {
59  _Ci[i].fillFromInputVector({creep_modulus[i], creep_ratio[i]},
60  RankFourTensor::symmetric_isotropic_E_nu);
61  _Si[i] = _Ci[i].invSymm();
62  }
63 
64  for (unsigned int i = 0; i < _eta_i.size(); ++i)
65  {
66  if (_eta_i[i] < 0 || MooseUtils::absoluteFuzzyEqual(_eta_i[i], 0.0))
67  mooseError("material viscosity must be strictly > 0");
68  }
69 
70  _components = _eta_i.size();
71  _has_longterm_dashpot = (_eta_i.size() == _Ci.size() + 1);
72 
74 }
75 
76 void
78 {
80 
81  for (unsigned int i = 0; i < _Ci.size(); ++i)
82  _springs_elasticity_tensors[_qp][i] = _Ci[i];
83 
84  for (unsigned int i = 0; i < _eta_i.size(); ++i)
85  _dashpot_viscosities[_qp][i] = _eta_i[i];
86 }
87 
88 void
90 {
91  (*_first_elasticity_tensor_inv)[_qp] = _S0;
92 
93  for (unsigned int i = 0; i < _Si.size(); ++i)
94  (*_springs_elasticity_tensors_inv)[_qp][i] = _Si[i];
95 }
virtual void computeQpViscoelasticPropertiesInv()
This method computes the inverse elasticity tensor of each spring in the system (if required)...
InputParameters validParams< GeneralizedKelvinVoigtBase >()
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
std::vector< Real > _eta_i
The viscosity of each dashpot.
RankFourTensor _S0
The inverse of the elasticity tensor of the first spring.
std::vector< RankFourTensor > _Ci
The elasticity tensor of each subsequent spring.
bool _has_longterm_dashpot
Indicates if the spring-dashpot assembly has a single dashpot not associated with a spring...
MaterialProperty< std::vector< RankFourTensor > > & _springs_elasticity_tensors
List of elasticity tensor of each subsequent spring in the chain.
MaterialProperty< std::vector< RankFourTensor > > * _springs_elasticity_tensors_inv
virtual void computeQpViscoelasticProperties()
This method assigns the mechanical properties of each spring and dashpot in the system.
RankFourTensor _C0
The elasticity tensor associated with the first spring.
GeneralizedKelvinVoigtModel(const InputParameters &parameters)
MaterialProperty< RankFourTensor > & _first_elasticity_tensor
Elasticity tensor of a stand-alone elastic spring in the chain.
MaterialProperty< std::vector< Real > > & _dashpot_viscosities
List of viscosities of each subsequent spring in the chain.
unsigned int _components
This is the number of internal variables required by the model.
This class represents an assembly of springs and dashpots following a generalized Kelvin-Voigt model ...
std::vector< RankFourTensor > _Si
The inverse of each subsequent spring elasticity tensor.
InputParameters validParams< GeneralizedKelvinVoigtModel >()