|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <utility>#include "AMReX.H"#include "AMReX_MultiFab.H"#include "AMReX_BCRec.H"#include "ERF_NumericalConstants.H"#include "ERF_MicrophysicsConstants.H"#include "ERF_DataStruct.H"#include "ERF_IndexDefines.H"#include "ERF_SurfaceLayer.H"#include "ERF_FillPatcher.H"#include "ERF_ImmersedWallCell.H"#include "ERF_ReadBndryPlanes.H"
Go to the source code of this file.
Classes | |
| struct | RealBdyConsMaps |
Enumerations | |
| enum class | TimeLevelSel { Old , New , Interp } |
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | wrf_moisture_target (const amrex::Real rho, const amrex::Real q_n, const amrex::Real q_np1, const amrex::Real alpha) noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | wrf_bdy_has_separate_hydrometeors (const MoistureComponentIndices &moisture_indices) noexcept |
| int | wrf_bdy_var_for_moisture_component (const int comp, const MoistureComponentIndices &moisture_indices, const bool use_wrf_bdy_qc_qi, const bool separate_hydrometeors=false) |
| RealBdyConsMaps | real_bdy_cons_maps (const bool read_density, const MoistureComponentIndices &moisture_indices, const bool use_wrf_bdy_qc_qi, const bool separate_hydrometeors) |
| void | rebalance_columns (amrex::MultiFab &rho, amrex::MultiFab &theta, const amrex::MultiFab &qt, const amrex::MultiFab &qv, const amrex::MultiFab *z_phys, const amrex::Geometry &geom, const bool &maintain_Th, bool use_sfc=false) |
| void | ChopGrids2D (amrex::BoxArray &ba, const amrex::Box &domain, int target_size) |
| amrex::BoxArray | ERFPostProcessBaseGrids (const amrex::Box &domain, bool decompose_in_z) |
| void | cons_to_prim (const amrex::MultiFab &cons_state, amrex::MultiFab &S_prim, int ng) |
| void | fill_wall_dist_ghost_cells (amrex::MultiFab &wdist, const amrex::Geometry &geom) |
| void | make_qt (const amrex::MultiFab &cons_state, amrex::MultiFab &qt, int n_qstate_into_total) |
| void | if_average_down (const amrex::MultiFab &S_fine, amrex::MultiFab &S_crse, const amrex::MultiFab &beta_fine, const amrex::MultiFab &beta_crse, const amrex::MultiFab &vol_fine, int scomp, int ncomp, const amrex::IntVect &ratio) |
| void | immersed_wall_dist (amrex::MultiFab &wdist, const amrex::MultiFab &terrain_blank, const amrex::MultiFab &z_phys_nd, const amrex::MultiFab &z_phys_cc, const amrex::Box &domain, amrex::Real small_volfrac, amrex::MultiFab *wall_height=nullptr, const amrex::MultiFab *wall_height_crse=nullptr) |
| void | make_ib_wall_face_masks (const amrex::MultiFab &terrain_blank, amrex::MultiFab &mask13, amrex::MultiFab &mask23, amrex::MultiFab &mask33, const amrex::Box &domain, amrex::Real small_volfrac, int spacing=0, amrex::Real dz=amrex::Real(1.0), amrex::Real z0=amrex::Real(0.1)) |
| std::pair< int, amrex::Real > | if_cf_surface_mismatch (const amrex::MultiFab &fine_tb, const amrex::BoxArray &fine_grids, const amrex::BoxArray &crse_grids, const amrex::DistributionMapping &crse_dmap, const amrex::Geometry &crse_geom, const amrex::IntVect &ratio, amrex::Real warn) |
| void | make_J (const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &detJ_cc) |
| void | make_areas (const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &ax, amrex::MultiFab &ay, amrex::MultiFab &az) |
| void | make_zcc (const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &z_phys_cc) |
| void | MomentumToVelocity (amrex::MultiFab &xvel_out, amrex::MultiFab &yvel_out, amrex::MultiFab &zvel_out, const amrex::MultiFab &cons_in, const amrex::MultiFab &xmom_in, const amrex::MultiFab &ymom_in, const amrex::MultiFab &zmom_in, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr) |
| void | VelocityToMomentum (const amrex::MultiFab &xvel_in, const amrex::IntVect &xvel_ngrow, const amrex::MultiFab &yvel_in, const amrex::IntVect &yvel_ngrow, const amrex::MultiFab &zvel_in, const amrex::IntVect &zvel_ngrow, const amrex::MultiFab &cons_in, amrex::MultiFab &xmom_out, amrex::MultiFab &ymom_out, amrex::MultiFab &zmom_out, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr) |
| void | ConvertForProjection (const amrex::MultiFab &den_div, const amrex::MultiFab &den_mlt, amrex::MultiFab &xmom, amrex::MultiFab &ymom, amrex::MultiFab &zmom, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h) |
| void | compute_influx_outflux_bdy (amrex::FArrayBox &bdy_data_xlo, amrex::FArrayBox &bdy_data_xhi, amrex::FArrayBox &bdy_data_ylo, amrex::FArrayBox &bdy_data_yhi, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom, amrex::Real &influx, amrex::Real &outflux, const int n) |
| void | enforceInOutSolvability_bdy (const amrex::MultiFab &rho0, amrex::FArrayBox &bdy_data_xlo, amrex::FArrayBox &bdy_data_xhi, amrex::FArrayBox &bdy_data_ylo, amrex::FArrayBox &bdy_data_yhi, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h) |
| void | enforceInOutSolvability (int lev, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &vels_vec, amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > &area_vec, const amrex::Geometry &geom) |
| void | realbdy_interior_bxs_xy (const amrex::Box &bx, const amrex::Box &domain, const int &width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0), const bool get_int_ng=false) |
| void | realbdy_bc_bxs_xy (const amrex::Box &bx, const amrex::Box &domain, const int &set_width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0)) |
| void | realbdy_compute_interior_ghost_rhs (const double &total_time, const double &delta_t, const double &start_bdy_time, const double &final_bdy_time, const double &bdy_time_interval, const amrex::Real &nudge_factor, int width, const amrex::Geometry &geom, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_cur_data, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xlo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xhi, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_ylo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_yhi, std::unique_ptr< ReadBndryPlanes > &m_r2d, const amrex::Real &c_p, const amrex::Real &rdOcp, const bool use_wrf_bdy_density, const amrex::Real &bdy_rho_nudge_factor) |
| void | fine_compute_interior_ghost_rhs (const double &time, const double &delta_t, const int &width, const int &set_width, const amrex::Geometry &geom, ERFFillPatcher *FPr_c, ERFFillPatcher *FPr_u, ERFFillPatcher *FPr_v, ERFFillPatcher *FPr_w, amrex::Vector< amrex::BCRec > &domain_bcs_type, amrex::Vector< amrex::MultiFab > &S_rhs_f, amrex::Vector< amrex::MultiFab > &S_data_f) |
| void | Time_Avg_Vel_atCC (double dt, double &t_avg_cnt, amrex::MultiFab *vel_t_avg, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel) |
| void | Accumulate_Interval_Means (double dt, double &t_mean_cnt, amrex::MultiFab *interval_means, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel, amrex::MultiFab &cons) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void | realbdy_compute_relaxation (const int &icomp, const int &num_var, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr, const amrex::Real &c_p, const amrex::Real &rdOcp, const int bdy_moist_nudge_type=0) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void | realbdy_compute_moisture_relaxation (const amrex::GpuArray< int, 6 > &moisture_comps, const int n_targets, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void | realbdy_compute_moisture_relaxation (const amrex::GpuArray< int, 3 > &moisture_comps, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void | ApplyMask (amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void | ApplyInvertedMask (amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0) |
| void | thinbody_wall_dist (std::unique_ptr< amrex::MultiFab > &wdist, amrex::Vector< amrex::IntVect > &xfaces, amrex::Vector< amrex::IntVect > &yfaces, amrex::Vector< amrex::IntVect > &zfaces, const amrex::Geometry &geomdata, std::unique_ptr< amrex::MultiFab > &z_phys_cc) |
| void | WeatherDataInterpolation (const double time) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | quad_interp_1d (amrex::Real z, amrex::Real z0, amrex::Real p0, amrex::Real z1, amrex::Real p1, amrex::Real z2, amrex::Real p2) |
| TimeLevelSel | select_time_level (double time, double t_old, double t_new) |
| amrex::Vector< amrex::MultiFab * > | select_time_data (TimeLevelSel sel, amrex::MultiFab &old_mf, amrex::MultiFab &new_mf) |
|
strong |
| void Accumulate_Interval_Means | ( | double | dt, |
| double & | t_mean_cnt, | ||
| amrex::MultiFab * | interval_means, | ||
| amrex::MultiFab & | xvel, | ||
| amrex::MultiFab & | yvel, | ||
| amrex::MultiFab & | zvel, | ||
| amrex::MultiFab & | cons | ||
| ) |
Accumulate time-weighted cell-centered velocity/theta first and second moments.
| [in] | dt | accumulation interval |
| [in,out] | t_mean_cnt | accumulated time |
| [in,out] | interval_means | ten-component moment storage |
| [in] | xvel | x-face velocity |
| [in] | yvel | y-face velocity |
| [in] | zvel | z-face velocity |
| [in] | cons | conserved cell-centered state |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyInvertedMask | ( | amrex::MultiFab & | dst, |
| const amrex::iMultiFab & | imask, | ||
| const int | nghost = 0 |
||
| ) |
Multiply a MultiFab by the inverse of an integer mask.
| [in,out] | dst | MultiFab to be masked. |
| [in] | imask | Integer mask MultiFab. |
| [in] | nghost | Number of ghost cells to include. |
Referenced by add_thin_body_sources(), and ERF::project_velocity_tb().


| AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyMask | ( | amrex::MultiFab & | dst, |
| const amrex::iMultiFab & | imask, | ||
| const int | nghost = 0 |
||
| ) |
Referenced by ERF::FillIntermediatePatch(), and ERF::project_velocity_tb().


| void ChopGrids2D | ( | amrex::BoxArray & | ba, |
| const amrex::Box & | domain, | ||
| int | target_size | ||
| ) |
| void compute_influx_outflux_bdy | ( | amrex::FArrayBox & | bdy_data_xlo, |
| amrex::FArrayBox & | bdy_data_xhi, | ||
| amrex::FArrayBox & | bdy_data_ylo, | ||
| amrex::FArrayBox & | bdy_data_yhi, | ||
| amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > & | area_vec, | ||
| const amrex::Geometry & | geom, | ||
| amrex::Real & | influx, | ||
| amrex::Real & | outflux, | ||
| const int | n | ||
| ) |
| void cons_to_prim | ( | const amrex::MultiFab & | cons_state, |
| amrex::MultiFab & | S_prim, | ||
| int | ng | ||
| ) |
Convert conservative state to primitive variables.
| [in] | cons_state | Conservative state MultiFab. |
| [out] | S_prim | Primitive state MultiFab. |
| [in] | ng | Number of ghost cells. |
| void ConvertForProjection | ( | const amrex::MultiFab & | den_div, |
| const amrex::MultiFab & | den_mlt, | ||
| amrex::MultiFab & | xmom, | ||
| amrex::MultiFab & | ymom, | ||
| amrex::MultiFab & | zmom, | ||
| const amrex::Box & | domain, | ||
| const amrex::Vector< amrex::BCRec > & | domain_bcs_type_h | ||
| ) |
| void enforceInOutSolvability | ( | int | lev, |
| amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > & | vels_vec, | ||
| amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > & | area_vec, | ||
| const amrex::Geometry & | geom | ||
| ) |
| void enforceInOutSolvability_bdy | ( | const amrex::MultiFab & | rho0, |
| amrex::FArrayBox & | bdy_data_xlo, | ||
| amrex::FArrayBox & | bdy_data_xhi, | ||
| amrex::FArrayBox & | bdy_data_ylo, | ||
| amrex::FArrayBox & | bdy_data_yhi, | ||
| amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > & | area_vec, | ||
| const amrex::Geometry & | geom, | ||
| const amrex::Vector< amrex::BCRec > & | domain_bcs_type_h | ||
| ) |
| amrex::BoxArray ERFPostProcessBaseGrids | ( | const amrex::Box & | domain, |
| bool | decompose_in_z | ||
| ) |
| void fill_wall_dist_ghost_cells | ( | amrex::MultiFab & | wdist, |
| const amrex::Geometry & | geom | ||
| ) |
Fill the ghost cells of the wall distance field, which is only computed on the valid region, so that operators reading from grown boxes do not see the sentinel value used to initialize it.
| [in,out] | wdist | MultiFab holding the wall distance. |
| [in] | geom | Geometry at this level. |
| void fine_compute_interior_ghost_rhs | ( | const double & | time, |
| const double & | delta_t, | ||
| const int & | width, | ||
| const int & | set_width, | ||
| const amrex::Geometry & | geom, | ||
| ERFFillPatcher * | FPr_c, | ||
| ERFFillPatcher * | FPr_u, | ||
| ERFFillPatcher * | FPr_v, | ||
| ERFFillPatcher * | FPr_w, | ||
| amrex::Vector< amrex::BCRec > & | domain_bcs_type, | ||
| amrex::Vector< amrex::MultiFab > & | S_rhs_f, | ||
| amrex::Vector< amrex::MultiFab > & | S_data_f | ||
| ) |
| void if_average_down | ( | const amrex::MultiFab & | S_fine, |
| amrex::MultiFab & | S_crse, | ||
| const amrex::MultiFab & | beta_fine, | ||
| const amrex::MultiFab & | beta_crse, | ||
| const amrex::MultiFab & | vol_fine, | ||
| int | scomp, | ||
| int | ncomp, | ||
| const amrex::IntVect & | ratio | ||
| ) |
Average down a cell-centred state over immersed-forcing levels (erf.if_average_down = fluid_mass). The fine cells are weighted by their fluid mass, (rho S)_c = rho_c * sum (1 - beta_f) V_f (rho S)_f / sum (1 - beta_f) V_f rho_f, with beta the solid fraction, V the fine cell volume (detJ / (m_x m_y), the weight the plain average carries in the state) and rho_c the coarse density: the fluid-volume-weighted mean of the fine density, sum (1 - beta_f) V_f rho_f / sum (1 - beta_f) V_f, when the density is in the component range, else the coarse cell's own. The coarse value is the fluid mean over the whole coarse cell (intensive), not the sum over the fine cells. Coarse cells that are solid on their own level, or with no fluid fine cell under them, keep their value. The plain average mixes the values of solid fine cells into coarse fluid cells.
| [in] | S_fine | Fine state (unscaled). |
| [in,out] | S_crse | Coarse state (unscaled); the covered cells are written. |
| [in] | beta_fine | Fine solid fraction (terrain_blanking). |
| [in] | beta_crse | Coarse solid fraction. |
| [in] | vol_fine | Fine cell volume weight (any constant factor cancels). |
| [in] | scomp | First component to average. |
| [in] | ncomp | Number of components. |
| [in] | ratio | Refinement ratio. |
| std::pair<int, amrex::Real> if_cf_surface_mismatch | ( | const amrex::MultiFab & | fine_tb, |
| const amrex::BoxArray & | fine_grids, | ||
| const amrex::BoxArray & | crse_grids, | ||
| const amrex::DistributionMapping & | crse_dmap, | ||
| const amrex::Geometry & | crse_geom, | ||
| const amrex::IntVect & | ratio, | ||
| amrex::Real | warn | ||
| ) |
Where the coarse and fine levels disagree on an immersed surface along the lateral coarse/fine faces of the fine level (erf.if_cf_mismatch_warning): the surface on a coarse cell's mid-plane leaves the coarse cell half solid over fine cells that are all solid and all fluid. For each coarse cell covered by the fine level and next to an uncovered one, the spread (max - min) of the fine solid fractions under it is formed; cells with a spread of at least warn are counted.
| [in] | fine_tb | fine solid fraction (terrain_blanking) |
| [in] | fine_grids | fine BoxArray |
| [in] | crse_grids | coarse BoxArray |
| [in] | crse_dmap | coarse DistributionMapping |
| [in] | crse_geom | coarse Geometry |
| [in] | ratio | refinement ratio |
| [in] | warn | spread at or above which a cell is counted |
| void immersed_wall_dist | ( | amrex::MultiFab & | wdist, |
| const amrex::MultiFab & | terrain_blank, | ||
| const amrex::MultiFab & | z_phys_nd, | ||
| const amrex::MultiFab & | z_phys_cc, | ||
| const amrex::Box & | domain, | ||
| amrex::Real | small_volfrac, | ||
| amrex::MultiFab * | wall_height = nullptr, |
||
| const amrex::MultiFab * | wall_height_crse = nullptr |
||
| ) |
RANS wall distance over terrain represented by immersed forcing with the fraction-stress wall law (erf.if_wall_form = fraction_stress): measured vertically from the surface itself, h = z_bot + beta dz of the wall cell (the partial cell, or the fluid cell on a solid cell; ERF_ImmersedWallCell.H), the wall cell at its fluid centroid (1 - beta) dz / 2 above it and every other cell at |z_cc - h|; a column without solid measures from the bottom of the domain. A box that does not see the surface of a column (a fine box inside the solid, or above the surface without reaching the bottom) measures from the coarser level's wall height.
| [out] | wdist | Wall distance (valid cells; ghost cells are left untouched). |
| [in] | terrain_blank | Cell-centred solid fraction. |
| [in] | z_phys_nd | Node heights. |
| [in] | z_phys_cc | Cell-centre heights. |
| [in] | domain | Index domain of the level. |
| [in] | small_volfrac | Solid fraction below which a cell counts as fluid. |
| [out] | wall_height | Optional: the height measured from in each column, on the level's BoxArray flattened to the bottom cell (same DistributionMapping). |
| [in] | wall_height_crse | Optional, fine levels: wall_height of the coarser level brought to this level's flattened BoxArray. Without it every box must hold whole columns. |
| void make_areas | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::MultiFab & | ax, | ||
| amrex::MultiFab & | ay, | ||
| amrex::MultiFab & | az | ||
| ) |
| void make_ib_wall_face_masks | ( | const amrex::MultiFab & | terrain_blank, |
| amrex::MultiFab & | mask13, | ||
| amrex::MultiFab & | mask23, | ||
| amrex::MultiFab & | mask33, | ||
| const amrex::Box & | domain, | ||
| amrex::Real | small_volfrac, | ||
| int | spacing = 0, |
||
| amrex::Real | dz = amrex::Real(1.0), |
||
| amrex::Real | z0 = amrex::Real(0.1) |
||
| ) |
Wall-face masks of the fraction-stress wall law (erf.if_wall_form = fraction_stress): zero on the xz (yz) edge that is the bottom face of the wall cell of an x-face (y-face) column, the spacing factor on the face above it, one elsewhere. The vertical flux of x (y) momentum is multiplied by them, so no resolved flux crosses the wall face (see ERF_ImmersedWallCell.H).
| [in] | terrain_blank | Cell-centred solid fraction; needs one more ghost cell than the masks. |
| [out] | mask13 | On convert(ba, IntVect(1,0,1)), valid and ghost cells. |
| [out] | mask23 | On convert(ba, IntVect(0,1,1)), valid and ghost cells. |
| [out] | mask33 | On convert(ba, IntVect(0,0,1)): the same for the cell columns, applied to the vertical diffusive fluxes of theta and TKE (zero on the bottom face of the wall cell). |
| [in] | domain | Index domain of the level. |
| [in] | small_volfrac | Solid fraction below which a cell counts as fluid. |
| [in] | spacing | erf.if_wall_face_spacing (0 grid, 1 physical, 2 log): the face ABOVE the wall cell gets ib_wall::face_above_factor instead of one. |
| [in] | dz | Cell height (constant-dz mesh). |
| [in] | z0 | Roughness length of the wall law. |
| void make_J | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::MultiFab & | detJ_cc | ||
| ) |
| void make_qt | ( | const amrex::MultiFab & | cons_state, |
| amrex::MultiFab & | qt, | ||
| int | n_qstate_into_total | ||
| ) |
Compute total water mixing ratio from conservative state.
| [in] | cons_state | Conservative state MultiFab. |
| [out] | qt | MultiFab to store total water. |
| [in] | n_qstate_into_total | Number of components to include in total water. |
| void make_zcc | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | z_phys_nd, | ||
| amrex::MultiFab & | z_phys_cc | ||
| ) |
| void MomentumToVelocity | ( | amrex::MultiFab & | xvel_out, |
| amrex::MultiFab & | yvel_out, | ||
| amrex::MultiFab & | zvel_out, | ||
| const amrex::MultiFab & | cons_in, | ||
| const amrex::MultiFab & | xmom_in, | ||
| const amrex::MultiFab & | ymom_in, | ||
| const amrex::MultiFab & | zmom_in, | ||
| const amrex::Box & | domain, | ||
| const amrex::Vector< amrex::BCRec > & | domain_bcs_type_h, | ||
| const amrex::MultiFab * | c_vfrac = nullptr |
||
| ) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real quad_interp_1d | ( | amrex::Real | z, |
| amrex::Real | z0, | ||
| amrex::Real | p0, | ||
| amrex::Real | z1, | ||
| amrex::Real | p1, | ||
| amrex::Real | z2, | ||
| amrex::Real | p2 | ||
| ) |
Perform quadratic interpolation in one dimension.
| [in] | z | Interpolation coordinate. |
| [in] | z0 | Coordinate of first point. |
| [in] | p0 | Value at first point. |
| [in] | z1 | Coordinate of second point. |
| [in] | p1 | Value at second point. |
| [in] | z2 | Coordinate of third point. |
| [in] | p2 | Value at third point. |
Referenced by compute_gradp_interpz().

