6.3
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 models
61  *----------------------------------------------------------------------------*/
62 
63 typedef enum {
64 
69 
71 
72 /*----------------------------------------------------------------------------
73  * Atmospheric nucleation models
74  *----------------------------------------------------------------------------*/
75 
76 typedef enum {
77 
82 
84 
85 /*----------------------------------------------------------------------------
86  * Atmospheric aerosol external library
87  *----------------------------------------------------------------------------*/
88 
89 typedef enum {
90 
93 
95 
96 /*============================================================================
97  * Type definitions
98  *============================================================================*/
99 
104 /*----------------------------------------------------------------------------
105  * Atmospheric model options descriptor
106  *----------------------------------------------------------------------------*/
107 
108 typedef struct {
109  /* Space and time reference of the run */
111  int syear;
113  int squant;
115  int shour;
117  int smin;
125  int nbmetd;
127  int nbmett;
130  int nbmetm;
131  int nbmaxt;
135 
138 
140 
141  /* Model options */
175 
178 
217 
218  /* Altitudes of the temperature profile */
220  /* Time (in sec) of the meteo profile */
222  /* Hydrostatic pressure from Laplace integration */
224 
226 
227 /*----------------------------------------------------------------------------
228  * Atmospheric model constants descriptor
229  *----------------------------------------------------------------------------*/
230 
231 typedef struct {
232  /* Space and tim reference of the run */
235 
237 
238 /*----------------------------------------------------------------------------
239  * Atmospheric chemistry options descriptor
240  *----------------------------------------------------------------------------*/
241 
242 typedef struct {
243 
251  int model;
254 
255  /* Flag to deactivate photolysis */
257 
262 
270  int n_layer;
272  int n_size;
274  int *species_to_scalar_id; // used only in Fortran
278  int *chempoint;
279 
282 
284 
285 /*============================================================================
286  * Static global variables
287  *============================================================================*/
288 
289 /* Pointer to atmo options structure */
291 
292 /* Pointer to atmo constants structure */
294 
295 /* Pointer to atmo chemistry structure */
297 
298 /*============================================================================
299  * Public function definitions
300  *============================================================================*/
301 
302 /*----------------------------------------------------------------------------*/
321 /*----------------------------------------------------------------------------*/
322 
323 void
325 
326 /*----------------------------------------------------------------------------*/
332 /*----------------------------------------------------------------------------*/
333 
334 void
335 cs_atmo_set_meteo_file_name(const char *file_name);
336 
337 /*----------------------------------------------------------------------------*/
343 /*----------------------------------------------------------------------------*/
344 
345 void
346 cs_atmo_chemistry_set_spack_file_name(const char *file_name);
347 
348 /*----------------------------------------------------------------------------*/
354 /*----------------------------------------------------------------------------*/
355 
356 void
357 cs_atmo_chemistry_set_aerosol_file_name(const char *file_name);
358 
359 /*----------------------------------------------------------------------------*/
381 /*----------------------------------------------------------------------------*/
382 
383 void
385 
386 /*----------------------------------------------------------------------------*/
392 /*----------------------------------------------------------------------------*/
393 
394 void
396 
397 /*----------------------------------------------------------------------------*/
416 /*----------------------------------------------------------------------------*/
417 
418 void
420  cs_real_t xlong,
421  cs_real_t jour,
422  cs_real_t heurtu,
423  int imer,
424  cs_real_t *albe,
425  cs_real_t *muzero,
426  cs_real_t *omega,
427  cs_real_t *fo);
428 
429 /*----------------------------------------------------------------------------*/
433 /*----------------------------------------------------------------------------*/
434 
435 void
436 cs_atmo_log_setup(void);
437 
438 /*----------------------------------------------------------------------------*/
442 /*----------------------------------------------------------------------------*/
443 
444 void
446 
447 /*----------------------------------------------------------------------------*/
451 /*----------------------------------------------------------------------------*/
452 
453 void
455 
456 /*----------------------------------------------------------------------------*/
457 
459 
460 #endif /* __CS_ATMO_H__ */
cs_atmo_option_t::deposition_model
int deposition_model
Definition: cs_atmo.h:145
cs_atmo_chemistry_t::species_to_scalar_id
int * species_to_scalar_id
Definition: cs_atmo.h:274
CS_ATMO_NUC_ABDUL_RAZZAK
@ CS_ATMO_NUC_ABDUL_RAZZAK
Definition: cs_atmo.h:81
cs_atmo_option_t
Definition: cs_atmo.h:108
cs_atmo_model_t
cs_atmo_model_t
Definition: cs_atmo.h:63
cs_atmo_option_t::meteo_zi
cs_real_t meteo_zi
Definition: cs_atmo.h:186
cs_atmo_option_t::sedimentation_model
int sedimentation_model
Definition: cs_atmo.h:143
CS_ATMO_NUC_COHARD
@ CS_ATMO_NUC_COHARD
Definition: cs_atmo.h:80
cs_atmo_chemistry_t::n_layer
int n_layer
Definition: cs_atmo.h:270
cs_atmo_chemistry_t::init_gas_with_lib
bool init_gas_with_lib
Definition: cs_atmo.h:266
cs_atmo_option_t::compute_z_ground
bool compute_z_ground
Definition: cs_atmo.h:137
cs_atmo_option_t::subgrid_model
int subgrid_model
Definition: cs_atmo.h:162
cs_atmo_option_t::meteo_u2
cs_real_t meteo_u2
Definition: cs_atmo.h:200
cs_atmo_option_t::meteo_z0
cs_real_t meteo_z0
Definition: cs_atmo.h:182
cs_atmo_chemistry_t::chempoint
int * chempoint
Definition: cs_atmo.h:278
cs_atmo_option_t::meteo_t0
cs_real_t meteo_t0
Definition: cs_atmo.h:208
cs_atmo_option_t::time_met
cs_real_t * time_met
Definition: cs_atmo.h:221
cs_atmo_option_t::meteo_dlmo
cs_real_t meteo_dlmo
Definition: cs_atmo.h:180
cs_atmo_chemistry_t::aerosol_model
cs_atmo_aerosol_type_t aerosol_model
Definition: cs_atmo.h:261
cs_atmo_compute_solar_angles
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:1130
cs_atmo_constants_t
Definition: cs_atmo.h:231
cs_atmo_option_t::meteo_ustar0
cs_real_t meteo_ustar0
Definition: cs_atmo.h:202
cs_atmo_chemistry_set_aerosol_file_name
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:997
cs_glob_atmo_constants
cs_atmo_constants_t * cs_glob_atmo_constants
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:493
cs_atmo_option_t::ssec
cs_real_t ssec
Definition: cs_atmo.h:119
cs_glob_atmo_option
cs_atmo_option_t * cs_glob_atmo_option
cs_atmo_chemistry_t::n_size
int n_size
Definition: cs_atmo.h:272
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
cs_atmo_set_meteo_file_name
void cs_atmo_set_meteo_file_name(const char *file_name)
This function set the file name of the meteo file.
Definition: cs_atmo.c:950
cs_atmo_option_t::meteo_tstar
cs_real_t meteo_tstar
Definition: cs_atmo.h:214
cs_atmo_option_t::meteo_wstar0
cs_real_t meteo_wstar0
Definition: cs_atmo.h:204
cs_glob_atmo_chemistry
cs_atmo_chemistry_t * cs_glob_atmo_chemistry
cs_atmo_log_setup
void cs_atmo_log_setup(void)
Print the atmospheric module options to setup.log.
Definition: cs_atmo.c:1221
cs_atmo_option_t::meteo_zu2
cs_real_t meteo_zu2
Definition: cs_atmo.h:190
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
ple_locator.h
cs_atmo_option_t::z_temp_met
cs_real_t * z_temp_met
Definition: cs_atmo.h:219
cpincl::omega
double precision, dimension(ncharm), save omega
Definition: cpincl.f90:99
cs_mesh_quantities.h
cs_atmo_option_t::smin
int smin
Definition: cs_atmo.h:117
cs_atmo_option_t::squant
int squant
Definition: cs_atmo.h:113
cs_atmo_chemistry_t::n_reactions
int n_reactions
Definition: cs_atmo.h:253
cs_mesh.h
cs_atmo_chemistry_t::chemistry_with_photolysis
bool chemistry_with_photolysis
Definition: cs_atmo.h:256
cs_atmo_constants_t::ps
cs_real_t ps
Definition: cs_atmo.h:234
CS_ATMO_HUMID
@ CS_ATMO_HUMID
Definition: cs_atmo.h:68
cs_atmo_chemistry_t::spack_file_name
char * spack_file_name
Definition: cs_atmo.h:273
cs_atmo_option_t::nbmetd
int nbmetd
Definition: cs_atmo.h:125
CS_ATMO_AEROSOL_OFF
@ CS_ATMO_AEROSOL_OFF
Definition: cs_atmo.h:91
cs_atmo_option_t::nbmett
int nbmett
Definition: cs_atmo.h:127
cs_halo.h
cs_atmo_option_t::meteo_u1
cs_real_t meteo_u1
Definition: cs_atmo.h:198
cs_atmo_chemistry_t::frozen_gas_chem
bool frozen_gas_chem
Definition: cs_atmo.h:264
cs_atmo_option_t::meteo_zu1
cs_real_t meteo_zu1
Definition: cs_atmo.h:188
cs_atmo_chemistry_t::model
int model
Definition: cs_atmo.h:251
cs_atmo_option_t::meteo_uref
cs_real_t meteo_uref
Definition: cs_atmo.h:196
cs_atmo_chemistry_t::aero_file_name
char * aero_file_name
Definition: cs_atmo.h:281
CS_ATMO_CONSTANT_DENSITY
@ CS_ATMO_CONSTANT_DENSITY
Definition: cs_atmo.h:66
cs_atmo_chemistry_log_setup
void cs_atmo_chemistry_log_setup(void)
Print the atmospheric chemistry options to setup.log.
Definition: cs_atmo.c:1332
cs_atmo_option_t::open_bcs_treatment
int open_bcs_treatment
Definition: cs_atmo.h:139
cs_atmo_chemistry_t::molar_mass
cs_real_t * molar_mass
Definition: cs_atmo.h:277
cs_atmo_chemistry_t::init_aero_with_lib
bool init_aero_with_lib
Definition: cs_atmo.h:268
CS_ATMO_NUC_OFF
@ CS_ATMO_NUC_OFF
Definition: cs_atmo.h:78
cs_atmo_option_t::nbmetm
int nbmetm
Definition: cs_atmo.h:130
cs_atmo_chemistry_set_spack_file_name
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:972
cs_atmo_option_t::meteo_zt2
cs_real_t meteo_zt2
Definition: cs_atmo.h:194
cs_atmo_option_t::meteo_profile
int meteo_profile
Definition: cs_atmo.h:174
cs_atmo_option_t::distribution_model
int distribution_model
Definition: cs_atmo.h:167
cs_atmo_aerosol_type_t
cs_atmo_aerosol_type_t
Definition: cs_atmo.h:89
cs_atmo_chemistry_t
Definition: cs_atmo.h:242
CS_ATMO_OFF
@ CS_ATMO_OFF
Definition: cs_atmo.h:65
cs_atmo_option_t::hyd_p_met
cs_real_t * hyd_p_met
Definition: cs_atmo.h:223
cs_atmo_option_t::domain_orientation
cs_real_t domain_orientation
Definition: cs_atmo.h:134
cs_atmo_option_t::meteo_file_name
char * meteo_file_name
Definition: cs_atmo.h:177
cs_atmo_option_t::meteo_angle
cs_real_t meteo_angle
Definition: cs_atmo.h:206
cs_atmo_option_t::nucleation_model
int nucleation_model
Definition: cs_atmo.h:154
cs_atmo_chemistry_t::n_species
int n_species
Definition: cs_atmo.h:252
cs_atmo_z_ground_compute
void cs_atmo_z_ground_compute(void)
This function computes the ground elevation.
Definition: cs_atmo.c:741
cs_atmo_option_t::meteo_zref
cs_real_t meteo_zref
Definition: cs_atmo.h:184
fvm_nodal.h
CS_ATMO_DRY
@ CS_ATMO_DRY
Definition: cs_atmo.h:67
cs_atmo_option_t::latitude
cs_real_t latitude
Definition: cs_atmo.h:123
atincl::xlat
real(c_double), pointer, save xlat
latitude of the domain origin
Definition: atincl.f90:205
cs_atmo_aerosol_log_setup
void cs_atmo_aerosol_log_setup(void)
Print the atmospheric aerosols options to setup.log.
Definition: cs_atmo.c:1394
CS_ATMO_AEROSOL_SSH
@ CS_ATMO_AEROSOL_SSH
Definition: cs_atmo.h:92
cs_atmo_chemistry_t::species_to_field_id
int * species_to_field_id
Definition: cs_atmo.h:275
cs_atmo_option_t::syear
int syear
Definition: cs_atmo.h:111
cs_atmo_option_t::nbmaxt
int nbmaxt
Definition: cs_atmo.h:131
cs_atmo_option_t::meteo_t2
cs_real_t meteo_t2
Definition: cs_atmo.h:212
cs_atmo_option_t::meteo_psea
cs_real_t meteo_psea
Definition: cs_atmo.h:216
CS_ATMO_NUC_PRUPPACHER_KLETT
@ CS_ATMO_NUC_PRUPPACHER_KLETT
Definition: cs_atmo.h:79
cs_atmo_option_t::meteo_t1
cs_real_t meteo_t1
Definition: cs_atmo.h:210
cs_atmo_hydrostatic_profiles_compute
void cs_atmo_hydrostatic_profiles_compute(void)
This function computes hydrostatic profiles of density and pressure.
Definition: cs_atmo.c:936
cs_atmo_nucleation_type_t
cs_atmo_nucleation_type_t
Definition: cs_atmo.h:76
cs_base.h
cs_atmo_option_t::longitude
cs_real_t longitude
Definition: cs_atmo.h:121
cs_atmo_option_t::meteo_zt1
cs_real_t meteo_zt1
Definition: cs_atmo.h:192
cs_atmo_option_t::shour
int shour
Definition: cs_atmo.h:115
cs_atmo_declare_chem_from_spack
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:1021