Chombo + EB  3.2
DirichletPoissonDomainBC.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _DIRICHLETPOISSONDOMAINBC_H_
12 #define _DIRICHLETPOISSONDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
15 #include "BaseDomainBC.H"
16 #include "BaseBCValue.H"
17 #include "NamespaceHeader.H"
18 
19 ///
20 /**
21  */
23 {
24 public:
25  ///
26  /**
27  */
29 
30  ///
31  /**
32  */
33  virtual ~DirichletPoissonDomainBC();
34 
35  ///
36  /**
37  */
38  virtual void setValue(Real a_value);
39 
40  ///
41  /**
42  */
43  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
44 
45  ///
46  /** use this for order of domain boundary
47  */
48  virtual void setEBOrder(int a_ebOrder);
49 
50  ///
51  /**
52  This is used by the projections to get
53  velocity at domain faces where eb intersects. Sets velocity to a dirichlet value.
54  */
55  virtual void getFaceVel(Real& a_faceFlux,
56  const FaceIndex& a_face,
57  const EBFluxFAB& a_vel,
58  const RealVect& a_probLo,
59  const RealVect& a_dx,
60  const int& a_idir,
61  const int& a_icomp,
62  const Real& a_time,
63  const Side::LoHiSide& a_side);
64 
65  ///
66  /**
67  */
68  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
69  const BaseFab<Real>& a_phi,
70  const RealVect& a_probLo,
71  const RealVect& a_dx,
72  const int& a_idir,
73  const Side::LoHiSide& a_side,
74  const DataIndex& a_dit,
75  const Real& a_time,
76  const bool& a_useHomogeneous);
77 
78  ///
79  /**
80  */
81  void getHigherOrderFaceFlux(BaseFab<Real>& a_faceFlux,
82  const BaseFab<Real>& a_phi,
83  const RealVect& a_probLo,
84  const RealVect& a_dx,
85  const int& a_idir,
86  const Side::LoHiSide& a_side,
87  const DataIndex& a_dit,
88  const Real& a_time,
89  const bool& a_useHomogeneous);
90 
91  ///
92  /**
93  Elliptic solver flux.
94  */
95  virtual void getFaceFlux(Real& a_faceFlux,
96  const VolIndex& a_vof,
97  const int& a_comp,
98  const EBCellFAB& a_phi,
99  const RealVect& a_probLo,
100  const RealVect& a_dx,
101  const int& a_idir,
102  const Side::LoHiSide& a_side,
103  const DataIndex& a_dit,
104  const Real& a_time,
105  const bool& a_useHomogeneous);
106 
107  ///
108  /**
109  Elliptic solver flux.
110  */
111  void getInhomFaceFlux(Real& a_faceFlux,
112  const VolIndex& a_vof,
113  const int& a_comp,
114  const EBCellFAB& a_phi,
115  const RealVect& a_probLo,
116  const RealVect& a_dx,
117  const int& a_idir,
118  const Side::LoHiSide& a_side,
119  const DataIndex& a_dit,
120  const Real& a_time);
121  ///
122  /**
123  A query of whether a_jvof is Dirichlet Domain boundary to a_ivof. a_jvof is the ghost vof; a_ivof is the valid computational vof.
124  If the code runs into here it's got to be Dirichlet BC
125  */
126  bool isDirichletDom(const VolIndex& a_ivof,
127  const VolIndex& a_jvof,
128  const EBCellFAB& a_phi) const
129  {
130  return true;
131  }
132 
133  ///
134  /**
135  This is called by InflowOutflowHelmholtzDomainBC::getFaceFlux,
136  which is called by EBAMRPoissonOp::applyOp when EB x domain.
137  Used for higher-order velocity boundary conditions.
138  This routine iterates over the possible multiple faces at a domain face
139  and calls getHigherOrderFaceFlux(...) below for the individual face extrapolation
140  */
141  void getHigherOrderFaceFlux(Real& a_faceFlux,
142  const VolIndex& a_vof,
143  const int& a_comp,
144  const EBCellFAB& a_phi,
145  const RealVect& a_probLo,
146  const RealVect& a_dx,
147  const int& a_idir,
148  const Side::LoHiSide& a_side,
149  const DataIndex& a_dit,
150  const Real& a_time,
151  const bool& a_useHomogeneous);
152 
153  ///
154  /**
155  This is called by DirichletPoissonDomain::getHigherOrderFaceflux
156  which is called by InflowOutflowHelmholtzDomainBC::getFaceFlux.
157  This is used by the projections to get extrapolated
158  grad(phi) at domain faces for cell-centered gradient.
159  Called by getFaceFlux.
160  */
161  void getHigherOrderFaceFlux(Real& a_faceFlux,
162  const FaceIndex& a_face,
163  const int& a_comp,
164  const EBCellFAB& a_phi,
165  const RealVect& a_probLo,
166  const RealVect& a_dx,
167  const int& a_idir,
168  const Side::LoHiSide& a_side,
169  const DataIndex& a_dit,
170  const Real& a_time,
171  const bool& a_useAreaFrac,
172  const RealVect& a_centroid,
173  const bool& a_useHomogeneous);
174 
175  ///
176  /**
177  This is called by InflowOutflowHelmholtzDomainBC::getFaceFlux,
178  which is called by EBAMRPoissonOp::applyOp when EB x domain.
179  Used for higher-order velocity boundary conditions.
180  This routine iterates over the possible multiple faces at a domain face
181  and calls getHigherOrderFaceFlux(...) below for the individual face extrapolation
182  */
183  void getHigherOrderInhomFaceFlux(Real& a_faceFlux,
184  const VolIndex& a_vof,
185  const int& a_comp,
186  const EBCellFAB& a_phi,
187  const RealVect& a_probLo,
188  const RealVect& a_dx,
189  const int& a_idir,
190  const Side::LoHiSide& a_side,
191  const DataIndex& a_dit,
192  const Real& a_time);
193 
194  ///
195  /**
196  This is called by DirichletPoissonDomain::getHigherOrderFaceflux
197  which is called by InflowOutflowHelmholtzDomainBC::getFaceFlux.
198  This is used by the projections to get extrapolated
199  grad(phi) at domain faces for cell-centered gradient.
200  Called by getFaceFlux.
201  */
202  void getHigherOrderInhomFaceFlux(Real& a_faceFlux,
203  const FaceIndex& a_face,
204  const int& a_comp,
205  const EBCellFAB& a_phi,
206  const RealVect& a_probLo,
207  const RealVect& a_dx,
208  const int& a_idir,
209  const Side::LoHiSide& a_side,
210  const DataIndex& a_dit,
211  const Real& a_time,
212  const bool& a_useAreaFrac,
213  const RealVect& a_centroid);
214 
215  ///
216  /**
217  This is used by the projections to get grad(phi) at domain faces (usually outflow).
218  Called by InflowOutflowPoissonDomainBC::getFaceFlux.
219  */
220  virtual void getFaceGradPhi(Real& a_faceFlux,
221  const FaceIndex& a_face,
222  const int& a_comp,
223  const EBCellFAB& a_phi,
224  const RealVect& a_probLo,
225  const RealVect& a_dx,
226  const int& a_idir,
227  const Side::LoHiSide& a_side,
228  const DataIndex& a_dit,
229  const Real& a_time,
230  const bool& a_useAreaFrac,
231  const RealVect& a_centroid,
232  const bool& a_useHomogeneous);
233 
234  ///
235  /**
236  This is used by the projections to get grad(phi) at domain faces (usually outflow).
237  Called by InflowOutflowPoissonDomainBC::getFaceFlux.
238  */
239  void getInhomFaceGradPhi(Real& a_faceFlux,
240  const FaceIndex& a_face,
241  const int& a_comp,
242  const EBCellFAB& a_phi,
243  const RealVect& a_probLo,
244  const RealVect& a_dx,
245  const int& a_idir,
246  const Side::LoHiSide& a_side,
247  const DataIndex& a_dit,
248  const Real& a_time,
249  const bool& a_useAreaFrac,
250  const RealVect& a_centroid);
251 
252  virtual void getFluxStencil( VoFStencil& a_stencil,
253  const VolIndex& a_vof,
254  const int& a_comp,
255  const RealVect& a_dx,
256  const int& a_idir,
257  const Side::LoHiSide& a_side,
258  const EBISBox& a_ebisBox);
259 
260  virtual void getFluxStencil( VoFStencil& a_stencil,
261  const FaceIndex& a_face,
262  const int& a_comp,
263  const RealVect& a_dx,
264  const int& a_idir,
265  const Side::LoHiSide& a_side,
266  const EBISBox& a_ebisBox);
267 
268  void getFirstOrderFluxStencil( VoFStencil& a_stencil,
269  const FaceIndex& a_face,
270  const int& a_comp,
271  const RealVect& a_dx,
272  const int& a_idir,
273  const Side::LoHiSide& a_side,
274  const EBISBox& a_ebisBox);
275 
276  void getSecondOrderFluxStencil( VoFStencil& a_stencil,
277  const FaceIndex& a_face,
278  const int& a_comp,
279  const RealVect& a_dx,
280  const int& a_idir,
281  const Side::LoHiSide& a_side,
282  const EBISBox& a_ebisBox);
283 
285 
286 private:
289 
292 
294 };
295 
297 {
298 public:
299  ///
300  /**
301  */
303 
304  ///
305  /**
306  */
308 
309  ///
310  /**
311  */
312  virtual DirichletPoissonDomainBC* create(const ProblemDomain& a_domain,
313  const EBISLayout& a_layout,
314  const RealVect& a_dx);
315 
316  ///
317  /**
318  */
319  virtual void setValue(Real a_value);
320 
321  ///
322  /**
323  */
324  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
325 
326  ///
327  /**
328  */
329  virtual void setEBOrder(int a_ebOrder);
330 
331 private:
334 
337 
339 };
340 #include "NamespaceFooter.H"
341 #endif
void getSecondOrderFluxStencil(VoFStencil &a_stencil, const FaceIndex &a_face, const int &a_comp, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const EBISBox &a_ebisBox)
virtual void getFluxStencil(VoFStencil &a_stencil, const VolIndex &a_vof, const int &a_comp, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const EBISBox &a_ebisBox)
virtual void getFaceFlux(BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useHomogeneous)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Definition: BaseDomainBC.H:31
virtual void setValue(Real a_value)
virtual void getFaceGradPhi(Real &a_faceFlux, const FaceIndex &a_face, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useAreaFrac, const RealVect &a_centroid, const bool &a_useHomogeneous)
Definition: FaceIndex.H:28
virtual void getFaceVel(Real &a_faceFlux, const FaceIndex &a_face, const EBFluxFAB &a_vel, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const int &a_icomp, const Real &a_time, const Side::LoHiSide &a_side)
bool m_isFunctional
Definition: DirichletPoissonDomainBC.H:288
Definition: EBISBox.H:46
bool m_onlyHomogeneous
Definition: DirichletPoissonDomainBC.H:287
bool m_onlyHomogeneous
Definition: DirichletPoissonDomainBC.H:332
void getHigherOrderInhomFaceFlux(Real &a_faceFlux, const VolIndex &a_vof, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time)
Definition: DirichletPoissonDomainBC.H:22
VoF-centered stencil.
Definition: Stencils.H:60
void getInhomFaceGradPhi(Real &a_faceFlux, const FaceIndex &a_face, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useAreaFrac, const RealVect &a_centroid)
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
bool m_isFunctional
Definition: DirichletPoissonDomainBC.H:333
int m_ebOrder
Definition: DirichletPoissonDomainBC.H:338
Definition: EBCellFAB.H:29
double Real
Definition: REAL.H:33
void getFirstOrderFluxStencil(VoFStencil &a_stencil, const FaceIndex &a_face, const int &a_comp, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const EBISBox &a_ebisBox)
Definition: BaseDomainBC.H:196
int m_ebOrder
Definition: DirichletPoissonDomainBC.H:293
LoHiSide
Definition: LoHiSide.H:27
Real m_value
Definition: DirichletPoissonDomainBC.H:290
void getHigherOrderFaceFlux(BaseFab< Real > &a_faceFlux, const BaseFab< Real > &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useHomogeneous)
bool isDirichletDom(const VolIndex &a_ivof, const VolIndex &a_jvof, const EBCellFAB &a_phi) const
Definition: DirichletPoissonDomainBC.H:126
virtual void setEBOrder(int a_ebOrder)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void setValue(Real a_value)
Definition: DataIndex.H:112
Definition: DirichletPoissonDomainBC.H:296
Real m_value
Definition: DirichletPoissonDomainBC.H:335
virtual void setFunction(RefCountedPtr< BaseBCValue > a_func)
bool m_isDefined
Definition: DirichletPoissonDomainBC.H:284
Volume of Fluid Index.
Definition: VolIndex.H:31
virtual DirichletPoissonDomainBC * create(const ProblemDomain &a_domain, const EBISLayout &a_layout, const RealVect &a_dx)
virtual ~DirichletPoissonDomainBC()
Definition: EBISLayout.H:39
virtual void setEBOrder(int a_ebOrder)
void getInhomFaceFlux(Real &a_faceFlux, const VolIndex &a_vof, const int &a_comp, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const int &a_idir, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time)
virtual void setFunction(RefCountedPtr< BaseBCValue > a_func)
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonDomainBC.H:291
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonDomainBC.H:336