ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SpongeStruct.H
Go to the documentation of this file.
1 #ifndef ERF_SPONGE_STRUCT_H_
2 #define ERF_SPONGE_STRUCT_H_
3 
4 #include <string>
5 #include <iostream>
6 
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_Print.H>
9 #include <AMReX_Gpu.H>
10 
11 /**
12  * Container holding the sponge-related choices
13  */
14 
15 struct SpongeChoice {
16  public:
17  void init_params()
18  {
19  amrex::ParmParse pp(pp_prefix);
20 
21  pp.query("sponge_type", sponge_type);
22 
23  // Include sponge damping
24  pp.query("use_xlo_sponge_damping", use_xlo_sponge_damping);
25  pp.query("use_xhi_sponge_damping", use_xhi_sponge_damping);
26  pp.query("use_ylo_sponge_damping", use_ylo_sponge_damping);
27  pp.query("use_yhi_sponge_damping", use_yhi_sponge_damping);
28  pp.query("use_zlo_sponge_damping", use_zlo_sponge_damping);
29  pp.query("use_zhi_sponge_damping", use_zhi_sponge_damping);
30 
31  pp.query("sponge_strength" , sponge_strength);
32  pp.query("xlo_sponge_end" , xlo_sponge_end);
33  pp.query("xhi_sponge_start", xhi_sponge_start);
34  pp.query("ylo_sponge_end" , ylo_sponge_end);
35  pp.query("yhi_sponge_start", yhi_sponge_start);
36  pp.query("zlo_sponge_end" , zlo_sponge_end);
37  pp.query("zhi_sponge_start", zhi_sponge_start);
38 
39  pp.query("sponge_density" , sponge_density);
40  pp.query("sponge_x_velocity" , sponge_x_velocity);
41  pp.query("sponge_y_velocity" , sponge_y_velocity);
42  pp.query("sponge_z_velocity" , sponge_z_velocity);
43  }
44 
45  void display()
46  {
47  amrex::Print() << "Sponge choices: " << std::endl;
48  }
49 
50  // Default prefix
51  std::string pp_prefix {"erf"};
52 
53  bool use_xlo_sponge_damping = false;
54  bool use_xhi_sponge_damping = false;
55  bool use_ylo_sponge_damping = false;
56  bool use_yhi_sponge_damping = false;
57  bool use_zlo_sponge_damping = false;
58  bool use_zhi_sponge_damping = false;
59 
60  amrex::Real sponge_strength;
61  std::string sponge_type;
62 
67 };
68 #endif
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:219
Definition: ERF_SpongeStruct.H:15
bool use_xlo_sponge_damping
Definition: ERF_SpongeStruct.H:53
amrex::Real sponge_y_velocity
Definition: ERF_SpongeStruct.H:66
amrex::Real xlo_sponge_end
Definition: ERF_SpongeStruct.H:63
std::string sponge_type
Definition: ERF_SpongeStruct.H:61
amrex::Real zlo_sponge_end
Definition: ERF_SpongeStruct.H:65
bool use_zlo_sponge_damping
Definition: ERF_SpongeStruct.H:57
amrex::Real sponge_strength
Definition: ERF_SpongeStruct.H:60
bool use_ylo_sponge_damping
Definition: ERF_SpongeStruct.H:55
amrex::Real zhi_sponge_start
Definition: ERF_SpongeStruct.H:65
void display()
Definition: ERF_SpongeStruct.H:45
amrex::Real sponge_z_velocity
Definition: ERF_SpongeStruct.H:66
bool use_xhi_sponge_damping
Definition: ERF_SpongeStruct.H:54
amrex::Real sponge_x_velocity
Definition: ERF_SpongeStruct.H:66
void init_params()
Definition: ERF_SpongeStruct.H:17
bool use_zhi_sponge_damping
Definition: ERF_SpongeStruct.H:58
amrex::Real yhi_sponge_start
Definition: ERF_SpongeStruct.H:64
amrex::Real sponge_density
Definition: ERF_SpongeStruct.H:66
bool use_yhi_sponge_damping
Definition: ERF_SpongeStruct.H:56
amrex::Real xhi_sponge_start
Definition: ERF_SpongeStruct.H:63
std::string pp_prefix
Definition: ERF_SpongeStruct.H:51
amrex::Real ylo_sponge_end
Definition: ERF_SpongeStruct.H:64