1 #ifndef ERF_IBSEB_PARAMS_H
2 #define ERF_IBSEB_PARAMS_H
4 #include <AMReX_ParmParse.H>
5 #include <AMReX_REAL.H>
167 amrex::ParmParse
pp(
"erf.ibseb");
221 pp.query(
"z_i",
z_i);
226 amrex::Abort(
"erf.ibseb.radiation must be \"prescribed\" or \"two_stream\"");
233 for (
const char* k : {
"sw_direct_normal",
"sw_diffuse",
"sw_transmission",
"sw_diffuse_coeff",
234 "solar_constant",
"albedo_ground"}) {
235 if (
pp.contains(k)) {
236 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.radiation = two_stream:"
237 " the faces take the two-stream columns' irradiances and the ground's reflection;"
243 amrex::Abort(
"erf.ibseb.sun_mode must be \"fixed\", \"solar\" or \"two_stream\"");
247 for (
const char* k : {
"latitude_deg",
"longitude_deg",
"day_of_year",
"time_zero_utc_s",
"solar_constant",
248 "sun_zenith_deg",
"sun_azimuth_deg",
"sw_direct_normal",
"sw_diffuse"}) {
249 if (
pp.contains(k)) {
250 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.sun_mode = two_stream:"
251 " the faces take the two-stream sun (start_datetime, erf.rad_cons_lat / lon,"
252 " erf.fixed_total_solar_irradiance); remove it");
256 if (sun_zenith_deg < 0.0 || sun_zenith_deg > 180.0) { amrex::Abort(
"erf.ibseb.sun_zenith_deg must be in [0, 180]"); }
257 if (latitude_deg < -90.0 || latitude_deg > 90.0) { amrex::Abort(
"erf.ibseb.latitude_deg must be in [-90, 90]"); }
258 if (longitude_deg < -180.0 || longitude_deg > 180.0) { amrex::Abort(
"erf.ibseb.longitude_deg must be in [-180, 180]"); }
259 if (day_of_year < 1.0 || day_of_year > 366.0) { amrex::Abort(
"erf.ibseb.day_of_year must be in [1, 366]"); }
262 if (
pp.contains(
"utc_offset_hours")) {
263 amrex::Abort(
"erf.ibseb.utc_offset_hours is not an input: the sun follows time_zero_utc_s (UTC) and longitude_deg; remove it");
266 if (sw_transmission <= 0.0 || sw_transmission > 1.0) { amrex::Abort(
"erf.ibseb.sw_transmission must be in (0, 1]"); }
267 if (albedo < 0.0 || albedo > 1.0 || albedo_ground < 0.0 || albedo_ground > 1.0) {
268 amrex::Abort(
"erf.ibseb.albedo and albedo_ground must be in [0, 1]");
270 if (emissivity <= 0.0 || emissivity > 1.0 || emissivity_ground <= 0.0 || emissivity_ground > 1.0 ||
271 sky_emissivity <= 0.0 || sky_emissivity > 1.0) {
272 amrex::Abort(
"erf.ibseb emissivities must be in (0, 1]");
274 if (
view_n_az < 1 ||
view_n_el < 1) { amrex::Abort(
"erf.ibseb.view_n_az and view_n_el must be >= 1"); }
276 amrex::Abort(
"erf.ibseb.lw_mode must be \"fixed\", \"gray\" or \"two_stream\"");
279 amrex::Abort(
"erf.ibseb.lw_mode = two_stream needs erf.ibseb.radiation = two_stream");
282 for (
const char* k : {
"lw_down",
"sky_emissivity",
"T_ground",
"emissivity_ground"}) {
283 if (
pp.contains(k)) {
284 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.lw_mode = two_stream:"
285 " the faces take the two-stream columns' longwave down and the ground's longwave up;"
290 if (
lw_down < 0.0 ||
T_ground <= 0.0) { amrex::Abort(
"erf.ibseb.lw_down must be >= 0 and T_ground > 0"); }
291 if (
z0_wall <= 0.0 ||
z0h_wall <= 0.0) { amrex::Abort(
"erf.ibseb.z0_wall and z0h_wall must be positive [m]"); }
292 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"); }
293 if (
n_slab_layers > 32) { amrex::Abort(
"erf.ibseb.n_slab_layers must be <= 32 (the slab kernels keep their layers on the stack)"); }
294 if (
n_slab_layers < 1) { amrex::Abort(
"erf.ibseb.n_slab_layers must be >= 1"); }
296 amrex::Abort(
"erf.ibseb.T_skin_init and T_interior must be positive [K]");
299 amrex::Abort(
"erf.ibseb.T_skin_min must be positive and below T_skin_max");
302 amrex::Abort(
"erf.ibseb.T_skin_init must lie within [T_skin_min, T_skin_max]");
305 amrex::Abort(
"erf.ibseb.newton_max_iter must be >= 1, newton_tol_K and newton_max_step_K positive");
307 if (
Q_ext_uniform < 0.0) { amrex::Abort(
"erf.ibseb.Q_ext_uniform must be >= 0"); }
308 if (
obukhov_seed !=
"ground" &&
obukhov_seed !=
"neutral") { amrex::Abort(
"erf.ibseb.obukhov_seed must be \"ground\" or \"neutral\""); }
310 amrex::Abort(
"erf.ibseb.convective_velocity must be \"none\" or \"deardorff\"");
313 amrex::Abort(
"erf.ibseb.z_i_mode must be \"bulk_ri\", \"pblh\" or \"fixed\"");
315 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"); }
316 if (obukhov_relax <= 0.0 || obukhov_relax > 1.0) { amrex::Abort(
"erf.ibseb.obukhov_relax must be in (0, 1]"); }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_IBSEBParams.H:25
amrex::Real newton_max_step_K
Largest Newton step [K].
Definition: ERF_IBSEBParams.H:134
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:151
amrex::Real T_ground
Ground temperature for the ground term [K].
Definition: ERF_IBSEBParams.H:90
amrex::Real Q_ext_uniform
Uniform external incident flux on every face [W/m2] (test hook)
Definition: ERF_IBSEBParams.H:135
amrex::Real day_of_year
solar: day of year
Definition: ERF_IBSEBParams.H:63
bool prognostic
Definition: ERF_IBSEBParams.H:129
int material_default
Definition: ERF_IBSEBParams.H:115
amrex::Real newton_tol_K
Newton stops when a step changes T_skin by less than this [K].
Definition: ERF_IBSEBParams.H:133
amrex::Real obukhov_relax
Under-relaxation of the roof's u*, theta* iteration (1 = none), as erf-model #3486.
Definition: ERF_IBSEBParams.H:156
amrex::Real z0_wall
Momentum roughness of the faces [m].
Definition: ERF_IBSEBParams.H:100
amrex::Real k_therm
Uniform conductivity [W/m/K].
Definition: ERF_IBSEBParams.H:117
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:118
std::string z_i_mode
"bulk_ri", "pblh" or "fixed"
Definition: ERF_IBSEBParams.H:153
amrex::Real thickness
Uniform slab thickness [m].
Definition: ERF_IBSEBParams.H:119
std::string material_file
Definition: ERF_IBSEBParams.H:114
int view_n_az
Definition: ERF_IBSEBParams.H:77
amrex::Real sky_emissivity
gray: effective clear-sky emissivity
Definition: ERF_IBSEBParams.H:89
bool couple_heat
Add the face flux to the temperature equation.
Definition: ERF_IBSEBParams.H:103
amrex::Real ri_crit
Critical bulk Richardson number of the diagnostic.
Definition: ERF_IBSEBParams.H:155
amrex::Real longitude_deg
solar: site longitude, east positive
Definition: ERF_IBSEBParams.H:62
int view_n_el
Definition: ERF_IBSEBParams.H:78
std::vector< int > material_by_building
Definition: ERF_IBSEBParams.H:116
std::string lw_mode
Definition: ERF_IBSEBParams.H:87
amrex::Real albedo_ground
Ground albedo for the reflected diffuse term.
Definition: ERF_IBSEBParams.H:70
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:72
void init_params()
Definition: ERF_IBSEBParams.H:165
std::string radiation
Definition: ERF_IBSEBParams.H:46
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:152
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:69
amrex::Real T_skin_min
Lower bound of the skin temperature [K].
Definition: ERF_IBSEBParams.H:130
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:88
amrex::Real z_i
Fixed mixed-layer depth [m] (z_i_mode = fixed, and the fallback)
Definition: ERF_IBSEBParams.H:154
amrex::Real z0h_wall
Heat roughness of the faces [m].
Definition: ERF_IBSEBParams.H:101
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:102
amrex::Real T_skin_init
Initial skin temperature [K].
Definition: ERF_IBSEBParams.H:28
amrex::Real latitude_deg
solar: site latitude, north positive
Definition: ERF_IBSEBParams.H:61
std::string obukhov_seed
"ground" or "neutral"
Definition: ERF_IBSEBParams.H:150
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:131
amrex::Real emissivity
Face longwave emissivity.
Definition: ERF_IBSEBParams.H:71
int newton_max_iter
Newton iteration cap per face and step.
Definition: ERF_IBSEBParams.H:132