|
inline |

| void realbdy_bc_bxs_xy | ( | const amrex::Box & | bx, |
| const amrex::Box & | domain, | ||
| const int & | set_width, | ||
| amrex::Box & | bx_xlo, | ||
| amrex::Box & | bx_xhi, | ||
| amrex::Box & | bx_ylo, | ||
| amrex::Box & | bx_yhi, | ||
| const amrex::IntVect & | ng_vect = amrex::IntVect(0, 0, 0) |
||
| ) |
| void realbdy_compute_interior_ghost_rhs | ( | const double & | total_time, |
| const double & | delta_t, | ||
| const double & | start_bdy_time, | ||
| const double & | final_bdy_time, | ||
| const double & | bdy_time_interval, | ||
| const amrex::Real & | nudge_factor, | ||
| int | width, | ||
| const amrex::Geometry & | geom, | ||
| amrex::Vector< amrex::MultiFab > & | S_rhs, | ||
| amrex::Vector< amrex::MultiFab > & | S_cur_data, | ||
| amrex::Vector< amrex::Vector< amrex::FArrayBox >> & | bdy_data_xlo, | ||
| amrex::Vector< amrex::Vector< amrex::FArrayBox >> & | bdy_data_xhi, | ||
| amrex::Vector< amrex::Vector< amrex::FArrayBox >> & | bdy_data_ylo, | ||
| amrex::Vector< amrex::Vector< amrex::FArrayBox >> & | bdy_data_yhi, | ||
| std::unique_ptr< ReadBndryPlanes > & | m_r2d, | ||
| const amrex::Real & | c_p, | ||
| const amrex::Real & | rdOcp, | ||
| const bool | use_wrf_bdy_density, | ||
| const amrex::Real & | bdy_rho_nudge_factor | ||
| ) |
| AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_moisture_relaxation | ( | const amrex::GpuArray< int, 3 > & | moisture_comps, |
| const int & | width, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dx, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbLo, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbHi, | ||
| const amrex::Real & | F1, | ||
| const amrex::Box & | bx_xlo, | ||
| const amrex::Box & | bx_xhi, | ||
| const amrex::Box & | bx_ylo, | ||
| const amrex::Box & | bx_yhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_xlo, | ||
| const amrex::Array4< const amrex::Real > & | arr_xhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_ylo, | ||
| const amrex::Array4< const amrex::Real > & | arr_yhi, | ||
| const amrex::Array4< const amrex::Real > & | data_arr, | ||
| const amrex::Array4< amrex::Real > & | rhs_arr | ||
| ) |

| AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_moisture_relaxation | ( | const amrex::GpuArray< int, 6 > & | moisture_comps, |
| const int | n_targets, | ||
| const int & | width, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dx, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbLo, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbHi, | ||
| const amrex::Real & | F1, | ||
| const amrex::Box & | bx_xlo, | ||
| const amrex::Box & | bx_xhi, | ||
| const amrex::Box & | bx_ylo, | ||
| const amrex::Box & | bx_yhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_xlo, | ||
| const amrex::Array4< const amrex::Real > & | arr_xhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_ylo, | ||
| const amrex::Array4< const amrex::Real > & | arr_yhi, | ||
| const amrex::Array4< const amrex::Real > & | data_arr, | ||
| const amrex::Array4< amrex::Real > & | rhs_arr | ||
| ) |
Apply Davies relaxation to explicitly mapped moisture components. Target component n corresponds to state component moisture_comps[n].
Referenced by realbdy_compute_moisture_relaxation().


| AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_relaxation | ( | const int & | icomp, |
| const int & | num_var, | ||
| const int & | width, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dx, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbLo, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | ProbHi, | ||
| const amrex::Real & | F1, | ||
| const amrex::Box & | bx_xlo, | ||
| const amrex::Box & | bx_xhi, | ||
| const amrex::Box & | bx_ylo, | ||
| const amrex::Box & | bx_yhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_xlo, | ||
| const amrex::Array4< const amrex::Real > & | arr_xhi, | ||
| const amrex::Array4< const amrex::Real > & | arr_ylo, | ||
| const amrex::Array4< const amrex::Real > & | arr_yhi, | ||
| const amrex::Array4< const amrex::Real > & | data_arr, | ||
| const amrex::Array4< amrex::Real > & | rhs_arr, | ||
| const amrex::Real & | c_p, | ||
| const amrex::Real & | rdOcp, | ||
| const int | bdy_moist_nudge_type = 0 |
||
| ) |
Compute the nudging relaxation
| [in] | delta_t | time step |
| [in] | icomp | component offset |
| [in] | num_var | number of variables to loop |
| [in] | width | width of wrf bdy file |
| [in] | dom_lo | low bound of domain |
| [in] | dom_hi | high bound of domain |
| [in] | F1 | drift relaxation parameter |
| [in] | bx_xlo | box for low x relaxation |
| [in] | bx_xhi | box for high x relaxation |
| [in] | bx_ylo | box for low y relaxation |
| [in] | bx_yhi | box for high y relaxation |
| [in] | arr_xlo | array for low x relaxation |
| [in] | arr_xhi | array for high x relaxation |
| [in] | arr_ylo | array for low y relaxation |
| [in] | arr_yhi | array for high y relaxation |
| [in] | data_arr | data array |
| [out] | rhs_arr | RHS array |
Referenced by realbdy_compute_interior_ghost_rhs().


