Solves the linear transport step of the FARGO-MHD algorithm.
More...
|
static void | FARGO_Flux (double *, double *, double) |
|
static void | FARGO_ParallelExchange (Data_Arr U, Data_Arr Us, double ***rbl[], RBox *, double ***rbu[], RBox *, Grid *grid) |
|
void | FARGO_ShiftSolution (Data_Arr U, Data_Arr Us, Grid *grid) |
|
Implements a uniform shift of the conservative fluid variables in the direction of orbital motion which is assumed to be
(for Cartesian or polar coordinates) or
(for spherical coordinates). The shift is converted into an integer part "m" and a fractional remainder "eps".
Parallelization is performed by adding extra data layers above and below the current data set so as to enlarge the required computational stencil in the orbital direction. The additional buffers are received from the processors lying, respectively, below and above and their size changes dynamically from one step to the next.
Reference
- "A conservative orbital advection scheme for simulations
of magnetized shear flows with the PLUTO code"
Mignone et al, A&A (2012) 545, A152 (–> Section 2.4)
- Author
- A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
G. Muscianisi (g.mus.nosp@m.cian.nosp@m.isi@c.nosp@m.inec.nosp@m.a.it)
- Date
- July 10, 2019
◆ FARGO_Flux()
void FARGO_Flux |
( |
double * |
q, |
|
|
double * |
flx, |
|
|
double |
eps |
|
) |
| |
|
static |
Compute the transport flux corresponding to a fractional increment eps.
- Parameters
-
[in] | q | 1D array of a conserved quantity |
[out] | flx | the conservative flux |
[in] | eps | the fractional increment |
The following MAPLE script may be used to check the correctness of implementation
restart;
P0 := 3/2*q[i] - (q[p]+q[m])/4;
P1 := q[p] - q[m];
P2 := 3*(q[p] - 2*q[i] + q[m]);
FS[p] := P0 + P1/2*(1 - epsilon) + P2*(1/4 - epsilon/2 + epsilon^2/3);
FS[m] := P0 - P1/2*(1 - epsilon) + P2*(1/4 - epsilon/2 + epsilon^2/3);
dq := q[p] - q[m];
d2q := q[p] - 2*q[i] + q[m];
FF[p] := q[p] - epsilon/2*(dq + d2q*(3 - 2*epsilon));
FF[m] := q[m] + epsilon/2*(dq - d2q*(3 - 2*epsilon));
◆ FARGO_ParallelExchange()
void FARGO_ParallelExchange |
( |
Data_Arr |
U, |
|
|
Data_Arr |
Us, |
|
|
double *** |
recv_buf_lower[], |
|
|
RBox * |
lbox, |
|
|
double *** |
recv_buf_upper[], |
|
|
RBox * |
ubox, |
|
|
Grid * |
grid |
|
) |
| |
|
static |
Exchange data values between adjacent processors lying in the the same direction (x2 for CARTESIAN/POLAR or x3 for SPHERICAL) Values will be stored inside recv_buf_lower & recv_buf_upper.
- Parameters
-
[in,out] | U | a 3D array of conserved, zone-centered values |
[in,out] | Us | a 3D array of staggered magnetic fields |
[out] | recv_buf_lower | buffer array received from the processor ahead |
[out] | recv_buf_upper | buffer array received from the processor behind |
[in] | ubox | pointer to RBox structure defining the index range of the upper data layer |
[in] | lbox | pointer to RBox structure defining the index range of the lower data layer |
[in] | grid | pointer to Grid structure; |
- Returns
- This function has no return value.
◆ FARGO_ShiftSolution()
void FARGO_ShiftSolution |
( |
Data_Arr |
U, |
|
|
Data_Arr |
Us, |
|
|
Grid * |
grid |
|
) |
| |
Shifts conserved variables in the orbital direction.
- Parameters
-
[in,out] | U | a 3D array of conserved, zone-centered values |
[in,out] | Us | a 3D array of staggered magnetic fields |
[in] | grid | pointer to Grid structure; |
- Returns
- This function has no return value.
- Todo:
- Optimization: avoid using too many if statements like on nproc_s > 1 or == 1