6.2
general documentation
cs_atmo.h
Go to the documentation of this file.
1 #ifndef __CS_ATMO_H__
2 #define __CS_ATMO_H__
3 
4 /*============================================================================
5  * Main for atmospheric related functions
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2020 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  * PLE library headers
32  *----------------------------------------------------------------------------*/
33 
34 #include <ple_locator.h>
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "fvm_nodal.h"
41 
42 #include "cs_base.h"
43 #include "cs_halo.h"
44 #include "cs_mesh.h"
45 #include "cs_mesh_quantities.h"
46 
47 /*----------------------------------------------------------------------------*/
48 
50 
51 /*============================================================================
52  * Local Macro definitions
53  *============================================================================*/
54 
55 /*============================================================================
56  * Type definitions
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Atmospheric nucleation models
61  *----------------------------------------------------------------------------*/
62 
63 typedef enum {
64 
69 
71 
72 /*----------------------------------------------------------------------------
73  * Atmospheric aerosol external library
74  *----------------------------------------------------------------------------*/
75 
76 typedef enum {
77 
80 
82 
83 /*============================================================================
84  * Type definitions
85  *============================================================================*/
86 
91 /*----------------------------------------------------------------------------
92  * Atmospheric model options descriptor
93  *----------------------------------------------------------------------------*/
94 
95 typedef struct {
96  /* Space and tim reference of the run */
98  int syear;
100  int squant;
102  int shour;
104  int smin;
112  int nbmetd;
114  int nbmett;
115  /* numbers of time steps for the meteo profiles */
116  int nbmetm;
117  /* Number of vertical levels */
118  int nbmaxt;
122 
123  /* Model options */
129  int imeteo;
130 
131  /* Altitudes of the temperature profile */
133  /* Time (in sec) of the meteo profile */
135  /* Hydrostatic pressure from Laplace integration */
137  /* Fractional nebulosity */
139  /* Diagnosed nebulosity */
141 
143 
144 /*----------------------------------------------------------------------------
145  * Atmospheric chemistry options descriptor
146  *----------------------------------------------------------------------------*/
147 
148 typedef struct {
149 
157  int model;
160 
161  /* Flag to deactivate photolysis */
163 
168 
176  int n_layer;
178  int n_size;
180  int *species_to_scalar_id; // used only in Fortran
184  int *chempoint;
185 
188 
190 
191 /*============================================================================
192  * Static global variables
193  *============================================================================*/
194 
195 /* Pointer to atmo options structure */
197 
198 /* Pointer to atmo chemistry structure */
200 
201 /*============================================================================
202  * Public function definitions
203  *============================================================================*/
204 
205 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
213 void
214 cs_atmo_chemistry_set_spack_file_name(const char *file_name);
215 
216 /*----------------------------------------------------------------------------*/
222 /*----------------------------------------------------------------------------*/
223 
224 void
225 cs_atmo_chemistry_set_aerosol_file_name(const char *file_name);
226 
227 /*----------------------------------------------------------------------------*/
249 /*----------------------------------------------------------------------------*/
250 
251 void
253 
254 /*----------------------------------------------------------------------------*/
260 /*----------------------------------------------------------------------------*/
261 
262 void
264 
265 /*----------------------------------------------------------------------------*/
284 /*----------------------------------------------------------------------------*/
285 
286 void
288  cs_real_t xlong,
289  cs_real_t jour,
290  cs_real_t heurtu,
291  int imer,
292  cs_real_t *albe,
293  cs_real_t *muzero,
294  cs_real_t *omega,
295  cs_real_t *fo);
296 
297 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
305 
306 /*----------------------------------------------------------------------------*/
310 /*----------------------------------------------------------------------------*/
311 
312 void
314 
315 /*----------------------------------------------------------------------------*/
316 
318 
319 #endif /* __CS_ATMO_H__ */
int nbmaxt
Definition: cs_atmo.h:118
cs_atmo_chemistry_t * cs_glob_atmo_chemistry
int * species_to_field_id
Definition: cs_atmo.h:181
void cs_atmo_compute_solar_angles(cs_real_t xlat, cs_real_t xlong, cs_real_t jour, cs_real_t heurtu, int imer, cs_real_t *albe, cs_real_t *muzero, cs_real_t *omega, cs_real_t *fo)
1D Radiative scheme - Solar data + zenithal angle) Compute:
Definition: cs_atmo.c:771
cs_atmo_option_t * cs_glob_atmo_option
cs_real_t * z_temp_met
Definition: cs_atmo.h:132
cs_atmo_aerosol_type_t aerosol_model
Definition: cs_atmo.h:167
int subgrid_model
Definition: cs_atmo.h:128
int smin
Definition: cs_atmo.h:104
double precision, dimension(ncharm), save omega
Definition: cpincl.f90:99
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
int deposition_model
Definition: cs_atmo.h:126
int n_layer
Definition: cs_atmo.h:176
bool compute_z_ground
Definition: cs_atmo.h:124
cs_real_t * time_met
Definition: cs_atmo.h:134
int sedimentation_model
Definition: cs_atmo.h:125
void cs_atmo_chemistry_set_aerosol_file_name(const char *file_name)
This function sets the file name to initialize the aerosol library.
Definition: cs_atmo.c:638
Definition: cs_atmo.h:65
Definition: cs_atmo.h:66
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
bool chemistry_with_photolysis
Definition: cs_atmo.h:162
int n_size
Definition: cs_atmo.h:178
Definition: cs_atmo.h:79
char * aero_file_name
Definition: cs_atmo.h:187
void cs_atmo_chemistry_log_setup(void)
Print the atmospheric chemistry options to setup.log.
Definition: cs_atmo.c:862
int n_reactions
Definition: cs_atmo.h:159
Definition: cs_atmo.h:148
char * spack_file_name
Definition: cs_atmo.h:179
cs_atmo_aerosol_type_t
Definition: cs_atmo.h:76
cs_real_t * frac_neb
Definition: cs_atmo.h:138
void cs_atmo_chemistry_set_spack_file_name(const char *file_name)
This function set the file name of the SPACK file.
Definition: cs_atmo.c:613
int nucleation_model
Definition: cs_atmo.h:127
bool frozen_gas_chem
Definition: cs_atmo.h:170
Definition: cs_atmo.h:95
int squant
Definition: cs_atmo.h:100
cs_real_t * diag_neb
Definition: cs_atmo.h:140
real(c_double), pointer, save xlat
latitude of the domain origin
Definition: atincl.f90:219
int shour
Definition: cs_atmo.h:102
int n_species
Definition: cs_atmo.h:158
int nbmetd
Definition: cs_atmo.h:112
cs_real_t latitude
Definition: cs_atmo.h:110
#define END_C_DECLS
Definition: cs_defs.h:496
int model
Definition: cs_atmo.h:157
Definition: cs_atmo.h:67
cs_real_t domain_orientation
Definition: cs_atmo.h:121
void cs_atmo_declare_chem_from_spack(void)
This function declare additional transported variables for atmospheric module for the chemistry defin...
Definition: cs_atmo.c:662
cs_atmo_nucleation_type_t
Definition: cs_atmo.h:63
bool init_aero_with_lib
Definition: cs_atmo.h:174
Definition: cs_atmo.h:78
int nbmetm
Definition: cs_atmo.h:116
cs_real_t * hyd_p_met
Definition: cs_atmo.h:136
cs_real_t * molar_mass
Definition: cs_atmo.h:183
int nbmett
Definition: cs_atmo.h:114
int syear
Definition: cs_atmo.h:98
cs_real_t ssec
Definition: cs_atmo.h:106
void cs_atmo_z_ground_compute(void)
This function computes the ground elevation.
Definition: cs_atmo.c:431
Definition: cs_atmo.h:68
int imeteo
Definition: cs_atmo.h:129
cs_real_t longitude
Definition: cs_atmo.h:108
void cs_atmo_aerosol_log_setup(void)
Print the atmospheric aerosols options to setup.log.
Definition: cs_atmo.c:924
bool init_gas_with_lib
Definition: cs_atmo.h:172
int * chempoint
Definition: cs_atmo.h:184
int * species_to_scalar_id
Definition: cs_atmo.h:180