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.
two_fluid_vms_linearized_darcy.h
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: Daniel Diez
11 // Jordi Cotela
12 //
13 
14 #if !defined(KRATOS_TWO_FLUID_VMS_LINEARIZED_DARCY_H_INCLUDED )
15 #define KRATOS_TWO_FLUID_VMS_LINEARIZED_DARCY_H_INCLUDED
16 // System includes
17 #include <string>
18 #include <iostream>
19 
21 
22 namespace Kratos {
23 
26 
29 
31 
35 template< unsigned int TDim,
36  unsigned int TNumNodes = TDim + 1 >
37 class TwoFluidVMSLinearizedDarcy : public TwoFluidVMS<TDim,TNumNodes> {
38 public:
39 
42 
45 
47 
49  typedef Node NodeType;
50 
56 
59 
62 
63  typedef std::size_t IndexType;
64 
68 
69  //Constructors.
70 
72 
76 
78 
83  : ElementBaseType(NewId, ThisNodes) {}
84 
86 
90  TwoFluidVMSLinearizedDarcy(IndexType NewId, GeometryType::Pointer pGeometry)
91  : ElementBaseType(NewId, pGeometry) {}
92 
94 
99  TwoFluidVMSLinearizedDarcy(IndexType NewId, GeometryType::Pointer pGeometry,
100  PropertiesType::Pointer pProperties)
101  : ElementBaseType(NewId, pGeometry, pProperties) {}
102 
105 
109 
111 
118  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes,
119  PropertiesType::Pointer pProperties) const override {
120 
121  return Kratos::make_intrusive<TwoFluidVMSLinearizedDarcy>(
122  NewId, (this->GetGeometry()).Create(ThisNodes), pProperties);
123  }
124 
126 
133  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom,
134  PropertiesType::Pointer pProperties) const override {
135 
136  return Kratos::make_intrusive<TwoFluidVMSLinearizedDarcy>(
137  NewId, pGeom, pProperties);
138  }
139 
141 
142 protected:
143 
146 
148  const double Density,
149  const double DynamicViscosity,
150  const double LinearCoefficient,
151  const double NonlinearCoefficient,
152  const array_1d<double, TNumNodes>& rShapefunctions) override {
153 
154  array_1d<double,3> old_velocity;
155  this->GetAdvectiveVel(old_velocity, rShapefunctions,1);
156  const double old_velocity_norm = MathUtils<double>::Norm3(old_velocity);
157 
158  return DynamicViscosity * LinearCoefficient + Density * NonlinearCoefficient*old_velocity_norm;
159  }
161 
162 private:
163 
166  friend class Serializer;
167 
168  void save(Serializer& rSerializer) const override {
170  }
171 
172  void load(Serializer& rSerializer) override {
174  }
175 
177 };
178 
182 
184 template< unsigned int TDim,
185  unsigned int TNumNodes >
186 inline std::istream & operator >>(std::istream& rIStream,
188 {
189  return rIStream;
190 }
192 template< unsigned int TDim,
193  unsigned int TNumNodes >
194 inline std::ostream & operator <<(std::ostream& rOStream,
196 {
197  rThis.PrintInfo(rOStream);
198  rOStream << std::endl;
199  rThis.PrintData(rOStream);
200  return rOStream;
201 }
202 
204 
206 
207 } // namespace Kratos.
208 
209 #endif //KRATOS_TWO_FLUID_VMS_LINEARIZED_DARCY_H_INCLUDED
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
std::size_t IndexType
Definition: flags.h:74
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
static double Norm3(const TVectorType &a)
Calculates the norm of vector "a" which is assumed to be of size 3.
Definition: math_utils.h:691
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
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
Definition: two_fluid_vms.h:80
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: two_fluid_vms.h:693
Version of TwoFluidVMS that treats the Darcy term explicitly.
Definition: two_fluid_vms_linearized_darcy.h:37
Node NodeType
definition of node type (default is: Node)
Definition: two_fluid_vms_linearized_darcy.h:49
double CalculateDarcyTerm(const double Density, const double DynamicViscosity, const double LinearCoefficient, const double NonlinearCoefficient, const array_1d< double, TNumNodes > &rShapefunctions) override
Definition: two_fluid_vms_linearized_darcy.h:147
TwoFluidVMS< TDim, TNumNodes > ElementBaseType
Definition: two_fluid_vms_linearized_darcy.h:46
TwoFluidVMSLinearizedDarcy(IndexType NewId=0)
Default constuctor.
Definition: two_fluid_vms_linearized_darcy.h:75
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(TwoFluidVMSLinearizedDarcy)
Pointer definition of TwoFluidVMS.
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: two_fluid_vms_linearized_darcy.h:118
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: two_fluid_vms_linearized_darcy.h:61
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: two_fluid_vms_linearized_darcy.h:58
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: two_fluid_vms_linearized_darcy.h:133
TwoFluidVMSLinearizedDarcy(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: two_fluid_vms_linearized_darcy.h:82
TwoFluidVMSLinearizedDarcy(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: two_fluid_vms_linearized_darcy.h:99
Properties PropertiesType
Definition: two_fluid_vms_linearized_darcy.h:55
~TwoFluidVMSLinearizedDarcy() override
Destructor.
Definition: two_fluid_vms_linearized_darcy.h:104
TwoFluidVMSLinearizedDarcy(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: two_fluid_vms_linearized_darcy.h:90
std::size_t IndexType
Definition: two_fluid_vms_linearized_darcy.h:63
virtual void GetAdvectiveVel(array_1d< double, 3 > &rAdvVel, const array_1d< double, TNumNodes > &rShapeFunc)
Write the advective velocity evaluated at this point to an array.
Definition: vms.h:1434
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307