PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
fargo.c File Reference

Solves the linear transport step of the FARGO-MHD algorithm. More...

#include "pluto.h"

Functions

static void FARGO_Flux (double *, double *, double)
 
void FARGO_ShiftSolution (Data_Arr U, Data_Arr Us, Grid *grid)
 

Detailed Description

Implements a uniform shift of the conservative fluid variables in the direction of orbital motion which is assumed to be $ x_2=y,\phi$ (for Cartesian or polar coordinates) or $ x_3 = \phi$ (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

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
G. Muscianisi (g.mus.nosp@m.cian.nosp@m.isi@c.nosp@m.inec.nosp@m.a.it)
Date
Aug 16, 2012

Function Documentation

void FARGO_Flux ( double *  q,
double *  flx,
double  eps 
)
static

Compute the transport flux corresponding to a fractional increment eps.

Parameters
[in]q1D array of a conserved quantity
[out]flxthe conservative flux
[in]epsthe 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));
void FARGO_ShiftSolution ( Data_Arr  U,
Data_Arr  Us,
Grid grid 
)

Shifts conserved variables in the orbital direction.

Parameters
[in,out]Ua 3D array of conserved, zone-centered values
[in,out]Usa 3D array of staggered magnetic fields
[in]gridpointer to Grid structure;
Returns
This function has no return value.
Todo:
Optimization: avoid using too many if statement like on nproc_s > 1 or == 1