PLUTO
fargo_source.c File Reference

Add source terms before the FARGO advection step. More...

#include "pluto.h"
Include dependency graph for fargo_source.c:

Go to the source code of this file.

Functions

void FARGO_Source (Data_Arr UU, double dt, Grid *grid)
 

Detailed Description

Add source terms before the FARGO advection step.

This function is called prior to the FARGO advection algorithm to add source terms. At present, we use it only for the energy equation in the ShearingBox module:

\[ \pd{E'}{t} + w\pd{E'}{y} = (B_xB_y - \rho v_xv'_y)\pd{w}{x} \]

where $w = -q\Omega x$. The discretization follows the algorithm of [GS10], see Eq. (51) and (63) of that paper.

Reference

  • [GS10] "Implementation of the shearing box approximation in Athena", Stone & Gardiner, ApJS (2010) 189, 142.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 26, 2015

Definition in file fargo_source.c.

Function Documentation

void FARGO_Source ( Data_Arr  UU,
double  dt,
Grid grid 
)
Parameters
[in,out]UUan array of conserved variables
[in]dtthe current time increment
[in]gridpointer to an array of Grid structures

Definition at line 28 of file fargo_source.c.

35 {
36 #if (HAVE_ENERGY) && (defined SHEARINGBOX)
37  int i,j,k;
38  double scrh, rho, mx, my, Bx, By;
39 
40  scrh = SB_Q*SB_OMEGA;
41  DOM_LOOP(k,j,i){
42  rho = UU[k][j][i][RHO];
43  mx = UU[k][j][i][MX1];
44  my = UU[k][j][i][MX2];
45  Bx = UU[k][j][i][BX1];
46  By = UU[k][j][i][BX2];
47 
48  UU[k][j][i][ENG] += - dt*scrh*Bx*(By - 0.5*dt*Bx*scrh)
49  + dt*scrh*mx*my/rho;
50  }
51 #endif
52 }
#define MX1
Definition: mod_defs.h:20
DOM_LOOP(k, j, i)
Definition: analysis.c:22
#define RHO
Definition: mod_defs.h:19
tuple scrh
Definition: configure.py:200
static double Bx
Definition: hlld.c:62
#define SB_OMEGA
Disk local orbital frequency .
Definition: shearingbox.h:81
int j
Definition: analysis.c:2
#define MX2
Definition: mod_defs.h:21
int k
Definition: analysis.c:2
#define SB_Q
The shear parameter, .
Definition: shearingbox.h:76
int i
Definition: analysis.c:2
#define BX1
Definition: mod_defs.h:25
#define BX2
Definition: mod_defs.h:26

Here is the call graph for this function:

Here is the caller graph for this function: