7.0
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-2021 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;
129  int nbmetd;
131  int nbmett;
134  int nbmetm;
135  int nbmaxt;
139 
142 
144 
145  /* Model options */
179 
182 
221 
222  /* Altitudes of the temperature profile */
224  /* Time (in sec) of the meteo profile */
226  /* Hydrostatic pressure from Laplace integration */
228 
230 
231 /*----------------------------------------------------------------------------
232  * Atmospheric model constants descriptor
233  *----------------------------------------------------------------------------*/
234 
235 typedef struct {
236  /* Space and tim reference of the run */
239 
241 
242 /*----------------------------------------------------------------------------
243  * Atmospheric chemistry options descriptor
244  *----------------------------------------------------------------------------*/
245 
246 typedef struct {
247 
255  int model;
258 
259  /* Flag to deactivate photolysis */
261 
266 
274  int n_layer;
276  int n_size;
278  int *species_to_scalar_id; // used only in Fortran
282  int *chempoint;
283 
286 
288 
289 /*============================================================================
290  * Static global variables
291  *============================================================================*/
292 
293 /* Pointer to atmo options structure */
295 
296 /* Pointer to atmo constants structure */
298 
299 /* Pointer to atmo chemistry structure */
301 
302 /*============================================================================
303  * Public function definitions
304  *============================================================================*/
305 /*----------------------------------------------------------------------------*/
309 /*----------------------------------------------------------------------------*/
310 
311 void
313 
314 /*----------------------------------------------------------------------------*/
318 /*----------------------------------------------------------------------------*/
319 
320 void
322 
323 /*----------------------------------------------------------------------------*/
345 /*----------------------------------------------------------------------------*/
346 
347 void
349 
350 /*----------------------------------------------------------------------------*/
368 /*----------------------------------------------------------------------------*/
369 
370 void
372 
373 /*----------------------------------------------------------------------------*/
381 /*----------------------------------------------------------------------------*/
382 
383 cs_real_t
385  cs_real_t dlmo);
386 
387 /*----------------------------------------------------------------------------*/
395 /*----------------------------------------------------------------------------*/
396 
397 cs_real_t
399  cs_real_t dlmo);
400 
401 /*----------------------------------------------------------------------------*/
410 /*----------------------------------------------------------------------------*/
411 
412 cs_real_t
414  cs_real_t z0,
415  cs_real_t dlmo);
416 
417 /*----------------------------------------------------------------------------*/
426 /*----------------------------------------------------------------------------*/
427 
428 cs_real_t
430  cs_real_t z0,
431  cs_real_t dlmo);
432 
433 /*----------------------------------------------------------------------------*/
439 /*----------------------------------------------------------------------------*/
440 
441 void
442 cs_atmo_set_meteo_file_name(const char *file_name);
443 
444 /*----------------------------------------------------------------------------*/
450 /*----------------------------------------------------------------------------*/
451 
452 void
453 cs_atmo_chemistry_set_spack_file_name(const char *file_name);
454 
455 /*----------------------------------------------------------------------------*/
461 /*----------------------------------------------------------------------------*/
462 
463 void
464 cs_atmo_chemistry_set_aerosol_file_name(const char *file_name);
465 
466 /*----------------------------------------------------------------------------*/
472 /*----------------------------------------------------------------------------*/
473 
474 void
476 
477 /*----------------------------------------------------------------------------*/
497 /*----------------------------------------------------------------------------*/
498 
499 void
501  cs_real_t xlong,
502  cs_real_t jour,
503  cs_real_t heurtu,
504  int imer,
505  cs_real_t *albe,
506  cs_real_t *muzero,
507  cs_real_t *omega,
508  cs_real_t *fo);
509 
510 /*----------------------------------------------------------------------------*/
514 /*----------------------------------------------------------------------------*/
515 
516 void
517 cs_atmo_log_setup(void);
518 
519 /*----------------------------------------------------------------------------*/
523 /*----------------------------------------------------------------------------*/
524 
525 void
527 
528 /*----------------------------------------------------------------------------*/
532 /*----------------------------------------------------------------------------*/
533 
534 void
536 
537 /*----------------------------------------------------------------------------*/
541 /*----------------------------------------------------------------------------*/
542 
543 void
544 cs_atmo_finalize(void);
545 
546 /*----------------------------------------------------------------------------*/
547 
549 
550 #endif /* __CS_ATMO_H__ */
int nbmaxt
Definition: cs_atmo.h:135
cs_real_t meteo_zi
Definition: cs_atmo.h:190
cs_atmo_chemistry_t * cs_glob_atmo_chemistry
int * species_to_field_id
Definition: cs_atmo.h:279
cs_real_t meteo_zref
Definition: cs_atmo.h:188
void cs_atmo_hydrostatic_profiles_compute(void)
Compute hydrostatic profiles of density and pressure.
Definition: cs_atmo.c:1413
Definition: cs_atmo.h:65
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)
Definition: cs_atmo.c:1819
cs_real_t meteo_ustar0
Definition: cs_atmo.h:206
cs_atmo_option_t * cs_glob_atmo_option
cs_real_t * z_temp_met
Definition: cs_atmo.h:223
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:1638
cs_atmo_aerosol_type_t aerosol_model
Definition: cs_atmo.h:265
cs_real_t meteo_u2
Definition: cs_atmo.h:204
cs_real_t meteo_z0
Definition: cs_atmo.h:186
Definition: cs_atmo.h:66
cs_real_t meteo_psea
Definition: cs_atmo.h:220
int subgrid_model
Definition: cs_atmo.h:166
int smin
Definition: cs_atmo.h:117
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:149
int n_layer
Definition: cs_atmo.h:274
Definition: cs_atmo.h:67
bool compute_z_ground
Definition: cs_atmo.h:141
cs_real_t meteo_u1
Definition: cs_atmo.h:202
cs_real_t * time_met
Definition: cs_atmo.h:225
int sedimentation_model
Definition: cs_atmo.h:147
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:1685
cs_real_t cs_mo_phim(cs_real_t z, cs_real_t dlmo)
Universal function phim for neutral, stable and unstable.
Definition: cs_atmo.h:78
Definition: cs_atmo.h:79
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
bool chemistry_with_photolysis
Definition: cs_atmo.h:260
cs_real_t meteo_zu2
Definition: cs_atmo.h:194
int n_size
Definition: cs_atmo.h:276
cs_real_t ps
Definition: cs_atmo.h:238
Definition: cs_atmo.h:92
char * aero_file_name
Definition: cs_atmo.h:285
cs_real_t meteo_zt2
Definition: cs_atmo.h:198
cs_real_t y_l93
Definition: cs_atmo.h:127
int meteo_profile
Definition: cs_atmo.h:178
cs_real_t x_l93
Definition: cs_atmo.h:125
void cs_atmo_log_setup(void)
Print the atmospheric module options to setup.log.
Definition: cs_atmo.c:1910
void cs_atmo_chemistry_log_setup(void)
Print the atmospheric chemistry options to setup.log.
Definition: cs_atmo.c:2024
cs_real_t meteo_t0
Definition: cs_atmo.h:212
cs_atmo_constants_t * cs_glob_atmo_constants
Definition: cs_atmo.h:235
int n_reactions
Definition: cs_atmo.h:257
Definition: cs_atmo.h:246
char * spack_file_name
Definition: cs_atmo.h:277
cs_atmo_aerosol_type_t
Definition: cs_atmo.h:89
cs_real_t meteo_uref
Definition: cs_atmo.h:200
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:1660
int nucleation_model
Definition: cs_atmo.h:158
bool frozen_gas_chem
Definition: cs_atmo.h:268
Definition: cs_atmo.h:108
void cs_atmo_init_meteo_profiles(void)
Initialize meteo profiles if no meteo file is given.
Definition: cs_atmo.c:847
cs_real_t cs_mo_psim(cs_real_t z, cs_real_t z0, cs_real_t dlmo)
Universal function psim for neutral, stable and unstable.
int squant
Definition: cs_atmo.h:113
cs_real_t meteo_t2
Definition: cs_atmo.h:216
real(c_double), pointer, save xlat
latitude of the domain origin
Definition: atincl.f90:205
int open_bcs_treatment
Definition: cs_atmo.h:143
int shour
Definition: cs_atmo.h:115
int n_species
Definition: cs_atmo.h:256
int nbmetd
Definition: cs_atmo.h:129
cs_real_t latitude
Definition: cs_atmo.h:123
#define END_C_DECLS
Definition: cs_defs.h:496
int model
Definition: cs_atmo.h:255
char * meteo_file_name
Definition: cs_atmo.h:181
Definition: cs_atmo.h:80
Definition: cs_atmo.h:68
cs_real_t domain_orientation
Definition: cs_atmo.h:138
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:1709
cs_atmo_nucleation_type_t
Definition: cs_atmo.h:76
bool init_aero_with_lib
Definition: cs_atmo.h:272
cs_real_t meteo_t1
Definition: cs_atmo.h:214
cs_real_t meteo_dlmo
Definition: cs_atmo.h:184
Definition: cs_atmo.h:91
int nbmetm
Definition: cs_atmo.h:134
cs_real_t cs_mo_psih(cs_real_t z, cs_real_t z0, cs_real_t dlmo)
Universal function psih for neutral, stable and unstable.
int distribution_model
Definition: cs_atmo.h:171
cs_real_t * hyd_p_met
Definition: cs_atmo.h:227
cs_real_t * molar_mass
Definition: cs_atmo.h:281
cs_real_t meteo_zu1
Definition: cs_atmo.h:192
cs_real_t meteo_zt1
Definition: cs_atmo.h:196
int nbmett
Definition: cs_atmo.h:131
int syear
Definition: cs_atmo.h:111
cs_real_t ssec
Definition: cs_atmo.h:119
void cs_atmo_z_ground_compute(void)
This function computes the ground elevation.
Definition: cs_atmo.c:1203
Definition: cs_atmo.h:81
void cs_atmo_finalize(void)
Deallocate arrays for atmo module.
Definition: cs_atmo.c:2135
cs_real_t meteo_angle
Definition: cs_atmo.h:210
cs_atmo_model_t
Definition: cs_atmo.h:63
cs_real_t meteo_tstar
Definition: cs_atmo.h:218
cs_real_t meteo_wstar0
Definition: cs_atmo.h:208
cs_real_t cs_mo_phih(cs_real_t z, cs_real_t dlmo)
Universal function phih for neutral, stable and unstable.
cs_real_t longitude
Definition: cs_atmo.h:121
void cs_atmo_aerosol_log_setup(void)
Print the atmospheric aerosols options to setup.log.
Definition: cs_atmo.c:2089
bool init_gas_with_lib
Definition: cs_atmo.h:270
int * chempoint
Definition: cs_atmo.h:282
void cs_atmo_compute_meteo_profiles(void)
Compute meteo profiles if no meteo file is given.
Definition: cs_atmo.c:1017
int * species_to_scalar_id
Definition: cs_atmo.h:278