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.
symbolic_stokes_data.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: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_SYMBOLIC_STOKES_DATA_H)
14 #define KRATOS_SYMBOLIC_STOKES_DATA_H
15 
16 // External includes
17 
18 // System includes
19 
20 // Project includes
22 
23 // Application includes
27 
28 namespace Kratos {
29 
32 
35 
36 template< size_t TDim, size_t TNumNodes >
37 class SymbolicStokesData : public FluidElementData<TDim,TNumNodes, true>
38 {
39 public:
40 
43 
48 
52 
57 
59 
60 double Density;
62 double DeltaTime; // Time increment
63 double DynamicTau; // Dynamic tau considered in ASGS stabilization coefficients
64 
65 double bdf0;
66 double bdf1;
67 double bdf2;
68 
69 // Auxiliary containers for the symbolically-generated matrices
70 BoundedMatrix<double,TNumNodes*(TDim+1),TNumNodes*(TDim+1)> lhs;
71 array_1d<double,TNumNodes*(TDim+1)> rhs;
72 
73 double ElementSize;
74 
78 
80  const Element& rElement,
81  const ProcessInfo& rProcessInfo) override
82 {
83  // Base class Initialize manages constitutive law parameters
85 
86  const Geometry< Node >& r_geometry = rElement.GetGeometry();
87  const Properties& r_properties = rElement.GetProperties();
88  this->FillFromHistoricalNodalData(Velocity, VELOCITY, r_geometry);
89  this->FillFromHistoricalNodalData(Velocity_OldStep1, VELOCITY, r_geometry, 1);
90  this->FillFromHistoricalNodalData(Velocity_OldStep2, VELOCITY, r_geometry, 2);
91  this->FillFromHistoricalNodalData(BodyForce, BODY_FORCE, r_geometry);
92  this->FillFromHistoricalNodalData(Pressure, PRESSURE, r_geometry);
93  this->FillFromProperties(Density, DENSITY, r_properties);
94  this->FillFromProperties(DynamicViscosity, DYNAMIC_VISCOSITY, r_properties);
95  this->FillFromProcessInfo(DeltaTime, DELTA_TIME, rProcessInfo);
96  this->FillFromProcessInfo(DynamicTau, DYNAMIC_TAU, rProcessInfo);
97 
98  const Vector& BDFVector = rProcessInfo[BDF_COEFFICIENTS];
99  bdf0 = BDFVector[0];
100  bdf1 = BDFVector[1];
101  bdf2 = BDFVector[2];
102 
104 
105  noalias(lhs) = ZeroMatrix(TNumNodes*(TDim+1),TNumNodes*(TDim+1));
106  noalias(rhs) = ZeroVector(TNumNodes*(TDim+1));
107 }
108 
110  const unsigned int IntegrationPointIndex,
111  double NewWeight,
112  const MatrixRowType& rN,
113  const BoundedMatrix<double, TNumNodes, TDim>& rDN_DX) override
114 {
116 }
117 
118 static int Check(const Element& rElement, const ProcessInfo& rProcessInfo)
119 {
120  const Geometry< Node >& r_geometry = rElement.GetGeometry();
121 
122  for (unsigned int i = 0; i < TNumNodes; i++)
123  {
124  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(VELOCITY, r_geometry[i]);
125  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(BODY_FORCE, r_geometry[i]);
126  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(PRESSURE, r_geometry[i]);
127  }
128 
129  return 0;
130 }
131 
133 
134 };
135 
137 
139 
140 }
141 
142 #endif // KRATOS_SYMBOLIC_STOKES_DATA_H
Base class for all Elements.
Definition: element.h:60
PropertiesType & GetProperties()
Definition: element.h:1024
static double MinimumElementSize(const Geometry< Node > &rGeometry)
Minimum element size based on the geometry.
Base class for data containers used within FluidElement and derived types.
Definition: fluid_element_data.h:37
void FillFromProperties(double &rData, const Variable< double > &rVariable, const Properties &rProperties)
Definition: fluid_element_data.cpp:192
void FillFromHistoricalNodalData(NodalScalarData &rData, const Variable< double > &rVariable, const Geometry< Node > &rGeometry)
Definition: fluid_element_data.cpp:65
virtual void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:18
unsigned int IntegrationPointIndex
Definition: fluid_element_data.h:100
virtual void UpdateGeometryValues(unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const ShapeDerivativesType &rDN_DX)
Definition: fluid_element_data.cpp:52
void FillFromProcessInfo(double &rData, const Variable< double > &rVariable, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:153
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
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
Definition: symbolic_stokes_data.h:38
typename FluidElementData< TDim, TNumNodes, true >::NodalVectorData NodalVectorData
Definition: symbolic_stokes_data.h:45
array_1d< double, TNumNodes *(TDim+1)> rhs
Definition: symbolic_stokes_data.h:71
NodalVectorData Velocity
Definition: symbolic_stokes_data.h:53
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: symbolic_stokes_data.h:118
double DynamicTau
Definition: symbolic_stokes_data.h:63
typename FluidElementData< TDim, TNumNodes, true >::MatrixRowType MatrixRowType
Definition: symbolic_stokes_data.h:47
double Density
Definition: symbolic_stokes_data.h:60
NodalVectorData BodyForce
Definition: symbolic_stokes_data.h:56
typename FluidElementData< TDim, TNumNodes, true >::ShapeFunctionsType ShapeFunctionsType
Definition: symbolic_stokes_data.h:46
NodalVectorData Velocity_OldStep2
Definition: symbolic_stokes_data.h:55
double ElementSize
Definition: symbolic_stokes_data.h:73
double bdf2
Definition: symbolic_stokes_data.h:67
NodalVectorData Velocity_OldStep1
Definition: symbolic_stokes_data.h:54
double bdf1
Definition: symbolic_stokes_data.h:66
NodalScalarData Pressure
Definition: symbolic_stokes_data.h:58
double DynamicViscosity
Definition: symbolic_stokes_data.h:61
void UpdateGeometryValues(const unsigned int IntegrationPointIndex, double NewWeight, const MatrixRowType &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX) override
Definition: symbolic_stokes_data.h:109
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> lhs
Definition: symbolic_stokes_data.h:70
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: symbolic_stokes_data.h:79
double bdf0
Definition: symbolic_stokes_data.h:65
double DeltaTime
Definition: symbolic_stokes_data.h:62
typename FluidElementData< TDim, TNumNodes, true >::NodalScalarData NodalScalarData
Definition: symbolic_stokes_data.h:44
Short class definition.
Definition: array_1d.h:61
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
integer i
Definition: TensorModule.f:17