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.
stationarity_check.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: Guillermo Casas
11 //
12 
13 #if !defined( KRATOS_SWIMMING_DEM_FLOW_STATIONARITY_CHECK )
14 #define KRATOS_SWIMMING_DEM_FLOW_STATIONARITY_CHECK
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/model_part.h"
22 #include "includes/define.h"
23 
24 namespace Kratos {
29 
37 class KRATOS_API(SWIMMING_DEM_APPLICATION) FlowStationarityCheck
38 {
39  public:
42 
45 
49 
51  FlowStationarityCheck(ModelPart& rFluidModelPart, const double tolerance)
52  : mrModelPart(rFluidModelPart),
53  mAveragingStep(0),
54  mTolerance(tolerance),
55  mCharacteristicPressureRate(1.0),
56  mCurrentPressureRate(2.0){}
57 
60 
62  virtual ~FlowStationarityCheck() = default;
63 
67 
70 
74 
80  bool AssessStationarity();
81  double GetCharacteristicPressureDerivative();
82  double GetCurrentPressureDerivative();
83  double GetTolerance();
84  double GetTransienceMeasure();
85 
89 
91  virtual std::string Info() const
92  {
93  std::stringstream buffer;
94  buffer << "FlowStationarityCheck";
95  return buffer.str();
96  }
97 
99  virtual void PrintInfo(std::ostream& rOStream) const
100  {
101  rOStream << "FlowStationarityCheck";
102  }
103 
105  virtual void PrintData(std::ostream& rOStream) const {}
106 
108 
109  protected:
113 
114  private:
117 
118  ModelPart& mrModelPart;
119  int mAveragingStep;
120  double mTolerance;
121  double mCharacteristicPressureRate;
122  double mCurrentPressureRate;
123 
127 
129 
130 }; // Class FlowStationarityCheck
131 
135 
137 inline std::istream &operator>>(std::istream& rIStream,
138  FlowStationarityCheck& rThis)
139 {
140  return rIStream;
141 }
142 
144 inline std::ostream &operator<<(std::ostream& rOStream,
145  const FlowStationarityCheck& rThis)
146 {
147  rThis.PrintInfo(rOStream);
148  rOStream << std::endl;
149  rThis.PrintData(rOStream);
150 
151  return rOStream;
152 }
155 } // namespace Kratos.
156 
157 #endif // KRATOS_SWIMMING_DEM_FLOW_STATIONARITY_CHECK defined
This defines a class to assess whether stationarity has been reached in the fluid.
Definition: stationarity_check.h:38
KRATOS_CLASS_POINTER_DEFINITION(FlowStationarityCheck)
Pointer definition of FlowStationarityCheck.
FlowStationarityCheck & operator=(FlowStationarityCheck const &rOther)=delete
Assignment operator.
virtual std::string Info() const
Turn back information as a string.
Definition: stationarity_check.h:91
virtual ~FlowStationarityCheck()=default
Destructor.
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: stationarity_check.h:105
FlowStationarityCheck(ModelPart &rFluidModelPart, const double tolerance)
Default constructor.
Definition: stationarity_check.h:51
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: stationarity_check.h:99
FlowStationarityCheck(FlowStationarityCheck const &rOther)=delete
Copy constructor.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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