ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPert_ABL.H File Reference

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("rho_0", rho_0)
 
pp query ("T_0", T_0)
 
pp query ("A_0", A_0)
 
pp query ("KE_0", KE_0)
 
pp query ("rhoKE_0", rhoKE_0)
 
pp query ("KE_decay_height", KE_decay_height)
 
pp query ("KE_decay_order", KE_decay_order)
 
pp query ("T_0_Pert_Mag", T_0_Pert_Mag)
 
pp query ("pert_rhotheta", pert_rhotheta)
 
pp query ("pert_deltaU", pert_deltaU)
 
pp query ("pert_deltaV", pert_deltaV)
 
pp query ("pert_ref_height", pert_ref_height)
 
 if (KE_decay_height > 0)
 
 if (pert_ref_height > 0)
 
 ParallelForRNG (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real x=prob_lo_x+(i+0.5) *dx;const Real y=prob_lo_y+(j+0.5) *dy;const Real z=z_cc(i, j, k);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z<=pert_ref_height) &&(T_0_Pert_Mag !=0.0)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *2.0 - 1.0) *T_0_Pert_Mag;if(!pert_rhotheta) { state_pert(i, j, k, RhoTheta_comp) *=r_hse(i, j, k);} } state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-10.*r *r);if(state_pert.nComp() > RhoKE_comp) { if(rhoKE_0 > 0) { state_pert(i, j, k, RhoKE_comp)=rhoKE_0;} else { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;} if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=amrex::max(std::pow(1 - amrex::min(z/KE_decay_height, 1.0), KE_decay_order), 1e-12);} } })
 

Variables

Real rho_0 = 0.0
 
Real T_0 = 0.0
 
Real A_0 = 1.0
 
Real KE_0 = 0.1
 
Real rhoKE_0 = -1
 
Real KE_decay_height = -1
 
Real KE_decay_order = 1
 
Real T_0_Pert_Mag = 0.0
 
bool pert_rhotheta = true
 
Real pert_deltaU = 0.0
 
Real pert_deltaV = 0.0
 
Real pert_ref_height = 100.0
 
const Real dx = geomdata.CellSize(0)
 
const Real dy = geomdata.CellSize(1)
 
const Real prob_lo_x = geomdata.ProbLo(0)
 
const Real prob_lo_y = geomdata.ProbLo(1)
 
const Real prob_lo_z = geomdata.ProbLo(2)
 
const Real prob_hi_x = geomdata.ProbHi(0)
 
const Real prob_hi_y = geomdata.ProbHi(1)
 
const Real prob_hi_z = geomdata.ProbHi(2)
 
const Real xc = 0.5 * (prob_lo_x + prob_hi_x)
 
const Real yc = 0.5 * (prob_lo_y + prob_hi_y)
 
const Real zc = 0.5 * (prob_lo_z + prob_hi_z)
 

Function Documentation

◆ if() [1/2]

if ( KE_decay_height  ,
 
)
37  {
38  amrex::Print() << "Initial KE profile (order " << KE_decay_order
39  << ") will extend up to " << KE_decay_height
40  << std::endl;
41  }
Real KE_decay_order
Definition: ERF_InitCustomPert_ABL.H:11
Real KE_decay_height
Definition: ERF_InitCustomPert_ABL.H:10

◆ if() [2/2]

if ( pert_ref_height  ,
 
)
44  {
45  if (T_0_Pert_Mag != 0.0) {
46  if (pert_rhotheta) {
47  amrex::Print() << "Adding random rho*theta perturbations" << std::endl;
48  } else {
49  amrex::Print() << "Adding random theta perturbations" << std::endl;
50  }
51  }
52  }
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_ABL.H:14
bool pert_rhotheta
Definition: ERF_InitCustomPert_ABL.H:15

◆ ParallelForRNG()

ParallelForRNG ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real x=prob_lo_x+(i+0.5) *dx;const Real y=prob_lo_y+(j+0.5) *dy;const Real z=z_cc(i, j, k);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z<=pert_ref_height) &&(T_0_Pert_Mag !=0.0)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *2.0 - 1.0) *T_0_Pert_Mag;if(!pert_rhotheta) { state_pert(i, j, k, RhoTheta_comp) *=r_hse(i, j, k);} } state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-10.*r *r);if(state_pert.nComp() > RhoKE_comp) { if(rhoKE_0 > 0) { state_pert(i, j, k, RhoKE_comp)=rhoKE_0;} else { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;} if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=amrex::max(std::pow(1 - amrex::min(z/KE_decay_height, 1.0), KE_decay_order), 1e-12);} } }   
)

