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