chombo-discharge
CD_EBHelmholtzNeumannDomainBC.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_EBHelmholtzNeumannDomainBC.H
8  @brief Declaration of a Neumann boundary condition class for EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzNeumannDomainBC_H
13 #define CD_EBHelmholtzNeumannDomainBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_EBHelmholtzDomainBC.H>
20 #include <CD_NamespaceHeader.H>
21 
27 {
28 public:
33 
39  EBHelmholtzNeumannDomainBC(const Real a_DphiDn);
40 
46  EBHelmholtzNeumannDomainBC(const std::function<Real(const RealVect& a_pos)>& a_value);
47 
52 
58  void
59  setDphiDn(const Real a_DphiDn);
60 
66  void
67  setDphiDn(const std::function<Real(const RealVect& a_pos)>& a_DphiDn);
68 
74  void
75  setBxDphiDn(const Real a_BxDphiDn);
76 
82  void
83  setBxDphiDn(const std::function<Real(const RealVect& a_pos)>& a_BxDphiDn);
84 
96  virtual void
97  getFaceFlux(BaseFab<Real>& a_faceFlux,
98  const BaseFab<Real>& a_phi,
99  const BaseFab<Real>& a_Bcoef,
100  const int& a_dir,
101  const Side::LoHiSide& a_side,
102  const DataIndex& a_dit,
103  const bool a_useHomogeneous) const override;
104 
115  virtual Real
116  getFaceFlux(const VolIndex& a_vof,
117  const EBCellFAB& a_phi,
118  const EBFaceFAB& a_Bcoef,
119  const int& a_dir,
120  const Side::LoHiSide& a_side,
121  const DataIndex& a_dit,
122  const bool a_useHomogeneous) const override;
123 
124 protected:
129 
134 
139 
144 
148  std::function<Real(const RealVect& a_pos)> m_functionDphiDn;
149 };
150 
151 #include <CD_NamespaceFooter.H>
152 
153 #endif
Base class for passing domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDomainBC.H:29
Boundary condition class for passing Neumann domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzNeumannDomainBC.H:27
void setDphiDn(const Real a_DphiDn)
Set value of dphi/dn on the EB.
Definition: CD_EBHelmholtzNeumannDomainBC.cpp:51
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzNeumannDomainBC.H:138
std::function< Real(const RealVect &a_pos)> m_functionDphiDn
Value on the domain side.
Definition: CD_EBHelmholtzNeumannDomainBC.H:148
bool m_useConstant
Use constant for BC.
Definition: CD_EBHelmholtzNeumannDomainBC.H:133
void setBxDphiDn(const Real a_BxDphiDn)
Set the value of B*dphi/dn on the EB.
Definition: CD_EBHelmholtzNeumannDomainBC.cpp:77
virtual ~EBHelmholtzNeumannDomainBC()
Destructor.
Definition: CD_EBHelmholtzNeumannDomainBC.cpp:45
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 override
Get face flux. This is for regular cells.
Definition: CD_EBHelmholtzNeumannDomainBC.cpp:97
bool m_multByBco
Hook for multiplying by b-coefficient or not.
Definition: CD_EBHelmholtzNeumannDomainBC.H:128
Real m_constantDphiDn
Value on the domain side.
Definition: CD_EBHelmholtzNeumannDomainBC.H:143
EBHelmholtzNeumannDomainBC()
Constructor. Must subsequently call setDphiDn or setBxDphiDn.
Definition: CD_EBHelmholtzNeumannDomainBC.cpp:21