PLUTO  4.4-patch2
Functions
rhs_source.c File Reference

Add source terms to the right hand side of HD/MHD eqns. More...

#include "pluto.h"

Functions

void RightHandSideSource (const Sweep *sweep, timeStep *Dts, int beg, int end, double dt, double *phi_p, Grid *grid)
 

Detailed Description

Add source terms to the right hand side of hydro/MHD equations. These include

  1. Shearing box source terms;
  2. Geometrical source term in curvilinear coordinates; (these include centrifugal-like terms as well as conservative discretizations to achieve angular momentum and B-phi conservation)
  3. FARGO or ROTATION source terms (included to enforce conservation of total energy or angular mometum);
  4. Body forces;
  5. Powell's 8-waves source terms;
  6. Extended GLM source terms.
Note
Shearing-Box source terms: With the shearing-box module, the user is required to provide only gravity while Coriolis source terms are automatically added here. Without FARGO, the source terms of the momentum and energy equations are

\begin{eqnarray*} \vec{S}_{\vec{m}} &=& \Big[ 2\Omega_0^2 q x \rho + 2\Omega_0\rho v_y\Big]\hvec{i} + \Big[-2\Omega_0\rho v_x\Big]\hvec{j} + \Big[-\rho\Omega_0^2z\Big]\hvec{k} \\ S_E &=& \rho \vec{v} \cdot\vec{g} = \rho v_x (2\Omega_0^2 qx) + \rho v_z (-\Omega_0^2 z) \end{eqnarray*}

When the FARGO module is used, they modify to

\begin{eqnarray*} \vec{S}_{\vec{m}} &=& \Big[ 2\Omega_0\rho v'_y\Big]\hvec{i} + \Big[(q-2)\Omega_0\rho v_x\Big]\hvec{j} + \Big[-\rho\Omega_0^2z\Big]\hvec{k} \\ \noalign{\medskip} S_E &=& (\rho v'_yv_x - B_yB_x)q\Omega_0 + \rho v_z(-\Omega_0^2 z) \end{eqnarray*}

The energy source term is included during the Fargo transport step, see FARGO_Source().

Care is taken to ensure that gravity components are included even when a direction is not active. The following table summarizes:

1D (x):

Sweepgx gy gz
x o o o

2D (x,y):

Sweepgx gy gz
x o
y o o

2D (x,z):

Sweepgx gy gz
x o
z o o

3D (x,y,z):

Sweepgx gy gz
x o
y o
z o

For consistency, the same approach must be used in PrimSource().

Reference

Author
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)\ B. Vaidya
Date
Aug 27, 2020

Function Documentation

◆ RightHandSideSource()

void RightHandSideSource ( const Sweep sweep,
timeStep Dts,
int  beg,
int  end,
double  dt,
double *  phi_p,
Grid grid 
)
Parameters
[in,out]statepointer to State_1D structure
[in]Dtspointer to time step structure
[in]beginitial index of computation
[in]endfinal index of computation
[in]dttime increment
[in]phi_pforce potential at interfaces
[in]gridpointer to Grid structure
Returns
This function has no return value.