1 #ifndef ERF_IBSEB_PARAMS_H
2 #define ERF_IBSEB_PARAMS_H
4 #include <AMReX_ParmParse.H>
5 #include <AMReX_REAL.H>
210 amrex::ParmParse
pp(
"erf.ibseb");
271 pp.query(
"z_i",
z_i);
276 amrex::Abort(
"erf.ibseb.radiation must be \"prescribed\" or \"two_stream\"");
283 for (
const char* k : {
"sw_direct_normal",
"sw_diffuse",
"sw_transmission",
"sw_diffuse_coeff",
284 "solar_constant",
"albedo_ground"}) {
285 if (
pp.contains(k)) {
286 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.radiation = two_stream:"
287 " the faces take the two-stream columns' irradiances and the ground's reflection;"
293 amrex::Abort(
"erf.ibseb.sun_mode must be \"fixed\", \"solar\" or \"two_stream\"");
297 for (
const char* k : {
"latitude_deg",
"longitude_deg",
"day_of_year",
"time_zero_utc_s",
"solar_constant",
298 "sun_zenith_deg",
"sun_azimuth_deg",
"sw_direct_normal",
"sw_diffuse"}) {
299 if (
pp.contains(k)) {
300 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.sun_mode = two_stream:"
301 " the faces take the two-stream sun (start_datetime, erf.rad_cons_lat / lon,"
302 " erf.fixed_total_solar_irradiance); remove it");
306 if (sun_zenith_deg < 0.0 || sun_zenith_deg > 180.0) { amrex::Abort(
"erf.ibseb.sun_zenith_deg must be in [0, 180]"); }
307 if (latitude_deg < -90.0 || latitude_deg > 90.0) { amrex::Abort(
"erf.ibseb.latitude_deg must be in [-90, 90]"); }
308 if (longitude_deg < -180.0 || longitude_deg > 180.0) { amrex::Abort(
"erf.ibseb.longitude_deg must be in [-180, 180]"); }
309 if (day_of_year < 1.0 || day_of_year > 366.0) { amrex::Abort(
"erf.ibseb.day_of_year must be in [1, 366]"); }
312 if (
pp.contains(
"utc_offset_hours")) {
313 amrex::Abort(
"erf.ibseb.utc_offset_hours is not an input: the sun follows time_zero_utc_s (UTC) and longitude_deg; remove it");
316 if (sw_transmission <= 0.0 || sw_transmission > 1.0) { amrex::Abort(
"erf.ibseb.sw_transmission must be in (0, 1]"); }
317 if (sw_diffuse_coeff < 0.0 || sw_diffuse_coeff > 1.0) { amrex::Abort(
"erf.ibseb.sw_diffuse_coeff must be in [0, 1]"); }
318 if (
solar_constant <= 0.0) { amrex::Abort(
"erf.ibseb.solar_constant must be > 0"); }
319 if (sun_min_elev_deg <= 0.0 || sun_min_elev_deg >= 90.0) {
320 amrex::Abort(
"erf.ibseb.sun_min_elev_deg must be in (0, 90) [deg]");
322 if (albedo < 0.0 || albedo > 1.0 || albedo_ground < 0.0 || albedo_ground > 1.0) {
323 amrex::Abort(
"erf.ibseb.albedo and albedo_ground must be in [0, 1]");
325 if (emissivity <= 0.0 || emissivity > 1.0 || emissivity_ground <= 0.0 || emissivity_ground > 1.0 ||
326 sky_emissivity <= 0.0 || sky_emissivity > 1.0) {
327 amrex::Abort(
"erf.ibseb emissivities must be in (0, 1]");
329 if (
view_n_az < 1 ||
view_n_el < 1) { amrex::Abort(
"erf.ibseb.view_n_az and view_n_el must be >= 1"); }
331 amrex::Abort(
"erf.ibseb.lw_mode must be \"fixed\", \"gray\" or \"two_stream\"");
334 amrex::Abort(
"erf.ibseb.lw_mode = two_stream needs erf.ibseb.radiation = two_stream");
337 for (
const char* k : {
"lw_down",
"sky_emissivity",
"T_ground",
"emissivity_ground"}) {
338 if (
pp.contains(k)) {
339 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.lw_mode = two_stream:"
340 " the faces take the two-stream columns' longwave down and the ground's longwave up;"
345 if (
lw_down < 0.0 ||
T_ground <= 0.0) { amrex::Abort(
"erf.ibseb.lw_down must be >= 0 and T_ground > 0"); }
346 if (
z0_wall <= 0.0 ||
z0h_wall <= 0.0) { amrex::Abort(
"erf.ibseb.z0_wall and z0h_wall must be positive [m]"); }
347 if (
k_therm <= 0.0 ||
rho_cp <= 0.0 ||
thickness <= 0.0) { amrex::Abort(
"erf.ibseb.k_therm, rho_cp and thickness must be positive"); }
348 if (
n_slab_layers > 32) { amrex::Abort(
"erf.ibseb.n_slab_layers must be <= 32 (the slab kernels keep their layers on the stack)"); }
349 if (
n_slab_layers < 1) { amrex::Abort(
"erf.ibseb.n_slab_layers must be >= 1"); }
351 amrex::Abort(
"erf.ibseb.T_skin_init and T_interior must be positive [K]");
354 amrex::Abort(
"erf.ibseb.T_skin_min must be positive and below T_skin_max");
357 amrex::Abort(
"erf.ibseb.T_skin_init must lie within [T_skin_min, T_skin_max]");
360 amrex::Abort(
"erf.ibseb.newton_max_iter must be >= 1, newton_tol_K and newton_max_step_K positive");
362 if (
Q_ext_uniform < 0.0) { amrex::Abort(
"erf.ibseb.Q_ext_uniform must be >= 0"); }
363 if (
obukhov_seed !=
"ground" &&
obukhov_seed !=
"neutral") { amrex::Abort(
"erf.ibseb.obukhov_seed must be \"ground\" or \"neutral\""); }
365 amrex::Abort(
"erf.ibseb.convective_velocity must be \"none\" or \"deardorff\"");
368 amrex::Abort(
"erf.ibseb.z_i_mode must be \"bulk_ri\", \"pblh\" or \"fixed\"");
370 if (
beta_conv <= 0.0 ||
z_i <= 0.0 ||
ri_crit <= 0.0) { amrex::Abort(
"erf.ibseb.beta_conv, z_i and ri_crit must be positive"); }
371 if (obukhov_relax <= 0.0 || obukhov_relax > 1.0) { amrex::Abort(
"erf.ibseb.obukhov_relax must be in (0, 1]"); }
373 amrex::Abort(
"erf.ibseb.stability_scheme must be \"iterative\" or \"louis\"");
376 amrex::Abort(
"erf.ibseb.stability_scheme selects the roofs' stability correction; set erf.ibseb.stability_correction = true or remove it");
378 if (
stability_scheme ==
"louis" && (
pp.contains(
"obukhov_seed") ||
pp.contains(
"obukhov_relax"))) {
379 amrex::Abort(
"erf.ibseb.obukhov_seed and obukhov_relax belong to stability_scheme = \"iterative\"; remove them with \"louis\"");
Definition: ERF_IBSEBParams.H:25
amrex::Real newton_max_step_K
Largest Newton step [K].
Definition: ERF_IBSEBParams.H:177
std::string csv_file
Per-building report.
Definition: ERF_IBSEBParams.H:30
amrex::Real T_interior
Interior (deep) temperature [K].
Definition: ERF_IBSEBParams.H:29
std::string sun_mode
Definition: ERF_IBSEBParams.H:56
std::string convective_velocity
"none" or "deardorff"
Definition: ERF_IBSEBParams.H:194
std::string stability_scheme
"iterative" or "louis" (with stability_correction)
Definition: ERF_IBSEBParams.H:145
amrex::Real T_ground
Ground temperature for the ground term [K].
Definition: ERF_IBSEBParams.H:129
amrex::Real Q_ext_uniform
Uniform external incident flux on every face [W/m2] (test hook)
Definition: ERF_IBSEBParams.H:178
amrex::Real day_of_year
solar: day of year
Definition: ERF_IBSEBParams.H:63
bool prognostic
Definition: ERF_IBSEBParams.H:172
int material_default
Definition: ERF_IBSEBParams.H:158
bool two_stream_buildings
Definition: ERF_IBSEBParams.H:125
amrex::Real newton_tol_K
Newton stops when a step changes T_skin by less than this [K].
Definition: ERF_IBSEBParams.H:176
amrex::Real obukhov_relax
Under-relaxation of the roof's u*, theta* iteration (1 = none), as erf-model #3486.
Definition: ERF_IBSEBParams.H:199
amrex::Real z0_wall
Momentum roughness of the faces [m].
Definition: ERF_IBSEBParams.H:142
amrex::Real k_therm
Uniform conductivity [W/m/K].
Definition: ERF_IBSEBParams.H:160
amrex::Real sw_transmission
solar, two_stream: bulk clear-sky transmission (Bird)
Definition: ERF_IBSEBParams.H:66
bool enable
Master switch.
Definition: ERF_IBSEBParams.H:26
int n_slab_layers
Conduction layers per face.
Definition: ERF_IBSEBParams.H:27
amrex::Real rho_cp
Uniform volumetric heat capacity [J/m3/K].
Definition: ERF_IBSEBParams.H:161
std::string z_i_mode
"bulk_ri", "pblh" or "fixed"
Definition: ERF_IBSEBParams.H:196
amrex::Real thickness
Uniform slab thickness [m].
Definition: ERF_IBSEBParams.H:162
std::string material_file
Definition: ERF_IBSEBParams.H:157
int view_n_az
Definition: ERF_IBSEBParams.H:104
amrex::Real sky_emissivity
gray: effective clear-sky emissivity
Definition: ERF_IBSEBParams.H:128
amrex::Real sun_min_elev_deg
Definition: ERF_IBSEBParams.H:75
bool couple_heat
Add the face flux to the temperature equation.
Definition: ERF_IBSEBParams.H:146
amrex::Real ri_crit
Critical bulk Richardson number of the diagnostic.
Definition: ERF_IBSEBParams.H:198
amrex::Real longitude_deg
solar: site longitude, east positive
Definition: ERF_IBSEBParams.H:62
int view_n_el
Definition: ERF_IBSEBParams.H:105
std::vector< int > material_by_building
Definition: ERF_IBSEBParams.H:159
std::string lw_mode
Definition: ERF_IBSEBParams.H:114
amrex::Real albedo_ground
Ground albedo for the reflected diffuse term.
Definition: ERF_IBSEBParams.H:78
bool dump_faces_tag_step
Name each dump by its step (keeps every one) instead of overwriting.
Definition: ERF_IBSEBParams.H:34
amrex::Real emissivity_ground
Ground emissivity for the ground term.
Definition: ERF_IBSEBParams.H:80
void init_params()
Definition: ERF_IBSEBParams.H:208
std::string radiation
Definition: ERF_IBSEBParams.H:46
bool ground_view_shadow
Definition: ERF_IBSEBParams.H:89
int csv_int
Steps between report rows; <= 0 disables.
Definition: ERF_IBSEBParams.H:31
amrex::Real beta_conv
Gustiness factor on w*.
Definition: ERF_IBSEBParams.H:195
bool debug
[IBSEB DEBUG] prints: set description at build, per-step summary, per-building rows
Definition: ERF_IBSEBParams.H:32
amrex::Real solar_constant
solar: [W/m2]
Definition: ERF_IBSEBParams.H:65
amrex::Real sw_direct_normal
fixed: direct-normal irradiance [W/m2]
Definition: ERF_IBSEBParams.H:59
std::string dump_faces_file
Per-rank face dump at report time (empty = off); a refined level N adds ".levN".
Definition: ERF_IBSEBParams.H:33
amrex::Real albedo
Face shortwave albedo.
Definition: ERF_IBSEBParams.H:77
bool ground_sky_view
Definition: ERF_IBSEBParams.H:94
amrex::Real T_skin_min
Lower bound of the skin temperature [K].
Definition: ERF_IBSEBParams.H:173
amrex::Real time_zero_utc_s
solar: seconds after 00:00 UTC at simulation time zero (the sun follows UTC and the longitude)
Definition: ERF_IBSEBParams.H:64
amrex::Real sun_zenith_deg
fixed: zenith angle [deg]
Definition: ERF_IBSEBParams.H:57
amrex::Real lw_down
fixed: sky longwave [W/m2]
Definition: ERF_IBSEBParams.H:127
amrex::Real z_i
Fixed mixed-layer depth [m] (z_i_mode = fixed, and the fallback)
Definition: ERF_IBSEBParams.H:197
amrex::Real z0h_wall
Heat roughness of the faces [m].
Definition: ERF_IBSEBParams.H:143
amrex::Real sw_diffuse
fixed: diffuse irradiance on a horizontal surface [W/m2]
Definition: ERF_IBSEBParams.H:60
amrex::Real sun_azimuth_deg
fixed: azimuth clockwise from north [deg]; 180 = sun in the south
Definition: ERF_IBSEBParams.H:58
bool stability_correction
Definition: ERF_IBSEBParams.H:144
amrex::Real T_skin_init
Initial skin temperature [K].
Definition: ERF_IBSEBParams.H:28
bool two_stream_buildings_given
Whether the deck sets it (start-up checks)
Definition: ERF_IBSEBParams.H:126
amrex::Real latitude_deg
solar: site latitude, north positive
Definition: ERF_IBSEBParams.H:61
bool two_stream_roofs
Definition: ERF_IBSEBParams.H:99
std::string obukhov_seed
"ground" or "neutral"
Definition: ERF_IBSEBParams.H:193
amrex::Real sw_diffuse_coeff
solar, two_stream: share of the attenuated beam that arrives as diffuse light
Definition: ERF_IBSEBParams.H:67
amrex::Real T_skin_max
Upper bound [K]; raise it for faces under a fire.
Definition: ERF_IBSEBParams.H:174
amrex::Real emissivity
Face longwave emissivity.
Definition: ERF_IBSEBParams.H:79
int newton_max_iter
Newton iteration cap per face and step.
Definition: ERF_IBSEBParams.H:175