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

Go to the source code of this file.

Functions

ParmParse pp_for_pert_vels ("prob")
 
pp_for_pert_vels query ("U_0", U_0)
 
pp_for_pert_vels query ("V_0", V_0)
 
pp_for_pert_vels query ("W_0", W_0)
 
pp_for_pert_vels query ("z0", z0)
 
pp_for_pert_vels query ("zRef", zRef)
 
pp_for_pert_vels query ("uRef", uRef)
 
pp_for_pert_vels query ("prob_type", prob_type)
 
pp_for_pert_vels query ("test_flow_amp", test_amp)
 
 ParallelFor (xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real z=use_z_phys ? erf_prob_heights::z_xface(i, j, k, z_nd) :prob_lo[2]+(k+myhalf) *dx[2];if(uRef !=zero) { x_vel_pert(i, j, k)=U_0+uRef *std::log((z+z0)/z0)/std::log((zRef+z0)/z0);} else { x_vel_pert(i, j, k)=U_0;} if(test_amp !=zero) { const Real x=prob_lo[0]+i *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];x_vel_pert(i, j, k)+=test_amp *(tf_kz/tf_kx) *std::sin(tf_kx *(x - tf_xlo)) *std::cos(tf_kz *(z - tf_zlo))+test_amp *std::sin(tf_ky *(y - tf_ylo));} })
 
 ParallelFor (ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { y_vel_pert(i, j, k)=V_0;if(test_amp !=zero) { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];y_vel_pert(i, j, k)+=test_amp *std::sin(tf_kx *(x - tf_xlo));} })
 
 ParallelFor (zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { z_vel_pert(i, j, k)=W_0;if(test_amp !=zero) { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real z=use_z_phys ? erf_prob_heights::z_zface(i, j, k, z_nd) :prob_lo[2]+k *dx[2];z_vel_pert(i, j, k) -=test_amp *std::cos(tf_kx *(x - tf_xlo)) *std::sin(tf_kz *(z - tf_zlo));} })
 

Variables

const bool use_z_phys = use_physical_z()
 
Real U_0 = zero
 
Real V_0 = zero
 
Real W_0 = zero
 
Real z0 = amrex::Real(0.1)
 
Real zRef = amrex::Real(80.0)
 
Real uRef = zero
 
int prob_type = -1
 
Real test_amp = zero
 
const Real tf_xlo = geomdata.ProbLo()[0]
 
const Real tf_ylo = geomdata.ProbLo()[1]
 
const Real tf_Lx = geomdata.ProbHi()[0] - tf_xlo
 
const Real tf_Ly = geomdata.ProbHi()[1] - tf_ylo
 
const Real tf_zlo = geomdata.ProbLo()[2]
 
const Real tf_H = geomdata.ProbHi()[2] - tf_zlo
 
const Real tf_kx = Real(2.0) * PI / tf_Lx
 
const Real tf_ky = Real(2.0) * PI / tf_Ly
 
const Real tf_kz = PI / tf_H
 

Function Documentation

◆ ParallelFor() [1/3]

ParallelFor ( xbx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real z=use_z_phys ? erf_prob_heights::z_xface(i, j, k, z_nd) :prob_lo[2]+(k+myhalf) *dx[2];if(uRef !=zero) { x_vel_pert(i, j, k)=U_0+uRef *std::log((z+z0)/z0)/std::log((zRef+z0)/z0);} else { x_vel_pert(i, j, k)=U_0;} if(test_amp !=zero) { const Real x=prob_lo[0]+i *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];x_vel_pert(i, j, k)+=test_amp *(tf_kz/tf_kx) *std::sin(tf_kx *(x - tf_xlo)) *std::cos(tf_kz *(z - tf_zlo))+test_amp *std::sin(tf_ky *(y - tf_ylo));} }   
)
Here is the call graph for this function:

◆ ParallelFor() [2/3]

ParallelFor ( ybx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { y_vel_pert(i, j, k)=V_0;if(test_amp !=zero) { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];y_vel_pert(i, j, k)+=test_amp *std::sin(tf_kx *(x - tf_xlo));} }   
)

◆ ParallelFor() [3/3]

ParallelFor ( zbx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { z_vel_pert(i, j, k)=W_0;if(test_amp !=zero) { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real z=use_z_phys ? erf_prob_heights::z_zface(i, j, k, z_nd) :prob_lo[2]+k *dx[2];z_vel_pert(i, j, k) -=test_amp *std::cos(tf_kx *(x - tf_xlo)) *std::sin(tf_kz *(z - tf_zlo));} }   
)
Here is the call graph for this function:

◆ pp_for_pert_vels()

ParmParse pp_for_pert_vels ( "prob"  )

◆ query() [1/8]

