KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
neo_hookean_J_1_squared_model.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_NEO_HOOKEAN_J_1_SQUARED_MODEL_H_INCLUDED)
11 #define KRATOS_NEO_HOOKEAN_J_1_SQUARED_MODEL_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
19 
20 namespace Kratos
21 {
24 
27 
31 
35 
39 
43 
45 
47  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) NeoHookeanJ_1SquaredModel : public NeoHookeanModel
48  {
49  public:
50 
53 
56 
60 
63 
66 
69  {
71  return *this;
72  }
73 
75  ConstitutiveModel::Pointer Clone() const override
76  {
77  return Kratos::make_shared<NeoHookeanJ_1SquaredModel>(*this);
78  }
79 
82 
83 
87 
88 
92 
93 
97 
98 
102 
103 
107 
109  std::string Info() const override
110  {
111  std::stringstream buffer;
112  buffer << "NeoHookeanJ_1SquaredModel";
113  return buffer.str();
114  }
115 
117  void PrintInfo(std::ostream& rOStream) const override
118  {
119  rOStream << "NeoHookeanJ_1SquaredModel";
120  }
121 
123  void PrintData(std::ostream& rOStream) const override
124  {
125  rOStream << "NeoHookeanJ_1SquaredModel Data";
126  }
127 
131 
132 
134 
135  protected:
136 
139 
143 
147 
151 
152 
153  // specialized methods:
154 
155  void CalculateVolumetricFactor(HyperElasticDataType& rVariables, double& rFactor) override
156  {
157  KRATOS_TRY
158 
159  rFactor = 0.5 * rVariables.Strain.Invariants.J * (rVariables.Strain.Invariants.J - 1.0);
160 
161  KRATOS_CATCH(" ")
162  }
163 
164  void CalculateConstitutiveMatrixFactor(HyperElasticDataType& rVariables, double& rFactor) override
165  {
166  KRATOS_TRY
167 
168  rFactor = rVariables.Strain.Invariants.I3;
169 
170  KRATOS_CATCH(" ")
171  }
172 
173  //************// W
174 
175  //option: g(J) = (lambda/2)*(J-1)² - (mu)*lnJ (neo_hookean_J_1_model)
176 
177  void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType& rVariables, double& rVolumetricDensityFunction) override
178  {
179  KRATOS_TRY
180 
181  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
182 
183  //g(J) = (lambda/2)*(J-1)² - (mu)*lnJ
184  rVolumetricDensityFunction = rMaterial.GetLameLambda() * 0.5 * (rVariables.Strain.Invariants.J - 1.0) * (rVariables.Strain.Invariants.J - 1.0);
185  rVolumetricDensityFunction -= rMaterial.GetLameMu() * std::log( rVariables.Strain.Invariants.J );
186 
187  KRATOS_CATCH(" ")
188  }
189 
190 
191  //************// dW
192 
193 
194  double& GetFunction1stI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //dW/dI3
195  {
196  KRATOS_TRY
197 
198  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
199 
200  //derivative of "g(J) = (lambda/2)*(J-1)² - (mu)*lnJ"
201  //dg(J)/dI3 = (lambda/4)*(J-1)/J - mu*(1/J²)/2
202  rDerivative = 0.25 * rMaterial.GetLameLambda() * ( rVariables.Strain.Invariants.I3 - rVariables.Strain.Invariants.J);
203  rDerivative -= 0.5 * rMaterial.GetLameMu();
204  rDerivative /= rVariables.Strain.Invariants.I3;
205 
206  return rDerivative;
207 
208  KRATOS_CATCH(" ")
209  }
210 
211 
212  double& GetFunction2ndI3Derivative(HyperElasticDataType& rVariables, double& rDerivative) override //ddW/dI3dI3
213  {
214  KRATOS_TRY
215 
216  const MaterialDataType& rMaterial = rVariables.GetMaterialParameters();
217  //ddg(J)/dI3dI3 = (lambda/4)*(1/J³) + (mu/2)*(1/J⁴)
218  rDerivative = 0.25 * rMaterial.GetLameLambda() * (rVariables.Strain.Invariants.J);
219  rDerivative += 0.5 * rMaterial.GetLameMu();
220  rDerivative /= (rVariables.Strain.Invariants.I3 * rVariables.Strain.Invariants.I3);
221 
222  return rDerivative;
223 
224  KRATOS_CATCH(" ")
225  }
226 
227 
231 
232 
236 
237 
241 
242 
244 
245  private:
246 
249 
250 
254 
255 
259 
260 
264 
265 
269 
270 
274  friend class Serializer;
275 
276 
277  void save(Serializer& rSerializer) const override
278  {
280  }
281 
282  void load(Serializer& rSerializer) override
283  {
285  }
286 
290 
291 
295 
297 
298  }; // Class NeoHookeanJ_1SquaredModel
299 
301 
304 
305 
309 
310 
312 
314 
315 } // namespace Kratos.
316 
317 #endif // KRATOS_NEO_HOOKEAN_J_1_SQUARED_MODEL_H_INCLUDED defined
Short class definition.
Definition: neo_hookean_J_1_squared_model.hpp:48
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: neo_hookean_J_1_squared_model.hpp:123
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: neo_hookean_J_1_squared_model.hpp:117
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: neo_hookean_J_1_squared_model.hpp:75
double & GetFunction2ndI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: neo_hookean_J_1_squared_model.hpp:212
NeoHookeanJ_1SquaredModel(NeoHookeanJ_1SquaredModel const &rOther)
Copy constructor.
Definition: neo_hookean_J_1_squared_model.hpp:65
void CalculateAndAddVolumetricStrainEnergy(HyperElasticDataType &rVariables, double &rVolumetricDensityFunction) override
Definition: neo_hookean_J_1_squared_model.hpp:177
void CalculateVolumetricFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: neo_hookean_J_1_squared_model.hpp:155
double & GetFunction1stI3Derivative(HyperElasticDataType &rVariables, double &rDerivative) override
Definition: neo_hookean_J_1_squared_model.hpp:194
NeoHookeanJ_1SquaredModel()
Default constructor.
Definition: neo_hookean_J_1_squared_model.hpp:62
~NeoHookeanJ_1SquaredModel() override
Destructor.
Definition: neo_hookean_J_1_squared_model.hpp:81
std::string Info() const override
Turn back information as a string.
Definition: neo_hookean_J_1_squared_model.hpp:109
KRATOS_CLASS_POINTER_DEFINITION(NeoHookeanJ_1SquaredModel)
Pointer definition of NeoHookeanJ_1SquaredModel.
NeoHookeanJ_1SquaredModel & operator=(NeoHookeanJ_1SquaredModel const &rOther)
Assignment operator.
Definition: neo_hookean_J_1_squared_model.hpp:68
void CalculateConstitutiveMatrixFactor(HyperElasticDataType &rVariables, double &rFactor) override
Definition: neo_hookean_J_1_squared_model.hpp:164
Short class definition.
Definition: neo_hookean_model.hpp:48
NeoHookeanModel & operator=(NeoHookeanModel const &rOther)
Assignment operator.
Definition: neo_hookean_model.hpp:68
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_model_data.hpp:92
const double & GetLameLambda() const
Definition: constitutive_model_data.hpp:113
Definition: hyper_elastic_model.hpp:108
StrainData Strain
Definition: hyper_elastic_model.hpp:117
const MaterialDataType & GetMaterialParameters() const
Definition: hyper_elastic_model.hpp:125
StrainInvariants Invariants
Definition: hyper_elastic_model.hpp:98
double J
Definition: hyper_elastic_model.hpp:60
double I3
Definition: hyper_elastic_model.hpp:58