|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Runtime state and operations for turbulent perturbation forcing. More...
#include <ERF_TurbPertStruct.H>

Public Member Functions | |
| ~TurbulentPerturbation () | |
| Destroy turbulent perturbation state. More... | |
| void | init_tpi_type (const int lev, const PerturbationType &pert_type, const int max_level) |
| Store the integer perturbation-type selector for one AMR level. More... | |
| void | init_tpi (const int lev, const amrex::Vector< amrex::BoxArray > &subdomains_lev, const amrex::GpuArray< amrex::Real, 3 > dx, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, const int ngrow_state, std::string pp_prefix, const amrex::Vector< amrex::IntVect > refRatio, const int max_level) |
| Initialize turbulent perturbation regions and per-box storage. More... | |
| void | calc_tpi_update (const int lev, const double dt, amrex::MultiFab &mf_xvel, amrex::MultiFab &mf_yvel, amrex::MultiFab &mf_cons) |
| Update perturbation amplitudes and intervals when each box is ready. More... | |
| void | apply_tpi (const int &lev, const amrex::Box &vbx, const int &comp, const amrex::IndexType &m_ixtype, const amrex::Array4< amrex::Real > &src_arr, const amrex::Array4< amrex::Real const > &pert_cell) |
| Apply stored turbulent perturbations to a source or state array. More... | |
| void | calc_tpi_amp (const int &lev, const int &boxIdx, const double &interval) |
| Compute the perturbation amplitude for one perturbation box. More... | |
| void | pseudoRandomPert (const int &boxIdx, const int &lev, const amrex::IndexType &m_ixtype) |
| Assign pseudo-random perturbations to cells in one perturbation box. More... | |
| void | zero_amp (const int &boxIdx, const int &lev, const amrex::IndexType &m_ixtype) |
| Reset CPM perturbation amplitudes in one perturbation box to zero. More... | |
| void | netZeroBuoyantAdd (const int &boxIdx, const int &lev) |
| Accumulate the mean perturbation contribution for net-zero buoyancy enforcement. More... | |
| void | netZeroBuoyantAdjust (const int &boxIdx, const int &lev) |
| Adjust perturbation cells so the net buoyant forcing is zero. More... | |
| void | calc_tpi_meanMag_perBox (const int &boxIdx, const int &lev, amrex::MultiFab &mf_cons, amrex::MultiFab &mf_xvel, amrex::MultiFab &mf_yvel) |
| Compute mean horizontal velocity magnitude and direction for one perturbation box. More... | |
| void | debug (double) |
| Write perturbation debug information when debug output is enabled. More... | |
Public Attributes | |
| amrex::Vector< int > | pt_type |
| Integer perturbation type for each AMR level. More... | |
| amrex::Vector< amrex::BoxArray > | pb_ba |
| Perturbation-box BoxArray for each AMR level. More... | |
| amrex::Vector< amrex::Vector< amrex::Real > > | pb_mag |
| Mean velocity magnitude for each perturbation box [m/s]. More... | |
| amrex::Vector< amrex::Vector< amrex::Real > > | pb_dir |
| Mean velocity direction for each perturbation box. More... | |
| amrex::Vector< amrex::MultiFab > | pb_cell |
| Per-cell perturbation amplitude storage. More... | |
Private Member Functions | |
| amrex::Real | RandomReal (const amrex::Real min, const amrex::Real max) |
| Return a pseudo-random real value in a closed interval. More... | |
Private Attributes | |
| int | tpi_layers |
| Number of layers of perturbation boxes. More... | |
| int | tpi_offset |
| Cell offset for the start of the perturbation region. More... | |
| amrex::Vector< int > | tpi_boxDim |
| Dimensions of each perturbation box. More... | |
| amrex::Vector< int > | tpi_direction |
| Boundary directions where perturbations are applied. More... | |
| amrex::Real | tpi_nonDim |
| Nondimensional number used by the perturbation formulation. More... | |
| amrex::Real | tpi_Ti |
| Temperature intensity used by the perturbation formulation. More... | |
| amrex::Real | tpi_Tinf |
| Reference temperature used by the perturbation formulation [K]. More... | |
| amrex::Vector< amrex::Real > | tpi_Hpb |
| Perturbation-box height for each AMR level [m]. More... | |
| amrex::Vector< amrex::Real > | tpi_Lpb |
| Perturbation-box length for each AMR level [m]. More... | |
| amrex::Vector< amrex::Real > | tpi_Wpb |
| Perturbation-box width for each AMR level [m]. More... | |
| amrex::Vector< amrex::Real > | tpi_lref |
| Perturbation-box reference length for each AMR level [m]. More... | |
| amrex::Real | tpi_net_buoyant |
| Accumulated net buoyant perturbation used for correction. More... | |
| amrex::Real | tpi_pert_adjust |
| Per-cell perturbation adjustment used for net-zero buoyancy. More... | |
| amrex::Vector< amrex::IntVect > | ref_ratio |
| Refinement ratios used by multilevel perturbation scaling. More... | |
| amrex::Real | input_Ug |
| Input geostrophic wind speed used to scale CPM perturbations. More... | |
| amrex::Real | input_w_amp |
| Input vertical velocity perturbation amplitude. More... | |
| int | perturbation_klo |
| Lower vertical index bound for perturbations. More... | |
| int | perturbation_khi |
| Upper vertical index bound for perturbations. More... | |
| amrex::Vector< amrex::Vector< double > > | pb_interval |
| Perturbation update interval for each box [s]. More... | |
| amrex::Vector< amrex::Vector< double > > | pb_local_etime |
| Local elapsed time for each perturbation box [s]. More... | |
| amrex::Vector< amrex::Vector< amrex::Real > > | pb_amp |
| Perturbation amplitude for each perturbation box. More... | |
| amrex::Vector< amrex::Vector< amrex::Real > > | pb_netZero |
| Per-box storage used for net-zero buoyancy calculation. More... | |
Runtime state and operations for turbulent perturbation forcing.
|
inline |
|
inline |
Apply stored turbulent perturbations to a source or state array.
| lev | AMR level index. |
| vbx | Valid box over which perturbations may be applied. |
| comp | Component to modify, or -1 for vertical velocity perturbations. |
| m_ixtype | Index type of the destination array. |
| src_arr | Destination array receiving perturbation increments. |
| pert_cell | Stored perturbation amplitudes. |
Referenced by make_sources().


|
inline |
Compute the perturbation amplitude for one perturbation box.
| lev | AMR level index. |
| boxIdx | Perturbation-box index on the level. |
| interval | Current perturbation update interval [s]. |
Referenced by calc_tpi_update().

|
inline |
Compute mean horizontal velocity magnitude and direction for one perturbation box.
| boxIdx | Perturbation-box index on the level. |
| lev | AMR level index. |
| mf_cons | Conserved state used for iteration layout. |
| mf_xvel | X-velocity field. |
| mf_yvel | Y-velocity field. |
Referenced by calc_tpi_update().


|
inline |
Update perturbation amplitudes and intervals when each box is ready.
| lev | AMR level index. |
| dt | Time step for elapsed-time accumulation. |
| mf_xvel | X-velocity field used to compute box mean velocities. |
| mf_yvel | Y-velocity field used to compute box mean velocities. |
| mf_cons | Conserved state used for iteration layout. |

|
inline |
|
inline |
Initialize turbulent perturbation regions and per-box storage.
| lev | AMR level index. |
| subdomains_lev | Rectangular level subdomains used to define perturbation regions. |
| dx | Cell spacing for this level. |
| ba | State BoxArray used for perturbation-cell storage. |
| dm | DistributionMapping for perturbation-cell storage. |
| ngrow_state | Number of ghost cells for perturbation-cell storage. |
| pp_prefix | ParmParse prefix for the ERF input namespace. |
| refRatio | Refinement ratios between AMR levels. |
| max_level | Maximum AMR level configured for the run. |

|
inline |
Store the integer perturbation-type selector for one AMR level.
| lev | AMR level index. |
| pert_type | Perturbation type selected for this level. |
| max_level | Maximum AMR level configured for the run. |
|
inline |
Accumulate the mean perturbation contribution for net-zero buoyancy enforcement.
| boxIdx | Perturbation-box index on the level. |
| lev | AMR level index. |
Referenced by calc_tpi_update().


|
inline |
Adjust perturbation cells so the net buoyant forcing is zero.
| boxIdx | Perturbation-box index on the level. |
| lev | AMR level index. |
Referenced by calc_tpi_update().


