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  virtual void setData(LevelData<EBCellFAB>* a_data)
46  {
47  m_data = a_data;
48  m_dataBased = true;
49  m_onlyHomogeneous = false;
50  }
51 
52  ///
53  /** use this for order of domain boundary
54  */
55  virtual void setEBOrder(int a_ebOrder);
56 
57  ///
58  /**
59  This is used by the projections to get
60  velocity at domain faces where eb intersects. Sets velocity to a dirichlet value.
61  */
62  virtual void getFaceVel(Real& a_faceFlux,
63  const FaceIndex& a_face,
64  const EBFluxFAB& a_vel,
65  const RealVect& a_probLo,
66  const RealVect& a_dx,
67  const int& a_idir,
68  const int& a_icomp,
69  const Real& a_time,
70  const Side::LoHiSide& a_side);
71 
72  ///
73  /**
74  */
75  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
76  const BaseFab<Real>& a_phi,
77  const RealVect& a_probLo,
78  const RealVect& a_dx,
79  const int& a_idir,
80  const Side::LoHiSide& a_side,
81  const DataIndex& a_dit,
82  const Real& a_time,
83  const bool& a_useHomogeneous);
84 
85  ///
86  /**
87  */
88  void getHigherOrderFaceFlux(BaseFab<Real>& a_faceFlux,
89  const BaseFab<Real>& a_phi,
90  const RealVect& a_probLo,
91  const RealVect& a_dx,
92  const int& a_idir,
93  const Side::LoHiSide& a_side,
94  const DataIndex& a_dit,
95  const Real& a_time,
96  const bool& a_useHomogeneous);
97 
98  ///
99  /**
100  Elliptic solver flux.
101  */
102  virtual void getFaceFlux(Real& a_faceFlux,
103  const VolIndex& a_vof,
104  const int& a_comp,
105  const EBCellFAB& a_phi,
106  const RealVect& a_probLo,
107  const RealVect& a_dx,
108  const int& a_idir,
109  const Side::LoHiSide& a_side,
110  const DataIndex& a_dit,
111  const Real& a_time,
112  const bool& a_useHomogeneous);
113 
114  ///
115  /**
116  Elliptic solver flux.
117  */
118  void getInhomFaceFlux(Real& a_faceFlux,
119  const VolIndex& a_vof,
120  const int& a_comp,
121  const EBCellFAB& a_phi,
122  const RealVect& a_probLo,
123  const RealVect& a_dx,
124  const int& a_idir,
125  const Side::LoHiSide& a_side,
126  const DataIndex& a_dit,
127  const Real& a_time);
128  ///
129  /**
130  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.
131  If the code runs into here it's got to be Dirichlet BC
132  */
133  bool isDirichletDom(const VolIndex& a_ivof,
134  const VolIndex& a_jvof,
135  const EBCellFAB& a_phi) const
136  {
137  return true;
138  }
139 
140  ///
141  /**
142  This is called by InflowOutflowHelmholtzDomainBC::getFaceFlux,
143  which is called by EBAMRPoissonOp::applyOp when EB x domain.
144  Used for higher-order velocity boundary conditions.
145  This routine iterates over the possible multiple faces at a domain face
146  and calls getHigherOrderFaceFlux(...) below for the individual face extrapolation
147  */
148  void getHigherOrderFaceFlux(Real& a_faceFlux,
149  const VolIndex& a_vof,
150  const int& a_comp,
151  const EBCellFAB& a_phi,
152  const RealVect& a_probLo,
153  const RealVect& a_dx,
154  const int& a_idir,
155  const Side::LoHiSide& a_side,
156  const DataIndex& a_dit,
157  const Real& a_time,
158  const bool& a_useHomogeneous);
159 
160  ///
161  /**
162  This is called by DirichletPoissonDomain::getHigherOrderFaceflux
163  which is called by InflowOutflowHelmholtzDomainBC::getFaceFlux.
164  This is used by the projections to get extrapolated
165  grad(phi) at domain faces for cell-centered gradient.
166  Called by getFaceFlux.
167  */
168  void getHigherOrderFaceFlux(Real& a_faceFlux,
169  const FaceIndex& a_face,
170  const int& a_comp,
171  const EBCellFAB& a_phi,
172  const RealVect& a_probLo,
173  const RealVect& a_dx,
174  const int& a_idir,
175  const Side::LoHiSide& a_side,
176  const DataIndex& a_dit,
177  const Real& a_time,
178  const bool& a_useAreaFrac,
179  const RealVect& a_centroid,
180  const bool& a_useHomogeneous);
181 
182  ///
183  /**
184  This is called by InflowOutflowHelmholtzDomainBC::getFaceFlux,
185  which is called by EBAMRPoissonOp::applyOp when EB x domain.
186  Used for higher-order velocity boundary conditions.
187  This routine iterates over the possible multiple faces at a domain face
188  and calls getHigherOrderFaceFlux(...) below for the individual face extrapolation
189  */
190  void getHigherOrderInhomFaceFlux(Real& a_faceFlux,
191  const VolIndex& a_vof,
192  const int& a_comp,
193  const EBCellFAB& a_phi,
194  const RealVect& a_probLo,
195  const RealVect& a_dx,
196  const int& a_idir,
197  const Side::LoHiSide& a_side,
198  const DataIndex& a_dit,
199  const Real& a_time);
200 
201  ///
202  /**
203  This is called by DirichletPoissonDomain::getHigherOrderFaceflux
204  which is called by InflowOutflowHelmholtzDomainBC::getFaceFlux.
205  This is used by the projections to get extrapolated
206  grad(phi) at domain faces for cell-centered gradient.
207  Called by getFaceFlux.
208  */
209  void getHigherOrderInhomFaceFlux(Real& a_faceFlux,
210  const FaceIndex& a_face,
211  const int& a_comp,
212  const EBCellFAB& a_phi,
213  const RealVect& a_probLo,
214  const RealVect& a_dx,
215  const int& a_idir,
216  const Side::LoHiSide& a_side,
217  const DataIndex& a_dit,
218  const Real& a_time,
219  const bool& a_useAreaFrac,
220  const RealVect& a_centroid);
221 
222  ///
223  /**
224  This is used by the projections to get grad(phi) at domain faces (usually outflow).
225  Called by InflowOutflowPoissonDomainBC::getFaceFlux.
226  */
227  virtual void getFaceGradPhi(Real& a_faceFlux,
228  const FaceIndex& a_face,
229  const int& a_comp,
230  const EBCellFAB& a_phi,
231  const RealVect& a_probLo,
232  const RealVect& a_dx,
233  const int& a_idir,
234  const Side::LoHiSide& a_side,
235  const DataIndex& a_dit,
236  const Real& a_time,
237  const bool& a_useAreaFrac,
238  const RealVect& a_centroid,
239  const bool& a_useHomogeneous);
240 
241  ///
242  /**
243  This is used by the projections to get grad(phi) at domain faces (usually outflow).
244  Called by InflowOutflowPoissonDomainBC::getFaceFlux.
245  */
246  void getInhomFaceGradPhi(Real& a_faceFlux,
247  const FaceIndex& a_face,
248  const int& a_comp,
249  const EBCellFAB& a_phi,
250  const RealVect& a_probLo,
251  const RealVect& a_dx,
252  const int& a_idir,
253  const Side::LoHiSide& a_side,
254  const DataIndex& a_dit,
255  const Real& a_time,
256  const bool& a_useAreaFrac,
257  const RealVect& a_centroid);
258 
259  virtual void getFluxStencil( VoFStencil& a_stencil,
260  const VolIndex& a_vof,
261  const int& a_comp,
262  const RealVect& a_dx,
263  const int& a_idir,
264  const Side::LoHiSide& a_side,
265  const EBISBox& a_ebisBox);
266 
267  virtual void getFluxStencil( VoFStencil& a_stencil,
268  const FaceIndex& a_face,
269  const int& a_comp,
270  const RealVect& a_dx,
271  const int& a_idir,
272  const Side::LoHiSide& a_side,
273  const EBISBox& a_ebisBox);
274 
275  void getFirstOrderFluxStencil( VoFStencil& a_stencil,
276  const FaceIndex& a_face,
277  const int& a_comp,
278  const RealVect& a_dx,
279  const int& a_idir,
280  const Side::LoHiSide& a_side,
281  const EBISBox& a_ebisBox);
282 
283  void getSecondOrderFluxStencil( VoFStencil& a_stencil,
284  const FaceIndex& a_face,
285  const int& a_comp,
286  const RealVect& a_dx,
287  const int& a_idir,
288  const Side::LoHiSide& a_side,
289  const EBISBox& a_ebisBox);
290 
292 
293 private:
296 
299 
302 
304 };
305 
307 {
308 public:
309  ///
310  /**
311  */
313 
314  ///
315  /**
316  */
318 
319  ///
320  /**
321  */
322  virtual DirichletPoissonDomainBC* create(const ProblemDomain& a_domain,
323  const EBISLayout& a_layout,
324  const RealVect& a_dx);
325 
326  ///
327  /**
328  */
329  virtual void setValue(Real a_value);
330 
331  ///
332  /**
333  */
334  virtual void setFunction(RefCountedPtr<BaseBCValue> a_func);
335 
336  ///
337  /**
338  */
339  virtual void setData(Vector<LevelData<EBCellFAB>* > a_data)
340  {
341  m_data = a_data;
342  m_dataBased = true;
343  m_onlyHomogeneous = false;
344  }
345 
346  ///
347  /**
348  */
349  virtual void setEBOrder(int a_ebOrder);
350 
353 
354 private:
357 
360 
362 };
363 #include "NamespaceFooter.H"
364 #endif
virtual void setData(Vector< LevelData< EBCellFAB > * > a_data)
Definition: DirichletPoissonDomainBC.H:339
bool m_dataBased
Definition: DirichletPoissonDomainBC.H:352
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)
one dimensional dynamic array
Definition: Vector.H:53
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:295
Definition: EBISBox.H:46
bool m_onlyHomogeneous
Definition: DirichletPoissonDomainBC.H:294
bool m_onlyHomogeneous
Definition: DirichletPoissonDomainBC.H:355
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
LevelData< EBCellFAB > * m_data
Definition: DirichletPoissonDomainBC.H:300
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 isDirichletDom(const VolIndex &a_ivof, const VolIndex &a_jvof, const EBCellFAB &a_phi) const
Definition: DirichletPoissonDomainBC.H:133
bool m_isFunctional
Definition: DirichletPoissonDomainBC.H:356
int m_ebOrder
Definition: DirichletPoissonDomainBC.H:361
Definition: EBCellFAB.H:29
bool m_dataBased
Definition: DirichletPoissonDomainBC.H:301
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:212
int m_ebOrder
Definition: DirichletPoissonDomainBC.H:303
LoHiSide
Definition: LoHiSide.H:27
Real m_value
Definition: DirichletPoissonDomainBC.H:297
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)
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
virtual void setData(LevelData< EBCellFAB > *a_data)
Definition: DirichletPoissonDomainBC.H:45
Definition: DataIndex.H:112
Definition: DirichletPoissonDomainBC.H:306
Real m_value
Definition: DirichletPoissonDomainBC.H:358
Vector< LevelData< EBCellFAB > *> m_data
Definition: DirichletPoissonDomainBC.H:351
virtual void setFunction(RefCountedPtr< BaseBCValue > a_func)
bool m_isDefined
Definition: DirichletPoissonDomainBC.H:291
Volume of Fluid Index.
Definition: VolIndex.H:31
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)
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonDomainBC.H:298
RefCountedPtr< BaseBCValue > m_func
Definition: DirichletPoissonDomainBC.H:359