My Project
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-2019 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  cs_real_3_t gravity; /* gravity vector */
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 icp; /* property index of the isobaric specific heat */
66  int icv; /* property index of the isochoric specific
67  heat */
68  int irovar; /* variable density field */
69  int ivivar; /* variable viscosity field */
70  int ivsuth; /* Sutherland law for laminar viscosity and
71  thermal conductivity in gas mix spec. phys. */
72  double ro0; /* reference density */
73  double viscl0; /* reference molecular dynamic viscosity */
74  double p0; /* reference pressure for the total pressure */
75  double pred0; /* reference value for the reduced pressure */
76  double xyzp0[3]; /* reference point coordinates for the total
77  pressure */
78  double t0; /* reference temperature */
79  double cp0; /* reference specific heat */
80  double cv0; /* reference specific heat */
81  double xmasmr; /* molar mass of the perfect gas in kg/mol
82  (if ieos=1) */
83  int ipthrm; /* Uniform variable thermodynamic pressure for the
84  low-Mach algorithm */
85  double pther; /* uniform thermodynamic pressure for the low-Mach
86  algorithm */
87  double pthera; /* thermodynamic pressure for the previous time
88  step */
89  double pthermax; /* thermodynamic maximum pressure for user
90  clipping, used to model a venting effect */
91  double sleak; /* Leak surface */
92  double kleak; /* Leak head loss (2.9 by default, from Idelcick) */
93  double roref; /* Initial reference density */
94 
96 
97 /*============================================================================
98  * Static global variables
99  *============================================================================*/
100 
101 /* Physical constants */
102 
103 extern const double cs_physical_constants_r; /* Ideal gas constant (J/mol/K) */
104 extern const double cs_physical_constants_kb; /* Boltzmann constant (J/K) */
105 extern const double cs_physical_constants_celsius_to_kelvin; /* Celsius to
106  Kelvin*/
107 extern const double cs_physical_constants_stephan; /* Stephan constant
108  (W/m2/K4)*/
109 
110 /* Pointer to main physical constants structure */
111 
113 
114 /* Pointer to main fluid properties structure */
115 
117 
118 /*=============================================================================
119  * Public function prototypes
120  *============================================================================*/
121 
122 /*----------------------------------------------------------------------------
123  * Provide access to cs_glob_physical_constants
124  *
125  * needed to initialize structure with GUI
126  *----------------------------------------------------------------------------*/
127 
130 
131 /*----------------------------------------------------------------------------
132  * Provide access to cs_glob_fluid_properties
133  *
134  * needed to initialize structure with GUI
135  *----------------------------------------------------------------------------*/
136 
139 
140 /*----------------------------------------------------------------------------
141  * Print the physical constants structure to setup.log.
142  *----------------------------------------------------------------------------*/
143 
144 void
146 
147 /*----------------------------------------------------------------------------
148  * Print the fluid properties structure to setup.log.
149  *----------------------------------------------------------------------------*/
150 
151 void
153 
154 /*----------------------------------------------------------------------------*/
155 
157 
158 #endif /* __CS_PHYSICAL_CONSTANTS_H__ */
cs_fluid_properties_t::irovar
int irovar
Definition: cs_physical_constants.h:68
cs_defs.h
cs_get_glob_physical_constants
cs_physical_constants_t * cs_get_glob_physical_constants(void)
Definition: cs_physical_constants.c:511
cs_physical_constants_t::gravity
cs_real_3_t gravity
Definition: cs_physical_constants.h:53
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
cs_physical_constants_r
const double cs_physical_constants_r
Ideal gas constant ( )
Definition: cs_physical_constants.c:328
cs_glob_physical_constants
const cs_physical_constants_t * cs_glob_physical_constants
Definition: cs_physical_constants.c:343
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_fluid_properties_t::icp
int icp
Definition: cs_physical_constants.h:65
cs_fluid_properties_t::t0
double t0
Definition: cs_physical_constants.h:78
cs_get_glob_fluid_properties
cs_fluid_properties_t * cs_get_glob_fluid_properties(void)
Definition: cs_physical_constants.c:524
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_fluid_properties_t::pthera
double pthera
Definition: cs_physical_constants.h:87
cs_fluid_properties_t::cp0
double cp0
Definition: cs_physical_constants.h:79
cs_physical_constants_kb
const double cs_physical_constants_kb
Definition: cs_physical_constants.c:332
cs_fluid_properties_t::sleak
double sleak
Definition: cs_physical_constants.h:91
cs_physical_constants_celsius_to_kelvin
const double cs_physical_constants_celsius_to_kelvin
Definition: cs_physical_constants.c:336
cs_fluid_properties_t::pther
double pther
Definition: cs_physical_constants.h:85
cs_fluid_properties_t::icv
int icv
Definition: cs_physical_constants.h:66
cs_physical_constants_t::icorio
int icorio
Definition: cs_physical_constants.h:54
cs_fluid_properties_t::viscl0
double viscl0
Definition: cs_physical_constants.h:73
cs_physical_constants_log_setup
void cs_physical_constants_log_setup(void)
Definition: cs_physical_constants.c:536
cs_physical_constants_stephan
const double cs_physical_constants_stephan
Definition: cs_physical_constants.c:341
cs_fluid_properties_t::ixyzp0
int ixyzp0
Definition: cs_physical_constants.h:63
cs_fluid_properties_t::ipthrm
int ipthrm
Definition: cs_physical_constants.h:83
cs_fluid_properties_t::pred0
double pred0
Definition: cs_physical_constants.h:75
cs_fluid_properties_t::ro0
double ro0
Definition: cs_physical_constants.h:72
cs_fluid_properties_t::kleak
double kleak
Definition: cs_physical_constants.h:92
cs_fluid_properties_t::pthermax
double pthermax
Definition: cs_physical_constants.h:89
cs_fluid_properties_t::ivsuth
int ivsuth
Definition: cs_physical_constants.h:70
cs_glob_fluid_properties
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.c:346
cs_fluid_properties_t::ivivar
int ivivar
Definition: cs_physical_constants.h:69
cs_fluid_properties_log_setup
void cs_fluid_properties_log_setup(void)
Definition: cs_physical_constants.c:564
cs_fluid_properties_t
Fluid properties descriptor.
Definition: cs_physical_constants.h:61
cs_fluid_properties_t::roref
double roref
Definition: cs_physical_constants.h:93
cs_physical_constants_t
Physical constants descriptor.
Definition: cs_physical_constants.h:51
cs_fluid_properties_t::xmasmr
double xmasmr
Definition: cs_physical_constants.h:81
cstphy::xyzp0
real(c_double), dimension(:), pointer, save xyzp0
coordinates of the reference point for the total pressure.
Definition: cstphy.f90:202
cs_fluid_properties_t::p0
double p0
Definition: cs_physical_constants.h:74
cs_fluid_properties_t::cv0
double cv0
Definition: cs_physical_constants.h:80