Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
cutcell/boundary_condition/IsentropicPressureBoundary.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Maikel Nadolski
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef FUB_AMREX_CUTCELL_ISENTROPIC_PRESSURE_BOUNDARY_HPP
22 #define FUB_AMREX_CUTCELL_ISENTROPIC_PRESSURE_BOUNDARY_HPP
23 
25 
26 #include "fub/Direction.hpp"
29 
31 
32 #include <AMReX.H>
33 
34 namespace fub::amrex::cutcell {
35 /// \ingroup BoundaryCondition
36 ///
40 
41  void Print(SeverityLogger& log) const;
42 
43  std::string channel_name{"IsentropicPressureBoundary"};
45  double outer_pressure = 101325.0;
47  int side = 0;
48 };
49 
50 namespace perfect_gas {
51 
52 /// \ingroup BoundaryCondition
53 ///
55 public:
58  const IsentropicPressureBoundaryOptions& options);
59 
60  void FillBoundary(::amrex::MultiFab& mf, const GriddingAlgorithm& grid,
61  int level);
62 
63  void FillBoundary(::amrex::MultiFab& mf, const GriddingAlgorithm& grid,
64  int level, Direction dir) {
65  if (dir == options_.direction) {
66  FillBoundary(mf, grid, level);
67  }
68  }
69 
70 private:
73 };
74 
75 } // namespace perfect_gas
76 
77 /// \ingroup BoundaryCondition
78 ///
80 public:
82  const IsentropicPressureBoundaryOptions& options);
83 
84  /// \brief Isentropically expand to an outer pressure each state on the
85  /// physical domain boundary.
86  ///
87  /// \param[in,out] mf The MultiFab that will be filled.
88  ///
89  /// \param[in] gridding The GriddingAlgorithm will serve as a context.
90  ///
91  /// \param[in] level The level number which is associated with the specified
92  /// MultiFab `mf`.
93  ///
94  /// \throw The OdeSolver within the FlameMasterReactor might not converge and
95  /// throw an exception.
96  ///
97  /// \throw If an unphysical state appears an exception is thrown.
98  ///
99  /// \pre `mf` is defined with the same (BoxArray, DistributionMapping) as
100  /// defined in the gridding algorithm at refinement level `level`.
101  void FillBoundary(::amrex::MultiFab& mf, const GriddingAlgorithm& gridding,
102  int level);
103 
104  /// \brief Isentropically expand to an outer pressure each state on the
105  /// physical domain boundary.
106  ///
107  /// \param[in,out] mf The MultiFab that will be filled.
108  ///
109  /// \param[in] gridding The GriddingAlgorithm will serve as a context.
110  ///
111  /// \param[in] level The level number which is associated with the specified
112  /// MultiFab `mf`.
113  ///
114  /// \param[in] dir The direction in which the physical boundary shall be
115  /// filled.
116  ///
117  /// \throw The OdeSolver within the FlameMasterReactor might not converge and
118  /// throw an exception.
119  ///
120  /// \throw If an unphysical state appears an exception is thrown.
121  ///
122  /// \pre `mf` is defined with the same (BoxArray, DistributionMapping) as
123  /// defined in the gridding algorithm at refinement level `level`.
124  void FillBoundary(::amrex::MultiFab& mf, const GriddingAlgorithm& gridding,
125  int level, Direction dir) {
126  if (dir == options_.direction) {
127  FillBoundary(mf, gridding, level);
128  }
129  }
130 
131  void FillBoundary(::amrex::MultiFab& mf, const ::amrex::MultiFab& alphas,
132  const ::amrex::Geometry& geom,
133  const Complete<IdealGasMix<AMREX_SPACEDIM>>& state);
134 
135 private:
138 };
139 
140 } // namespace fub::amrex::cutcell
141 
142 #endif // !FUB_AMREX_CUTCELL_ISENTROPIC_PRESSURE_BOUNDARY_HPP
This class modifies and initializes a cutcell::PatchLevel in a cutcell::PatchHierarchy.
Definition: AMReX/cutcell/GriddingAlgorithm.hpp:56
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:79
void FillBoundary(::amrex::MultiFab &mf, const GriddingAlgorithm &gridding, int level, Direction dir)
Isentropically expand to an outer pressure each state on the physical domain boundary.
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:124
IsentropicPressureBoundaryOptions options_
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:137
void FillBoundary(::amrex::MultiFab &mf, const GriddingAlgorithm &gridding, int level)
Isentropically expand to an outer pressure each state on the physical domain boundary.
void FillBoundary(::amrex::MultiFab &mf, const ::amrex::MultiFab &alphas, const ::amrex::Geometry &geom, const Complete< IdealGasMix< AMREX_SPACEDIM >> &state)
IdealGasMix< AMREX_SPACEDIM > equation_
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:136
IsentropicPressureBoundary(const IdealGasMix< AMREX_SPACEDIM > &eq, const IsentropicPressureBoundaryOptions &options)
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:54
PerfectGas< AMREX_SPACEDIM > equation_
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:71
void FillBoundary(::amrex::MultiFab &mf, const GriddingAlgorithm &grid, int level)
void FillBoundary(::amrex::MultiFab &mf, const GriddingAlgorithm &grid, int level, Direction dir)
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:63
IsentropicPressureBoundaryOptions options_
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:72
IsentropicPressureExpansionBoundary(const PerfectGas< AMREX_SPACEDIM > &eq, const IsentropicPressureBoundaryOptions &options)
Definition: FillCutCellData.hpp:30
boost::log::sources::severity_logger< boost::log::trivial::severity_level > SeverityLogger
Definition: Log.hpp:46
Direction
This is a type safe type to denote a dimensional split direction.
Definition: Direction.hpp:30
IndexBox< Rank > Box(const BasicView< State, Layout, Rank > &view)
Definition: State.hpp:486
std::map< std::string, pybind11::object > ProgramOptions
Definition: ProgramOptions.hpp:40
This type has a constructor which takes an equation and might allocate any dynamically sized member v...
Definition: State.hpp:335
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:37
IsentropicPressureBoundaryOptions(const ProgramOptions &options)
::amrex::Box coarse_inner_box
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:44
double outer_pressure
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:45
std::string channel_name
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:43
Direction direction
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:46
int side
Definition: cutcell/boundary_condition/IsentropicPressureBoundary.hpp:47