9.1
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_1d_rad->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_1d_rad->nvert = 1;
at_1d_rad->nlevels = 49;//n_faces -1
at_1d_rad->nlevels_max = at_1d_rad->nlevels;
/* Complete 1-D mesh to ztop in case of radiative transfer */
if (at_1d_rad->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_1d_rad->nlevels_max)++;
}
}
cs_atmo_1d_rad_t * cs_glob_atmo_1d_rad
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
Definition: cs_atmo_1d_rad.h:52
int nlevels
Definition: cs_atmo_1d_rad.h:59
int radiative_model_1d
Definition: cs_atmo_1d_rad.h:55
int nlevels_max
Definition: cs_atmo_1d_rad.h:62
int nvert
Definition: cs_atmo_1d_rad.h:57

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 ground table of each vertical grid */
if (at_opt->ground_model != 0) {
for (int i = 0; i < at_1d_rad->nvert; i++) {
at_1d_rad->albedo0[i] = 0.25;
at_1d_rad->emissi0[i] = 0.965;
at_1d_rad->temp0 [i] = 14.77;
/* NB automatic computation of at_1d_rad->theta0 [i] */
at_1d_rad->qw0 [i] = 0.0043;
at_1d_rad->p0 [i] = 102300.;
at_1d_rad->rho0 [i] = 1.23;
}
/* Modify the ground parameters if activated */
at_opt->ground_cat_roughness[3] = 0.0012;
at_opt->ground_cat_thermal_inertia[3] = 1.7e-5;
at_opt->ground_cat_thermal_roughness[3] = 0.0012;
}
/* Example: define 1-D radiative transfer mesh for
* the atmospheric module */
/*-----------------------------------------------------------------*/
if (at_1d_rad->radiative_model_1d > 0) {
at_1d_rad->zq[0 ] = 0.;
at_1d_rad->zq[1 ] = 10.;
at_1d_rad->zq[2 ] = 31.;
at_1d_rad->zq[3 ] = 53.;
at_1d_rad->zq[4 ] = 77.;
at_1d_rad->zq[5 ] = 102.;
at_1d_rad->zq[6 ] = 128.;
at_1d_rad->zq[7 ] = 156.;
at_1d_rad->zq[8 ] = 185.;
at_1d_rad->zq[9 ] = 214.;
at_1d_rad->zq[10] = 246.;
at_1d_rad->zq[11] = 278.;
at_1d_rad->zq[12] = 311.;
at_1d_rad->zq[13] = 346.;
at_1d_rad->zq[14] = 381.;
at_1d_rad->zq[15] = 417.;
at_1d_rad->zq[16] = 454.;
at_1d_rad->zq[17] = 493.;
at_1d_rad->zq[18] = 531.;
at_1d_rad->zq[19] = 571.;
at_1d_rad->zq[20] = 612.;
at_1d_rad->zq[21] = 653.;
at_1d_rad->zq[22] = 695.;
at_1d_rad->zq[23] = 737.;
at_1d_rad->zq[24] = 781.;
at_1d_rad->zq[25] = 824.;
at_1d_rad->zq[26] = 869.;
at_1d_rad->zq[27] = 914.;
at_1d_rad->zq[28] = 959.;
at_1d_rad->zq[29] = 1005.;
at_1d_rad->zq[30] = 1051.;
at_1d_rad->zq[31] = 1098.;
at_1d_rad->zq[32] = 1146.;
at_1d_rad->zq[33] = 1193.;
at_1d_rad->zq[34] = 1241.;
at_1d_rad->zq[35] = 1290.;
at_1d_rad->zq[36] = 1339.;
at_1d_rad->zq[37] = 1388.;
at_1d_rad->zq[38] = 1438.;
at_1d_rad->zq[39] = 1487.;
at_1d_rad->zq[40] = 1538.;
at_1d_rad->zq[41] = 1588.;
at_1d_rad->zq[42] = 1639.;
at_1d_rad->zq[43] = 1690.;
at_1d_rad->zq[44] = 1741.;
at_1d_rad->zq[45] = 1793.;
at_1d_rad->zq[46] = 1844.;
at_1d_rad->zq[47] = 1896.;
at_1d_rad->zq[48] = 1949.;
at_1d_rad->zq[49] = 2001.;
/* Complete 1-D mesh to ztop in case of radiative transfer */
if (at_1d_rad->nvert > 0) {
int i = at_1d_rad->nlevels;
cs_real_t zvmax = 2001.;/* 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_1d_rad->zq[i] = zzmax;
bft_printf("Atmo, rad 1D zq[%d]=%f\n", i+1, at_1d_rad->zq[i]);
}
}
}
/* Initialize position of each vertical */
for (int i = 0; i < at_1d_rad->nvert; i++) {
at_1d_rad->xy[0 * at_1d_rad->nvert + i] = 50.; /* X coord */
at_1d_rad->xy[1 * at_1d_rad->nvert + i] = 50.; /* Y coord */
at_1d_rad->xy[2 * at_1d_rad->nvert + i] = 1.; /* kmin in case of
non-flat terrain */
}
int bft_printf(const char *const format,...)
Replacement for printf() with modifiable behavior.
Definition: bft_printf.cpp:140
cs_atmo_option_t * cs_glob_atmo_option
cs_real_t * rho0
Definition: cs_atmo_1d_rad.h:130
cs_real_t * emissi0
Definition: cs_atmo_1d_rad.h:120
cs_real_t * zq
Definition: cs_atmo_1d_rad.h:92
cs_real_t * qw0
Definition: cs_atmo_1d_rad.h:126
cs_real_t * xy
Definition: cs_atmo_1d_rad.h:67
cs_real_t * temp0
Definition: cs_atmo_1d_rad.h:122
cs_real_t * p0
Definition: cs_atmo_1d_rad.h:128
cs_real_t * albedo0
Definition: cs_atmo_1d_rad.h:118
Definition: cs_atmo.h:149
int ground_model
Definition: cs_atmo.h:364
cs_real_t * ground_cat_roughness
Definition: cs_atmo.h:402
cs_real_t * ground_cat_thermal_roughness
Definition: cs_atmo.h:404
cs_real_t * ground_cat_thermal_inertia
Definition: cs_atmo.h:400

Data Entry for the atmospheric ground model

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

at_opt->ground_model = 1; /* Switch on ground model */
/* Set the number of predefined categories (+1 which is the default one)
* among:
* - CS_ATMO_GROUND_5_CAT
* - CS_ATMO_GROUND_7_CAT
* */
at_opt->ground_cat= CS_ATMO_GROUND_5_CAT; /* Switch on ground model */
/* Specify the boundary zone which is modeled */
@ CS_ATMO_GROUND_5_CAT
Definition: cs_atmo.h:95
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:716
cs_atmo_ground_cat_t ground_cat
Definition: cs_atmo.h:369
int ground_zone_id
Definition: cs_atmo.h:371
int id
Definition: cs_zone.h:59

Initialization of atmospheric

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

const cs_zone_t *z
cs_field_t *f = cs_field_by_name("atmo_ground_percentages");
for (cs_lnum_t elt_id = 0; elt_id < z->n_elts; elt_id++) {
for (cs_lnum_t ground_id = 0; ground_id < f->dim; ground_id++)
f->val[ground_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:692
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
cs_field_t * cs_field_by_name(const char *name)
Return a pointer to a field based on its name.
Definition: cs_field.cpp:2371
Field descriptor.
Definition: cs_field.h:156
cs_real_t * val
Definition: cs_field.h:177
int dim
Definition: cs_field.h:163
Definition: cs_zone.h:55
cs_lnum_t n_elts
Definition: cs_zone.h:64