54 void Init (
double *us,
double x1,
double x2,
double x3)
59 double n0, k0, Q,
t0, j0, xf, Tc, T0;
60 double G1_2p1_n, G1_n;
67 G1_2p1_n = 1.068628702119319;
68 G1_n = 2.218159543757688;
70 j0 = pow((pow(n0+2.,1.+n0)*pow(2.,1.-n0))/(n0*pow(
CONST_PI,n0/2.)),1./(n0+2.))*pow(G1_2p1_n/G1_n,n0/(n0+2.));
71 xf = pow(k0*pow(Q,n0)*t0, 1./(n0+2.))*j0/1.0e8;
72 Tc = pow(Q*Q/(k0*t0), 1./(n0+2.))*pow(n0*j0*j0/(2*(n0+2.)), 1./n0);
73 T0 = 6.05736872274111e7;
80 if ((1.0 - x1*x1/xf/xf) < 1.0e-20){
81 us[PRS] = us[
RHO]*Tc/T0*pow(1.0e-20,0.4);
83 us[PRS] = us[
RHO]*Tc/T0*pow( (1.0 - x1*x1/xf/xf) ,0.4);
95 double n0, k0, Q,
t0, j0, xf, Tc, T0;
96 double G5_2p1_n, G1p1_n, G3_2, x;
103 G5_2p1_n = 1.827355080624036;
104 G1p1_n = 0.887263817503075;
105 G3_2 = 0.886226925452758;
107 j0 = pow((3.*n0+2.)/(pow(2., n0-1.)*n0*pow(
CONST_PI,n0)),1./(3.*n0+2.))*pow(G5_2p1_n/G1p1_n/G3_2,n0/(3.*n0+2.));
108 xf = pow(k0*pow(Q,n0)*t0, 1./(3.*n0+2.))*j0/1.e8;
109 Tc = j0*j0*j0/xf/xf/xf*1.e-24*Q*pow(n0*j0*j0/(2.*(3.*n0+2.)), 1./n0);
110 T0 = 6.05736872274111e7;
112 #if GEOMETRY == CARTESIAN || GEOMETRY == CYLINDRICAL
113 x = sqrt(
D_EXPAND(x1*x1, + x2*x2, + x3*x3));
114 #elif GEOMETRY == POLAR
115 x = sqrt(
D_EXPAND(x1*x1, + 0.0, + x3*x3));
116 #elif GEOMETRY == SPHERICAL
125 if ((1.0 - x*x/xf/xf) < 1.0e-20){
126 #if GEOMETRY == SPHERICAL
127 us[PRS] = us[
RHO]*Tc/T0*pow(1.0e-8,0.4);
129 us[PRS] = us[
RHO]*Tc/T0*pow(1.0e-20,0.4);
132 us[PRS] = us[
RHO]*Tc/T0*pow( (1.0 - x*x/xf/xf) ,0.4);
157 EXPAND(d->
Vc[
VX1][k][j][i] = 0.0; ,
158 d->
Vc[
VX2][k][j][i] = 0.0; ,
159 d->
Vc[
VX3][k][j][i] = 0.0;)
161 #if ENTROPY_SWITCH == YES
#define X3_BEG
Boundary region at X3 beg.
#define X1_BEG
Boundary region at X1 beg.
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
int vpos
Location of the variable inside the cell.
#define BOX_LOOP(B, k, j, i)
double **** Vc
The main four-index data array used for cell-centered primitive variables.
#define X3_END_LOOP(k, j, i)
#define X1_END
Boundary region at X1 end.
#define X2_BEG_LOOP(k, j, i)
unsigned char *** flag
Pointer to a 3D array setting useful integration flags that are retrieved during integration.
#define X2_END_LOOP(k, j, i)
#define TOT_LOOP(k, j, i)
#define FLAG_ENTROPY
Update pressure using entropy equation.
#define X2_END
Boundary region at X2 end.
#define X1_END_LOOP(k, j, i)
#define X3_END
Boundary region at X3 end.
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
#define X2_BEG
Boundary region at X2 beg.
#define X3_BEG_LOOP(k, j, i)
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
void Analysis(const Data *d, Grid *grid)
void Init(double *v, double x1, double x2, double x3)