9.0
general documentation
Loading...
Searching...
No Matches
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;
/* 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)++;
}
}

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 */
}

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 */

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:

if (cs_glob_atmo_option->soil_zone_id > -1) {
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.;
}
}