31 void PrimRHS (
double *v,
double *dv,
double cs2,
double h,
double *Adv)
51 #if EOS == IDEAL || EOS == PVTE_LAW
52 EXPAND(Adv[
VXn] = u*dv[
VXn] + dv[PRS]/v[
RHO]; ,
55 Adv[PRS] = cs2*v[
RHO]*dv[
VXn] + u*dv[PRS];
56 #elif EOS == ISOTHERMAL
72 double *a2,
double *h,
double **src,
Grid *grid)
99 double tau, dA_dV, th;
101 double *v, *vp, *A, *dV, r_inv, ct;
102 double *x1, *x2, *x3;
103 double *x1p, *x2p, *x3p;
104 double *dx1, *dx2, *dx3;
105 static double *phi_p;
108 #if ROTATING_FRAME == YES
109 print1 (
"! PrimSource(): does not work with rotations\n");
119 #if GEOMETRY == CYLINDRICAL
145 #if GEOMETRY == CYLINDRICAL
148 for (i = beg; i <= end; i++){
159 src[
i][PRS] = a2[
i]*src[
i][
RHO];
164 #elif GEOMETRY == POLAR
167 for (i = beg; i <= end; i++){
180 #if DIMENSIONS == 1 && COMPONENTS >= 2
185 src[
i][PRS] = a2[
i]*src[
i][
RHO];
191 for (j = beg; j <= end; j++){
198 #elif GEOMETRY == SPHERICAL
200 print1 (
"! PrimSource: not implemented in Spherical geometry\n");
214 for (i = beg; i <= end; i++) {
218 for (j = beg; j <= end; j++) {
229 #if (BODY_FORCE != NO)
232 #if BODY_FORCE & POTENTIAL
235 for (i = beg; i <= end; i++){
236 #if BODY_FORCE & VECTOR
241 #if BODY_FORCE & POTENTIAL
243 src[
i][
VX1] -= (phi_p[
i] - phi_p[i-1])/(hscale*dx1[i]);
256 #if BODY_FORCE & POTENTIAL
259 #if GEOMETRY == POLAR || GEOMETRY == SPHERICAL
262 for (j = beg; j <= end; j++){
263 #if BODY_FORCE & VECTOR
268 #if BODY_FORCE & POTENTIAL
270 src[
j][
VX2] -= (phi_p[
j] - phi_p[j-1])/(hscale*dx2[j]);
275 #if DIMENSIONS == 2 && COMPONENTS == 3
281 #if BODY_FORCE & POTENTIAL
284 #if GEOMETRY == SPHERICAL
286 hscale = x1[
i]*sin(th);
288 for (k = beg; k <= end; k++){
289 #if BODY_FORCE & VECTOR
294 #if BODY_FORCE & POTENTIAL
296 src[
k][
VX3] -= (phi_p[
k] - phi_p[k-1])/(hscale*dx3[k]);
308 #if (defined FARGO) && !(defined SHEARINGBOX)
309 #if GEOMETRY == POLAR || GEOMETRY == SPHERICAL
310 print1 (
"! Time Stepping works only in Cartesian or cylindrical coords\n");
311 print1 (
"! Use RK instead\n");
315 double **
wA, *dx, *dz;
319 for (i = beg; i <= end; i++){
321 src[
i][
VX2] -= 0.5*v[
VX1]*(wA[
k][i+1] - wA[
k][i-1])/dx[i];
325 for (k = beg; k <= end; k++){
327 src[
k][
VX2] -= 0.5*v[
VX3]*(wA[k+1][
i] - wA[k-1][
i])/dz[k];
double ** v
Cell-centered primitive varables at the base time level, v[i] = .
void print1(const char *fmt,...)
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
void PrimSource(const State_1D *state, int beg, int end, double *a2, double *h, double **src, Grid *grid)
int g_dir
Specifies the current sweep or direction of integration.
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
#define SB_OMEGA
Disk local orbital frequency .
double * xgc
Cell volumetric centroid (!= x when geometry != CARTESIAN).
double BodyForcePotential(double, double, double)
int g_k
x3 grid index when sweeping along the x1 or x2 direction.
#define SB_Q
The shear parameter, .
void PrimRHS(double *v, double *dv, double cs2, double h, double *Adv)
#define ARRAY_1D(nx, type)
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
double ** FARGO_GetVelocity(void)
void BodyForceVector(double *, double *, double, double, double)
#define QUIT_PLUTO(e_code)
double * A
Right interface area, A[i] = .