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.
qsvms_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: Jordi Cotela
11 //
12 
13 #if !defined(KRATOS_QSVMS_DATA_H)
14 #define KRATOS_QSVMS_DATA_H
15 
19 
20 namespace Kratos {
21 
24 
27 
28 template< size_t TDim, size_t TNumNodes,bool TElementIntegratesInTime = false >
29 class QSVMSData : public FluidElementData<TDim,TNumNodes, TElementIntegratesInTime>
30 {
31 public:
32 
35 
38 
42 
47 
50 
51 double Density;
53 double CSmagorinsky;
54 double DeltaTime;
55 double DynamicTau;
56 int UseOSS;
57 
58 double ElementSize;
59 
61 BoundedMatrix<double,TNumNodes*(TDim+1),TNumNodes*(TDim+1)> LHS;
62 
66 
67 void Initialize(const Element& rElement, const ProcessInfo& rProcessInfo) override
68 {
69  // Base class Initialize manages constitutive law parameters
71 
72  const Geometry< Node >& r_geometry = rElement.GetGeometry();
73  const Properties& r_properties = rElement.GetProperties();
74  this->FillFromHistoricalNodalData(Velocity,VELOCITY,r_geometry);
75  this->FillFromHistoricalNodalData(MeshVelocity,MESH_VELOCITY,r_geometry);
76  this->FillFromHistoricalNodalData(BodyForce,BODY_FORCE,r_geometry);
77  this->FillFromHistoricalNodalData(MomentumProjection,ADVPROJ,r_geometry);
78  this->FillFromHistoricalNodalData(Pressure,PRESSURE,r_geometry);
79  this->FillFromHistoricalNodalData(MassProjection,DIVPROJ,r_geometry);
80  this->FillFromProperties(Density,DENSITY,r_properties);
81  this->FillFromProperties(DynamicViscosity,DYNAMIC_VISCOSITY,r_properties); //TODO: remove once we have a Smagorinky constitutive law
82  this->FillFromElementData(CSmagorinsky,C_SMAGORINSKY,rElement); //TODO: remove once we have a Smagorinky constitutive law
83  this->FillFromProcessInfo(DeltaTime,DELTA_TIME,rProcessInfo);
84  this->FillFromProcessInfo(DynamicTau,DYNAMIC_TAU,rProcessInfo);
85  this->FillFromProcessInfo(UseOSS,OSS_SWITCH,rProcessInfo);
86 
88 }
89 
90 static int Check(const Element& rElement, const ProcessInfo& rProcessInfo)
91 {
92  const Geometry< Node >& r_geometry = rElement.GetGeometry();
93 
94  for (unsigned int i = 0; i < TNumNodes; i++)
95  {
96  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(VELOCITY,r_geometry[i]);
97  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(MESH_VELOCITY,r_geometry[i]);
98  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(BODY_FORCE,r_geometry[i]);
99  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(ADVPROJ,r_geometry[i]);
100  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(PRESSURE,r_geometry[i]);
101  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(DIVPROJ,r_geometry[i]);
102  }
103 
104  return 0;
105 }
106 
108 
109 };
110 
112 
114 
115 }
116 
117 #endif
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
void FillFromElementData(double &rData, const Variable< double > &rVariable, const Element &rElement)
Definition: fluid_element_data.cpp:167
virtual void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: fluid_element_data.cpp:18
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: qsvms_data.h:30
typename FluidElementData< TDim, TNumNodes, false >::NodalVectorData NodalVectorData
Definition: qsvms_data.h:37
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: qsvms_data.h:67
int UseOSS
Definition: qsvms_data.h:56
double DynamicTau
Definition: qsvms_data.h:55
NodalScalarData Pressure
Definition: qsvms_data.h:48
NodalVectorData Velocity
Definition: qsvms_data.h:43
NodalScalarData MassProjection
Definition: qsvms_data.h:49
BoundedMatrix< double, TNumNodes *(TDim+1), TNumNodes *(TDim+1)> LHS
Auxiliary container for the local matrix at the integration point (stored to save reallocation at eac...
Definition: qsvms_data.h:61
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: qsvms_data.h:90
NodalVectorData BodyForce
Definition: qsvms_data.h:45
typename FluidElementData< TDim, TNumNodes, false >::NodalScalarData NodalScalarData
Definition: qsvms_data.h:36
double DynamicViscosity
Definition: qsvms_data.h:52
double Density
Definition: qsvms_data.h:51
NodalVectorData MomentumProjection
Definition: qsvms_data.h:46
NodalVectorData MeshVelocity
Definition: qsvms_data.h:44
double DeltaTime
Definition: qsvms_data.h:54
double ElementSize
Definition: qsvms_data.h:58
double CSmagorinsky
Definition: qsvms_data.h:53
#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
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