PLUTO
eos.c File Reference

Implementation of the isothermal EOS. More...

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

Go to the source code of this file.

Functions

void SoundSpeed2 (double **v, double *cs2, double *h, int beg, int end, int pos, Grid *grid)
 
void Enthalpy (double **v, real *h, int beg, int end)
 
void Entropy (double **v, double *s, int beg, int end)
 

Detailed Description

Implementation of the isothermal EOS.

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
April 14, 2014

Definition in file eos.c.

Function Documentation

void Enthalpy ( double **  v,
real h,
int  beg,
int  end 
)

Compute the enthalpy.

Parameters
[in]v1D array of primitive quantities
[in]h1D array of enthalpy values
[in]beginitial index of computation
[in]endfinal index of computation
Returns
This function has no return value.

Definition at line 63 of file eos.c.

74 {
75  print ("! Enthalpy: enthalpy not defined in isothermal EOS\n");
76  QUIT_PLUTO(1);
77 }
void print(const char *fmt,...)
Definition: amrPluto.cpp:497
#define QUIT_PLUTO(e_code)
Definition: macros.h:125

Here is the call graph for this function:

void Entropy ( double **  v,
double *  s,
int  beg,
int  end 
)

Compute the entropy.

Parameters
[in]v1D array of primitive quantities
[in]s1D array of entropy values
[in]isinitial index of computation
[in]iefinal index of computation
Returns
This function has no return value.

Definition at line 80 of file eos.c.

91 {
92  print ("Entropy: entropy not defined for isothermal EOS\n");
93  QUIT_PLUTO(1);
94 }
void print(const char *fmt,...)
Definition: amrPluto.cpp:497
#define QUIT_PLUTO(e_code)
Definition: macros.h:125

Here is the call graph for this function:

void SoundSpeed2 ( double **  v,
double *  cs2,
double *  h,
int  beg,
int  end,
int  pos,
Grid grid 
)

Define the square of the sound speed.

Parameters
[in]v1D array of primitive quantities
[out]cs21D array containing the square of the sound speed
[in]h1D array of enthalpy values
[in]beginitial index of computation
[in]endfinal index of computation
[in]posan integer specifying the spatial position inside the cell (only for spatially-dependent EOS)
[in]gridpointer to an array of Grid structures
Returns
This function has no return value.

Definition at line 13 of file eos.c.

29 {
30  int i, j,k; /* -- used as multidimensional indices -- */
31  double *x1, *x2, *x3;
32 
33  #if PHYSICS == HD || PHYSICS == MHD
34  x1 = grid[IDIR].x;
35  x2 = grid[JDIR].x;
36  x3 = grid[KDIR].x;
37 
38  i = g_i; j = g_j; k = g_k;
39 
40  if (g_dir == IDIR) {
41 
42  x1 = (pos == FACE_CENTER ? grid[IDIR].xr : grid[IDIR].x);
43  for (i = beg; i <= end; i++) cs2[i] = g_isoSoundSpeed*g_isoSoundSpeed;
44 
45  }else if (g_dir == JDIR){
46 
47  x2 = (pos == FACE_CENTER ? grid[JDIR].xr : grid[JDIR].x);
48  for (j = beg; j <= end; j++) cs2[j] = g_isoSoundSpeed*g_isoSoundSpeed;
49 
50  }else if (g_dir == KDIR){
51 
52  x3 = (pos == FACE_CENTER ? grid[KDIR].xr : grid[KDIR].x);
53  for (k = beg; k <= end; k++) cs2[k] = g_isoSoundSpeed*g_isoSoundSpeed;
54 
55  }
56  #else
57  print ("! SoundSpeed2: not defined for this EoS\n");
58  QUIT_PLUTO(1);
59  #endif
60 }
double * xr
Definition: structs.h:81
#define KDIR
Definition: pluto.h:195
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
Definition: globals.h:82
#define IDIR
Definition: pluto.h:193
int g_dir
Specifies the current sweep or direction of integration.
Definition: globals.h:86
#define FACE_CENTER
Definition: pluto.h:206
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
Definition: globals.h:83
int j
Definition: analysis.c:2
int k
Definition: analysis.c:2
void print(const char *fmt,...)
Definition: amrPluto.cpp:497
double * x
Definition: structs.h:80
int g_k
x3 grid index when sweeping along the x1 or x2 direction.
Definition: globals.h:84
int i
Definition: analysis.c:2
#define JDIR
Definition: pluto.h:194
#define QUIT_PLUTO(e_code)
Definition: macros.h:125

Here is the call graph for this function: