chombo-discharge
CD_EBHelmholtzDomainBC.H
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
6 /*
7  @file CD_EBHelmholtzDomainBC.H
8  @brief Declaration of a domain boundary condition class for EBHelmholtzOp.
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzDomainBC_H
13 #define CD_EBHelmholtzDomainBC_H
14 
15 // Chombo includes
16 #include <EBLevelGrid.H>
17 #include <RefCountedPtr.H>
18 #include <LevelData.H>
19 #include <EBFluxFAB.H>
20 
21 // Our includes
22 #include <CD_Location.H>
23 #include <CD_NamespaceHeader.H>
24 
29 {
30 public:
35 
39  virtual ~EBHelmholtzDomainBC();
40 
44  EBHelmholtzDomainBC(const EBHelmholtzDomainBC& a_other) = delete;
45 
49  EBHelmholtzDomainBC(const EBHelmholtzDomainBC&& a_other) = delete;
50 
55  operator=(const EBHelmholtzDomainBC& a_other) = delete;
56 
61  operator=(const EBHelmholtzDomainBC&& a_other) = delete;
62 
70  virtual void
71  define(const Location::Cell a_dataLocation, const EBLevelGrid& a_eblg, const RealVect& a_probLo, const Real a_dx);
72 
84  virtual void
85  getFaceFlux(BaseFab<Real>& a_faceFlux,
86  const BaseFab<Real>& a_phi,
87  const BaseFab<Real>& a_Bcoef,
88  const int& a_dir,
89  const Side::LoHiSide& a_side,
90  const DataIndex& a_dit,
91  const bool a_useHomogeneous) const = 0;
92 
103  virtual Real
104  getFaceFlux(const VolIndex& a_vof,
105  const EBCellFAB& a_phi,
106  const EBFaceFAB& a_Bcoef,
107  const int& a_dir,
108  const Side::LoHiSide& a_side,
109  const DataIndex& a_dit,
110  const bool a_useHomogeneous) const = 0;
111 
112 protected:
116  constexpr static int m_comp = 0;
117 
121  constexpr static int m_nComp = 1;
122 
127 
131  Real m_dx;
132 
136  RealVect m_probLo;
137 
141  EBLevelGrid m_eblg;
142 
149  inline RealVect
150  getBoundaryPosition(const IntVect& a_iv, const int& a_dir, const Side::LoHiSide& a_side) const;
151 
163  void
164  multiplyByBcoef(BaseFab<Real>& a_flux,
165  const BaseFab<Real>& a_bco,
166  const int a_dir,
167  const Side::LoHiSide a_side) const;
168 };
169 
170 #include <CD_NamespaceFooter.H>
171 
172 #include <CD_EBHelmholtzDomainBCImplem.H>
173 
174 #endif
Declaration of cell positions.
Base class for passing domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDomainBC.H:29
EBLevelGrid m_eblg
Level grid.
Definition: CD_EBHelmholtzDomainBC.H:141
RealVect getBoundaryPosition(const IntVect &a_iv, const int &a_dir, const Side::LoHiSide &a_side) const
Returns the cell-centered position at the boundary.
Definition: CD_EBHelmholtzDomainBCImplem.H:20
virtual Real getFaceFlux(const VolIndex &a_vof, const EBCellFAB &a_phi, const EBFaceFAB &a_Bcoef, const int &a_dir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const bool a_useHomogeneous) const =0
Get face flux. This is for irregular cells.
Location::Cell m_dataLocation
Data centering.
Definition: CD_EBHelmholtzDomainBC.H:126
EBHelmholtzDomainBC & operator=(const EBHelmholtzDomainBC &a_other)=delete
Disallowed - don't see why you would need it.
EBHelmholtzDomainBC()
Constructor.
Definition: CD_EBHelmholtzDomainBC.cpp:23
void multiplyByBcoef(BaseFab< Real > &a_flux, const BaseFab< Real > &a_bco, const int a_dir, const Side::LoHiSide a_side) const
Utility function which multiplies the flux (or actually, dphi/dn) by the B-coefficient....
Definition: CD_EBHelmholtzDomainBC.cpp:50
EBHelmholtzDomainBC & operator=(const EBHelmholtzDomainBC &&a_other)=delete
Disallowed - don't see why you would need it.
virtual void getFaceFlux(BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const BaseFab< Real > &a_Bcoef, const int &a_dir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const bool a_useHomogeneous) const =0
Get face flux. This is for regular cells.
constexpr static int m_nComp
Number of components. Always have m_nComp = 1.
Definition: CD_EBHelmholtzDomainBC.H:121
constexpr static int m_comp
Component that everything is defined for. Always have m_comp = 0.
Definition: CD_EBHelmholtzDomainBC.H:116
EBHelmholtzDomainBC(const EBHelmholtzDomainBC &a_other)=delete
Disallowed – don't see why you would need it.
EBHelmholtzDomainBC(const EBHelmholtzDomainBC &&a_other)=delete
Disallowed – don't see why you would need it.
Real m_dx
Grid resolution.
Definition: CD_EBHelmholtzDomainBC.H:131
virtual ~EBHelmholtzDomainBC()
Destructor.
Definition: CD_EBHelmholtzDomainBC.cpp:28
virtual void define(const Location::Cell a_dataLocation, const EBLevelGrid &a_eblg, const RealVect &a_probLo, const Real a_dx)
Define function.
Definition: CD_EBHelmholtzDomainBC.cpp:34
RealVect m_probLo
Lower-left corner of computational domain.
Definition: CD_EBHelmholtzDomainBC.H:136
Cell
Enum for distinguishing between cell locations.
Definition: CD_Location.H:30