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

Compute the right hand side of the conservative HD/MHD equations. More...

#include "pluto.h"

Functions

static void TotalFlux (const State_1D *, double *, int, int, Grid *)
 
void RightHandSide (const State_1D *state, Time_Step *Dts, int beg, int end, double dt, Grid *grid)
 

Detailed Description

This function constructs the one-dimensional right hand side of the conservative MHD or HD equations in the direction given by g_dir in different geometries. The right hand side is computed as a two-point flux difference term plus a source term:

\[ \mathrm{RHS}_i = \frac{dt}{dV_i}\Big(A_{i+1/2}F_{i+1/2} - A_{i-1/2}F_{i-1/2}\Big) + dt S_i \]

where

See also RHS_page The right hand side is assembled through the following steps:

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012

Function Documentation

void RightHandSide ( const State_1D state,
Time_Step Dts,
int  beg,
int  end,
double  dt,
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]gridpointer to Grid structure
Returns
This function has no return value.
Note
Todo:
void TotalFlux ( const State_1D state,
double *  gPhi,
int  beg,
int  end,
Grid grid 
)
static

Compute the total flux in order to enforce conservation of angular momentum and energy in presence of FARGO source terms, rotation or gravitational potential.

Parameters
[in]statepointer to State_1D structure;
[in,out]gPhi1D array defining the gravitational potential;
[in]beginitial index of computation;
[in]endfinal index of computation;
[in]gridpointer to Grid structure;