43 void Init (
double *us,
double x1,
double x2,
double x3)
70 #if GEOMETRY == CARTESIAN
71 rs = sqrt(x1*x1 + x2*x2 + x3*x3);
72 #elif GEOMETRY == CYLINDRICAL
73 rs = sqrt(x1*x1 + x2*x2);
74 #elif GEOMETRY == SPHERICAL
81 scrh = 0.5*
acf*(rs*rs - 1.0) + 1.0/3.0*
bcf*(rs*rs*rs - 1.0)
82 + 0.25*
ccf*(rs*rs*rs*rs - 1.0);
108 double *x1, *x2, *x3;
118 #if GEOMETRY == CARTESIAN
119 rs = sqrt(x1[i]*x1[i] + x2[j]*x2[j] + x3[k]*x3[k]);
120 #elif GEOMETRY == CYLINDRICAL
121 rs = sqrt(x1[i]*x1[i] + x2[j]*x2[j]);
122 #elif GEOMETRY == SPHERICAL
123 rs = sqrt(x1[i]*x1[i]);
126 EXPAND(d->
Vc[
VX1][k][j][i] = 0.0; ,
127 d->
Vc[
VX2][k][j][i] = 0.0; ,
128 d->
Vc[
VX3][k][j][i] = 0.0;)
132 }
else if (side ==
X2_END) {
135 #if GEOMETRY == CARTESIAN
136 rs = sqrt(x1[i]*x1[i] + x2[j]*x2[j] + x3[k]*x3[k]);
137 #elif GEOMETRY == CYLINDRICAL
138 rs = sqrt(x1[i]*x1[i] + x2[j]*x2[j]);
139 #elif GEOMETRY == SPHERICAL
140 rs = sqrt(x1[i]*x1[i]);
143 EXPAND(d->
Vc[
VX1][k][j][i] = 0.0; ,
144 d->
Vc[
VX2][k][j][i] = 0.0; ,
145 d->
Vc[
VX3][k][j][i] = 0.0;)
149 }
else if (side ==
X3_END) {
152 rs = sqrt(x1[i]*x1[i] + x2[j]*x2[j] + x3[k]*x3[k]);
154 EXPAND(d->
Vc[
VX1][k][j][i] = 0.0; ,
155 d->
Vc[
VX2][k][j][i] = 0.0; ,
156 d->
Vc[
VX3][k][j][i] = 0.0;)
162 #if (BODY_FORCE & VECTOR)
164 void BodyForceVector(
double *v,
double *g,
double x1,
double x2,
double x3)
177 #if GEOMETRY == CARTESIAN
178 rs = sqrt(x1*x1 + x2*x2 + x3*x3);
179 #elif GEOMETRY == CYLINDRICAL
180 rs = sqrt(x1*x1 + x2*x2);
183 if (rs > 1.0) gs = -1.0/rs/rs;
184 else gs = rs*(acf + rs*(bcf + rs*
ccf));
186 #if GEOMETRY == CARTESIAN
190 #elif GEOMETRY == CYLINDRICAL
199 #if (BODY_FORCE & POTENTIAL)
215 #if GEOMETRY == CARTESIAN
216 rs = sqrt(x1*x1 + x2*x2 + x3*x3);
217 #elif GEOMETRY == CYLINDRICAL
218 rs = sqrt(x1*x1 + x2*x2);
221 C = (0.5*acf + bcf/3.0 + ccf*0.25);
222 if (rs > 1.0) phi = -1.0/rs;
223 else phi = -rs*rs*(0.5*acf + rs*(bcf/3.0 + rs*ccf*0.25)) + C - 1.0;
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
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_END_LOOP(k, j, i)
#define X2_END
Boundary region at X2 end.
double g_inputParam[32]
Array containing the user-defined parameters.
#define X1_END_LOOP(k, j, i)
double * xgc
Cell volumetric centroid (!= x when geometry != CARTESIAN).
#define X3_END
Boundary region at X3 end.
double BodyForcePotential(double x, double y, double z)
void Analysis(const Data *d, Grid *grid)
void Init(double *v, double x1, double x2, double x3)
void BodyForceVector(double *v, double *g, double x, double y, double z)