|
inline |
Assign pseudo-random perturbations to cells in one perturbation box.
| boxIdx | Perturbation-box index on the level. |
| lev | AMR level index. |
| m_ixtype | Index type used to align perturbation storage. |
Referenced by calc_tpi_update().


|
inlineprivate |
Return a pseudo-random real value in a closed interval.
| min | Lower bound of the interval. |
| max | Upper bound of the interval. |
Referenced by calc_tpi_update(), and pseudoRandomPert().

|
inline |
Reset CPM perturbation amplitudes in one perturbation box to zero.
| boxIdx | Perturbation-box index on the level. |
| lev | AMR level index. |
| m_ixtype | Index type used to align perturbation storage. |
Referenced by calc_tpi_update().


|
private |
Input geostrophic wind speed used to scale CPM perturbations.
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Input vertical velocity perturbation amplitude.
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Perturbation amplitude for each perturbation box.
Referenced by calc_tpi_amp(), init_tpi(), and pseudoRandomPert().
| TurbulentPerturbation::pb_ba |
Perturbation-box BoxArray for each AMR level.
Referenced by apply_tpi(), calc_tpi_meanMag_perBox(), calc_tpi_update(), init_tpi(), netZeroBuoyantAdd(), netZeroBuoyantAdjust(), pseudoRandomPert(), and zero_amp().
| TurbulentPerturbation::pb_cell |
Per-cell perturbation amplitude storage.
Referenced by init_tpi(), make_sources(), netZeroBuoyantAdd(), netZeroBuoyantAdjust(), pseudoRandomPert(), and zero_amp().
| TurbulentPerturbation::pb_dir |
Mean velocity direction for each perturbation box.
Referenced by calc_tpi_meanMag_perBox(), calc_tpi_update(), and init_tpi().
|
private |
Perturbation update interval for each box [s].
Referenced by calc_tpi_update(), and init_tpi().
|
private |
Local elapsed time for each perturbation box [s].
Referenced by calc_tpi_update(), and init_tpi().
| TurbulentPerturbation::pb_mag |
Mean velocity magnitude for each perturbation box [m/s].
Referenced by calc_tpi_amp(), calc_tpi_meanMag_perBox(), calc_tpi_update(), and init_tpi().
|
private |
Per-box storage used for net-zero buoyancy calculation.
Referenced by calc_tpi_update(), init_tpi(), and netZeroBuoyantAdd().
|
private |
Upper vertical index bound for perturbations.
Referenced by init_tpi().
|
private |
Lower vertical index bound for perturbations.
Referenced by init_tpi().
| TurbulentPerturbation::pt_type |
Integer perturbation type for each AMR level.
Referenced by apply_tpi(), calc_tpi_amp(), calc_tpi_update(), init_tpi(), init_tpi_type(), pseudoRandomPert(), and zero_amp().
|
private |
Refinement ratios used by multilevel perturbation scaling.
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Dimensions of each perturbation box.
Referenced by init_tpi().
|
private |
Boundary directions where perturbations are applied.
Referenced by init_tpi().
|
private |
Perturbation-box height for each AMR level [m].
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Number of layers of perturbation boxes.
Referenced by calc_tpi_update(), and init_tpi().
|
private |
Perturbation-box length for each AMR level [m].
Referenced by calc_tpi_update(), and init_tpi().
|
private |
Perturbation-box reference length for each AMR level [m].
Referenced by calc_tpi_update(), and init_tpi().
|
private |
Accumulated net buoyant perturbation used for correction.
Referenced by calc_tpi_update(), and init_tpi().
|
private |
Nondimensional number used by the perturbation formulation.
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Cell offset for the start of the perturbation region.
Referenced by init_tpi().
|
private |
Per-cell perturbation adjustment used for net-zero buoyancy.
Referenced by calc_tpi_update(), init_tpi(), and netZeroBuoyantAdjust().
|
private |
Temperature intensity used by the perturbation formulation.
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Reference temperature used by the perturbation formulation [K].
Referenced by calc_tpi_amp(), and init_tpi().
|
private |
Perturbation-box width for each AMR level [m].
Referenced by calc_tpi_update(), and init_tpi().