8.3
general documentation
Atmospheric model

Introduction

User functions for the atmospheric model.

Atmospheric definition

Activate 1-D radiative transfer model

Is define in cs_user_model function

/* Activate 1-D radiative transfer model */
at_opt->radiative_model_1d = 1;
/* Specify the number of verticals and the number of levels.
* The mesh levels can be specified in cs_user_parameters function.
* */
at_opt->rad_1d_nvert = 1;
at_opt->rad_1d_nlevels = 50;
at_opt->rad_1d_nlevels_max = at_opt->rad_1d_nlevels;
/* Complete 1-D mesh to ztop in case of radiative transfer */
if (at_opt->rad_1d_nvert > 0) {
cs_real_t zvmax = 1975.;/* top of the domain */
cs_real_t ztop = 11000.;/* top of the troposphere */
for (cs_real_t zzmax = (((int) zvmax)/1000)*1000.;
zzmax <= (ztop -1000);
zzmax += 1000.) {
(at_opt->rad_1d_nlevels_max)++;
}
}
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342

define 1-D radiative transfer mesh

Is define in cs_user_parameters function

/* Example: define 1-D radiative transfer mesh for
* the atmospheric module */
/*-----------------------------------------------------------------*/
/* Initializing the soil table of each vertical grid */
if (at_opt->soil_model != 0) {
for (int i = 0; i < at_opt->rad_1d_nvert; i++) {
at_opt->rad_1d_albedo0[i] = 0.25;
at_opt->rad_1d_emissi0[i] = 0.965;
at_opt->rad_1d_temp0 [i] = 14.77;
/* NB automatic computation of at_opt->rad_1d_theta0 [i] */
at_opt->rad_1d_qw0 [i] = 0.0043;
at_opt->rad_1d_p0 [i] = 102300.;
at_opt->rad_1d_rho0 [i] = 1.23;
}
/* Modify the soil parameters if activated */
at_opt->soil_cat_roughness[3] = 0.0012;
at_opt->soil_cat_thermal_inertia[3] = 1.7e-5;
at_opt->soil_cat_thermal_roughness[3] = 0.0012;
}
at_opt->rad_1d_z[0 ] = 0.;
at_opt->rad_1d_z[1 ] = 5.;
at_opt->rad_1d_z[2 ] = 20.5;
at_opt->rad_1d_z[3 ] = 42.0;
at_opt->rad_1d_z[4 ] = 65.0;
at_opt->rad_1d_z[5 ] = 89.5;
at_opt->rad_1d_z[6 ] = 115.0;
at_opt->rad_1d_z[7 ] = 142.0;
at_opt->rad_1d_z[8 ] = 170.5;
at_opt->rad_1d_z[9 ] = 199.5;
at_opt->rad_1d_z[10] = 230.0;
at_opt->rad_1d_z[11] = 262.0;
at_opt->rad_1d_z[12] = 294.5;
at_opt->rad_1d_z[13] = 328.5;
at_opt->rad_1d_z[14] = 363.5;
at_opt->rad_1d_z[15] = 399.0;
at_opt->rad_1d_z[16] = 435.5;
at_opt->rad_1d_z[17] = 473.5;
at_opt->rad_1d_z[18] = 512.0;
at_opt->rad_1d_z[19] = 551.0;
at_opt->rad_1d_z[20] = 591.5;
at_opt->rad_1d_z[21] = 632.5;
at_opt->rad_1d_z[22] = 674.0;
at_opt->rad_1d_z[23] = 716.0;
at_opt->rad_1d_z[24] = 759.0;
at_opt->rad_1d_z[25] = 802.5;
at_opt->rad_1d_z[26] = 846.5;
at_opt->rad_1d_z[27] = 891.5;
at_opt->rad_1d_z[28] = 936.5;
at_opt->rad_1d_z[29] = 982.0;
at_opt->rad_1d_z[30] = 1028.0;
at_opt->rad_1d_z[31] = 1074.5;
at_opt->rad_1d_z[32] = 1122.0;
at_opt->rad_1d_z[33] = 1169.5;
at_opt->rad_1d_z[34] = 1217.0;
at_opt->rad_1d_z[35] = 1265.5;
at_opt->rad_1d_z[36] = 1314.5;
at_opt->rad_1d_z[37] = 1363.5;
at_opt->rad_1d_z[38] = 1413.0;
at_opt->rad_1d_z[39] = 1462.5;
at_opt->rad_1d_z[40] = 1512.5;
at_opt->rad_1d_z[41] = 1563.0;
at_opt->rad_1d_z[42] = 1613.5;
at_opt->rad_1d_z[43] = 1664.5;
at_opt->rad_1d_z[44] = 1715.5;
at_opt->rad_1d_z[45] = 1767.0;
at_opt->rad_1d_z[46] = 1818.5;
at_opt->rad_1d_z[47] = 1870.0;
at_opt->rad_1d_z[48] = 1922.5;
at_opt->rad_1d_z[49] = 1975.0;
/* Complete 1-D mesh to ztop in case of radiative transfer */
if (at_opt->rad_1d_nvert > 0) {
int i = at_opt->rad_1d_nlevels;
cs_real_t zvmax = 1975.;/* top of the domain */
cs_real_t ztop = 11000.;/* top of the troposphere */
for (cs_real_t zzmax = (((int) zvmax)/1000)*1000.;
zzmax <= (ztop -1000);
i++) {
zzmax += 1000.;
at_opt->rad_1d_z[i] = zzmax;
}
}
/* Initialize position of each vertical */
for (int i = 0; i < at_opt->rad_1d_nvert; i++) {
at_opt->rad_1d_xy[0 * at_opt->rad_1d_nvert + i] = 50.; /* X coord */
at_opt->rad_1d_xy[1 * at_opt->rad_1d_nvert + i] = 50.; /* Y coord */
at_opt->rad_1d_xy[2 * at_opt->rad_1d_nvert + i] = 1.; /* kmin in case of
non-flat terrain */
}
cs_atmo_option_t * cs_glob_atmo_option
Definition: cs_atmo.h:143
cs_real_t * rad_1d_qw0
Definition: cs_atmo.h:257
cs_real_t * rad_1d_p0
Definition: cs_atmo.h:259
cs_real_t * soil_cat_thermal_inertia
Definition: cs_atmo.h:461
cs_real_t * rad_1d_emissi0
Definition: cs_atmo.h:251
cs_real_t * rad_1d_temp0
Definition: cs_atmo.h:253
cs_real_t * rad_1d_rho0
Definition: cs_atmo.h:261
cs_real_t * rad_1d_albedo0
Definition: cs_atmo.h:249
cs_real_t * soil_cat_thermal_roughness
Definition: cs_atmo.h:465
int soil_model
Definition: cs_atmo.h:425
cs_real_t * rad_1d_z
Definition: cs_atmo.h:200
cs_real_t * rad_1d_xy
Definition: cs_atmo.h:197
int rad_1d_nvert
Definition: cs_atmo.h:187
cs_real_t * soil_cat_roughness
Definition: cs_atmo.h:463
int rad_1d_nlevels
Definition: cs_atmo.h:189

