chombo-discharge
CD_MFHelmholtzRobinEBBC.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_MFHelmholtzRobinEBBC.H
8  @brief Declaration of a boundary condition class for MFHelmholtzOp
9  @author Robert Marskar
10 */
11 
12 #ifndef CD_MFHelmholtzRobinEBBC_H
13 #define CD_MFHelmholtzRobinEBBC_H
14 
15 // Std includes
16 #include <functional>
17 
18 // Our includes
19 #include <CD_VofUtils.H>
20 #include <CD_MFHelmholtzEBBC.H>
21 #include <CD_NamespaceHeader.H>
22 
29 {
30 public:
34  MFHelmholtzRobinEBBC(const int a_phase, const RefCountedPtr<MFHelmholtzJumpBC>& a_jumpBC);
35 
39  virtual ~MFHelmholtzRobinEBBC();
40 
45  void
46  setOrder(const int a_order);
47 
52  void
53  setWeight(const int a_weight);
54 
58  virtual void
59  setDomainDropOrder(const int a_domainSize);
60 
67  void
68  setCoefficients(const Real a_A, const Real a_B, const Real a_C);
69 
76  void
77  setCoefficients(const std::function<Real(const RealVect& a_pos)>& a_A,
78  const std::function<Real(const RealVect& a_pos)>& a_B,
79  const std::function<Real(const RealVect& a_pos)>& a_C);
80 
81 protected:
82  /*
83  @brief Use constant for BC
84  */
85  bool m_useConstant;
86 
91 
95  int m_order;
96 
100  int m_weight;
101 
106 
111 
116 
121 
125  std::function<Real(const RealVect& a_pos)> m_functionA;
126 
130  std::function<Real(const RealVect& a_pos)> m_functionB;
131 
135  std::function<Real(const RealVect& a_pos)> m_functionC;
136 
140  virtual void
141  defineSinglePhase() override;
142 
153  virtual void
154  applyEBFluxSinglePhase(VoFIterator& a_singlePhaseVofs,
155  EBCellFAB& a_Lphi,
156  const EBCellFAB& a_phi,
157  const BaseIVFAB<Real>& a_Bcoef,
158  const DataIndex& a_dit,
159  const Real& a_beta,
160  const bool& a_homogeneousPhysBC) const override;
161 
170  VoFStencil
171  getInterpolationStencil(const VolIndex& a_vof,
172  const DataIndex& a_dit,
173  const VofUtils::Neighborhood a_neighborhood,
174  const int a_order) const;
175 };
176 
177 #include <CD_NamespaceFooter.H>
178 
179 #endif
Declaration of an EB boundary condition class for MFHelmholtzOp.
Various functions for getting Vofs near cut-cells.
Class for making boundary conditions on the EB in a multifluid context.
Definition: CD_MFHelmholtzEBBC.H:27
Base class for passing Robin MF boundary conditions into MFHelmholtzOp.
Definition: CD_MFHelmholtzRobinEBBC.H:29
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_MFHelmholtzRobinEBBC.cpp:272
Real m_constantC
Constant C-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:120
virtual void setDomainDropOrder(const int a_domainSize)
Drop BC order if domain size is equal or below this.
Definition: CD_MFHelmholtzRobinEBBC.cpp:60
std::function< Real(const RealVect &a_pos)> m_functionC
Function-based C-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:135
std::function< Real(const RealVect &a_pos)> m_functionA
Function-based A-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:125
MFHelmholtzRobinEBBC(const int a_phase, const RefCountedPtr< MFHelmholtzJumpBC > &a_jumpBC)
Full constructor. Must subsequently set the order and weight for stencils.
Definition: CD_MFHelmholtzRobinEBBC.cpp:22
void setCoefficients(const Real a_A, const Real a_B, const Real a_C)
Set constant coefficients.
Definition: CD_MFHelmholtzRobinEBBC.cpp:68
int m_order
Stencil order.
Definition: CD_MFHelmholtzRobinEBBC.H:95
int m_domainDropOrder
Special flag for dropping stencil order when domains become coarser than this.
Definition: CD_MFHelmholtzRobinEBBC.H:105
virtual void applyEBFluxSinglePhase(VoFIterator &a_singlePhaseVofs, 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 flux single phase.
Definition: CD_MFHelmholtzRobinEBBC.cpp:223
std::function< Real(const RealVect &a_pos)> m_functionB
Function-based B-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:130
void setOrder(const int a_order)
Set BC order.
Definition: CD_MFHelmholtzRobinEBBC.cpp:40
void setWeight(const int a_weight)
Set equation weights for least squares reconstruction.
Definition: CD_MFHelmholtzRobinEBBC.cpp:50
virtual void defineSinglePhase() override
User define function.
Definition: CD_MFHelmholtzRobinEBBC.cpp:96
int m_weight
Stencil weight.
Definition: CD_MFHelmholtzRobinEBBC.H:100
Real m_constantB
Constant B-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:115
virtual ~MFHelmholtzRobinEBBC()
Destructor.
Definition: CD_MFHelmholtzRobinEBBC.cpp:34
bool m_useFunction
Use function for BC value.
Definition: CD_MFHelmholtzRobinEBBC.H:90
Real m_constantA
Constant A-coefficient.
Definition: CD_MFHelmholtzRobinEBBC.H:110
Neighborhood
Neighborhood type.
Definition: CD_VofUtils.H:55