chombo-discharge
CD_EBHelmholtzRobinDomainBC.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_EBHelmholtzRobinDomainBC.H
8  @brief Declaration of a Robin boundary condition class for EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzRobinDomainBC_H
13 #define CD_EBHelmholtzRobinDomainBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_EBHelmholtzDomainBC.H>
20 #include <CD_NamespaceHeader.H>
21 
29 {
30 public:
35 
39  virtual ~EBHelmholtzRobinDomainBC();
40 
47  void
48  setCoefficients(const Real a_A, const Real a_B, const Real a_C);
49 
56  void
57  setCoefficients(const std::function<Real(const RealVect& a_pos)>& a_A,
58  const std::function<Real(const RealVect& a_pos)>& a_B,
59  const std::function<Real(const RealVect& a_pos)>& a_C);
60 
72  virtual void
73  getFaceFlux(BaseFab<Real>& a_faceFlux,
74  const BaseFab<Real>& a_phi,
75  const BaseFab<Real>& a_Bcoef,
76  const int& a_dir,
77  const Side::LoHiSide& a_side,
78  const DataIndex& a_dit,
79  const bool a_useHomogeneous) const override;
80 
91  virtual Real
92  getFaceFlux(const VolIndex& a_vof,
93  const EBCellFAB& a_phi,
94  const EBFaceFAB& a_Bcoef,
95  const int& a_dir,
96  const Side::LoHiSide& a_side,
97  const DataIndex& a_dit,
98  const bool a_useHomogeneous) const override;
99 
100 protected:
105 
110 
115 
120 
125 
129  std::function<Real(const RealVect& a_pos)> m_functionA;
130 
134  std::function<Real(const RealVect& a_pos)> m_functionB;
135 
139  std::function<Real(const RealVect& a_pos)> m_functionC;
140 };
141 
142 #include <CD_NamespaceFooter.H>
143 
144 #endif
Base class for passing domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzDomainBC.H:29
Base class for passing Robin domain boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzRobinDomainBC.H:29
std::function< Real(const RealVect &a_pos)> m_functionB
Function-based B-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:134
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzRobinDomainBC.H:109
std::function< Real(const RealVect &a_pos)> m_functionA
Function-based A-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:129
void setCoefficients(const Real a_A, const Real a_B, const Real a_C)
Set constant coefficients.
Definition: CD_EBHelmholtzRobinDomainBC.cpp:35
Real m_constantC
Constant C-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:124
Real m_constantA
Constant A-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:114
Real m_constantB
Constant B-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:119
virtual ~EBHelmholtzRobinDomainBC()
Destructor.
Definition: CD_EBHelmholtzRobinDomainBC.cpp:29
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_EBHelmholtzRobinDomainBC.cpp:63
bool m_useConstant
Use constant for BC.
Definition: CD_EBHelmholtzRobinDomainBC.H:104
std::function< Real(const RealVect &a_pos)> m_functionC
Function-based C-coefficient.
Definition: CD_EBHelmholtzRobinDomainBC.H:139
EBHelmholtzRobinDomainBC()
Default constructor. Must subsequently set coefficients.
Definition: CD_EBHelmholtzRobinDomainBC.cpp:21