Data Entry for the atmospheric soil model

To activate the model, the user has to set the and to specify the zone id on which the soil model is applied in cs_user_parameters.cpp, routine cs_user_model:

at_opt->soil_model = 1; /* Switch on soil model */
/* Set the number of predefined categories (+1 which is the default one)
* among:
* - CS_ATMO_SOIL_5_CAT
* - CS_ATMO_SOIL_7_CAT
* */
at_opt->soil_cat= CS_ATMO_SOIL_5_CAT; /* Switch on soil model */
/* Specify the boundary zone which is modeled */
@ CS_ATMO_SOIL_5_CAT
Definition: cs_atmo.h:106
const cs_zone_t * cs_boundary_zone_by_name(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.cpp:711
int soil_zone_id
Definition: cs_atmo.h:432
cs_atmo_soil_cat_t soil_cat
Definition: cs_atmo.h:430
int id
Definition: cs_zone.h:59

Then the user may change default coefficient values for soil categories in cs_user_parameters.cpp

Initialization of atmospheric

The user has to specify the percentage of each categories for all faces of the soil zone in cs_user_initialization.cpp:

const cs_zone_t *z
cs_field_t *f = cs_field_by_name("atmo_soil_percentages");
for (cs_lnum_t elt_id = 0; elt_id < z->n_elts; elt_id++) {
for (cs_lnum_t soil_id = 0; soil_id < f->dim; soil_id++)
f->val[soil_id + f->dim * elt_id] = 0.;
/* 100% of mineral */
f->val[4 + f->dim * elt_id] = 100.;
}
}
const cs_zone_t * cs_boundary_zone_by_id(int id)
Return a pointer to a boundary zone based on its id.
Definition: cs_boundary_zone.cpp:687
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
cs_field_t * cs_field_by_name(const char *name)
Return a pointer to a field based on its name.
Definition: cs_field.cpp:2489
Field descriptor.
Definition: cs_field.h:131
cs_real_t * val
Definition: cs_field.h:152
int dim
Definition: cs_field.h:138
Definition: cs_zone.h:55
cs_lnum_t n_elts
Definition: cs_zone.h:64