PLUTO
fluxes.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Compute the hydro (HD) flux.
5 
6  Compute the flux of the conservative HD equations in the direction
7  given by ::g_dir.
8  This function defines the component of the hyperbolic flux tensor
9  of the standard HD equations.\n
10  In what follows:
11  - \c VXn, \c MXn are the velocity, momentum components in the direction
12  given by ::g_dir (normal, \c "n")
13  - \c VXt, \c MXt and \c VXb, \c MXb are the transverse components
14  (tangent \c "t" and bi-tangent \c "b").
15 
16  \author A. Mignone (mignone@ph.unito.it)
17  \date Aug 16, 2012
18 */
19 /* ///////////////////////////////////////////////////////////////////// */
20 #include "pluto.h"
21 
22 /* ********************************************************************* */
23 void Flux (double **u, double **w, double *a2, double **fx, double *p,
24  int beg, int end)
25 /*!
26  * \param [in] u 1D array of conserved quantities
27  * \param [in] w 1D array of primitive quantities
28  * \param [in] a2 1D array of sound speeds
29  * \param [out] fx 1D array of fluxes (total pressure excluded)
30  * \param [out] p 1D array of pressure values
31  * \param [in] beg initial index of computation
32  * \param [in] end final index of computation
33  *
34  * \return This function has no return value.
35  *********************************************************************** */
36 {
37  int nv, ii;
38 
39  for (ii = beg; ii <= end; ii++) {
40  fx[ii][RHO] = u[ii][MXn];
41  EXPAND(fx[ii][MX1] = u[ii][MX1]*w[ii][VXn]; ,
42  fx[ii][MX2] = u[ii][MX2]*w[ii][VXn]; ,
43  fx[ii][MX3] = u[ii][MX3]*w[ii][VXn];)
44 #if HAVE_ENERGY
45  p[ii] = w[ii][PRS];
46  fx[ii][ENG] = (u[ii][ENG] + w[ii][PRS])*w[ii][VXn];
47 #elif EOS == ISOTHERMAL
48  p[ii] = a2[ii]*w[ii][RHO];
49 #endif
50 /*
51 #if DUST == YES
52  fx[ii][RHO_D] = u[ii][MXn_D];
53  EXPAND(fx[ii][MX1_D] = u[ii][MX1_D]*w[ii][VXn_D]; ,
54  fx[ii][MX2_D] = u[ii][MX2_D]*w[ii][VXn_D]; ,
55  fx[ii][MX3_D] = u[ii][MX3_D]*w[ii][VXn_D];)
56 #endif
57 */
58  }
59 }
#define MX3
Definition: mod_defs.h:22
#define MX1
Definition: mod_defs.h:20
void Flux(double **u, double **w, double *a2, double **fx, double *p, int beg, int end)
Definition: fluxes.c:23
#define RHO
Definition: mod_defs.h:19
#define MX2
Definition: mod_defs.h:21
int MXn
Definition: globals.h:74
int VXn
Definition: globals.h:73
PLUTO main header file.
#define HAVE_ENERGY
Definition: pluto.h:395