ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPert_TurbulentInflow.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 ("KE_decay_height", KE_decay_height)
 
pp query ("KE_decay_order", KE_decay_order)
 
pp query ("U_0", U_0)
 
pp query ("V_0", V_0)
 
pp query ("W_0", W_0)
 
pp query ("U_0_Pert_Mag", U_0_Pert_Mag)
 
pp query ("V_0_Pert_Mag", V_0_Pert_Mag)
 
pp query ("W_0_Pert_Mag", W_0_Pert_Mag)
 
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_periods_U", pert_periods_U)
 
pp query ("pert_periods_V", pert_periods_V)
 
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 *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=z_cc(i, j, k);const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(prob_lo[2]+prob_hi[2]);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 !=zero)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *two - one) *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(-amrex::Real(10.) *r *r);if(state_pert.nComp() > RhoKE_comp) { 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) *=max(std::pow(1 - min(z/KE_decay_height, one), KE_decay_order), Real(1e-12));} } })
 

Variables

Real rho_0 = one
 
Real T_0 = amrex::Real(300.0)
 
Real A_0 = one
 
Real KE_0 = amrex::Real(0.1)
 
Real KE_decay_height = -1
 
Real KE_decay_order = 1
 
Real U_0 = zero
 
Real V_0 = zero
 
Real W_0 = zero
 
Real U_0_Pert_Mag = zero
 
Real V_0_Pert_Mag = zero
 
Real W_0_Pert_Mag = zero
 
Real T_0_Pert_Mag = zero
 
bool pert_rhotheta = true
 
Real pert_deltaU = zero
 
Real pert_deltaV = zero
 
Real pert_periods_U = amrex::Real(5.0)
 
Real pert_periods_V = amrex::Real(5.0)
 
Real pert_ref_height = amrex::Real(100.0)
 
const Realprob_lo = geomdata.ProbLo()
 
const Realprob_hi = geomdata.ProbHi()
 

Function Documentation

◆ if() [1/2]

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

◆ if() [2/2]

if ( pert_ref_height  ,
 
)
40  {
41  if ((pert_deltaU != zero) || (pert_deltaV != zero)) {
42  amrex::Print() << "Adding divergence-free perturbations "
43  << pert_deltaU << " " << pert_deltaV
44  << std::endl;
45  }
46  if (U_0_Pert_Mag != zero) {
47  amrex::Print() << "Adding random x-velocity perturbations" << std::endl;
48  }
49  if (V_0_Pert_Mag != zero) {
50  amrex::Print() << "Adding random y-velocity perturbations" << std::endl;
51  }
52  if (T_0_Pert_Mag != zero) {
53  if (pert_rhotheta) {
54  amrex::Print() << "Adding random rho*theta perturbations" << std::endl;
55  } else {
56  amrex::Print() << "Adding random theta perturbations" << std::endl;
57  }
58  }
59  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:21
Real U_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:18
Real pert_deltaV
Definition: ERF_InitCustomPert_TurbulentInflow.H:26
Real pert_deltaU
Definition: ERF_InitCustomPert_TurbulentInflow.H:25
bool pert_rhotheta
Definition: ERF_InitCustomPert_TurbulentInflow.H:22
Real V_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:19

◆ ParallelForRNG()

ParallelForRNG ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=z_cc(i, j, k);const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(prob_lo[2]+prob_hi[2]);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 !=zero)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *two - one) *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(-amrex::Real(10.) *r *r);if(state_pert.nComp() > RhoKE_comp) { 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) *=max(std::pow(1 - min(z/KE_decay_height, one), KE_decay_order), Real(1e-12));} } }   
)
Here is the call graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

◆ query() [1/19]

pp query ( "A_0"  ,
A_0   
)

◆ query() [2/19]

pp query ( "KE_0"  ,
KE_0   
)

◆ query() [3/19]

pp query ( "KE_decay_height"  ,
KE_decay_height   
)

◆ query() [4/19]

pp query ( "KE_decay_order"  ,
KE_decay_order   
)

◆ query() [5/19]

pp query ( "pert_deltaU"  ,
pert_deltaU   
)

◆ query() [6/19]

pp query ( "pert_deltaV"  ,
pert_deltaV   
)

◆ query() [7/19]

pp query ( "pert_periods_U"  ,
pert_periods_U   
)

◆ query() [8/19]

pp query ( "pert_periods_V"  ,
pert_periods_V   
)

◆ query() [9/19]

pp query ( "pert_ref_height"  ,
pert_ref_height   
)

◆ query() [10/19]

pp query ( "pert_rhotheta"  ,
pert_rhotheta   
)

◆ query() [11/19]

pp query ( "rho_0"  ,
rho_0   
)

◆ query() [12/19]

pp query ( "T_0"  ,
T_0   
)

◆ query() [13/19]

pp query ( "T_0_Pert_Mag"  ,
T_0_Pert_Mag   
)

◆ query() [14/19]

pp query ( "U_0"  ,
U_0   
)

◆ query() [15/19]

pp query ( "U_0_Pert_Mag"  ,
U_0_Pert_Mag   
)

◆ query() [16/19]

pp query ( "V_0"  ,
V_0   
)

◆ query() [17/19]

pp query ( "V_0_Pert_Mag"  ,
V_0_Pert_Mag   
)

◆ query() [18/19]

pp query ( "W_0"  ,
W_0   
)

◆ query() [19/19]

pp query ( "W_0_Pert_Mag"  ,
W_0_Pert_Mag   
)

Variable Documentation

◆ A_0

Real A_0 = one

Referenced by ParallelForRNG().

◆ KE_0

Real KE_0 = amrex::Real(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 = zero

Referenced by if().

◆ pert_deltaV

Real pert_deltaV = zero

Referenced by if().

◆ pert_periods_U

Real pert_periods_U = amrex::Real(5.0)

◆ pert_periods_V

Real pert_periods_V = amrex::Real(5.0)

◆ pert_ref_height

Real pert_ref_height = amrex::Real(100.0)

Referenced by ParallelForRNG().

◆ pert_rhotheta

bool pert_rhotheta = true

Referenced by if(), and ParallelForRNG().

◆ prob_hi

const Real* prob_hi = geomdata.ProbHi()

Referenced by ParallelForRNG().

◆ prob_lo

const Real* prob_lo = geomdata.ProbLo()

Referenced by ParallelForRNG().

◆ rho_0

Real rho_0 = one

◆ T_0

Real T_0 = amrex::Real(300.0)

◆ T_0_Pert_Mag

Real T_0_Pert_Mag = zero

Referenced by if(), and ParallelForRNG().

◆ U_0

Real U_0 = zero

Referenced by erf_init_rayleigh().

◆ U_0_Pert_Mag

Real U_0_Pert_Mag = zero

Referenced by if().

◆ V_0

Real V_0 = zero

◆ V_0_Pert_Mag

Real V_0_Pert_Mag = zero

Referenced by if().

◆ W_0

Real W_0 = zero

Referenced by erf_init_rayleigh().

◆ W_0_Pert_Mag

Real W_0_Pert_Mag = zero