Unstruct2D  1.0
Solution of 2-D Euler- and Navier-Stokes Equations on Unstructured Triangular Grids
 All Classes Files Functions Variables Typedefs Enumerations Macros
defs.h
Go to the documentation of this file.
1 //*****************************************************************************
6 //
7 // (c) J. Blazek, CFD Consulting & Analysis, www.cfd-ca.de
8 // Created February 15, 2014
9 // Last modification: July 1, 2014
10 //
11 //=============================================================================
12 //
13 // This program is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 //
27 //*****************************************************************************
28 
29 #ifndef DEFS_H_INCLUDED
30 #define DEFS_H_INCLUDED
31 
32 #include <cmath>
33 #include <cfloat>
34 
36  enum class FlowType { External, Internal };
37 
39  enum class Equations { Euler, NavierStokes };
40 
42  enum class TimeStepping { Local, Global };
43 
44 // floating point type (SGLPREC=single precision, otherwise double) ***********
45 
46 #ifdef SGLPREC
47  typedef float REAL;
48  #define EPSGLO FLT_EPSILON
49  #define ABS fabsf
50  #define SQRT sqrtf
51  #define SIN sinf
52  #define COS cosf
53  #define POW powf
54  #define TAN tanf
55  #define ATAN2 atan2f
56  #define LOG10 log10f
57 #else
58  typedef double REAL;
59  #define EPSGLO DBL_EPSILON
60  #define ABS fabs
61  #define SQRT sqrt
62  #define SIN sin
63  #define COS cos
64  #define POW pow
65  #define TAN tan
66  #define ATAN2 atan2
67  #define LOG10 log10
68 #endif
69 
70 // general structures of geometry and flow variables **************************
71 
73  typedef struct T_NODE
74  {
75  REAL x,
76  y;
77  } NODE;
78 
80  typedef struct T_CONSVARS
81  {
83  xmom,
84  ymom,
85  ener;
86  } CONSVARS;
87 
89  typedef struct T_PRIMVARS
90  {
92  uvel,
93  vvel,
94  press;
95  } PRIMVARS;
96 
98  typedef struct T_DEPVARS
99  {
101  temp,
102  csoun,
103  gamma,
104  cpgas;
105  } DEPVARS;
106 
108  typedef struct T_VISCDEPVARS
109  {
111  cond;
112  } VISCDEPVARS;
113 
114 // general constants **********************************************************
115 
116 #define PI 3.1415926535897932
117 #define PI2 1.5707963267948966
118 #define RAD 1.7453292519943296e-2
119 
120 // function macros ************************************************************
121 
122 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
123 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
124 #define SIGN(a,b) (((b) < (0)) ? (-a) : (a))
125 
126 #endif // DEFS_H_INCLUDED
REAL temp
Definition: defs.h:100
struct T_CONSVARS CONSVARS
Conserved variables. All quantities are in SI units.
struct T_VISCDEPVARS VISCDEPVARS
Additional dependent variables for viscous flow. All quantities are in SI units.
REAL xmom
Definition: defs.h:82
REAL cond
Definition: defs.h:110
Coordinates of a grid node.
Definition: defs.h:73
REAL press
Definition: defs.h:91
struct T_PRIMVARS PRIMVARS
Primitive variables. All quantities are in SI units.
REAL ener
Definition: defs.h:82
REAL gamma
Definition: defs.h:100
REAL csoun
Definition: defs.h:100
Additional dependent variables for viscous flow. All quantities are in SI units.
Definition: defs.h:108
REAL y
Definition: defs.h:75
REAL vvel
Definition: defs.h:91
REAL cpgas
Definition: defs.h:100
REAL dens
Definition: defs.h:91
Primitive variables. All quantities are in SI units.
Definition: defs.h:89
REAL dens
Definition: defs.h:82
REAL ymom
Definition: defs.h:82
REAL mue
Definition: defs.h:110
FlowType
Types of fluid flow.
Definition: defs.h:36
REAL press
Definition: defs.h:100
struct T_DEPVARS DEPVARS
Dependent variables (inviscid flow). All quantities are in SI units.
TimeStepping
Kind of time-stepping.
Definition: defs.h:42
Conserved variables. All quantities are in SI units.
Definition: defs.h:80
struct T_NODE NODE
Coordinates of a grid node.
double REAL
Definition: defs.h:58
Dependent variables (inviscid flow). All quantities are in SI units.
Definition: defs.h:98
REAL uvel
Definition: defs.h:91
REAL x
Definition: defs.h:75
Equations
Kind of equations solved.
Definition: defs.h:39