32 int evolve(
int nmin,
int nmax,
int flag,
double *rho_1D,
double *dvol,
33 double *dm,
double *dtbdm,
double *xa1,
double *xa,
34 double *dvol1,
double *umid,
double *upmid,
35 double *pmid,
double *xa2,
double *dx,
double *xa3,
36 double *vx_1D_old,
double *vx_1D,
double *vy_1D,
37 double *vz_1D,
double *eng_1D,
38 double *e_int_1D,
double *pre_1D) {
43 for (i = nmin - 3; i <= nmax + 4; i++) {
44 dm[i] = rho_1D[i] * dvol[i];
45 dtbdm[i] =
dt / dm[i];
48 xa[i] = xa[i] +
dt * umid[i];
49 upmid[i] = umid[i] * pmid[i];
52 xa1[nmin - 4] = xa[nmin - 4];
53 xa1[nmax + 5] = xa[nmax + 5];
56 for (i = nmin - 4; i <= nmax + 5; i++) {
57 xa2[i] = xa1[i] + 0.5 * dx[i];
58 dx[i] = xa[i + 1] - xa[i];
59 xa3[i] = xa[i] + 0.5 * dx[i];
62 for (i = nmin - 3; i <= nmax + 4; i++) {
67 for (i = nmin - 3; i <= nmax + 3; i++) {
68 rho_1D[i] = rho_1D[i]*(dvol1[i] / dvol[i]);
72 vx_1D_old[i] = vx_1D[i];
75 vx_1D[i] = vx_1D[i] - dtbdm[i]*(pmid[i + 1] - pmid[i]) +
dt *
grav_acc;
76 eng_1D[i] = eng_1D[i] - dtbdm[i]*(upmid[i + 1] - upmid[i]) + 0.5 *
dt *
77 grav_acc * (vx_1D_old[i] + vx_1D[i]);
80 vx_1D[i] = vx_1D[i] - dtbdm[i]*(pmid[i + 1] - pmid[i]);
81 eng_1D[i] = eng_1D[i] - dtbdm[i]*(upmid[i + 1] - upmid[i]);
84 vx_1D[i] = vx_1D[i] - dtbdm[i]*(pmid[i + 1] - pmid[i]);
85 eng_1D[i] = eng_1D[i] - dtbdm[i]*(upmid[i + 1] - upmid[i]);
89 e_int_1D[i] = eng_1D[i] - 0.5 * (pow(vx_1D[i], 2) + pow(vy_1D[i], 2) + pow(vz_1D[i], 2));