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.
time_dependant_porosity_field.h
Go to the documentation of this file.
1 #ifndef KRATOS_TIME_DEPENDANT_1D_POROSITY_FIELD_H
2 #define KRATOS_TIME_DEPENDANT_1D_POROSITY_FIELD_H
3 
4 //#include "real_functions.h"
5 #include "real_field.h"
6 #include "real_functions.h"
7 #include "vector_field.h"
8 
9 namespace Kratos
10 {
11 
12 // This class implements the necessary fields for the imposition of a 1D manufactured solution
13 
15  {
17  public:
18 
20 
21  using RealField::Evaluate;
22 
24 
25  TimeDependantPorosityField(const double& max_time): mC(2 * max_time){}
26 
28 
30 
31  //***************************************************************************************************************
32  //***************************************************************************************************************
33 
34  double Evaluate(const double time, const array_1d<double, 3>& coor) override
35  {
36  return ((coor[1] - 2) / (2 * time - mC));
37  }
38 
39  //***************************************************************************************************************
40  //***************************************************************************************************************
41 
42  double CalculateTimeDerivative(const double time, const array_1d<double, 3>& coor) override
43  {
44  return (2 * (2 - coor[1]) / ((2 * time - 4) * (2 * time - mC)));
45  }
46 
47  //***************************************************************************************************************
48  //***************************************************************************************************************
49 
50  void CalculateGradient(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& gradient) override
51  {
52  gradient[0] = 0.0;
53  gradient[1] = 1.0 / (2 * time - mC);
54  gradient[2] = 0.0;
55  }
56 
57  //***************************************************************************************************************
58  //***************************************************************************************************************
59 
60  void CalculateLaplacian(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& laplacian) override
61  {
62  laplacian[0] = 0.0;
63  laplacian[1] = 0.0;
64  laplacian[2] = 0.0;
65  }
66 
67  //***************************************************************************************************************
68  //***************************************************************************************************************
69 
73 
74 
78 
80 
81  virtual std::string Info() const override
82  {
83  return "";
84  }
85 
87 
88  virtual void PrintInfo(std::ostream& rOStream) const override
89  {
90  }
91 
93 
94  virtual void PrintData(std::ostream& rOStream) const override
95  {
96  }
97 
98 
102 
104 
105  protected:
108 
109 
113 
114 
118 
119 
123 
124 
128 
132 
133 
137 
138 
140 
141  private:
142  double mC;
143  // RealFunction& mF;
144  // RealFunction& mG;
147 
148 
152 
156 
160 
161 
165 
166 
170 
171 
175 
178 
179 
181 
182  }; // Class TimeDependantPorosityField
183 
184 class TimeDependantForceField: public VectorField<3>
185 {
186 
187 public:
188 
190 
191 TimeDependantForceField(const double max_time): mAlpha(max_time){}
192 
194 
195 //***************************************************************************************************************
196 //***************************************************************************************************************
197 void Evaluate(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& vector, const int i_thread = 0) override
198 {
199  array_1d<double, 3> porosity_grad;
200  const double porosity = mAlpha.Evaluate(time, coor);
201 
202  mAlpha.CalculateGradient(time, coor, porosity_grad);
203  vector[0] = 0.0;
204  vector[1] = - porosity * porosity_grad[1];
205  vector[2] = 0.0;
206 }
207 
208 //***************************************************************************************************************
209 //***************************************************************************************************************
210 
212 
213 std::string Info() const override
214 {
215  return "time-dependant porosity field";
216 }
217 
218 
219 void PrintInfo(std::ostream& rOStream) const override {}
220 
221 
222 void PrintData(std::ostream& rOStream) const override {}
223 
224 
225 protected:
226 
227 private:
228 
230 
231 TimeDependantForceField & operator=(TimeDependantForceField const& rOther);
232 
233 }; // Class TimeDependantForceField
235 
238 
239 
243 
244 } // namespace Kratos.
245 
246 #endif // KRATOS_TIME_DEPENDANT_1D_POROSITY_FIELD_H
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: real_field.h:29
virtual double Evaluate(const double time, const array_1d< double, 3 > &coor)
Definition: real_field.h:45
virtual void CalculateGradient(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &gradient)
Definition: real_field.h:61
Definition: time_dependant_1D_porosity_field.h:180
std::string Info() const override
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: time_dependant_porosity_field.h:213
TimeDependantForceField(const double max_time)
Definition: time_dependant_porosity_field.h:191
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: time_dependant_porosity_field.h:222
void Evaluate(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &vector, const int i_thread=0) override
Definition: time_dependant_porosity_field.h:197
KRATOS_CLASS_POINTER_DEFINITION(TimeDependantForceField)
virtual ~TimeDependantForceField()
Definition: time_dependant_porosity_field.h:193
TimeDependantPorosityField GetPorosityField()
Definition: time_dependant_porosity_field.h:211
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: time_dependant_porosity_field.h:219
Definition: time_dependant_porosity_field.h:15
TimeDependantPorosityField(const double &max_time)
Default constructor.
Definition: time_dependant_porosity_field.h:25
double CalculateTimeDerivative(const double time, const array_1d< double, 3 > &coor) override
Definition: time_dependant_porosity_field.h:42
void CalculateGradient(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &gradient) override
Definition: time_dependant_porosity_field.h:50
virtual std::string Info() const override
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: time_dependant_porosity_field.h:81
KRATOS_CLASS_POINTER_DEFINITION(TimeDependantPorosityField)
virtual ~TimeDependantPorosityField()
Destructor.
Definition: time_dependant_porosity_field.h:29
void CalculateLaplacian(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &laplacian) override
Definition: time_dependant_porosity_field.h:60
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: time_dependant_porosity_field.h:94
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: time_dependant_porosity_field.h:88
double Evaluate(const double time, const array_1d< double, 3 > &coor) override
Definition: time_dependant_porosity_field.h:34
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
float max_time
Definition: ProjectParameters.py:8
time
Definition: face_heat.py:85
porosity
Definition: sp_statistics.py:18