-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParameters.h
182 lines (150 loc) · 4.8 KB
/
Parameters.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#ifndef _PARAMETERS_H_
#define _PARAMETERS_H_
#include "Definitions.h"
#include <petscsys.h>
#include <string>
#include "Meshsize.h"
//! Classes for the parts of the parameters
//@{
class TimestepParameters{
public:
FLOAT dt; //! Timestep
FLOAT tau; //! Security factor
};
class SimulationParameters{
public:
FLOAT finalTime; //! Final time for the simulation
std::string type; //! type of the simulation (DNS vs. turbulence modeling)
std::string scenario; //! If channel or cavity, for example
};
class EnvironmentalParameters{
public:
// Gravity components
FLOAT gx;
FLOAT gy;
FLOAT gz;
};
class FlowParameters{
public:
FLOAT Re; //! Reynolds number
};
class SolverParameters{
public:
FLOAT gamma; //! Donor cell balance coefficient
int maxIterations; //! Maximum number of iterations in the linear solver
};
class GeometricParameters{
public:
// Dimensions
int dim;
// Number of cells
int sizeX;
int sizeY;
int sizeZ;
// Cell sizing
FLOAT lengthX;
FLOAT lengthY;
FLOAT lengthZ;
// meshsize type
int meshsizeType;
// for meshstretching
int stretchX;
int stretchY;
int stretchZ;
};
class WallParameters{
public:
// Scalar value definition. Used to define the pressure, for example
FLOAT scalarLeft;
FLOAT scalarRight;
FLOAT scalarBottom;
FLOAT scalarTop;
FLOAT scalarFront;
FLOAT scalarBack;
// Vector values at the boundaries, to define, for example, the velocities
FLOAT vectorLeft [3];
FLOAT vectorRight [3];
FLOAT vectorBottom [3];
FLOAT vectorTop [3];
FLOAT vectorFront [3];
FLOAT vectorBack [3];
// Define how will the boundary behave
BoundaryType typeLeft;
BoundaryType typeRight;
BoundaryType typeTop;
BoundaryType typeBottom;
BoundaryType typeFront;
BoundaryType typeBack;
};
class VTKParameters{
public:
FLOAT interval; //! Time interval for file printing
std::string prefix; //! Output filename
};
class StdOutParameters{
public:
FLOAT interval;
};
class ParallelParameters{
public:
int rank; //! Rank of the current processor
int numProcessors[3]; //! Array with the number of processors in each direction
//@brief Ranks of the neighbors
//@{
int leftNb;
int rightNb;
int bottomNb;
int topNb;
int frontNb;
int backNb;
//@}
int indices[3]; //! 3D indices to locate the array
int localSize[3]; //! Size for the local flow field
int firstCorner[3]; //! Position of the first element. Used for plotting
PetscInt * sizes[3]; //! Arrays with the sizes of the blocks in each direction.
int centerlineFlag; //! ->1 if center line is in that processor and ->0 otherwise
int centerProcessor[3];
int local_center_line_index[3]; //! used for center line velocity communication -> local index of the center line
MPI_Comm planeComm; //! used for center line velocity communication -> new communicator
int plane_rank; //! used for cneter line velocity communication -> new ranks
int plane_root; //! used for cneter line velocity communication -> root processor for the Bcasting the velocities
};
class BFStepParameters{
public:
FLOAT xRatio;
FLOAT yRatio;
};
class TurbulenceParameters{
public:
std::string model;
std::string boundaryLayerEquation; // for mixing length model
std::string boundaryConditions; // for k-epsilon model
static const FLOAT cmu=0.09;
static const FLOAT ceps=0.07;
static const FLOAT c1=0.126;
static const FLOAT c2=1.92;
FLOAT gamma;
};
//@}
/** A class to store and pass around the parameters
*/
class Parameters {
public:
Parameters(): meshsize(NULL){}
~Parameters(){ if (meshsize!=NULL){ delete meshsize; meshsize=NULL; } }
SimulationParameters simulation;
TimestepParameters timestep;
EnvironmentalParameters environment;
FlowParameters flow;
SolverParameters solver;
GeometricParameters geometry;
WallParameters walls;
VTKParameters vtk;
ParallelParameters parallel;
StdOutParameters stdOut;
BFStepParameters bfStep;
// TODO WS2: include parameters for turbulence
TurbulenceParameters turbulence;
Meshsize *meshsize;
};
#endif