|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <ERF_FireWindExtract.H>
Functions | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | column_wind_at_height (const Array4< const Real > &xvel, const Array4< const Real > &yvel, const Array4< const Real > &z_cc, int ia, int ja, int nz, Real z_target, Real z_ground, Real &u_out, Real &v_out, bool below_first_log=false, Real z0_log=Real(0.1)) noexcept |
| Wind at a target height within one atmospheric column. More... | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE Real | log_law_factor (Real z_to, Real z_from, Real z0) noexcept |
| Neutral log-law factor ln(z_to / z0) / ln(z_from / z0) More... | |
| std::string | fire_column_z0_range_error (const MultiFab &col_z0, Real z_low) |
| void | fill_fire_wind_from_interpolation (MultiFab &fire_wind_ref, MultiFab &fire_wind_extract_z_mf, const MultiFab &xvel_mf, const MultiFab &yvel_mf, const MultiFab &z_phys_cc_mf, const MultiFab &fire_surface_z_mf, const MultiFab &fire_col_ground_mf, const FireGrid &fg, Real z_ref, int nz, const MultiFab *z_ref_cell_mf, int wind_interp, const MultiFab *col_open, const MultiFab *col_roof, Real z_sample, Real z0_log, bool below_first_log, const MultiFab *col_z0) |
| void | extract_fire_wind_k0 (amrex::MultiFab &u_k0, amrex::MultiFab &v_k0, amrex::MultiFab &h_k0, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &z_phys_cc, const amrex::MultiFab *z_phys_nd, const amrex::Geometry &geom) |
| The wind at the lowest cell center of each atmospheric column, and its height above that column's ground. More... | |
|
noexcept |
Wind at a target height within one atmospheric column.
Brackets the target height by bisection on the column's terrain-following cell-center heights, averages the face velocities to cell centers at the two bracketing levels, and interpolates linearly between them. A target above the highest cell center takes that level's wind. A target below the lowest cell center takes the lowest center's wind as it is (below_first_log = false, which with a 20 m first cell hands the fire the 10 m wind as its 6.1 m wind, 12 % high at z0 = 0.1 m), or scaled down a neutral log profile of roughness z0_log (below_first_log = true), U(z) = U(z_1) ln(z/z0) / ln(z_1/z0), the better form for a first cell above the reference height. z_ground is the ground height the column heights are measured from; z_target - z_ground is the height above ground.
Referenced by fill_fire_wind_from_interpolation().

| void extract_fire_wind_k0 | ( | amrex::MultiFab & | u_k0, |
| amrex::MultiFab & | v_k0, | ||
| amrex::MultiFab & | h_k0, | ||
| const amrex::MultiFab & | xvel, | ||
| const amrex::MultiFab & | yvel, | ||
| const amrex::MultiFab & | z_phys_cc, | ||
| const amrex::MultiFab * | z_phys_nd, | ||
| const amrex::Geometry & | geom | ||
| ) |
The wind at the lowest cell center of each atmospheric column, and its height above that column's ground.
For an engine that drives its fire with the k = 0 wind of the atmospheric columns rather than a wind interpolated to a height (LSFIRE does). The face velocities are averaged to the k = 0 cell center; the height is that center minus the column's ground, the mean of its four k = 0 nodes (the ground compute_fire_surface_height uses), or minus the domain floor without nodal heights.
| [out] | u_k0,v_k0 | Wind [m/s] on the k = 0 slabs of the level (one per box of the level, the BoxArray of FireForcing::T_k0), with any ghost cells: those are filled with FillBoundary |
| [out] | h_k0 | Height of that wind above the column's ground [m], laid out as u_k0 |
| [in] | xvel,yvel | Face velocities of the level (FireForcing::xvel, yvel) |
| [in] | z_phys_cc | Cell-center height of the level [m] |
| [in] | z_phys_nd | Nodal height of the level [m], or nullptr (flat floor) |
| [in] | geom | Geometry of the level |

| void fill_fire_wind_from_interpolation | ( | MultiFab & | fire_wind_ref, |
| MultiFab & | fire_wind_extract_z_mf, | ||
| const MultiFab & | xvel_mf, | ||
| const MultiFab & | yvel_mf, | ||
| const MultiFab & | z_phys_cc_mf, | ||
| const MultiFab & | fire_surface_z_mf, | ||
| const MultiFab & | fire_col_ground_mf, | ||
| const FireGrid & | fg, | ||
| Real | z_ref, | ||
| int | nz, | ||
| const MultiFab * | z_ref_cell_mf, | ||
| int | wind_interp, | ||
| const MultiFab * | col_open, | ||
| const MultiFab * | col_roof, | ||
| Real | z_sample, | ||
| Real | z0_log, | ||
| bool | below_first_log, | ||
| const MultiFab * | col_z0 | ||
| ) |

| std::string fire_column_z0_range_error | ( | const MultiFab & | col_z0, |
| Real | z_low | ||
| ) |
|
noexcept |
Neutral log-law factor ln(z_to / z0) / ln(z_from / z0)
Every argument of the logarithms is kept valid whether or not the caller uses the result: clang evaluates a ternary's arm speculatively in Release, and with resampling off z_from is 0, so log(0) raised the divide-by-zero flag and tripped amrex.fpe_trap_zero on the first step. abs and the tiny offset are not selects, so nothing is folded back into the arm; for positive heights and roughness the values are unchanged. ln(z_to / z0) is floored at zero, so a roughness at or above z_to gives no wind rather than a reversed one, as the clamp below the first center does; the callers keep z0 well below both heights, where the floor is never reached.
Referenced by fill_fire_wind_from_interpolation().
