49 #define STS_MAX_STEPS 1024
65 int i,
j,
k, nv,
n, m;
67 double dt_par, tau, tsave, inv_dtp;
110 MPI_Allreduce (&Dts->
inv_dtp, &tau, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
152 #if VISCOSITY == SUPER_TIME_STEPPING
153 EXPAND(d->
Uc[k][j][i][
MX1] += tau*rhs[k][j][i][
MX1]; ,
154 d->
Uc[k][j][i][
MX2] += tau*rhs[k][j][i][
MX2]; ,
155 d->
Uc[k][j][i][
MX3] += tau*rhs[k][j][i][
MX3];)
157 #if (RESISTIVITY == SUPER_TIME_STEPPING)
158 EXPAND(d->
Uc[k][j][i][
BX1] += tau*rhs[k][j][i][
BX1]; ,
159 d->
Uc[k][j][i][
BX2] += tau*rhs[k][j][i][
BX2]; ,
160 d->
Uc[k][j][i][
BX3] += tau*rhs[k][j][i][
BX3];)
163 #if (THERMAL_CONDUCTION == SUPER_TIME_STEPPING) || \
164 (RESISTIVITY == SUPER_TIME_STEPPING) || \
165 (VISCOSITY == SUPER_TIME_STEPPING)
166 d->
Uc[
k][
j][
i][ENG] += tau*rhs[
k][
j][
i][ENG];
170 #if (defined STAGGERED_MHD) && (RESISTIVITY == SUPER_TIME_STEPPING)
250 for (i = 0; i < ssorder; i++) {
251 tau[
i] = dtex / ((-1.0 +
STS_NU)*cos(((2.0*i+1.0)*
CONST_PI)/(2.0*ssorder))
272 while(fabs(Ns-Ns1) >= 1.0e-5){
277 Ns1 = Ns + (dta - dtr*Ns/(2.0*sqrt(
STS_NU))*c)
278 /(dtr/(2.0*sqrt(
STS_NU))*(c-2.0*Ns*b*log(a)*(1.0+
c)/(1.0+b)));
281 print1 (
"! STS_FindRoot: max number of iterations exceeded");
301 dtr = dta*2.0*sqrt(
STS_NU)/(n0*
c);
void Boundary(const Data *d, int idim, Grid *grid)
double **** Vs
The main four-index data array used for face-centered staggered magnetic fields.
void print1(const char *fmt,...)
void PrimToCons3D(Data_Arr V, Data_Arr U, RBox *box)
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
int g_intStage
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1...
double **** Vc
The main four-index data array used for cell-centered primitive variables.
double g_dt
The current integration time step.
double ParabolicRHS(const Data *d, Data_Arr dU, double dt, Grid *grid)
#define DOM
Computational domain (interior)
void CT_Update(const Data *d, Data_Arr Bs, double dt, Grid *grid)
static void STS_ComputeSubSteps(double, double tau[], int)
unsigned char *** flag
Pointer to a 3D array setting useful integration flags that are retrieved during integration.
void ConsToPrim3D(Data_Arr U, Data_Arr V, unsigned char ***flag, RBox *box)
double inv_dtp
Inverse of diffusion (parabolic) time step .
void STS(const Data *d, Time_Step *Dts, Grid *grid)
static double STS_CorrectTimeStep(int, double)
#define TOT_LOOP(k, j, i)
#define FLAG_ENTROPY
Update pressure using entropy equation.
double cfl_par
Courant number for diffusion (STS only).
#define STS_NU
Sets the nu parameter used in STS.
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
#define ARRAY_4D(nx, ny, nz, nv, type)
static double STS_FindRoot(double, double, double)
double g_time
The current integration time.
double **** Uc
The main four-index data array used for cell-centered conservative variables.
int Nsts
Maximum number of substeps used in STS.
#define QUIT_PLUTO(e_code)
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
void CT_AverageMagneticField(double ****bf, double ****UU, Grid *grid)