ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_EBStruct.H
Go to the documentation of this file.
1 #ifndef ERF_EB_STRUCT_H_
2 #define ERF_EB_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  * @brief Boundary condition model applied on embedded-boundary surfaces.
13  */
14 enum struct EBBoundaryType {
16 };
17 
18 /**
19  * @brief Embedded-boundary stress component indices.
20  */
21 enum EBTauType {
23 };
24 
25 /**
26  * @brief Grid centering used for embedded-boundary data.
27  */
28 enum EBGridType {
30 };
31 
32 /**
33  * Container holding EB-related choices
34  */
35 
36 struct EBChoice {
37  public:
38  /**
39  * @brief Read embedded-boundary options from the input parameter database.
40  * @param pp_prefix ParmParse prefix for the ERF input namespace.
41  * @param requires_cover Force eb_cover_zero_area_faces on (a level projects every step: the
42  * projection does not constrain momentum on faces of zero CC area fraction).
43  */
44  void init_params (std::string pp_prefix, bool requires_cover)
45  {
46  amrex::ParmParse pp(pp_prefix);
47 
48  static std::string eb_boundary_type_string = "NoSlipWall";
49  pp.queryAdd("eb_boundary_type",eb_boundary_type_string);
50 
51  if (!eb_boundary_type_string.compare("SlipWall")) {
53  } else if (!eb_boundary_type_string.compare("NoSlipWall")) {
55  } else if (!eb_boundary_type_string.compare("SurfaceLayer")) {
57  } else {
58  amrex::Error("Don't know this eb_boundary_type");
59  }
60 
61  const bool given = pp.query("eb_cover_zero_area_faces", eb_cover_zero_area_faces);
62  if (requires_cover) {
63  if (given && !eb_cover_zero_area_faces) {
64  amrex::Abort("erf.eb_cover_zero_area_faces = false is not allowed with Anelastic or "
65  "PseudoIncompressible levels");
66  }
68  }
69  }
70 
71  /**
72  * @brief Print the configured embedded-boundary options.
73  */
74  void display ()
75  {
76  amrex::Print() << "EB choices: " << std::endl;
78  amrex::Print() << " eb_boundary_type : SlipWall" << std::endl;
80  amrex::Print() << " eb_boundary_type : NoSlipWall" << std::endl;
82  amrex::Print() << " eb_boundary_type : SurfaceLayer" << std::endl;
83  }
84  amrex::Print() << " eb_cover_zero_area_faces: " << (eb_cover_zero_area_faces ? "true" : "false")
85  << std::endl;
86  }
87 
90 };
91 
92 /**
93  * @var EBChoice::eb_boundary_type
94  * @brief Boundary condition model applied on embedded-boundary surfaces.
95  *
96  * @var EBChoice::eb_cover_zero_area_faces
97  * @brief Cover FC EB cells at faces with zero CC area fraction (forced on with a projection).
98  */
99 #endif
EBTauType
Embedded-boundary stress component indices.
Definition: ERF_EBStruct.H:21
@ tau_eb23
Definition: ERF_EBStruct.H:22
@ tau_eb13
Definition: ERF_EBStruct.H:22
EBBoundaryType
Boundary condition model applied on embedded-boundary surfaces.
Definition: ERF_EBStruct.H:14
EBGridType
Grid centering used for embedded-boundary data.
Definition: ERF_EBStruct.H:28
@ yface
Definition: ERF_EBStruct.H:29
@ zface
Definition: ERF_EBStruct.H:29
@ xface
Definition: ERF_EBStruct.H:29
ParmParse pp("prob")
Definition: ERF_SurfaceLayer.H:64
Definition: ERF_EBStruct.H:36
void display()
Print the configured embedded-boundary options.
Definition: ERF_EBStruct.H:74
bool eb_cover_zero_area_faces
Cover FC EB cells at faces with zero CC area fraction (forced on with a projection).
Definition: ERF_EBStruct.H:89
void init_params(std::string pp_prefix, bool requires_cover)
Read embedded-boundary options from the input parameter database.
Definition: ERF_EBStruct.H:44
EBBoundaryType eb_boundary_type
Boundary condition model applied on embedded-boundary surfaces.
Definition: ERF_EBStruct.H:88