26 #define _NUMA3D_ "numa3d"
31 #define _MODEL_NDIMS_ 3
32 #define _MODEL_NVARS_ 5
39 #define _Numa3DGetFlowVars_(u,drho,uvel,vvel,wvel,dT,rho0) \
42 uvel = u[1]/(rho0+drho); \
43 vvel = u[2]/(rho0+drho); \
44 wvel = u[3]/(rho0+drho); \
48 #define _Numa3DSetFlux_(f,dir,drho,uvel,vvel,wvel,dT,dP,rho0,T0) \
50 if (dir == _XDIR_) { \
51 f[0] = (rho0+drho) * uvel; \
52 f[1] = (rho0+drho)*uvel*uvel + dP; \
53 f[2] = (rho0+drho)*uvel*vvel; \
54 f[3] = (rho0+drho)*uvel*wvel; \
55 f[4] = uvel*(dT+T0); \
56 } else if (dir == _YDIR_) { \
57 f[0] = (rho0+drho) * vvel; \
58 f[1] = (rho0+drho)*uvel*vvel; \
59 f[2] = (rho0+drho)*vvel*vvel + dP; \
60 f[3] = (rho0+drho)*wvel*vvel; \
61 f[4] = vvel*(dT+T0); \
62 } else if (dir == _ZDIR_) { \
63 f[0] = (rho0+drho) * wvel; \
64 f[1] = (rho0+drho)*uvel*wvel; \
65 f[2] = (rho0+drho)*vvel*wvel; \
66 f[3] = (rho0+drho)*wvel*wvel + dP; \
67 f[4] = wvel*(dT+T0); \
71 #define _Numa3DSetLinearFlux_(f,dir,drho,uvel,vvel,wvel,dT,dP,rho0,T0) \
73 if (dir == _XDIR_) { \
74 f[0] = (rho0+drho) * uvel; \
78 f[4] = (rho0+drho)*uvel*T0/rho0; \
79 } else if (dir == _YDIR_) { \
80 f[0] = (rho0+drho) * vvel; \
84 f[4] = (rho0+drho)*vvel*T0/rho0; \
85 } else if (dir == _ZDIR_) { \
86 f[0] = (rho0+drho) * wvel; \
90 f[4] = (rho0+drho)*wvel*T0/rho0; \
94 #define _Numa3DSetSource_(s,param,uvel,vvel,drho,rho0) \
97 s[1] = 2.0*param->Omega*vvel*(rho0+drho); \
98 s[2] = -2.0*param->Omega*uvel*(rho0+drho); \
99 s[3] = -param->g*drho; \
103 #define _Numa3DComputePressure_(params,T0,dT,P0,dP) \
105 double gamma = params->gamma; \
106 double Pref = params->Pref; \
107 double R = params->R; \
108 double P_total = Pref * raiseto((R*(T0+dT)/Pref),gamma); \
112 #define _Numa3DComputeLinearizedPressure_(params,T0,dT,P0,dP) \
114 double gamma = params->gamma; \
115 dP = (gamma*P0/T0) * dT; \
118 #define _Numa3DComputeSpeedofSound_(gamma,R,T0,dT,rho0,drho,EP,c) \
120 c = sqrt(gamma*R*(T0+dT)*EP/(rho0+drho)); \
123 #define _Numa3DComputeLinearizedSpeedofSound_(gamma,R,T0,rho0,EP,c) \
125 c = sqrt(gamma*R*T0*EP/rho0); \
128 typedef struct numa3d_parameters {
139 void (*StandardAtmosphere)(
void*,double,
double*,
double*,
double*,
double*);
149 #define _RUSANOV_UPWINDING_ "rusanov"
150 #define _RF_CHAR_UPWINDING_ "rf-char"
#define _MAX_STRING_SIZE_
Contains function definitions for common mathematical functions.
int Numa3DInitialize(void *, void *)
int Numa3DCleanup(void *)
Some basic definitions and macros.