www.mooseframework.org
GeneralizedKelvinVoigtModel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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.addClassDescription(
19  "Generalized Kelvin-Voigt model composed of a serial assembly of unit Kelvin-Voigt modules");
20  params.addRequiredParam<Real>("young_modulus", "initial elastic modulus of the material");
21  params.addRequiredParam<Real>("poisson_ratio", "initial poisson ratio of the material");
22  params.addRequiredParam<std::vector<Real>>(
23  "creep_modulus", "list of the elastic moduli of the different springs in the material");
24  params.addRequiredParam<std::vector<Real>>(
25  "creep_viscosity",
26  "list of the characteristic times of the different dashpots in the material");
27  params.addParam<std::vector<Real>>(
28  "creep_ratio", "list of the poisson ratios of the different springs in the material");
29  params.set<bool>("force_recompute_properties") = false;
30  params.suppressParameter<bool>("force_recompute_properties");
31  return params;
32 }
33 
35  : GeneralizedKelvinVoigtBase(parameters),
36  _Ci(getParam<std::vector<Real>>("creep_modulus").size()),
37  _eta_i(getParam<std::vector<Real>>("creep_viscosity")),
38  _Si(getParam<std::vector<Real>>("creep_modulus").size())
39 {
40  Real young_modulus = getParam<Real>("young_modulus");
41  Real poisson_ratio = getParam<Real>("poisson_ratio");
42 
43  _C0.fillFromInputVector({young_modulus, poisson_ratio}, RankFourTensor::symmetric_isotropic_E_nu);
44  _S0 = _C0.invSymm();
45 
46  std::vector<Real> creep_modulus = getParam<std::vector<Real>>("creep_modulus");
47  std::vector<Real> creep_ratio;
48  if (isParamValid("creep_ratio"))
49  creep_ratio = getParam<std::vector<Real>>("creep_ratio");
50  else
51  creep_ratio.resize(_Ci.size(), poisson_ratio);
52 
53  if (creep_modulus.size() != _Ci.size())
54  mooseError("incompatible number of creep moduli and viscosities");
55  if (creep_ratio.size() != _Ci.size())
56  mooseError("incompatible number of creep ratios and viscosities");
57  if (!(_Ci.size() == _eta_i.size() || _Ci.size() + 1 == _eta_i.size()))
58  mooseError("incompatible number of creep ratios and viscosities");
59 
60  for (unsigned int i = 0; i < _Ci.size(); ++i)
61  {
62  _Ci[i].fillFromInputVector({creep_modulus[i], creep_ratio[i]},
64  _Si[i] = _Ci[i].invSymm();
65  }
66 
67  for (unsigned int i = 0; i < _eta_i.size(); ++i)
68  {
69  if (_eta_i[i] < 0 || MooseUtils::absoluteFuzzyEqual(_eta_i[i], 0.0))
70  mooseError("material viscosity must be strictly > 0");
71  }
72 
73  _components = _eta_i.size();
74  _has_longterm_dashpot = (_eta_i.size() == _Ci.size() + 1);
75 
78 }
79 
80 void
82 {
84 
85  for (unsigned int i = 0; i < _Ci.size(); ++i)
87 
88  for (unsigned int i = 0; i < _eta_i.size(); ++i)
89  (*_dashpot_viscosities[i])[_qp] = _eta_i[i];
90 }
91 
92 void
94 {
95  (*_first_elasticity_tensor_inv)[_qp] = _S0;
96 
97  for (unsigned int i = 0; i < _Si.size(); ++i)
99 }
This class is an implementation of a generalized Kelvin-Voigt model with constant mechanical properti...
virtual void computeQpViscoelasticPropertiesInv()
This method computes the inverse elasticity tensor of each spring in the system (if required)...
std::vector< MaterialProperty< RankFourTensor > * > _springs_elasticity_tensors_inv
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
std::vector< Real > _eta_i
The viscosity of each dashpot.
std::vector< MaterialProperty< RankFourTensor > * > _springs_elasticity_tensors
List of elasticity tensor of each subsequent spring in the chain.
RankFourTensor _S0
The inverse of the elasticity tensor of the first spring.
std::vector< RankFourTensor > _Ci
The elasticity tensor of each subsequent spring.
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method)
void declareViscoelasticProperties()
Declare all necessary MaterialProperties for the model.
bool _has_longterm_dashpot
Indicates if the spring-dashpot assembly has a single dashpot not associated with a spring...
registerMooseObject("SolidMechanicsApp", GeneralizedKelvinVoigtModel)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void suppressParameter(const std::string &name)
bool isParamValid(const std::string &name) const
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)
std::vector< MaterialProperty< Real > * > _dashpot_viscosities
List of viscosities of each subsequent dashpot in the chain.
MaterialProperty< RankFourTensor > & _first_elasticity_tensor
Elasticity tensor of a stand-alone elastic spring in the chain.
static InputParameters validParams()
const T & getParam(const std::string &name) const
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 ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< RankFourTensor > _Si
The inverse of each subsequent spring elasticity tensor.
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
RankFourTensorTempl< T > invSymm() const