programmer's documentation
cs_physical_constants.h
Go to the documentation of this file.
1 #ifndef __CS_PHYSICAL_CONSTANTS_H__
2 #define __CS_PHYSICAL_CONSTANTS_H__
3 
4 /*============================================================================
5  * Base physical constants data.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2016 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*=============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 /* physical constants descriptor */
49 /*-------------------------------*/
50 
51 typedef struct {
52 
53  double gx, gy, gz; /* gravity components */
54  int icorio; /* Coriolis source terms indicator */
55 
57 
58 /* fluid properties descriptor */
59 /*-----------------------------*/
60 
61 typedef struct {
62 
63  int ixyzp0; /* indicator for filling of reference point for
64  total pressure */
65  int ieos; /* indicator of equation of state for the
66  compressible module */
67  int icp; /* property index of the isobaric specific heat */
68  int icv; /* property index of the isochoric specific
69  heat */
70  int irovar; /* variable density field */
71  int ivivar; /* variable viscosity field */
72  int ivsuth; /* Sutherland law for laminar viscosity and
73  thermal conductivity in gas mix spec. phys. */
74  double ro0; /* reference density */
75  double viscl0; /* reference molecular dynamic viscosity */
76  double p0; /* reference pressure for the total pressure */
77  double pred0; /* reference value for the reduced pressure */
78  double xyzp0[3]; /* reference point coordinates for the total
79  pressure */
80  double t0; /* reference temperature */
81  double cp0; /* reference specific heat */
82  double cv0; /* reference specific heat */
83  double xmasmr; /* molar mass of the perfect gas in kg/mol
84  (if ieos=1) */
85  double psginf; /* stiffened gas (ieos=2) limit pressure (zero in
86  perfect gas) (Pa) */
87  double gammasg; /* stiffened gas (ieos=2) polytropic coefficient,
88  (dimensionless) */
89  int ipthrm; /* Uniform variable thermodynamic pressure for the
90  low-Mach algorithm */
91  double pther; /* uniform thermodynamic pressure for the low-Mach
92  algorithm */
93  double pthera; /* thermodynamic pressure for the previous time
94  step */
95  double pthermax; /* thermodynamic maximum pressure for user
96  clipping, used to model a venting effect */
97  double sleak; /* Leak surface */
98  double kleak; /* Leak head loss (2.9 by default, from Idelcick) */
99  double roref; /* Initial reference density */
100 
102 
103 /*============================================================================
104  * Static global variables
105  *============================================================================*/
106 
107 /* Physical constants */
108 
109 extern const double cs_physical_constants_r; /* Ideal gas constant (J/mol/K) */
110 extern const double cs_physical_constants_kb; /* Boltzmann constant (J/K) */
111 
112 /* Pointer to main physical constants structure */
113 
115 
116 /* Pointer to main fluid properties structure */
117 
119 
120 /*=============================================================================
121  * Public function prototypes
122  *============================================================================*/
123 
124 /*----------------------------------------------------------------------------
125  * Provide access to cs_glob_physical_constants
126  *
127  * needed to initialize structure with GUI
128  *----------------------------------------------------------------------------*/
129 
132 
133 /*----------------------------------------------------------------------------
134  * Provide access to cs_glob_fluid_properties
135  *
136  * needed to initialize structure with GUI
137  *----------------------------------------------------------------------------*/
138 
141 
142 /*----------------------------------------------------------------------------*/
143 
145 
146 #endif /* __CS_PHYSICAL_CONSTANTS_H__ */
real(c_double), pointer, save gy
Definition: cstphy.f90:73
Fluid properties descriptor.
Definition: cs_physical_constants.h:61
int ixyzp0
Definition: cs_physical_constants.h:63
double cp0
Definition: cs_physical_constants.h:81
cs_fluid_properties_t * cs_get_glob_fluid_properties(void)
Definition: cs_physical_constants.c:522
real(c_double), dimension(:), pointer, save xyzp0
coordinates of the reference point for the total pressure.
Definition: cstphy.f90:189
double sleak
Definition: cs_physical_constants.h:97
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
int ieos
Definition: cs_physical_constants.h:65
double xmasmr
Definition: cs_physical_constants.h:83
double kleak
Definition: cs_physical_constants.h:98
const cs_physical_constants_t * cs_glob_physical_constants
Definition: cs_physical_constants.c:330
cs_physical_constants_t * cs_get_glob_physical_constants(void)
Definition: cs_physical_constants.c:509
double t0
Definition: cs_physical_constants.h:80
double pthermax
Definition: cs_physical_constants.h:95
int icv
Definition: cs_physical_constants.h:68
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.c:332
int irovar
Definition: cs_physical_constants.h:70
const double cs_physical_constants_r
Ideal gas constant ( )
Definition: cs_physical_constants.c:324
int icorio
Definition: cs_physical_constants.h:54
double pther
Definition: cs_physical_constants.h:91
double psginf
Definition: cs_physical_constants.h:85
real(c_double), pointer, save gx
Gravity.
Definition: cstphy.f90:73
const double cs_physical_constants_kb
Definition: cs_physical_constants.c:328
double viscl0
Definition: cs_physical_constants.h:75
int icp
Definition: cs_physical_constants.h:67
double cv0
Definition: cs_physical_constants.h:82
int ipthrm
Definition: cs_physical_constants.h:89
#define END_C_DECLS
Definition: cs_defs.h:449
double pthera
Definition: cs_physical_constants.h:93
double p0
Definition: cs_physical_constants.h:76
Physical constants descriptor.
Definition: cs_physical_constants.h:51
double gz
Definition: cs_physical_constants.h:53
double gammasg
Definition: cs_physical_constants.h:87
int ivsuth
Definition: cs_physical_constants.h:72
int ivivar
Definition: cs_physical_constants.h:71
double roref
Definition: cs_physical_constants.h:99
double pred0
Definition: cs_physical_constants.h:77
double ro0
Definition: cs_physical_constants.h:74