| void realbdy_interior_bxs_xy | ( | const amrex::Box & | bx, |
| const amrex::Box & | domain, | ||
| const int & | width, | ||
| amrex::Box & | bx_xlo, | ||
| amrex::Box & | bx_xhi, | ||
| amrex::Box & | bx_ylo, | ||
| amrex::Box & | bx_yhi, | ||
| const amrex::IntVect & | ng_vect = amrex::IntVect(0, 0, 0), |
||
| const bool | get_int_ng = false |
||
| ) |
| void rebalance_columns | ( | amrex::MultiFab & | rho, |
| amrex::MultiFab & | theta, | ||
| const amrex::MultiFab & | qt, | ||
| const amrex::MultiFab & | qv, | ||
| const amrex::MultiFab * | z_phys, | ||
| const amrex::Geometry & | geom, | ||
| const bool & | maintain_Th, | ||
| bool | use_sfc = false |
||
| ) |
|
inline |
The pair of MultiFabs to hand to an AMReX FillPatch routine for a given time-level selection. When only one time level is wanted it is passed twice, so that AMReX's own comparison of the (rounded) times can never bring in the other one.
| [in] | sel | which time level(s) to use |
| [in] | old_mf | data at the old time |
| [in] | new_mf | data at the new time |
Referenced by ERF::FillCoarseFineGhostsForImplicit(), ERF::FillIntermediatePatch(), ERF::FillPatchCrseLevel(), and ERF::FillPatchFineLevel().

