Chombo + EB + MF  3.2
MixedViscousTensorDomainBC.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 _MIXEDVISCOUSTENSORDOMAINBC_H_
12 #define _MIXEDVISCOUSTENSORDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
15 #include "BaseDomainBC.H"
16 #include "BaseBCFuncEval.H"
17 #include "ViscousBaseDomainBC.H"
18 #include "NamespaceHeader.H"
19 
20 ///
21 /**
22  */
24 {
25 public:
26  ///
27  /**
28  */
30  {
31  ///set default start length to huge so it defaults to Neumann
32  m_startDirichlet = 1.23456789e10;
33  }
34 
35  ///
36  /**
37  */
39  {;}
40 
41 
42  ///
43  /**
44  */
45  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
46  const BaseFab<Real>& 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  ///
56  virtual void getFaceFlux(Real& a_faceFlux,
57  const VolIndex& a_vof,
58  const int& a_comp,
59  const EBCellFAB& a_phi,
60  const RealVect& a_probLo,
61  const RealVect& a_dx,
62  const int& a_idir,
63  const Side::LoHiSide& a_side,
64  const DataIndex& a_dit,
65  const Real& a_time,
66  const bool& a_useHomogeneous);
67 
68 
69  void setStartDirichlet(const Real& a_startDirichlet)
70  {
71  m_startDirichlet = a_startDirichlet;
72  }
73 
74  virtual void
76  const Box& a_valid,
77  const Box& a_domain,
78  Real a_dx,
79  bool a_homogeneous)
80  {
81 
82  Box grownBox = a_valid;
83  grownBox.grow(1);
84  for (int idir=0; idir<CH_SPACEDIM; ++idir)
85  {
86  for(SideIterator sit; sit.ok(); ++sit)
87  {
88  Box choppedBox = grownBox;
89  choppedBox.grow(idir,-1);
90  Box toRegion = adjCellBox(choppedBox, idir, sit(), 1);
91 
92  for (BoxIterator bit(toRegion); bit.ok(); ++bit)
93  {
94  const IntVect& iv = bit();
95  //fake vof just to get the location
96  VolIndex vof(iv, 0);
98  int isign = sign(sit());
99  IntVect ivneigh = iv - isign*BASISV(idir);
100  RealVect value = bcvaluefunc(loc, idir, sit());
101  if(a_homogeneous) value = RealVect::Zero;
102  for(int comp = 0; comp < SpaceDim; comp++)
103  {
104  if(loc[0] < m_startDirichlet)
105  {
106  //neum
107  a_phi(iv, comp) = a_phi(ivneigh, comp) + a_dx*value[comp];
108  }
109  else
110  {
111  //diri
112  a_phi(iv, comp) = -a_phi(ivneigh, comp) + 2.*value[comp];
113  }
114  }
115  }
116  }
117  }//end loop over directions
118  }
119 
120 private:
121 
123 
124 };
125 
126 #include "NamespaceFooter.H"
127 #endif
bool ok()
Definition: BoxIterator.H:281
#define CH_SPACEDIM
Definition: SPACE.H:51
IntVect BASISV(int dir)
Definition: IntVect.H:1276
iterates through the IntVects of a Box
Definition: BoxIterator.H:37
const int SpaceDim
Definition: SPACE.H:38
Definition: ViscousBaseDomainBC.H:33
virtual ~MixedViscousTensorDomainBC()
Definition: MixedViscousTensorDomainBC.H:38
MixedViscousTensorDomainBC()
Definition: MixedViscousTensorDomainBC.H:29
Definition: MixedViscousTensorDomainBC.H:23
static const RealVect Zero
Definition: RealVect.H:421
Real m_startDirichlet
Definition: MixedViscousTensorDomainBC.H:122
Definition: EBCellFAB.H:29
int sign(const Side::LoHiSide &a_side)
double Real
Definition: REAL.H:33
LoHiSide
Definition: LoHiSide.H:27
virtual void fillVelGhost(FArrayBox &a_phi, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: MixedViscousTensorDomainBC.H:75
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
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
bool ok() const
void setStartDirichlet(const Real &a_startDirichlet)
Definition: MixedViscousTensorDomainBC.H:69
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
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)