pp_for_pert_vels query ( "prob_type"  ,
prob_type   
)

◆ query() [2/8]

pp_for_pert_vels query ( "test_flow_amp"  ,
test_amp   
)

◆ query() [3/8]

pp_for_pert_vels query ( "U_0"  ,
U_0   
)

◆ query() [4/8]

pp_for_pert_vels query ( "uRef"  ,
uRef   
)

◆ query() [5/8]

pp_for_pert_vels query ( "V_0"  ,
V_0   
)

◆ query() [6/8]

pp_for_pert_vels query ( "W_0"  ,
W_0   
)

◆ query() [7/8]

pp_for_pert_vels query ( "z0"  ,
z0   
)

◆ query() [8/8]

pp_for_pert_vels query ( "zRef"  ,
zRef   
)

Variable Documentation

◆ prob_type

int prob_type = -1

◆ test_amp

Real test_amp = zero

Referenced by ParallelFor().

◆ tf_H

const Real tf_H = geomdata.ProbHi()[2] - tf_zlo

◆ tf_kx

const Real tf_kx = Real(2.0) * PI / tf_Lx

Referenced by ParallelFor().

◆ tf_ky

const Real tf_ky = Real(2.0) * PI / tf_Ly

Referenced by ParallelFor().

◆ tf_kz

const Real tf_kz = PI / tf_H

Referenced by ParallelFor().

◆ tf_Lx

const Real tf_Lx = geomdata.ProbHi()[0] - tf_xlo

◆ tf_Ly

const Real tf_Ly = geomdata.ProbHi()[1] - tf_ylo

◆ tf_xlo

const Real tf_xlo = geomdata.ProbLo()[0]

Referenced by ParallelFor().

◆ tf_ylo

const Real tf_ylo = geomdata.ProbLo()[1]

Referenced by ParallelFor().

◆ tf_zlo

const Real tf_zlo = geomdata.ProbLo()[2]

Referenced by ParallelFor().

◆ U_0

Real U_0 = zero

Referenced by ParallelFor().

◆ uRef

Real uRef = zero

Referenced by ParallelFor().

◆ use_z_phys

const bool use_z_phys = use_physical_z()

Referenced by ParallelFor().

◆ V_0

Real V_0 = zero

Referenced by ParallelFor().

◆ W_0

Real W_0 = zero

Referenced by ParallelFor().

◆ z0

Real z0 = amrex::Real(0.1)

Referenced by erf_surface_moisture::aerodynamic_resistance(), bound_inverted_roughness(), ib_stability::capped_psi(), Charnock_roughness(), COARE3_roughness(), column_wind_at_height(), compute_if_most_target_vel(), Compute_roughness(), IBFaceSet::compute_sensible(), ComputeDiffusivityYSU(), ComputeDiffusivityYSUNew(), Donelan_roughness(), ib_wall::face_above_factor(), near_surface_diagnostics::fill(), WindFarm::fill_SMark_multifab(), near_surface_diagnostics::fill_wind_10m(), ib_wall::friction_velocity(), ImmersedForcingBuildings_Scalar(), ImmersedForcingBuildings_Xmom(), ImmersedForcingBuildings_Ymom(), ImmersedForcingBuildings_Zmom(), ImmersedForcingTerrain_HorizMom_FractionStress(), ImmersedForcingTerrain_Scalar(), ImmersedForcingTerrain_Scalar_FractionStress(), ImmersedForcingTerrain_Xmom(), ImmersedForcingTerrain_Ymom(), ERF::InitData_post(), ERFFillPatcher::InterpFace(), interpolate_column_metgrid_linear(), adiabatic_mod_charnock::iterate_flux(), adiabatic_charnock::iterate_flux(), adiabatic_donelan::iterate_flux(), adiabatic_wave_coupled::iterate_flux(), surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_temp_charnock::iterate_flux(), surface_temp_mod_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_temp_wave_coupled::iterate_flux(), surface_temp::iterate_flux(), surface_temp_eb::iterate_flux(), make_ib_wall_face_masks(), Mod_Charnock_roughness(), ParallelFor(), ib_wall::phi(), ib_stability::psi_cap(), ib_stability::psi_m_for_ustar(), quad_interp_1d(), ibseb::ray_blocked(), ibseb::ray_hit(), SurfaceLayer::set_default_roughness(), ERFFillPatcher::SetLogLawFill(), erf_surface_moisture::surface_layer_aerodynamic_resistance(), thinbody_wall_dist(), erf_cloud_chamber::wall_roughness_geometry_error(), ib_wall::wall_state(), ib_wall::wall_tke(), and WaveCoupled_roughness().

◆ zRef

Real zRef = amrex::Real(80.0)

Referenced by ParallelFor().