|
inline |
Decide whether data at time "time" should come from the old-time data, the new-time data, or an interpolation between the two.
This is done in double precision, before any cast to Real, and with a single tolerance at both ends. The tolerance is a small fraction of (t_new - t_old), but never smaller than a few ulps of the times themselves, since those carry roundoff proportional to their magnitude – which matters once the time is large (e.g. months measured in seconds).
Times outside [t_old, t_new] are clamped to the nearer end rather than extrapolated. If t_old == t_new (to within the tolerance), Old is returned.
| [in] | time | time at which data are requested |
| [in] | t_old | old time of the level |
| [in] | t_new | new time of the level |
Referenced by ERF::cf_zface_coarse_at(), ERF::FillCoarseFineGhostsForImplicit(), ERF::FillIntermediatePatch(), ERF::FillPatchCrseLevel(), and ERF::FillPatchFineLevel().

| void thinbody_wall_dist | ( | std::unique_ptr< amrex::MultiFab > & | wdist, |
| amrex::Vector< amrex::IntVect > & | xfaces, | ||
| amrex::Vector< amrex::IntVect > & | yfaces, | ||
| amrex::Vector< amrex::IntVect > & | zfaces, | ||
| const amrex::Geometry & | geomdata, | ||
| std::unique_ptr< amrex::MultiFab > & | z_phys_cc | ||
| ) |
Compute the distance to thin-body walls.
| [out] | wdist | MultiFab to store wall distances. |
| [in] | xfaces | Indices of x-faces forming walls. |
| [in] | yfaces | Indices of y-faces forming walls. |
| [in] | zfaces | Indices of z-faces forming walls. |
| [in] | geomdata | Geometry used for physical distance. |
| [in] | z_phys_cc | Cell-centered physical height. |
| void Time_Avg_Vel_atCC | ( | double | dt, |
| double & | t_avg_cnt, | ||
| amrex::MultiFab * | vel_t_avg, | ||
| amrex::MultiFab & | xvel, | ||
| amrex::MultiFab & | yvel, | ||
| amrex::MultiFab & | zvel | ||
| ) |
| void VelocityToMomentum | ( | const amrex::MultiFab & | xvel_in, |
| const amrex::IntVect & | xvel_ngrow, | ||
| const amrex::MultiFab & | yvel_in, | ||
| const amrex::IntVect & | yvel_ngrow, | ||
| const amrex::MultiFab & | zvel_in, | ||
| const amrex::IntVect & | zvel_ngrow, | ||
| const amrex::MultiFab & | cons_in, | ||
| amrex::MultiFab & | xmom_out, | ||
| amrex::MultiFab & | ymom_out, | ||
| amrex::MultiFab & | zmom_out, | ||
| const amrex::Box & | domain, | ||
| const amrex::Vector< amrex::BCRec > & | domain_bcs_type_h, | ||
| const amrex::MultiFab * | c_vfrac = nullptr |
||
| ) |
Referenced by ERF::Advance(), ERF::advance_dycore(), ERF::AverageDownTo(), ERF::estTimeStep(), ERF::FillCoarsePatch(), ERF::FillIntermediatePatch(), ERF::FillPatchFineLevel(), ERF::project_initial_velocity(), and ERF::project_momenta().

| void WeatherDataInterpolation | ( | const double | time | ) |
|
noexcept |
True when ERF carries all five hydrometeor mass species separately.
Referenced by ERF::InitData_post(), and ERF::timeStep().

|
inline |
Map an active conserved moisture component to its real-boundary field.
Referenced by real_bdy_cons_maps().

|
noexcept |
Build one density-weighted, nonnegative WRF moisture target.