Chombo + EB + MF  3.2
DirichletConductivityDomainBC.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 _DIRICHLETCONDUCTIVITYDOMAINBC_H_
12 #define _DIRICHLETCONDUCTIVITYDOMAINBC_H_
13 
14 #include "RefCountedPtr.H"
17 #include "BaseBCValue.H"
18 #include "NamespaceHeader.H"
19 
21 {
22 public:
24 
26 
27  virtual int whichBC(int a_idir,
28  Side::LoHiSide a_side);
29 
30  virtual void getFaceFlux(BaseFab<Real>& a_faceFlux,
31  const BaseFab<Real>& a_phi,
32  const RealVect& a_probLo,
33  const RealVect& a_dx,
34  const int& a_idir,
35  const Side::LoHiSide& a_side,
36  const DataIndex& a_dit,
37  const Real& a_time,
38  const bool& a_useHomogeneous);
39 
40 
41  virtual void getHigherOrderFaceFlux(BaseFab<Real>& a_faceFlux,
42  const BaseFab<Real>& a_phi,
43  const RealVect& a_probLo,
44  const RealVect& a_dx,
45  const int& a_idir,
46  const Side::LoHiSide& a_side,
47  const DataIndex& a_dit,
48  const Real& a_time,
49  const bool& a_useHomogeneous);
50 
51 
52  virtual bool isDirichletDom(const VolIndex& a_ivof,
53  const VolIndex& a_jvof,
54  const EBCellFAB& a_phi)
55  {
56  return true;
57  }
58 
59  virtual void getFaceFlux(Real& a_faceFlux,
60  const VolIndex& a_vof,
61  const int& a_comp,
62  const EBCellFAB& a_phi,
63  const RealVect& a_probLo,
64  const RealVect& a_dx,
65  const int& a_idir,
66  const Side::LoHiSide& a_side,
67  const DataIndex& a_dit,
68  const Real& a_time,
69  const bool& a_useHomogeneous);
70 
71  virtual void getFaceGradPhi(Real& a_faceFlux,
72  const FaceIndex& a_face,
73  const int& a_comp,
74  const EBCellFAB& a_phi,
75  const RealVect& a_probLo,
76  const RealVect& a_dx,
77  const int& a_idir,
78  const Side::LoHiSide& a_side,
79  const DataIndex& a_dit,
80  const Real& a_time,
81  const bool& a_useAreaFrac,
82  const RealVect& a_centroid,
83  const bool& a_useHomogeneous);
84 
85  virtual void getFaceVel(Real& a_faceFlux,
86  const FaceIndex& a_face,
87  const EBFluxFAB& a_vel,
88  const RealVect& a_probLo,
89  const RealVect& a_dx,
90  const int& a_idir,
91  const int& a_icomp,
92  const Real& a_time,
93  const Side::LoHiSide& a_side);
94 
95  virtual void
97  const Box& a_valid,
98  const Box& a_domain,
99  Real a_dx,
100  bool a_homogeneous)
101  {
102  Box grownBox = a_valid;
103  grownBox.grow(1);
104 
105  for (int idir=0; idir<CH_SPACEDIM; ++idir)
106  {
107  for(SideIterator sit; sit.ok(); ++sit)
108  {
109  Box choppedBox = grownBox;
110  choppedBox.grow(idir,-1);
111  Box toRegion = adjCellBox(choppedBox, idir, sit(), 1);
112 
113  if(!a_domain.contains(toRegion))
114  {
115  for (BoxIterator bit(toRegion); bit.ok(); ++bit)
116  {
117  const IntVect& iv = bit();
118  //fake vof just to get the location
119  VolIndex vof(iv, 0);
121  int isign = sign(sit());
122  IntVect ivneigh = iv - isign*BASISV(idir);
123  Real value = bcvaluefunc(loc, idir, sit());
124  if(a_homogeneous) value = 0.;
125 
126  a_phi(iv, 0) = -a_phi(ivneigh, 0) + 2.*value;
127 
128  }
129  }
130  }
131 
132  }//end loop over directions
133  }
134 private:
135 };
136 
138 {
139 public:
141 
143 
144  virtual void setValue(Real a_value);
145 
146  virtual void setFunction(RefCountedPtr<BaseBCFuncEval> a_flux);
147 
148  virtual DirichletConductivityDomainBC* create(const ProblemDomain& a_domain,
149  const EBISLayout& a_layout,
150  const RealVect& a_dx);
151 
152 private:
155 
158 };
159 
160 #include "NamespaceFooter.H"
161 #endif
bool ok()
Definition: BoxIterator.H:281
virtual int whichBC(int a_idir, Side::LoHiSide a_side)
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)
bool ok() const
#define CH_SPACEDIM
Definition: SPACE.H:51
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
void setFunction(RefCountedPtr< BaseBCFuncEval > a_func)
Definition: ConductivityBaseDomainBC.H:52
Definition: DirichletConductivityDomainBC.H:20
int sign(const CH_XD::Side::LoHiSide &a_side)
Definition: FaceIndex.H:28
Definition: ConductivityBaseDomainBC.H:32
bool contains(const IntVect &p) const
Definition: Box.H:1887
IntVect BASISV(int dir)
Definition: IntVect.H:1285
iterates through the IntVects of a Box
Definition: BoxIterator.H:37
Definition: DirichletConductivityDomainBC.H:137
virtual void fillPhiGhost(FArrayBox &a_phi, const Box &a_valid, const Box &a_domain, Real a_dx, bool a_homogeneous)
Definition: DirichletConductivityDomainBC.H:96
A EBFaceFAB-like container for edge-centered fluxes.
Definition: EBFluxFAB.H:25
bool m_isFunction
Definition: DirichletConductivityDomainBC.H:154
static const RealVect Zero
Definition: RealVect.H:421
virtual 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)
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)
virtual bool isDirichletDom(const VolIndex &a_ivof, const VolIndex &a_jvof, const EBCellFAB &a_phi)
Definition: DirichletConductivityDomainBC.H:52
Definition: EBCellFAB.H:29
double Real
Definition: REAL.H:33
Definition: BaseDomainBC.H:212
Real m_value
Definition: DirichletConductivityDomainBC.H:156
RefCountedPtr< BaseBCFuncEval > m_flux
Definition: DirichletConductivityDomainBC.H:157
LoHiSide
Definition: LoHiSide.H:27
void setValue(Real a_value)
Definition: ConductivityBaseDomainBC.H:44
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
Real bcvaluefunc(const RealVect &a_point, const int &a_dir, const Side::LoHiSide &a_side)
Definition: ConductivityBaseDomainBC.H:78
bool m_onlyHomogeneous
Definition: DirichletConductivityDomainBC.H:153
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
Definition: EBISLayout.H:39
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
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)