1 #ifndef ERF_IBSEB_PARAMS_H
2 #define ERF_IBSEB_PARAMS_H
4 #include <AMReX_ParmParse.H>
5 #include <AMReX_REAL.H>
175 amrex::ParmParse
pp(
"erf.ibseb");
230 pp.query(
"z_i",
z_i);
235 amrex::Abort(
"erf.ibseb.radiation must be \"prescribed\" or \"two_stream\"");
242 for (
const char* k : {
"sw_direct_normal",
"sw_diffuse",
"sw_transmission",
"sw_diffuse_coeff",
243 "solar_constant",
"albedo_ground"}) {
244 if (
pp.contains(k)) {
245 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.radiation = two_stream:"
246 " the faces take the two-stream columns' irradiances and the ground's reflection;"
252 amrex::Abort(
"erf.ibseb.sun_mode must be \"fixed\", \"solar\" or \"two_stream\"");
256 for (
const char* k : {
"latitude_deg",
"longitude_deg",
"day_of_year",
"time_zero_utc_s",
"solar_constant",
257 "sun_zenith_deg",
"sun_azimuth_deg",
"sw_direct_normal",
"sw_diffuse"}) {
258 if (
pp.contains(k)) {
259 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.sun_mode = two_stream:"
260 " the faces take the two-stream sun (start_datetime, erf.rad_cons_lat / lon,"
261 " erf.fixed_total_solar_irradiance); remove it");
265 if (sun_zenith_deg < 0.0 || sun_zenith_deg > 180.0) { amrex::Abort(
"erf.ibseb.sun_zenith_deg must be in [0, 180]"); }
266 if (latitude_deg < -90.0 || latitude_deg > 90.0) { amrex::Abort(
"erf.ibseb.latitude_deg must be in [-90, 90]"); }
267 if (longitude_deg < -180.0 || longitude_deg > 180.0) { amrex::Abort(
"erf.ibseb.longitude_deg must be in [-180, 180]"); }
268 if (day_of_year < 1.0 || day_of_year > 366.0) { amrex::Abort(
"erf.ibseb.day_of_year must be in [1, 366]"); }
271 if (
pp.contains(
"utc_offset_hours")) {
272 amrex::Abort(
"erf.ibseb.utc_offset_hours is not an input: the sun follows time_zero_utc_s (UTC) and longitude_deg; remove it");
275 if (sw_transmission <= 0.0 || sw_transmission > 1.0) { amrex::Abort(
"erf.ibseb.sw_transmission must be in (0, 1]"); }
276 if (sw_diffuse_coeff < 0.0 || sw_diffuse_coeff > 1.0) { amrex::Abort(
"erf.ibseb.sw_diffuse_coeff must be in [0, 1]"); }
277 if (
solar_constant <= 0.0) { amrex::Abort(
"erf.ibseb.solar_constant must be > 0"); }
278 if (sun_min_elev_deg <= 0.0 || sun_min_elev_deg >= 90.0) {
279 amrex::Abort(
"erf.ibseb.sun_min_elev_deg must be in (0, 90) [deg]");
281 if (albedo < 0.0 || albedo > 1.0 || albedo_ground < 0.0 || albedo_ground > 1.0) {
282 amrex::Abort(
"erf.ibseb.albedo and albedo_ground must be in [0, 1]");
284 if (emissivity <= 0.0 || emissivity > 1.0 || emissivity_ground <= 0.0 || emissivity_ground > 1.0 ||
285 sky_emissivity <= 0.0 || sky_emissivity > 1.0) {
286 amrex::Abort(
"erf.ibseb emissivities must be in (0, 1]");
288 if (
view_n_az < 1 ||
view_n_el < 1) { amrex::Abort(
"erf.ibseb.view_n_az and view_n_el must be >= 1"); }
290 amrex::Abort(
"erf.ibseb.lw_mode must be \"fixed\", \"gray\" or \"two_stream\"");
293 amrex::Abort(
"erf.ibseb.lw_mode = two_stream needs erf.ibseb.radiation = two_stream");
296 for (
const char* k : {
"lw_down",
"sky_emissivity",
"T_ground",
"emissivity_ground"}) {
297 if (
pp.contains(k)) {
298 amrex::Abort(std::string(
"erf.ibseb.") + k +
" is not used with erf.ibseb.lw_mode = two_stream:"
299 " the faces take the two-stream columns' longwave down and the ground's longwave up;"
304 if (
lw_down < 0.0 ||
T_ground <= 0.0) { amrex::Abort(
"erf.ibseb.lw_down must be >= 0 and T_ground > 0"); }
305 if (
z0_wall <= 0.0 ||
z0h_wall <= 0.0) { amrex::Abort(
"erf.ibseb.z0_wall and z0h_wall must be positive [m]"); }
306 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"); }
307 if (
n_slab_layers > 32) { amrex::Abort(
"erf.ibseb.n_slab_layers must be <= 32 (the slab kernels keep their layers on the stack)"); }
308 if (
n_slab_layers < 1) { amrex::Abort(
"erf.ibseb.n_slab_layers must be >= 1"); }
310 amrex::Abort(
"erf.ibseb.T_skin_init and T_interior must be positive [K]");
313 amrex::Abort(
"erf.ibseb.T_skin_min must be positive and below T_skin_max");
316 amrex::Abort(
"erf.ibseb.T_skin_init must lie within [T_skin_min, T_skin_max]");
319 amrex::Abort(
"erf.ibseb.newton_max_iter must be >= 1, newton_tol_K and newton_max_step_K positive");
321 if (
Q_ext_uniform < 0.0) { amrex::Abort(
"erf.ibseb.Q_ext_uniform must be >= 0"); }
322 if (
obukhov_seed !=
"ground" &&
obukhov_seed !=
"neutral") { amrex::Abort(
"erf.ibseb.obukhov_seed must be \"ground\" or \"neutral\""); }
324 amrex::Abort(
"erf.ibseb.convective_velocity must be \"none\" or \"deardorff\"");
327 amrex::Abort(
"erf.ibseb.z_i_mode must be \"bulk_ri\", \"pblh\" or \"fixed\"");
329 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"); }
330 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:142
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:159
amrex::Real T_ground
Ground temperature for the ground term [K].
Definition: ERF_IBSEBParams.H:98
amrex::Real Q_ext_uniform
Uniform external incident flux on every face [W/m2] (test hook)
Definition: ERF_IBSEBParams.H:143
amrex::Real day_of_year
solar: day of year
Definition: ERF_IBSEBParams.H:63
bool prognostic
Definition: ERF_IBSEBParams.H:137
int material_default
Definition: ERF_IBSEBParams.H:123
amrex::Real newton_tol_K
Newton stops when a step changes T_skin by less than this [K].
Definition: ERF_IBSEBParams.H:141
amrex::Real obukhov_relax
Under-relaxation of the roof's u*, theta* iteration (1 = none), as erf-model #3486.
Definition: ERF_IBSEBParams.H:164
amrex::Real z0_wall
Momentum roughness of the faces [m].
Definition: ERF_IBSEBParams.H:108
amrex::Real k_therm
Uniform conductivity [W/m/K].
Definition: ERF_IBSEBParams.H:125
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:126
std::string z_i_mode
"bulk_ri", "pblh" or "fixed"
Definition: ERF_IBSEBParams.H:161
amrex::Real thickness
Uniform slab thickness [m].
Definition: ERF_IBSEBParams.H:127
std::string material_file
Definition: ERF_IBSEBParams.H:122
int view_n_az
Definition: ERF_IBSEBParams.H:85
amrex::Real sky_emissivity
gray: effective clear-sky emissivity
Definition: ERF_IBSEBParams.H:97
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:111
amrex::Real ri_crit
Critical bulk Richardson number of the diagnostic.
Definition: ERF_IBSEBParams.H:163
amrex::Real longitude_deg
solar: site longitude, east positive
Definition: ERF_IBSEBParams.H:62
int view_n_el
Definition: ERF_IBSEBParams.H:86
std::vector< int > material_by_building
Definition: ERF_IBSEBParams.H:124
std::string lw_mode
Definition: ERF_IBSEBParams.H:95
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:173
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:160
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
amrex::Real T_skin_min
Lower bound of the skin temperature [K].
Definition: ERF_IBSEBParams.H:138
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:96
amrex::Real z_i
Fixed mixed-layer depth [m] (z_i_mode = fixed, and the fallback)
Definition: ERF_IBSEBParams.H:162
amrex::Real z0h_wall
Heat roughness of the faces [m].
Definition: ERF_IBSEBParams.H:109
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:110
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:158
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:139
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:140