https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GeneralizedKelvinVoigtModel.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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{
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.addParam<Real>("longterm_youngs_modulus",
30 "Young's modulus used in elasticity tensor associated with the long-term "
31 "dashpot (defaults to young_modulus if not specified)");
32 params.addParam<Real>("longterm_poissons_ratio",
33 "Poisson's ratio of the elasticity tensor associated with the long-term "
34 "dashpot (defaults to poisson_ratio if not specified)");
35 params.set<bool>("force_recompute_properties") = false;
36 params.suppressParameter<bool>("force_recompute_properties");
37 return params;
38}
39
41 : GeneralizedKelvinVoigtBase(parameters),
42 _Ci(getParam<std::vector<Real>>("creep_modulus").size()),
43 _eta_i(getParam<std::vector<Real>>("creep_viscosity")),
44 _Si(getParam<std::vector<Real>>("creep_modulus").size()),
45 _C_longterm(std::nullopt),
46 _S_longterm(std::nullopt)
47{
48 Real young_modulus = getParam<Real>("young_modulus");
49 Real poisson_ratio = getParam<Real>("poisson_ratio");
50
52 _S0 = _C0.invSymm();
53
54 std::vector<Real> creep_modulus = getParam<std::vector<Real>>("creep_modulus");
55 std::vector<Real> creep_ratio;
56 if (isParamValid("creep_ratio"))
57 creep_ratio = getParam<std::vector<Real>>("creep_ratio");
58 else
59 creep_ratio.resize(_Ci.size(), poisson_ratio);
60
61 if (creep_modulus.size() != _Ci.size())
62 mooseError("incompatible number of creep moduli and viscosities");
63 if (creep_ratio.size() != _Ci.size())
64 mooseError("incompatible number of creep ratios and viscosities");
65 if (!(_Ci.size() == _eta_i.size() || _Ci.size() + 1 == _eta_i.size()))
66 mooseError("incompatible number of creep ratios and viscosities");
67
68 for (unsigned int i = 0; i < _Ci.size(); ++i)
69 {
70 _Ci[i].fillFromInputVector({creep_modulus[i], creep_ratio[i]},
72 _Si[i] = _Ci[i].invSymm();
73 }
74
75 for (unsigned int i = 0; i < _eta_i.size(); ++i)
76 {
77 if (_eta_i[i] < 0 || MooseUtils::absoluteFuzzyEqual(_eta_i[i], 0.0))
78 mooseError("material viscosity must be strictly > 0");
79 }
80
81 _components = _eta_i.size();
82 _has_longterm_dashpot = (_eta_i.size() == _Ci.size() + 1);
83
85 {
86 Real longterm_youngs_modulus =
87 (isParamValid("longterm_youngs_modulus") ? getParam<Real>("longterm_youngs_modulus")
88 : young_modulus);
89 Real longterm_poissons_ratio =
90 (isParamValid("longterm_poissons_ratio") ? getParam<Real>("longterm_poissons_ratio")
91 : poisson_ratio);
92 _C_longterm = std::make_optional<RankFourTensor>();
93 _C_longterm->fillFromInputVector({longterm_youngs_modulus, longterm_poissons_ratio},
95 _S_longterm = std::make_optional<RankFourTensor>();
96 *_S_longterm = _C_longterm->invSymm();
97 }
98
101}
102
103void
105{
107
108 for (unsigned int i = 0; i < _Ci.size(); ++i)
109 (*_springs_elasticity_tensors[i])[_qp] = _Ci[i];
110
111 for (unsigned int i = 0; i < _eta_i.size(); ++i)
112 (*_dashpot_viscosities[i])[_qp] = _eta_i[i];
113
115 (*_longterm_elasticity_tensor)[_qp] = *_C_longterm;
116}
117
118void
120{
121 (*_first_elasticity_tensor_inv)[_qp] = _S0;
122
123 for (unsigned int i = 0; i < _Si.size(); ++i)
124 (*_springs_elasticity_tensors_inv[i])[_qp] = _Si[i];
125
127 (*_longterm_elasticity_tensor_inv)[_qp] = *_S_longterm;
128}
registerMooseObject("SolidMechanicsApp", GeneralizedKelvinVoigtModel)
void mooseError(Args &&... args)
This class represents an assembly of springs and dashpots following a generalized Kelvin-Voigt model ...
virtual void declareViscoelasticProperties() override
Declare all necessary MaterialProperties for the model.
static InputParameters validParams()
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< RankFourTensor > _Ci
The elasticity tensor of each subsequent spring.
RankFourTensor _C0
The elasticity tensor associated with the first spring.
std::vector< RankFourTensor > _Si
The inverse of each subsequent spring elasticity tensor.
RankFourTensor _S0
The inverse of the elasticity tensor of the first spring.
GeneralizedKelvinVoigtModel(const InputParameters &parameters)
virtual void computeQpViscoelasticProperties()
This method assigns the mechanical properties of each spring and dashpot in the system.
std::optional< RankFourTensor > _C_longterm
The elasticity tensor associated with the long-term dashpot, if applicable.
std::optional< RankFourTensor > _S_longterm
The inverse of the elasticity tensor associated with the long-term dashpot, if applicable.
std::vector< Real > _eta_i
The viscosity of each dashpot.
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
void suppressParameter(const std::string &name)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
std::vector< MaterialProperty< RankFourTensor > * > _springs_elasticity_tensors
List of elasticity tensor of each subsequent spring in the chain.
bool _has_longterm_dashpot
Indicates if the spring-dashpot assembly has a single dashpot not associated with a spring.
std::vector< MaterialProperty< RankFourTensor > * > _springs_elasticity_tensors_inv
std::vector< MaterialProperty< Real > * > _dashpot_viscosities
List of viscosities of each subsequent dashpot in the chain.
unsigned int _components
This is the number of internal variables required by the model.
MaterialProperty< RankFourTensor > & _first_elasticity_tensor
Elasticity tensor of a stand-alone elastic spring in the chain.
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method)
RankFourTensorTempl< T > invSymm() const