chombo-discharge
CD_EBHelmholtzRobinEBBC.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_EBHelmholtzRobinEBBC.H
8  @brief Declaration of a boundary condition class for EBHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_EBHelmholtzRobinEBBC_H
13 #define CD_EBHelmholtzRobinEBBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_VofUtils.H>
20 #include <CD_EBHelmholtzEBBC.H>
21 #include <CD_NamespaceHeader.H>
22 
30 {
31 public:
36 
45  EBHelmholtzRobinEBBC(const int a_order, const int a_weight, const Real a_A, const Real a_B, const Real a_C);
46 
55  EBHelmholtzRobinEBBC(const int a_order,
56  const int a_weight,
57  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 
64  virtual ~EBHelmholtzRobinEBBC();
65 
70  void
71  setOrder(const int a_order);
72 
77  void
78  setWeight(const int a_weight);
79 
83  virtual void
84  setDomainDropOrder(const int a_domainSize);
85 
92  void
93  setCoefficients(const Real a_A, const Real a_B, const Real a_C);
94 
101  void
102  setCoefficients(const std::function<Real(const RealVect& a_pos)>& a_A,
103  const std::function<Real(const RealVect& a_pos)>& a_B,
104  const std::function<Real(const RealVect& a_pos)>& a_C);
105 
116  virtual void
117  applyEBFlux(VoFIterator& a_vofit,
118  EBCellFAB& a_Lphi,
119  const EBCellFAB& a_phi,
120  const BaseIVFAB<Real>& a_Bcoef,
121  const DataIndex& a_dit,
122  const Real& a_beta,
123  const bool& a_homogeneousPhysBC) const override;
124 
125 protected:
130 
135 
139  int m_order;
140 
144  int m_weight;
145 
150 
155 
160 
165 
169  std::function<Real(const RealVect& a_pos)> m_functionA;
170 
174  std::function<Real(const RealVect& a_pos)> m_functionB;
175 
179  std::function<Real(const RealVect& a_pos)> m_functionC;
180 
184  virtual void
185  define() override;
186 
195  VoFStencil
196  getInterpolationStencil(const VolIndex& a_vof,
197  const DataIndex& a_dit,
198  const VofUtils::Neighborhood a_neighborhood,
199  const int a_order) const;
200 };
201 
202 #include <CD_NamespaceFooter.H>
203 
204 #endif
Various functions for getting Vofs near cut-cells.
Base class for passing EB boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzEBBC.H:29
Base class for passing Robin EB boundary conditions into EBHelmholtzOp.
Definition: CD_EBHelmholtzRobinEBBC.H:30
int m_domainDropOrder
Special flag for dropping stencil order when domains become coarser than this.
Definition: CD_EBHelmholtzRobinEBBC.H:149
Real m_constantA
Constant A-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:154
VoFStencil getInterpolationStencil(const VolIndex &a_vof, const DataIndex &a_dit, const VofUtils::Neighborhood a_neighborhood, const int a_order) const
Get a least-squares based interpolation stencil.
Definition: CD_EBHelmholtzRobinEBBC.cpp:304
bool m_useFunction
Use function for BC value.
Definition: CD_EBHelmholtzRobinEBBC.H:134
EBHelmholtzRobinEBBC()
Default constructor. Must subsequently set coefficients.
Definition: CD_EBHelmholtzRobinEBBC.cpp:22
virtual ~EBHelmholtzRobinEBBC()
Destructor.
Definition: CD_EBHelmholtzRobinEBBC.cpp:68
Real m_constantB
Constant B-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:159
std::function< Real(const RealVect &a_pos)> m_functionB
Function-based B-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:174
std::function< Real(const RealVect &a_pos)> m_functionC
Function-based C-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:179
virtual void define() override
User define function.
Definition: CD_EBHelmholtzRobinEBBC.cpp:130
int m_weight
Stencil weight (for weighting equations in least squares reconstruction)
Definition: CD_EBHelmholtzRobinEBBC.H:144
void setOrder(const int a_order)
Set BC order.
Definition: CD_EBHelmholtzRobinEBBC.cpp:74
int m_order
Stencil order.
Definition: CD_EBHelmholtzRobinEBBC.H:139
Real m_constantC
Constant C-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:164
bool m_useConstant
Use constant for BC.
Definition: CD_EBHelmholtzRobinEBBC.H:129
void setWeight(const int a_weight)
Set equation weights for least squares reconstruction.
Definition: CD_EBHelmholtzRobinEBBC.cpp:84
std::function< Real(const RealVect &a_pos)> m_functionA
Function-based A-coefficient.
Definition: CD_EBHelmholtzRobinEBBC.H:169
virtual void applyEBFlux(VoFIterator &a_vofit, EBCellFAB &a_Lphi, const EBCellFAB &a_phi, const BaseIVFAB< Real > &a_Bcoef, const DataIndex &a_dit, const Real &a_beta, const bool &a_homogeneousPhysBC) const override
Apply the EB flux. This is the version that is called by EBHelmholtzOp.
Definition: CD_EBHelmholtzRobinEBBC.cpp:254
virtual void setDomainDropOrder(const int a_domainSize)
Drop BC order if domain size is equal or below this.
Definition: CD_EBHelmholtzRobinEBBC.cpp:94
void setCoefficients(const Real a_A, const Real a_B, const Real a_C)
Set constant coefficients.
Definition: CD_EBHelmholtzRobinEBBC.cpp:102
Neighborhood
Neighborhood type.
Definition: CD_VofUtils.H:55