21 #define _NUMA2D_ "numa2d" 26 #define _MODEL_NDIMS_ 2 27 #define _MODEL_NVARS_ 4 33 #define _Numa2DGetFlowVars_(u,drho,uvel,vvel,dT,rho0) \ 36 uvel = u[1]/(rho0+drho); \ 37 vvel = u[2]/(rho0+drho); \ 41 #define _Numa2DSetFlux_(f,dir,drho,uvel,vvel,dT,dP,rho0,T0) \ 43 if (dir == _XDIR_) { \ 44 f[0] = (rho0+drho) * uvel; \ 45 f[1] = (rho0+drho)*uvel*uvel + dP; \ 46 f[2] = (rho0+drho)*uvel*vvel; \ 47 f[3] = uvel*(dT+T0); \ 48 } else if (dir == _YDIR_) { \ 49 f[0] = (rho0+drho) * vvel; \ 50 f[1] = (rho0+drho)*uvel*vvel; \ 51 f[2] = (rho0+drho)*vvel*vvel + dP; \ 52 f[3] = vvel*(dT+T0); \ 56 #define _Numa2DSetLinearFlux_(f,dir,drho,uvel,vvel,dT,dP,rho0,T0) \ 58 if (dir == _XDIR_) { \ 59 f[0] = (rho0+drho) * uvel; \ 62 f[3] = (rho0+drho)*uvel*T0/rho0; \ 63 } else if (dir == _YDIR_) { \ 64 f[0] = (rho0+drho) * vvel; \ 67 f[3] = (rho0+drho)*vvel*T0/rho0; \ 71 #define _Numa2DSetSource_(s,param,drho) \ 75 s[2] = -param->g*drho; \ 79 #define _Numa2DComputePressure_(params,T0,dT,P0,dP) \ 81 double gamma = params->gamma; \ 82 double Pref = params->Pref; \ 83 double R = params->R; \ 84 double P_total = Pref * raiseto((R*(T0+dT)/Pref),gamma); \ 88 #define _Numa2DComputeLinearizedPressure_(params,T0,dT,P0,dP) \ 90 double gamma = params->gamma; \ 91 dP = (gamma*P0/T0) * dT; \ 94 #define _Numa2DComputeTemperature_(rho0,drho,T0,dT,temperature) \ 96 temperature = (T0+dT)*EP/(rho0+drho); \ 99 #define _Numa2DComputeSpeedofSound_(gamma,R,T0,dT,rho0,drho,EP,c) \ 101 c = sqrt(gamma*R*(T0+dT)*EP/(rho0+drho)); \ 104 #define _Numa2DComputeLinearizedSpeedofSound_(gamma,R,T0,rho0,EP,c) \ 106 c = sqrt(gamma*R*T0*EP/rho0); \ 109 typedef struct numa2d_parameters {
120 void (*StandardAtmosphere)(
void*,double,
double*,
double*,
double*,
double*);
130 #define _RUSANOV_UPWINDING_ "rusanov"
Contains function definitions for common mathematical functions.
Some basic definitions and macros.
#define _MAX_STRING_SIZE_
int Numa2DCleanup(void *)
int Numa2DInitialize(void *, void *)