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.
displacement_newtonian_fluid_3D_law.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Contri Alessandro
11 //
12 // References: This class is based on the file applications/ParticleMechanicsApplication/custom_constitutive/hyperelastic_3D_law.hpp
13 
14 
15 #if !defined (KRATOS_DISPLACEMENT_NEWTONIAN_3D_LAW_H_INCLUDED)
16 #define KRATOS_DISPLACEMENT_NEWTONIAN_3D_LAW_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
24 
25 
26 namespace Kratos
27 {
28 
39 class KRATOS_API(PARTICLE_MECHANICS_APPLICATION) DispNewtonianFluid3DLaw
40  : public ConstitutiveLaw
41 {
42 protected:
43 
45  {
46 
47  // general material properties
48  double Mu; // shear modulus
49  double BulkModulus;
50 
51  // kinematic properties
52  double DeterminantF;
53  double DeltaTime;
54  Matrix DeformationGradientF; // Deformation Gradient Tensor in 3D
56 
57  Matrix DeformationRate; // symmetric part of velocity gradient
58  Matrix CauchyGreenMatrix; // LeftCauchyGreen
60 
64 
65  public:
66  void SetShapeFunctionsValues(const Vector& rShapeFunctionsValues)
67  {
68  mpShapeFunctionsValues = &rShapeFunctionsValues;
69  };
70 
71  void SetElementGeometry(const GeometryType& rElementGeometry)
72  {
73  mpElementGeometry = &rElementGeometry;
74  };
75 
77  {
78  return *mpShapeFunctionsValues;
79  };
80 
82  {
83  return *mpElementGeometry;
84  };
85  };
86 
87 public:
93  typedef std::size_t SizeType;
99 
108 
113  ConstitutiveLaw::Pointer Clone() const override;
114 
119 
120 
125  //DispNewtonianFluid3DLaw& operator=(const DispNewtonianFluid3DLaw& rOther);
126 
127 
131  ~DispNewtonianFluid3DLaw() override;
132 
145  {
146  return 3;
147  };
148 
152  SizeType GetStrainSize() const override
153  {
154  return 6;
155  };
156 
157  bool Has(const Variable<double>& rThisVariable) override;
158  bool Has(const Variable<Vector>& rThisVariable) override;
159  bool Has(const Variable<Matrix>& rThisVariable) override;
160 
161 
162  double& CalculateValue(Parameters& rParameterValues, const Variable<double>& rThisVariable, double& rValue) override;
163 
164  double& GetValue(const Variable<double>& rThisVariable, double& rValue) override;
165  Vector& GetValue(const Variable<Vector>& rThisVariable, Vector& rValue) override;
166  Matrix& GetValue(const Variable<Matrix>& rThisVariable, Matrix& rValue) override;
167 
168  void SetValue(const Variable<double>& rVariable, const double& rValue, const ProcessInfo& rCurrentProcessInfo) override;
169  void SetValue(const Variable<Vector>& rVariable, const Vector& rValue, const ProcessInfo& rCurrentProcessInfo) override;
170  void SetValue(const Variable<Matrix>& rVariable, const Matrix& rValue, const ProcessInfo& rCurrentProcessInfo) override;
171 
175  void InitializeMaterial(const Properties& rMaterialProperties,
176  const GeometryType& rElementGeometry,
177  const Vector& rShapeFunctionsValues) override;
178 
185  void CalculateMaterialResponseKirchhoff(Parameters& rValues) override;
186 
193  void CalculateMaterialResponseCauchy(Parameters& rValues) override;
194 
195 
202  void FinalizeMaterialResponseKirchhoff(Parameters& rValues) override;
203 
210  void FinalizeMaterialResponseCauchy(Parameters& rValues) override;
211 
216  void GetLawFeatures(Features& rFeatures) override;
217 
227  int Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo) const override;
228 
235  //String Info() const override;
239  //void PrintInfo(std::ostream& rOStream) const override;
243  //void PrintData(std::ostream& rOStream) const override;
244 
245 protected:
246 
252 
254 
256 
263 
269  virtual void CalculateAlmansiStrain( const Matrix & rLeftCauchyGreen,
270  Vector& rStrainVector );
271 
276  virtual void CalculateDeformationRate(MaterialResponseVariables& rViscousVariables);
277 
285  void CalculateStress(MaterialResponseVariables& rViscousVariables, StressMeasure rStressMeasure, Vector& rStressVector);
286 
292  virtual void CalculateVolumetricStress(const MaterialResponseVariables& rViscousVariables, Vector& rVolStressVector);
293 
301  virtual void CalculateIsochoricStress(const MaterialResponseVariables& rViscousVariables, StressMeasure rStressMeasure, Vector& rIsoStressVector);
302 
303 
310  virtual void CalculateConstitutiveMatrix ( const MaterialResponseVariables& rViscousVariables,
311  Matrix& rConstitutiveMatrix);
312 
316  double& ConstitutiveComponent(double& rCabcd, const MaterialResponseVariables& rViscousVariables,
317  const unsigned int& a, const unsigned int& b, const unsigned int& c, const unsigned int& d);
318 
325  virtual void CalculateVolumetricConstitutiveMatrix(const MaterialResponseVariables& rViscousVariables, Matrix& rConstitutiveMatrix);
326 
330  double& VolumetricConstitutiveComponent(double& rCabcd, const MaterialResponseVariables& rViscousVariables, const Vector& rFactors, const unsigned int& a,
331  const unsigned int& b, const unsigned int& c, const unsigned int& d);
332 
333 
341  virtual void CalculateIsochoricConstitutiveMatrix(const MaterialResponseVariables& rViscousVariables, const Matrix& rIsoStressMatrix, Matrix& rConstitutiveMatrix);
342 
346  double& IsochoricConstitutiveComponent(double& rCabcd, const MaterialResponseVariables& rViscousVariables, const Matrix& rIsoStressMatrix, const unsigned int& a,
347  const unsigned int& b, const unsigned int& c, const unsigned int& d);
348 
354  virtual double& CalculateVolumetricPressure(const MaterialResponseVariables& rViscousVariables,
355  double& rPressure);
356 
362  virtual Vector& CalculateVolumetricPressureFactors(const MaterialResponseVariables& rViscousVariables, Vector& rFactors);
363 
370  Matrix& Transform2DTo3D(Matrix& rMatrix);
371 
378  virtual void UpdateInternalVariables(Parameters& rValues);
379 
386  void CalculateDeviatoricPart(const Matrix& rMatrix, Matrix& rDevMatrix);
387 
394  virtual bool CheckParameters(Parameters& rValues);
395 
396 private:
397 
403 
404 
408 
409 
413 
418 
419 
423  friend class Serializer;
424 
425  void save(Serializer& rSerializer) const override
426  {
428  rSerializer.save("mInverseDeformationGradientF0", mInverseDeformationGradientF0);
429  rSerializer.save("mDeterminantF0", mDeterminantF0);
430  }
431 
432  void load(Serializer& rSerializer) override
433  {
435  rSerializer.load("mInverseDeformationGradientF0", mInverseDeformationGradientF0);
436  rSerializer.load("mDeterminantF0", mDeterminantF0);
437  }
438 
439 
440 
441 }; // Class DispNewtonianFluid3DLaw
442 } // namespace Kratos.
443 #endif // KRATOS_DISPLACEMENT_NEWTONIAN_3D_LAW_H_INCLUDED defined
Definition: constitutive_law.h:47
StressMeasure
Definition: constitutive_law.h:69
std::size_t SizeType
Definition: constitutive_law.h:82
Definition: displacement_newtonian_fluid_3D_law.hpp:41
ConstitutiveLaw BaseType
Definition: displacement_newtonian_fluid_3D_law.hpp:92
KRATOS_CLASS_POINTER_DEFINITION(DispNewtonianFluid3DLaw)
Matrix mInverseDeformationGradientF0
Definition: displacement_newtonian_fluid_3D_law.hpp:253
double mDeterminantF0
Definition: displacement_newtonian_fluid_3D_law.hpp:255
SizeType WorkingSpaceDimension() override
Definition: displacement_newtonian_fluid_3D_law.hpp:144
ProcessInfo ProcessInfoType
Definition: displacement_newtonian_fluid_3D_law.hpp:91
SizeType GetStrainSize() const override
Definition: displacement_newtonian_fluid_3D_law.hpp:152
std::size_t SizeType
Definition: displacement_newtonian_fluid_3D_law.hpp:93
Geometry base class.
Definition: geometry.h:71
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
def load(f)
Definition: ode_solve.py:307
int d
Definition: ode_solve.py:397
Definition: constitutive_law.h:189
Definition: displacement_newtonian_fluid_3D_law.hpp:45
Matrix Identity
Definition: displacement_newtonian_fluid_3D_law.hpp:55
double DeterminantF
Definition: displacement_newtonian_fluid_3D_law.hpp:52
const Matrix * mpShapeFunctionsDerivatives
Definition: displacement_newtonian_fluid_3D_law.hpp:62
double BulkModulus
Definition: displacement_newtonian_fluid_3D_law.hpp:49
Matrix DeformationGradientF
Definition: displacement_newtonian_fluid_3D_law.hpp:54
const GeometryType * mpElementGeometry
Definition: displacement_newtonian_fluid_3D_law.hpp:63
void SetShapeFunctionsValues(const Vector &rShapeFunctionsValues)
Definition: displacement_newtonian_fluid_3D_law.hpp:66
Matrix StressMatrix
Definition: displacement_newtonian_fluid_3D_law.hpp:59
double DeltaTime
Definition: displacement_newtonian_fluid_3D_law.hpp:53
Matrix CauchyGreenMatrix
Definition: displacement_newtonian_fluid_3D_law.hpp:58
void SetElementGeometry(const GeometryType &rElementGeometry)
Definition: displacement_newtonian_fluid_3D_law.hpp:71
const GeometryType & GetElementGeometry() const
Definition: displacement_newtonian_fluid_3D_law.hpp:81
Matrix DeformationRate
Definition: displacement_newtonian_fluid_3D_law.hpp:57
const Vector & GetShapeFunctionsValues() const
Definition: displacement_newtonian_fluid_3D_law.hpp:76
double Mu
Definition: displacement_newtonian_fluid_3D_law.hpp:48
const Vector * mpShapeFunctionsValues
Definition: displacement_newtonian_fluid_3D_law.hpp:61