Chombo + EB  3.2
NeumannViscousTensorDomainBC.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 _NEUMANNVISCOUSTENSORDOMAINBC_H_
12 #define _NEUMANNVISCOUSTENSORDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
15 
16 #include "ViscousBaseDomainBC.H"
17 #include "BaseBCValue.H"
18 #include "BCFunc.H"
19 #include "NamespaceHeader.H"
20 
21 
23 {
24 public:
26 
28 
29  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
30  const BaseFab<Real>& a_phi,
31  const RealVect& a_probLo,
32  const RealVect& a_dx,
33  const int& a_idir,
34  const Side::LoHiSide& a_side,
35  const DataIndex& a_dit,
36  const Real& a_time,
37  const bool& a_useHomogeneous);
38 
39  ///
40  /**
41  Elliptic solver flux.
42  */
43  virtual void getFaceFlux(Real& a_faceFlux,
44  const VolIndex& a_vof,
45  const int& a_comp,
46  const EBCellFAB& a_phi,
47  const RealVect& a_probLo,
48  const RealVect& a_dx,
49  const int& a_idir,
50  const Side::LoHiSide& a_side,
51  const DataIndex& a_dit,
52  const Real& a_time,
53  const bool& a_useHomogeneous);
54 
55  virtual void
57  const Box& a_valid,
58  const Box& a_domain,
59  Real a_dx,
60  bool a_homogeneous)
61  {
62  Box valid = a_valid;
63  Box grownBox = a_valid;
64  grownBox.grow(1);
65  for (int idir=0; idir<CH_SPACEDIM; ++idir)
66  {
67  for(SideIterator sit; sit.ok(); ++sit)
68  {
69  Box choppedBox = grownBox;
70  choppedBox.grow(idir,-1);
71  Box toRegion = adjCellBox(choppedBox, idir, sit(), 1);
72 
73  if(!a_domain.contains(toRegion))
74  {
75  for (BoxIterator bit(toRegion); bit.ok(); ++bit)
76  {
77  const IntVect& iv = bit();
78  //fake vof just to get the location
79  VolIndex vof(iv, 0);
81  int isign = sign(sit());
82  IntVect ivneigh = iv - isign*BASISV(idir);
83  RealVect value = bcvaluefunc(loc, idir, sit());
84  if(a_homogeneous) value = RealVect::Zero;
85  for(int comp = 0; comp < SpaceDim; comp++)
86  {
87  //neumann
88  a_phi(iv, comp) = a_phi(ivneigh, comp) + a_dx*value[comp];
89  }
90  }
91  }
92  }
93  }//end loop over directions
94  }
95 
96 
97 private:
98  void getDivergenceAndGradient(Real& a_divergence,
99  Real* a_gradient,
100  const int& a_idir,
101  const FaceIndex& a_bndryFace,
102  const VolIndex& a_vof,
103  const EBCellFAB& a_phi,
104  const RealVect& a_probLo,
105  const RealVect& a_dx,
106  const Side::LoHiSide& a_side,
107  const DataIndex& a_dit,
108  const Real& a_time,
109  const bool& a_useHomogeneous);
110 };
111 
113 {
114 public:
116 
118 
119  ///
120  /**
121  Sets value of NORMAL gradient of normal component. Everything
122  else in valueland is set to zero. If you want something more
123  elaborate, use the functional form.
124  */
125  virtual void setValue(Real a_value);
126 
127  virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_flux);
128 
129  virtual NeumannViscousTensorDomainBC* create(const ProblemDomain& a_domain,
130  const EBISLayout& a_layout,
131  const RealVect& a_dx);
132 
133 
134 private:
137 
140 };
141 
142 #include "NamespaceFooter.H"
143 #endif
bool ok()
Definition: BoxIterator.H:281
bool ok() const
#define CH_SPACEDIM
Definition: SPACE.H:51
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int sign(const CH_XD::Side::LoHiSide &a_side)
Definition: FaceIndex.H:28
Real m_value
Definition: NeumannViscousTensorDomainBC.H:138
bool contains(const IntVect &p) const
Definition: Box.H:1871
IntVect BASISV(int dir)
Definition: IntVect.H:1266
iterates through the IntVects of a Box
Definition: BoxIterator.H:37
Definition: NeumannViscousTensorDomainBC.H:112
const int SpaceDim
Definition: SPACE.H:38
Definition: ViscousBaseDomainBC.H:33
RefCountedPtr< BaseBCFuncEval > m_flux
Definition: NeumannViscousTensorDomainBC.H:139
static const RealVect Zero
Definition: RealVect.H:421
Definition: NeumannViscousTensorDomainBC.H:22
Definition: EBCellFAB.H:29
double Real
Definition: REAL.H:33
virtual void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
Definition: ViscousBaseDomainBC.H:110
Definition: BaseDomainBC.H:212
LoHiSide
Definition: LoHiSide.H:27
bool m_onlyHomogeneous
Definition: NeumannViscousTensorDomainBC.H:135
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool m_isFunction
Definition: NeumannViscousTensorDomainBC.H:136
Iterator for low and high side.
Definition: LoHiSide.H:74
Definition: DataIndex.H:112
RealVect bcvaluefunc(const RealVect &a_point, const int &a_dir, const Side::LoHiSide &a_side)
Definition: ViscousBaseDomainBC.H:152
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
virtual void setValue(Real a_value)
Definition: ViscousBaseDomainBC.H:98
Definition: FArrayBox.H:45
Volume of Fluid Index.
Definition: VolIndex.H:31
Box & grow(int i)
grow functions
Definition: Box.H:2247
Definition: EBISLayout.H:39
virtual void fillVelGhost(FArrayBox &a_phi, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: NeumannViscousTensorDomainBC.H:56
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:623
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)
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)