chombo-discharge
CD_ComputationalGeometry.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_ComputationalGeometry_H
13 #define CD_ComputationalGeometry_H
14 
15 // Chombo includes
16 #include <BaseIF.H>
17 #include <MFIndexSpace.H>
18 #include <Box.H>
19 #include <RealVect.H>
20 #include <ProblemDomain.H>
21 
22 // Our includes
23 #include <CD_Dielectric.H>
24 #include <CD_Electrode.H>
26 #include <CD_RealBox.H>
27 #include <CD_NamespaceHeader.H>
28 
36 {
37 public:
42 
46  virtual ~ComputationalGeometry();
47 
52  const Vector<Dielectric>&
53  getDielectrics() const;
54 
59  const Vector<Electrode>&
60  getElectrodes() const;
61 
66  Real
67  getGasPermittivity() const;
68 
73  void
74  useScanShop(const ProblemDomain a_startDomain);
75 
79  void
80  useChomboShop();
81 
86  void
87  setDielectrics(const Vector<Dielectric>& a_dielectrics);
88 
93  void
94  setElectrodes(const Vector<Electrode>& a_electrodes);
95 
100  void
101  setGasPermittivity(const Real a_eps0);
102 
106  const RefCountedPtr<MultiFluidIndexSpace>&
107  getMfIndexSpace() const;
108 
112  const RefCountedPtr<BaseIF>&
113  getGasImplicitFunction() const;
114 
118  const RefCountedPtr<BaseIF>&
119  getSolidImplicitFunction() const;
120 
125  const RefCountedPtr<BaseIF>&
126  getImplicitFunction(const phase::which_phase a_phase) const;
127 
139  virtual void
140  buildGeometries(const ProblemDomain a_finestDomain,
141  const RealVect a_probLo,
142  const Real a_finestDx,
143  const int a_nCellMax,
144  const int a_maxGhostEB,
145  const int a_maxCoarsen = -1);
146 
147 protected:
151  constexpr static Real s_thresh = 1.E-15;
152 
156  RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
157 
161  Real m_eps0;
162 
167 
171  ProblemDomain m_scanDomain;
172 
177 
181  Vector<Dielectric> m_dielectrics;
182 
186  Vector<Electrode> m_electrodes;
187 
191  RefCountedPtr<BaseIF> m_implicitFunctionGas;
192 
196  RefCountedPtr<BaseIF> m_implicitFunctionSolid;
197 
205  void
206  buildGasGeometry(GeometryService*& a_geoserver,
207  const ProblemDomain a_finestDomain,
208  const RealVect a_probLo,
209  const Real a_finestDx);
210 
218  void
219  buildSolidGeometry(GeometryService*& a_geoserver,
220  const ProblemDomain a_finestDomain,
221  const RealVect a_probLo,
222  const Real a_finestDx);
223 };
224 
225 #include <CD_NamespaceFooter.H>
226 
227 #endif
Dielectric class.
Declaration of an electrode class.
Multi-fluid index space.
Declaration of an axis-aligned box in space.
Abstract base class for geometries.
Definition: CD_ComputationalGeometry.H:36
const RefCountedPtr< BaseIF > & getGasImplicitFunction() const
Get the implicit function used to generate the gas-phase EBIS.
Definition: CD_ComputationalGeometry.cpp:88
const RefCountedPtr< BaseIF > & getImplicitFunction(const phase::which_phase a_phase) const
Get implicit function.
Definition: CD_ComputationalGeometry.cpp:104
const Vector< Electrode > & getElectrodes() const
Get electrodes.
Definition: CD_ComputationalGeometry.cpp:80
void useChomboShop()
Calls for ComputationalGeometry to use Chombo's geometry generation tool.
Definition: CD_ComputationalGeometry.cpp:62
Real m_eps0
Background permittivity.
Definition: CD_ComputationalGeometry.H:161
ProblemDomain m_scanDomain
Grid level where we begin using ScanShop.
Definition: CD_ComputationalGeometry.H:171
void setElectrodes(const Vector< Electrode > &a_electrodes)
Set electrodes.
Definition: CD_ComputationalGeometry.cpp:136
virtual ~ComputationalGeometry()
Destructor.
Definition: CD_ComputationalGeometry.cpp:45
Vector< Electrode > m_electrodes
electrodes
Definition: CD_ComputationalGeometry.H:186
bool m_useScanShop
True if we use the chombo-discharge geometry generation utility.
Definition: CD_ComputationalGeometry.H:166
void buildSolidGeometry(GeometryService *&a_geoserver, const ProblemDomain a_finestDomain, const RealVect a_probLo, const Real a_finestDx)
Set up the geometry generation tool for the solid phase, i.e. the part inside the dielectrics.
Definition: CD_ComputationalGeometry.cpp:233
virtual void buildGeometries(const ProblemDomain a_finestDomain, const RealVect a_probLo, const Real a_finestDx, const int a_nCellMax, const int a_maxGhostEB, const int a_maxCoarsen=-1)
Build geometries and the MFIndexSpace.
Definition: CD_ComputationalGeometry.cpp:152
int m_maxGhostEB
Maximum number of ghost cells that we will ever need.
Definition: CD_ComputationalGeometry.H:176
void buildGasGeometry(GeometryService *&a_geoserver, const ProblemDomain a_finestDomain, const RealVect a_probLo, const Real a_finestDx)
Set up the geometry generation tool for the gas phase.
Definition: CD_ComputationalGeometry.cpp:192
void setDielectrics(const Vector< Dielectric > &a_dielectrics)
Set dielectrics.
Definition: CD_ComputationalGeometry.cpp:128
void useScanShop(const ProblemDomain a_startDomain)
Calls for ComputationalGeometry to use ScanShop rather than Chombo's default geometry generation tool...
Definition: CD_ComputationalGeometry.cpp:51
const RefCountedPtr< MultiFluidIndexSpace > & getMfIndexSpace() const
Get the multifluid index space.
Definition: CD_ComputationalGeometry.cpp:120
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
Multifluid index spaces.
Definition: CD_ComputationalGeometry.H:156
Vector< Dielectric > m_dielectrics
dielectrics
Definition: CD_ComputationalGeometry.H:181
Real getGasPermittivity() const
Get the background gas permittivity.
Definition: CD_ComputationalGeometry.cpp:112
const Vector< Dielectric > & getDielectrics() const
Get dielectrics.
Definition: CD_ComputationalGeometry.cpp:72
ComputationalGeometry()
Constructor. Sets a blank geometry.
Definition: CD_ComputationalGeometry.cpp:29
const RefCountedPtr< BaseIF > & getSolidImplicitFunction() const
Get the implicit function used to generate the solid-phase EBIS.
Definition: CD_ComputationalGeometry.cpp:96
RefCountedPtr< BaseIF > m_implicitFunctionGas
The gas-phase implicit function (i.e. outside electrodes and dielectrics).
Definition: CD_ComputationalGeometry.H:191
RefCountedPtr< BaseIF > m_implicitFunctionSolid
The solid-phase implicit function (i.e. the inside of the dielectrics).
Definition: CD_ComputationalGeometry.H:196
void setGasPermittivity(const Real a_eps0)
Set the background permittivity.
Definition: CD_ComputationalGeometry.cpp:144
constexpr static Real s_thresh
Threshold for Vof computation.
Definition: CD_ComputationalGeometry.H:151