PLUTO  4.4-patch2
Functions
parabolic_update.c File Reference

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)
 

Detailed Description

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:

\[ \begin{array}{llc} (1)\quad & \vec{R}^{n} & = - \Delta t\nabla\cdot\vec{F}_h^n \\ \noalign{\medskip} (2)\quad & \vec{R}^{n} & += + \Delta t\nabla\cdot\vec{F}_p^n \end{array} \]

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:

\[ \pd{U}{t} = \nabla\cdot\Big(D\nabla U\Big) + S \]

Here U is a generic cell-centered quantity (like momentum, magnetic field or total energy) and $\vec{F} = D\nabla U$ 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:

\[ \pd{\vec{B}}{t} = - \nabla\times\vec{E} \equiv -\nabla\cdot\tens{M} \qquad\mathrm{where}\qquad \tens{M} = \left(\begin{array}{ccc} 0 & E_z & -E_y \\ \noalign{\medskip} -E_z & 0 & E_x \\ \noalign{\medskip} E_y & -E_x & 0 \end{array}\right) \qquad\mathrm{or\quad also}\qquad \tens{M}_{ij} = (\vec{E}\times\hvec{e}_i)\cdot\hvec{e}_j \]

which is valid for any electric vector while $\tens{M}$ is an antisymmetric tensor. Note that in curvilinear geometries, the right hand side contains source terms. In cylindrical coordinates, for instance:

\[ \begin{array}{lcl} (\nabla\cdot\tens{M})_r &=&\DS \frac{1}{r}\pd{}{r}(rM_{rr}) + \frac{1}{r}\pd{M_{\phi r}}{\phi} + \pd{M_{zr}}{z} - \frac{M_{\phi\phi}}{r} \\ \noalign{\medskip} (\nabla\cdot\tens{M})_\phi &=&\DS \frac{1}{r}\pd{}{r}(rM_{r\phi}) + \frac{1}{r}\pd{M_{\phi\phi}}{\phi} + \pd{M_{z\phi}}{z} + \frac{M_{\phi r}}{r} \\ \noalign{\medskip} (\nabla\cdot\tens{M})_z &=&\DS \frac{1}{r}\pd{}{r}(rM_{rz}) + \frac{1}{r}\pd{M_{\phi z}}{\phi} + \pd{M_{zz}}{z} \end{array} \]

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:

\[ \Delta t_{p}^{-1} = \max\left[\frac{D_{i+\HALF} + D_{i-\HALF}}{2\Delta x^2} + \frac{D_{j+\HALF} + D_{j-\HALF}}{2\Delta y^2} + \frac{D_{k+\HALF} + D_{k-\HALF}}{2\Delta z^2}\right] \]

where $\eta_{x,y,z}$ are the diffusion coefficients available at cell interfaces in the three directions, respectively, and the maximum is taken over the local processor grid.

Date
July 10, 2019
Authors
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
B. Vaidya Z. Ahmane

Function Documentation

◆ ParabolicRHS()

double ParabolicRHS ( const Data d,
Data_Arr  dU,
RBox domBox,
double **  aflux,
int  timeStepping,
double  dt,
Grid grid 
)
Parameters
[in]dPointer to the PLUTO data structure.
[out]dU3D array containing the conservative right hand sides
[in]domBoxA pointer to an RBox structure defining the zones of the domain to be updated
[in]afluxA 2D pointer to store fluxes (needed by Chombo)
[in]timeSteppingan integer specifying the time stepping method (= EXPLICIT / STS / RKL)
[in]dtthe time step
[in]gridpointer to Grid structure
Returns
On output it returns the maximum diffusion coefficients among all dissipative term over the local processor grid.

◆ ParabolicUpdate()

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.

Note
When the entropy switch is enabled, the right hand side is comuted as a combination of energy, momentum and magnetic feld rhs:

\[ \Delta\sigma = \Delta t\frac{\Gamma-1}{\rho^{\Gamma-1}} \left[\Delta E - \vec{v}\cdot\Delta\vec{m} - \vec{B}\cdot\Delta{\vec{B}} \right] \]

where $\sigma = p/\rho^{\Gamma-1}$ is the conserved entropy.
Parameters
[in]dPointer 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]dUArray of conservative rhs to be updated
[in]domBoxA pointer to an RBox structure defining the zones of the domain to be updated
[in,out]afluxA 2D pointer to store fluxes (needed by Chombo)
[in]dtThe time step increment
[out]DtsPointer to the timeStep structure
[in]gridPointer to the grid structure