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_1D_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 
7 namespace Kratos
8 {
10 {
11 //friend class TimeDependant1DPorosityField;
12 public:
13 
15 
18 
20 {
21  mC = 2 * max_time;
22 }
23 
25 
27 
28 //***************************************************************************************************************
29 //***************************************************************************************************************
30 
31 double Evaluate(const double time, const array_1d<double, 3>& coor) override
32 {
33  return ((coor[1] - 2) / (2 * time - mC));
34 }
35 
36 //***************************************************************************************************************
37 //***************************************************************************************************************
38 
39 double CalculateTimeDerivative(const double time, const array_1d<double, 3>& coor) override
40 {
41  return (2 * (2 - coor[1]) / ((2 * time - 4) * (2 * time - mC)));
42 }
43 
44 //***************************************************************************************************************
45 //***************************************************************************************************************
46 
47 void CalculateGradient(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& gradient) override
48 {
49  gradient[0] = 0.0;
50  gradient[1] = 1.0 / (2 * time - mC);
51  gradient[2] = 0.0;
52 }
53 
54 //***************************************************************************************************************
55 //***************************************************************************************************************
56 
57 void CalculateLaplacian(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& laplacian) override
58 {
59  laplacian = ZeroVector(3);
60 }
61 
62 //***************************************************************************************************************
63 //***************************************************************************************************************
64 
68 
69 
73 
75 
76 virtual std::string Info() const
77 {
78  return "";
79 }
80 
82 
83 virtual void PrintInfo(std::ostream& rOStream) const
84 {
85 }
86 
88 
89 virtual void PrintData(std::ostream& rOStream) const
90 {
91 }
92 
93 
97 
99 
100 protected:
103 
104 
108 double mC;
111 
115 
116 
120 
121 
125 
129 
130 
134 
135 
137 
138 private:
139 
142 
143 
147 
151 
155 
156 
160 
161 
165 
166 
170 
173 
174 
176 
177 }; // Class TimeDependant1DPorosityField
178 
180 {
181 
182 using RealField::Evaluate;
183 
184 
185 public:
186 
188 
189 
191 
192 //***************************************************************************************************************
193 //***************************************************************************************************************
194 
195 double Evaluate(const double time, const array_1d<double, 3>& coor)
196 {
197  array_1d<double, 3> porosity_grad;
198 
199  double porosity = mAlpha.Evaluate(time, coor);
200  mAlpha.CalculateGradient(time, coor, porosity_grad);
201 
202  return (- porosity * porosity_grad[1]);
203 }
204 
205 //***************************************************************************************************************
206 //***************************************************************************************************************
207 
208 double CalculateTimeDerivative(const double time, const array_1d<double, 3>& coor)
209 {
210  return 0.0;
211 }
212 
213 //***************************************************************************************************************
214 //***************************************************************************************************************
215 
216 void CalculateGradient(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& gradient){}
217 void CalculateLaplacian(const double time, const array_1d<double, 3>& coor, array_1d<double, 3>& laplacian){}
218 
219 //***************************************************************************************************************
220 //***************************************************************************************************************
221 
222 
223 virtual std::string Info() const
224 {
225  return "";
226 }
227 
228 
229 virtual void PrintInfo(std::ostream& rOStream) const{}
230 
231 virtual void PrintData(std::ostream& rOStream) const{}
232 
233 protected:
234 
235 private:
236 
237 RealFunction mF;
238 RealFunction mG;
239 RealField& mAlpha;
240 
241 TimeDependantForceField & operator=(TimeDependantForceField const& rOther);
242 
243 }; // Class TimeDependantForceField
245 
248 
249 
253 
254 } // namespace Kratos.
255 
256 #endif // KRATOS_TIME_DEPENDANT_1D_POROSITY_FIELD_H
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: real_functions.h:27
Definition: time_dependant_1D_porosity_field.h:10
double mC
Definition: time_dependant_1D_porosity_field.h:108
virtual ~TimeDependant1DPorosityField()
Destructor.
Definition: time_dependant_1D_porosity_field.h:26
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: time_dependant_1D_porosity_field.h:83
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: time_dependant_1D_porosity_field.h:76
double CalculateTimeDerivative(const double time, const array_1d< double, 3 > &coor) override
Definition: time_dependant_1D_porosity_field.h:39
void CalculateLaplacian(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &laplacian) override
Definition: time_dependant_1D_porosity_field.h:57
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: time_dependant_1D_porosity_field.h:89
void CalculateGradient(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &gradient) override
Definition: time_dependant_1D_porosity_field.h:47
RealFunction mG
Definition: time_dependant_1D_porosity_field.h:110
RealFunction mF
Definition: time_dependant_1D_porosity_field.h:109
double Evaluate(const double time, const array_1d< double, 3 > &coor) override
Definition: time_dependant_1D_porosity_field.h:31
TimeDependant1DPorosityField(const double &max_time)
Definition: time_dependant_1D_porosity_field.h:19
KRATOS_CLASS_POINTER_DEFINITION(TimeDependant1DPorosityField)
Definition: time_dependant_1D_porosity_field.h:180
void CalculateLaplacian(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &laplacian)
Definition: time_dependant_1D_porosity_field.h:217
TimeDependantForceField(const double max_time)
Definition: time_dependant_1D_porosity_field.h:187
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: time_dependant_1D_porosity_field.h:229
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: time_dependant_1D_porosity_field.h:223
double Evaluate(const double time, const array_1d< double, 3 > &coor)
Definition: time_dependant_1D_porosity_field.h:195
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: time_dependant_1D_porosity_field.h:231
void CalculateGradient(const double time, const array_1d< double, 3 > &coor, array_1d< double, 3 > &gradient)
Definition: time_dependant_1D_porosity_field.h:216
virtual ~TimeDependantForceField()
Definition: time_dependant_1D_porosity_field.h:190
double CalculateTimeDerivative(const double time, const array_1d< double, 3 > &coor)
Definition: time_dependant_1D_porosity_field.h:208
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
float max_time
Definition: ProjectParameters.py:8
time
Definition: face_heat.py:85
porosity
Definition: sp_statistics.py:18