Chombo + EB + MF  3.2
DirichletViscousTensorDomainBC.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 _DIRICHLETVISCOUSTENSORDOMAINBC_H_
12 #define _DIRICHLETVISCOUSTENSORDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
15 #include "BCFunc.H"
16 #include "ViscousBaseDomainBC.H"
17 #include "BaseBCFuncEval.H"
18 #include "NamespaceHeader.H"
19 
20 ///
21 /**
22  */
24 {
25 public:
26  ///
27  /**
28  */
30 
31  ///
32  /**
33  */
35 
36 
37  ///
38  /**
39  */
40  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
41  const BaseFab<Real>& a_phi,
42  const RealVect& a_probLo,
43  const RealVect& a_dx,
44  const int& a_idir,
45  const Side::LoHiSide& a_side,
46  const DataIndex& a_dit,
47  const Real& a_time,
48  const bool& a_useHomogeneous);
49 
50  ///
51  /**
52  Elliptic solver flux.
53  */
54  virtual void getFaceFlux(Real& a_faceFlux,
55  const VolIndex& a_vof,
56  const int& a_comp,
57  const EBCellFAB& a_phi,
58  const RealVect& a_probLo,
59  const RealVect& a_dx,
60  const int& a_idir,
61  const Side::LoHiSide& a_side,
62  const DataIndex& a_dit,
63  const Real& a_time,
64  const bool& a_homogeneous);
65 
66  virtual void
68  const Box& a_valid,
69  const Box& a_domain,
70  Real a_dx,
71  bool a_homogeneous)
72  {
73  Box grownBox = a_valid;
74  grownBox.grow(1);
75  for (int idir=0; idir<CH_SPACEDIM; ++idir)
76  {
77  for(SideIterator sit; sit.ok(); ++sit)
78  {
79  Box choppedBox = grownBox;
80  choppedBox.grow(idir,-1);
81  Box toRegion = adjCellBox(choppedBox, idir, sit(), 1);
82  if(!a_domain.contains(toRegion))
83  {
84  for (BoxIterator bit(toRegion); bit.ok(); ++bit)
85  {
86  const IntVect& iv = bit();
87  //fake vof just to get the location
88  VolIndex vof(iv, 0);
90  int isign = sign(sit());
91  IntVect ivneigh = iv - isign*BASISV(idir);
92  RealVect value = bcvaluefunc(loc, idir, sit());
93  if(a_homogeneous) value = RealVect::Zero;
94  for(int comp = 0; comp < SpaceDim; comp++)
95  {
96  //diri
97  a_phi(iv, comp) = -a_phi(ivneigh, comp) + 2.*value[comp];
98  }
99  }
100  }
101  }
102  }//end loop over directions
103  }
104 
105 private:
106  void getDivergenceAndGradient(Real& a_divergence,
107  Real* a_gradient,
108  const int& a_idir,
109  const FaceIndex& a_bndryFace,
110  const VolIndex& a_vof,
111  const EBCellFAB& a_phi,
112  const RealVect& a_probLo,
113  const RealVect& a_dx,
114  const Side::LoHiSide& a_side,
115  const DataIndex& a_dit,
116  const Real& a_time,
117  const bool& a_useHomogeneous);
118 
119 };
120 
122 {
123 public:
124  ///
125  /**
126  */
128 
129  ///
130  /**
131  */
133 
134  ///
135  /**
136  */
137  virtual DirichletViscousTensorDomainBC* create(const ProblemDomain& a_domain,
138  const EBISLayout& a_layout,
139  const RealVect& a_dx);
140 
141  ///
142  /**
143  Sets value of of normal component. Other components set to zero.
144  */
145  virtual void setValue(Real a_value);
146 
147  ///
148  /**
149  */
150  virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_func);
151 
152 private:
155 
158 };
159 #include "NamespaceFooter.H"
160 #endif
bool ok()
Definition: BoxIterator.H:281
#define CH_SPACEDIM
Definition: SPACE.H:51
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Real m_value
Definition: DirichletViscousTensorDomainBC.H:156
Definition: FaceIndex.H:28
Definition: DirichletViscousTensorDomainBC.H:23
IntVect BASISV(int dir)
Definition: IntVect.H:1276
iterates through the IntVects of a Box
Definition: BoxIterator.H:37
RefCountedPtr< BaseBCFuncEval > m_func
Definition: DirichletViscousTensorDomainBC.H:157
const int SpaceDim
Definition: SPACE.H:38
void getDivergenceAndGradient(Real &a_divergence, Real *a_gradient, const int &a_idir, const FaceIndex &a_bndryFace, const VolIndex &a_vof, const EBCellFAB &a_phi, const RealVect &a_probLo, const RealVect &a_dx, const Side::LoHiSide &a_side, const DataIndex &a_dit, const Real &a_time, const bool &a_useHomogeneous)
bool m_onlyHomogeneous
Definition: DirichletViscousTensorDomainBC.H:153
Definition: ViscousBaseDomainBC.H:33
static const RealVect Zero
Definition: RealVect.H:421
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)
Definition: EBCellFAB.H:29
int sign(const Side::LoHiSide &a_side)
double Real
Definition: REAL.H:33
Definition: BaseDomainBC.H:196
LoHiSide
Definition: LoHiSide.H:27
virtual void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Iterator for low and high side.
Definition: LoHiSide.H:74
Definition: DataIndex.H:114
RealVect bcvaluefunc(const RealVect &a_point, const int &a_dir, const Side::LoHiSide &a_side)
Definition: ViscousBaseDomainBC.H:152
bool contains(const IntVect &p) const
Definition: Box.H:1887
virtual DirichletViscousTensorDomainBC * create(const ProblemDomain &a_domain, const EBISLayout &a_layout, const RealVect &a_dx)
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
Volume of Fluid Index.
Definition: VolIndex.H:31
Box & grow(int i)
grow functions
Definition: Box.H:2263
virtual void setValue(Real a_value)
Definition: EBISLayout.H:39
bool ok() const
bool m_isFunctional
Definition: DirichletViscousTensorDomainBC.H:154
Definition: DirichletViscousTensorDomainBC.H:121
virtual void fillVelGhost(FArrayBox &a_phi, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: DirichletViscousTensorDomainBC.H:67
static RealVect getVoFLocation(const VolIndex &a_vof, const RealVect &a_dx, const RealVect &a_probLo)
I have misspelled this one time too many.
Definition: EBArith.H:616