1 #ifndef ERF_IBSEB_PARAMS_H
2 #define ERF_IBSEB_PARAMS_H
4 #include <AMReX_ParmParse.H>
5 #include <AMReX_REAL.H>
151 amrex::ParmParse
pp(
"erf.ibseb");
205 pp.query(
"z_i",
z_i);
210 amrex::Abort(
"erf.ibseb.radiation: only \"prescribed\" is available in this build");
213 amrex::Abort(
"erf.ibseb.sun_mode must be \"fixed\" or \"solar\"");
215 if (sun_zenith_deg < 0.0 || sun_zenith_deg > 180.0) { amrex::Abort(
"erf.ibseb.sun_zenith_deg must be in [0, 180]"); }
216 if (latitude_deg < -90.0 || latitude_deg > 90.0) { amrex::Abort(
"erf.ibseb.latitude_deg must be in [-90, 90]"); }
217 if (longitude_deg < -180.0 || longitude_deg > 180.0) { amrex::Abort(
"erf.ibseb.longitude_deg must be in [-180, 180]"); }
218 if (day_of_year < 1.0 || day_of_year > 366.0) { amrex::Abort(
"erf.ibseb.day_of_year must be in [1, 366]"); }
221 if (
pp.contains(
"utc_offset_hours")) {
222 amrex::Abort(
"erf.ibseb.utc_offset_hours is not an input: the sun follows time_zero_utc_s (UTC) and longitude_deg; remove it");
225 if (sw_transmission <= 0.0 || sw_transmission > 1.0) { amrex::Abort(
"erf.ibseb.sw_transmission must be in (0, 1]"); }
226 if (albedo < 0.0 || albedo > 1.0 || albedo_ground < 0.0 || albedo_ground > 1.0) {
227 amrex::Abort(
"erf.ibseb.albedo and albedo_ground must be in [0, 1]");
229 if (emissivity <= 0.0 || emissivity > 1.0 || emissivity_ground <= 0.0 || emissivity_ground > 1.0 ||
230 sky_emissivity <= 0.0 || sky_emissivity > 1.0) {
231 amrex::Abort(
"erf.ibseb emissivities must be in (0, 1]");
233 if (
view_n_az < 1 ||
view_n_el < 1) { amrex::Abort(
"erf.ibseb.view_n_az and view_n_el must be >= 1"); }
234 if (
lw_mode !=
"fixed" &&
lw_mode !=
"gray") { amrex::Abort(
"erf.ibseb.lw_mode must be \"fixed\" or \"gray\""); }
235 if (
lw_down < 0.0 ||
T_ground <= 0.0) { amrex::Abort(
"erf.ibseb.lw_down must be >= 0 and T_ground > 0"); }
236 if (
z0_wall <= 0.0 ||
z0h_wall <= 0.0) { amrex::Abort(
"erf.ibseb.z0_wall and z0h_wall must be positive [m]"); }
237 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"); }
238 if (
n_slab_layers > 32) { amrex::Abort(
"erf.ibseb.n_slab_layers must be <= 32 (the slab kernels keep their layers on the stack)"); }
239 if (
n_slab_layers < 1) { amrex::Abort(
"erf.ibseb.n_slab_layers must be >= 1"); }
241 amrex::Abort(
"erf.ibseb.T_skin_init and T_interior must be positive [K]");
244 amrex::Abort(
"erf.ibseb.T_skin_min must be positive and below T_skin_max");
247 amrex::Abort(
"erf.ibseb.T_skin_init must lie within [T_skin_min, T_skin_max]");
250 amrex::Abort(
"erf.ibseb.newton_max_iter must be >= 1, newton_tol_K and newton_max_step_K positive");
252 if (
Q_ext_uniform < 0.0) { amrex::Abort(
"erf.ibseb.Q_ext_uniform must be >= 0"); }
253 if (
obukhov_seed !=
"ground" &&
obukhov_seed !=
"neutral") { amrex::Abort(
"erf.ibseb.obukhov_seed must be \"ground\" or \"neutral\""); }
255 amrex::Abort(
"erf.ibseb.convective_velocity must be \"none\" or \"deardorff\"");
258 amrex::Abort(
"erf.ibseb.z_i_mode must be \"bulk_ri\", \"pblh\" or \"fixed\"");
260 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"); }
261 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:118
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:46
std::string convective_velocity
"none" or "deardorff"
Definition: ERF_IBSEBParams.H:135
amrex::Real T_ground
Ground temperature for the ground term [K].
Definition: ERF_IBSEBParams.H:75
amrex::Real Q_ext_uniform
Uniform external incident flux on every face [W/m2] (test hook)
Definition: ERF_IBSEBParams.H:119
amrex::Real day_of_year
solar: day of year
Definition: ERF_IBSEBParams.H:53
bool prognostic
Definition: ERF_IBSEBParams.H:113
int material_default
Definition: ERF_IBSEBParams.H:99
amrex::Real newton_tol_K
Newton stops when a step changes T_skin by less than this [K].
Definition: ERF_IBSEBParams.H:117
amrex::Real obukhov_relax
Under-relaxation of the roof's u*, theta* iteration (1 = none), as erf-model #3486.
Definition: ERF_IBSEBParams.H:140
amrex::Real z0_wall
Momentum roughness of the faces [m].
Definition: ERF_IBSEBParams.H:85
amrex::Real k_therm
Uniform conductivity [W/m/K].
Definition: ERF_IBSEBParams.H:101
amrex::Real sw_transmission
solar: bulk clear-sky transmission (Bird)
Definition: ERF_IBSEBParams.H:56
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:102
std::string z_i_mode
"bulk_ri", "pblh" or "fixed"
Definition: ERF_IBSEBParams.H:137
amrex::Real thickness
Uniform slab thickness [m].
Definition: ERF_IBSEBParams.H:103
std::string material_file
Definition: ERF_IBSEBParams.H:98
int view_n_az
Definition: ERF_IBSEBParams.H:67
amrex::Real sky_emissivity
gray: effective clear-sky emissivity
Definition: ERF_IBSEBParams.H:74
bool couple_heat
Add the face flux to the temperature equation.
Definition: ERF_IBSEBParams.H:88
amrex::Real ri_crit
Critical bulk Richardson number of the diagnostic.
Definition: ERF_IBSEBParams.H:139
amrex::Real longitude_deg
solar: site longitude, east positive
Definition: ERF_IBSEBParams.H:52
int view_n_el
Definition: ERF_IBSEBParams.H:68
std::vector< int > material_by_building
Definition: ERF_IBSEBParams.H:100
std::string lw_mode
Definition: ERF_IBSEBParams.H:72
amrex::Real albedo_ground
Ground albedo for the reflected diffuse term.
Definition: ERF_IBSEBParams.H:60
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:62
void init_params()
Definition: ERF_IBSEBParams.H:149
std::string radiation
Definition: ERF_IBSEBParams.H:41
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:136
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:55
amrex::Real sw_direct_normal
fixed: direct-normal irradiance [W/m2]
Definition: ERF_IBSEBParams.H:49
std::string dump_faces_file
Per-rank face dump at report time (empty = off)
Definition: ERF_IBSEBParams.H:33
amrex::Real albedo
Face shortwave albedo.
Definition: ERF_IBSEBParams.H:59
amrex::Real T_skin_min
Lower bound of the skin temperature [K].
Definition: ERF_IBSEBParams.H:114
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:54
amrex::Real sun_zenith_deg
fixed: zenith angle [deg]
Definition: ERF_IBSEBParams.H:47
amrex::Real lw_down
fixed: sky longwave [W/m2]
Definition: ERF_IBSEBParams.H:73
amrex::Real z_i
Fixed mixed-layer depth [m] (z_i_mode = fixed, and the fallback)
Definition: ERF_IBSEBParams.H:138
amrex::Real z0h_wall
Heat roughness of the faces [m].
Definition: ERF_IBSEBParams.H:86
amrex::Real sw_diffuse
fixed: diffuse irradiance on a horizontal surface [W/m2]
Definition: ERF_IBSEBParams.H:50
amrex::Real sun_azimuth_deg
fixed: azimuth clockwise from north [deg]; 180 = sun in the south
Definition: ERF_IBSEBParams.H:48
bool stability_correction
Definition: ERF_IBSEBParams.H:87
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:51
std::string obukhov_seed
"ground" or "neutral"
Definition: ERF_IBSEBParams.H:134
amrex::Real sw_diffuse_coeff
solar: share of the attenuated beam that arrives as diffuse light
Definition: ERF_IBSEBParams.H:57
amrex::Real T_skin_max
Upper bound [K]; raise it for faces under a fire.
Definition: ERF_IBSEBParams.H:115
amrex::Real emissivity
Face longwave emissivity.
Definition: ERF_IBSEBParams.H:61
int newton_max_iter
Newton iteration cap per face and step.
Definition: ERF_IBSEBParams.H:116