Chombo + EB  3.2
DirichletViscousTensorEBBC.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 _DIRICHLETVISCOUSTENSOREBBC_H_
12 #define _DIRICHLETVISCOUSTENSOREBBC_H_
13 
14 #include "RefCountedPtr.H"
15 
16 #include "BaseEBBC.H"
17 #include "BaseBCFuncEval.H"
18 #include "LayoutData.H"
19 #include "IntVectSet.H"
20 #include "EBStencil.H"
21 #include "NamespaceHeader.H"
22 class VoFCache;
23 class VoFStencil;
24 
25 ///
26 /**
27  */
29 {
30 public:
31 
32  ///
34 
35  ///
36  /**
37  If the optional a_ghostCells(Phi,Rhs) args are NULL, we won't use the
38  VoF cache.
39  */
41  const EBISLayout& a_layout,
42  const RealVect& a_dx,
43  const IntVect* a_ghostCellsPhi,
44  const IntVect* a_ghostCellsRhs);
45 
46  ///
47  /**
48  */
50 
51  ///
52  /**
53  */
54  virtual void define(const LayoutData<IntVectSet>& a_cfivs,
55  const Real& a_factor);
56 
58  {
59  return &m_fluxStencil[ivar];
60  }
61 
62  virtual void applyEBFlux(EBCellFAB& a_lphi,
63  const EBCellFAB& a_phi,
64  VoFIterator& a_vofit,
65  const LayoutData<IntVectSet>& a_cfivs,
66  const DataIndex& a_dit,
67  const RealVect& a_probLo,
68  const RealVect& a_dx,
69  const Real& a_factor,
70  const bool& a_useHomogeneous,
71  const Real& a_time);
72 
73  ///
74  /**
75  public for testing. gets the gradient of the solution at centroid
76  of the embedded boundary given the boundary condition and the solution.
77  In both cases, it uses the johansen stencil for the normal gradient. For the tangential
78  gradient, in the function case, it calls the derivative function (in the value case, it sets
79  tangential gradients to zero). Since the derivative function operates in cartesian space
80  there is some complication (set all cartesian gradients. rotate to NT space. overwrite
81  normal gradient. rotate back to cartesian space).
82  **/
83  void getGradient(Real a_grad[SpaceDim][SpaceDim],
84  const VolIndex& a_vof,
85  const EBCellFAB& a_phi,
86  const EBISBox& a_ebisBox,
87  const DataIndex& a_dit,
88  const Real& a_dx,
89  bool a_homogeneous);
90 
91  //public to test the stencil.
92  void getGradientStenValue(Real a_grad[SpaceDim][SpaceDim],
93  const VolIndex& a_vof,
94  const EBCellFAB& a_phi,
95  const EBISBox& a_ebisBox,
96  const DataIndex& a_dit,
97  const Real& a_dx,
98  bool a_homogeneous);
99 protected:
100  //get the gradient associated with the inhomogeneous bit.
101  void getGradInhomOnly(Real a_grad[SpaceDim][SpaceDim],
102  const Real& a_weight,
103  const VolIndex& a_vof,
104  const EBISBox& a_ebisBox,
105  const Real& a_dx);
106  //get the stencil for the normal gradient
107  void getNormalStencil(VoFStencil& a_stencil,
108  Real& a_weight,
109  const VolIndex& a_vof,
110  const EBISBox& a_ebisBox,
111  const RealVect& a_dx,
112  const IntVectSet& a_cfivs);
113 
114  //get the homogeneous flux stencil
115  void getFluxStencil(VoFStencil a_stencil[SpaceDim],
116  Real a_weight[ SpaceDim],
117  const DataIndex& a_dit,
118  const VolIndex& a_vof,
119  const EBISBox& a_ebisBox,
120  const RealVect& a_dx,
121  const IntVectSet& a_cfivs);
122 
123  //another testing routine
124  void
125  getGradientFunction(Real a_grad[SpaceDim][SpaceDim],
126  const VolIndex& a_vof,
127  const EBCellFAB& a_phi,
128  const EBISBox& a_ebisBox,
129  const DataIndex& a_dit,
130  const Real& a_dx,
131  bool a_homogeneous);
132 
133  //return true if you need to drop order
134  bool getSecondOrderStencil(VoFStencil& a_stencil,
135  Real& a_weight,
136  Vector<VoFStencil>& a_pointStencil,
137  Vector<Real>& a_distanceAlongLine,
138  const VolIndex& a_vof,
139  const EBISBox& a_ebisBox,
140  const RealVect& a_dx,
141  const IntVectSet& a_cfivs);
142 
143  void getFirstOrderStencil(VoFStencil& a_stencil,
144  Real& a_weight,
145  const VolIndex& a_vof,
146  const EBISBox& a_ebisBox,
147  const RealVect& a_dx,
148  const IntVectSet& a_cfivs);
149 
150 
151  void getJacobianAndInverse(Real a_Jacobian[SpaceDim][SpaceDim],
152  Real a_Jinverse[SpaceDim][SpaceDim],
153  RealVect& a_normal,
154  RealVect a_tangents[SpaceDim-1]);
155 
156 
157  virtual RealVect getInhomogeneousContribution(const VolIndex& a_vof,
158  const EBCellFAB& a_phi,
159  const EBISBox& a_ebisBox,
160  const DataIndex& a_dit,
161  const Real& a_dx);
162 
163  void getFlux(Real a_flux[SpaceDim][SpaceDim],
164  const VolIndex& a_vof,
165  const EBCellFAB& a_phi,
166  const EBISBox& a_ebisBox,
167  const DataIndex& a_dit,
168  const Real& a_dx,
169  bool a_homogeneous);
170 
171 
172  void getCartesianGradientStencil(VoFStencil a_gradStencils[SpaceDim][SpaceDim],
173  VoFStencil & a_normalStencil,
174  const DataIndex& a_dit,
175  const VolIndex& a_vof,
176  const EBISBox& a_ebisBox,
177  const RealVect& a_dx);
178 
179 
180  static int s_leastSquaresRad;
181 protected:
182 
184 
187 
189 
190 
191  //stencils for operator evaluation
196 
197 
198 };
199 
200 ///
201 /**
202  */
204 {
205 public:
206  ///
207  /**
208  */
210 
211  ///
212  /**
213  */
215 
216 
217  ///
218  /**
219  */
220  virtual void setValue(Real a_value);
221 
222  ///
223  /**
224  */
225  virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_func);
226 
227  ///
228  /**
229  */
230  virtual DirichletViscousTensorEBBC* create( const ProblemDomain& a_domain,
231  const EBISLayout& a_layout,
232  const RealVect& a_dx,
233  const IntVect* a_ghostCellsPhi,
234  const IntVect* a_ghostCellsRhs);
235 
236 protected:
237 
238 private:
240 
245 
246 };
247 
248 
249 
250 #include "NamespaceFooter.H"
251 #endif
virtual void define(const LayoutData< IntVectSet > &a_cfivs, const Real &a_factor)
void getNormalStencil(VoFStencil &a_stencil, Real &a_weight, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx, const IntVectSet &a_cfivs)
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
#define CH_SPACEDIM
Definition: SPACE.H:51
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void getGradient(Real a_grad[SpaceDim][SpaceDim], const VolIndex &a_vof, const EBCellFAB &a_phi, const EBISBox &a_ebisBox, const DataIndex &a_dit, const Real &a_dx, bool a_homogeneous)
bool m_isDefined
Definition: DirichletViscousTensorEBBC.H:183
const IntVect m_ghostCellsPhi
Definition: DirichletViscousTensorEBBC.H:194
ProblemDomain m_domain
Definition: DirichletViscousTensorEBBC.H:185
Definition: EBISBox.H:46
bool getSecondOrderStencil(VoFStencil &a_stencil, Real &a_weight, Vector< VoFStencil > &a_pointStencil, Vector< Real > &a_distanceAlongLine, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx, const IntVectSet &a_cfivs)
virtual RealVect getInhomogeneousContribution(const VolIndex &a_vof, const EBCellFAB &a_phi, const EBISBox &a_ebisBox, const DataIndex &a_dit, const Real &a_dx)
const IntVect m_ghostCellsPhi
Definition: DirichletViscousTensorEBBC.H:243
const int SpaceDim
Definition: SPACE.H:38
virtual ~DirichletViscousTensorEBBC()
VoF-centered stencil.
Definition: Stencils.H:60
void getFlux(Real a_flux[SpaceDim][SpaceDim], const VolIndex &a_vof, const EBCellFAB &a_phi, const EBISBox &a_ebisBox, const DataIndex &a_dit, const Real &a_dx, bool a_homogeneous)
void getJacobianAndInverse(Real a_Jacobian[SpaceDim][SpaceDim], Real a_Jinverse[SpaceDim][SpaceDim], RealVect &a_normal, RealVect a_tangents[SpaceDim-1])
virtual void setValue(Real a_value)
Definition: BaseEBBC.H:149
LayoutData< BaseIVFAB< Real > > m_fluxWeight[CH_SPACEDIM]
Definition: DirichletViscousTensorEBBC.H:193
Definition: EBCellFAB.H:29
RefCountedPtr< BaseBCFuncEval > m_func
Definition: DirichletViscousTensorEBBC.H:242
const IntVect m_ghostCellsRHS
Definition: DirichletViscousTensorEBBC.H:195
void getFirstOrderStencil(VoFStencil &a_stencil, Real &a_weight, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx, const IntVectSet &a_cfivs)
double Real
Definition: REAL.H:33
void getGradInhomOnly(Real a_grad[SpaceDim][SpaceDim], const Real &a_weight, const VolIndex &a_vof, const EBISBox &a_ebisBox, const Real &a_dx)
bool m_isFunction
Definition: DirichletViscousTensorEBBC.H:239
virtual void applyEBFlux(EBCellFAB &a_lphi, const EBCellFAB &a_phi, VoFIterator &a_vofit, const LayoutData< IntVectSet > &a_cfivs, const DataIndex &a_dit, const RealVect &a_probLo, const RealVect &a_dx, const Real &a_factor, const bool &a_useHomogeneous, const Real &a_time)
RealVect m_dx
Definition: DirichletViscousTensorEBBC.H:188
Definition: BaseEBBC.H:109
static int s_leastSquaresRad
Definition: DirichletViscousTensorEBBC.H:180
const IntVect m_ghostCellsRHS
Definition: DirichletViscousTensorEBBC.H:244
virtual LayoutData< BaseIVFAB< VoFStencil > > * getFluxStencil(int ivar)
Definition: DirichletViscousTensorEBBC.H:57
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Definition: DataIndex.H:112
Definition: BaseEBBC.H:315
Iterator for all vofs within an IntVectSet and an Ebgraph.
Definition: VoFIterator.H:27
LayoutData< BaseIVFAB< VoFStencil > > m_fluxStencil[CH_SPACEDIM]
Definition: DirichletViscousTensorEBBC.H:192
Definition: DirichletViscousTensorEBBC.H:28
void getCartesianGradientStencil(VoFStencil a_gradStencils[SpaceDim][SpaceDim], VoFStencil &a_normalStencil, const DataIndex &a_dit, const VolIndex &a_vof, const EBISBox &a_ebisBox, const RealVect &a_dx)
EBISLayout m_ebisl
Definition: DirichletViscousTensorEBBC.H:186
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
virtual void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
Definition: BaseEBBC.H:161
Volume of Fluid Index.
Definition: VolIndex.H:31
Definition: EBISLayout.H:39
void getGradientFunction(Real a_grad[SpaceDim][SpaceDim], const VolIndex &a_vof, const EBCellFAB &a_phi, const EBISBox &a_ebisBox, const DataIndex &a_dit, const Real &a_dx, bool a_homogeneous)
Real m_value
Definition: DirichletViscousTensorEBBC.H:241
void getGradientStenValue(Real a_grad[SpaceDim][SpaceDim], const VolIndex &a_vof, const EBCellFAB &a_phi, const EBISBox &a_ebisBox, const DataIndex &a_dit, const Real &a_dx, bool a_homogeneous)
Definition: DirichletViscousTensorEBBC.H:203