PLUTO
4.4-patch2
|
Compute right hand side from parabolic (diffusion) terms. More...
#include "pluto.h"
Functions | |
void | ParabolicUpdate (const Data *d, Data_Arr dU, RBox *domBox, double **aflux, double dt, timeStep *Dts, Grid *grid) |
double | ParabolicRHS (const Data *d, Data_Arr dU, RBox *domBox, double **aflux, int timeStepping, double dt, Grid *grid) |
The ParabolicUpdate() function computes the right hand side of conservative variables using contributions coming from diffusion operators only. It is called by EXPLICIT methods only immediately after the hyerbolic rhs has been computed. Note that this is not an operator split formalism since contributions are added as the same time level:
Step (2) is the one performed by ParabolicUpdate(). By convention, parabolic fluxes are written with the plus sign when they are on the right hand side.
The ParabolicRHS() function does the actual computation of the right hand side, in divergence form, of the parabolic (diffusion) operators only:
Here U
is a generic cell-centered quantity (like momentum, magnetic field or total energy) and is the corresponding flux and
S
is the source terms (including geometrical source terms). Contributions may simultaneously come from ambipolar diffusion, resistivity, thermal conduction and viscosity computed, respectively, by the functions AD_Flux(), ResistiveFlux(), TC_Flux() and ViscousFlux().
For resistivity / ambipolar diffusion / Hall MHD, we use the divergence form of the induction equation when updating cell-centered magnetic fields:
which is valid for any electric vector while is an antisymmetric tensor. Note that in curvilinear geometries, the right hand side contains source terms. In cylindrical coordinates, for instance:
This function is intended for operator split algorithms (STS, RKL) as well as explicit time stepping.
This function also computes the inverse diffusion time step by adding, for each diffusion equation, contributions coming from different directions:
where are the diffusion coefficients available at cell interfaces in the three directions, respectively, and the maximum is taken over the local processor grid.
double ParabolicRHS | ( | const Data * | d, |
Data_Arr | dU, | ||
RBox * | domBox, | ||
double ** | aflux, | ||
int | timeStepping, | ||
double | dt, | ||
Grid * | grid | ||
) |
[in] | d | Pointer to the PLUTO data structure. |
[out] | dU | 3D array containing the conservative right hand sides |
[in] | domBox | A pointer to an RBox structure defining the zones of the domain to be updated |
[in] | aflux | A 2D pointer to store fluxes (needed by Chombo) |
[in] | timeStepping | an integer specifying the time stepping method (= EXPLICIT / STS / RKL) |
[in] | dt | the time step |
[in] | grid | pointer to Grid structure |
void ParabolicUpdate | ( | const Data * | d, |
Data_Arr | dU, | ||
RBox * | domBox, | ||
double ** | aflux, | ||
double | dt, | ||
timeStep * | Dts, | ||
Grid * | grid | ||
) |
It is called only by explicit schemes.
[in] | d | Pointer to the PLUTO data structure. When set to NULL , the right hand side is not recomputed, and the most recent computed value of rhs[] is employed (useful for CTU algorithms). |
[in,out] | dU | Array of conservative rhs to be updated |
[in] | domBox | A pointer to an RBox structure defining the zones of the domain to be updated |
[in,out] | aflux | A 2D pointer to store fluxes (needed by Chombo) |
[in] | dt | The time step increment |
[out] | Dts | Pointer to the timeStep structure |
[in] | grid | Pointer to the grid structure |