Referenced by ERF::create_random_perturbations(), and TurbulentPerturbation::pseudoRandomPert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

Referenced by add_par(), Morrison::Advance(), ERF::appendPlotVariables(), SolverChoice::build_coriolis_forcings_const_lat(), TurbulentPerturbation::calc_tpi_update(), eb_aux_::define(), AdvChoice::display(), ERF::ERF(), erf_init_dens_hse_moist(), erf_init_rayleigh(), ERF::ErrorEst(), Morrison::Init(), NOAHMP::Init(), ProblemBase::init_buildings_surface(), ERF::init_custom(), init_my_custom_terrain(), TurbChoice::init_params(), SolverChoice::init_params(), AdvChoice::init_params(), DampingChoice::init_params(), DiffChoice::init_params(), EBChoice::init_params(), SpongeChoice::init_params(), ERF::init_phys_bcs(), ProblemBase::init_terrain_surface(), TurbulentPerturbation::init_tpi(), init_which_terrain_grid(), WindFarm::init_windfarm_lat_lon(), init_zlevels(), ERF::InitData_post(), InputSoundingData::InputSoundingData(), InputSpongeData::InputSpongeData(), LineSampler::LineSampler(), SurfaceLayer::make_SurfaceLayer_at_level(), ProblemBase::name(), PlaneSampler::PlaneSampler(), query_one_or_per_level(), Radiation::Radiation(), SolverChoice::read_int_string(), ReadBndryPlanes::ReadBndryPlanes(), ERF::ReadCheckpointFile(), SDInitialization::readInputs(), SDInjection::readInputs(), SDInitProperties::readInputs(), ERF::ReadParameters(), ERF::refinement_criteria_setup(), MOSTAverage::set_k_indices_N(), MOSTAverage::set_k_indices_T(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_z_positions_T(), ERF::setPlotVariables(), ERF::setPlotVariables2D(), ERF::setSubVolVariables(), IRadiation::setupDataLog(), SHOCInterface::SHOCInterface(), SurfaceLayer::SurfaceLayer(), WriteBndryPlanes::WriteBndryPlanes(), and ERF::WriteSubvolume().

◆ query() [1/12]

pp query ( "A_0"  ,
A_0   
)

◆ query() [2/12]

pp query ( "KE_0"  ,
KE_0   
)

◆ query() [3/12]

pp query ( "KE_decay_height"  ,
KE_decay_height   
)

◆ query() [4/12]

pp query ( "KE_decay_order"  ,
KE_decay_order   
)

◆ query() [5/12]

pp query ( "pert_deltaU"  ,
pert_deltaU   
)

◆ query() [6/12]

pp query ( "pert_deltaV"  ,
pert_deltaV   
)

◆ query() [7/12]

pp_for_pert_vels query ( "pert_ref_height"  ,
pert_ref_height   
)

◆ query() [8/12]

pp query ( "pert_rhotheta"  ,
pert_rhotheta   
)

◆ query() [9/12]

pp query ( "rho_0"  ,
rho_0   
)

Referenced by containerHasElement().

Here is the caller graph for this function:

◆ query() [10/12]

pp query ( "rhoKE_0"  ,
rhoKE_0   
)

◆ query() [11/12]

pp query ( "T_0"  ,
T_0   
)

◆ query() [12/12]

pp query ( "T_0_Pert_Mag"  ,
T_0_Pert_Mag   
)

Variable Documentation

◆ A_0

Real A_0 = 1.0

Referenced by ParallelForRNG().

◆ dx

const Real dx = geomdata.CellSize(0)

Referenced by ERF::apply_gaussian_smoothing_to_perturbations(), ApplyBndryForcing_Forecast(), ApplySpongeZoneBCsForCC(), ApplySpongeZoneBCsForMom(), ApplySpongeZoneBCsForMom_ReadFromFile(), compute_gradp(), MOSTAverage::compute_region_averages(), ComputeGlobalMinLocation(), eb_aux_::define(), ForestDrag::define_drag_field(), DiffusionSrcForMom_EB(), erf_calc_slopes_eb_Dirichlet(), erf_calc_slopes_eb_Dirichlet_staggered(), erf_calc_slopes_eb_staggered(), erf_calc_slopes_eb_staggered_upwind(), derived::erf_derenstrophysq(), derived::erf_dervorty(), derived::erf_dervortz(), erf_slow_rhs_post(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_NS(), erf_substep_T(), ERF::ErrorEst(), WindFarm::fill_Nturb_multifab(), WindFarm::fill_SMark_multifab(), WindFarm::fill_SMark_multifab_mesoscale_models(), ERF::FillForecastStateMultiFabs(), ERF::FillSurfaceStateMultiFabs(), ERF::FindInitialEye(), HurricaneEyeTrackerNotInitial(), HurricaneMaxVelTracker(), HurricaneMinPressureTracker(), if(), init_bx_scalars_from_input_sounding(), init_bx_scalars_from_input_sounding_hse(), init_bx_velocities_from_input_sounding(), init_default_zphys(), init_my_custom_terrain(), TurbulentPerturbation::init_tpi(), init_zlevels(), interpolate_from_coarse(), make_areas(), make_J(), MOSTAverage::make_MOSTAverage_at_level(), make_sources(), ParallelFor(), ParallelForRNG(), ERF::poisson_wall_dist(), ERF::project_momenta(), SurfaceLayer::read_custom_roughness(), ProblemBase::read_custom_terrain(), realbdy_compute_interior_ghost_rhs(), realbdy_compute_relaxation(), ERF::refinement_criteria_setup(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_z_positions_T(), ERF::setSpongeRefFromSounding(), ERF::solve_with_gmres(), EWP::source_terms_cellcentered(), Fitch::source_terms_cellcentered(), GeneralAD::source_terms_cellcentered(), SimpleAD::source_terms_cellcentered(), ERF::sum_derived_quantities(), ERF::sum_energy_quantities(), tag_on_distance_from_eye(), thinbody_wall_dist(), ERF::volWgtColumnSum(), ERF::volWgtSumMF(), ERF::Write2DPlotFile(), ERF::Write3DPlotFile(), ERF::write_1D_profiles(), ERF::write_1D_profiles_stag(), LineSampler::write_line_plotfile(), and writeNCPlotFile().

◆ dy

◆ KE_0

Real KE_0 = 0.1

Referenced by ParallelForRNG().

◆ KE_decay_height

Real KE_decay_height = -1

Referenced by if(), and ParallelForRNG().

◆ KE_decay_order

Real KE_decay_order = 1

Referenced by if(), and ParallelForRNG().

◆ pert_deltaU

Real pert_deltaU = 0.0

◆ pert_deltaV

Real pert_deltaV = 0.0

◆ pert_ref_height

Real pert_ref_height = 100.0

Referenced by ParallelForRNG().

◆ pert_rhotheta

bool pert_rhotheta = true

Referenced by if(), and ParallelForRNG().

◆ prob_hi_x

const Real prob_hi_x = geomdata.ProbHi(0)

◆ prob_hi_y

const Real prob_hi_y = geomdata.ProbHi(1)

◆ prob_hi_z

const Real prob_hi_z = geomdata.ProbHi(2)

◆ prob_lo_x

const Real prob_lo_x = geomdata.ProbLo(0)

Referenced by ParallelForRNG().

◆ prob_lo_y

const Real prob_lo_y = geomdata.ProbLo(1)

Referenced by ParallelForRNG().

◆ prob_lo_z

const Real prob_lo_z = geomdata.ProbLo(2)

◆ rho_0

◆ rhoKE_0

Real rhoKE_0 = -1

Referenced by ParallelForRNG().

◆ T_0

◆ T_0_Pert_Mag

Real T_0_Pert_Mag = 0.0

Referenced by if(), and ParallelForRNG().

◆ xc

const Real xc = 0.5 * (prob_lo_x + prob_hi_x)

◆ yc

const Real yc = 0.5 * (prob_lo_y + prob_hi_y)

◆ zc

const Real zc = 0.5 * (prob_lo_z + prob_hi_z)

Referenced by ParallelFor(), and ParallelForRNG().