chombo-discharge
CD_CdrSolver.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_CdrSolver_H
13 #define CD_CdrSolver_H
14 
15 // Std includes
16 #include <random>
17 #include <time.h>
18 #include <chrono>
19 #include <functional>
20 
21 // Our includes
22 #include <CD_AmrMesh.H>
24 #include <CD_CdrSpecies.H>
25 #include <CD_CdrDomainBC.H>
26 #include <CD_NamespaceHeader.H>
27 
33 class CdrSolver
34 {
35 public:
40  CdrSolver();
41 
46  CdrSolver(const CdrSolver& a_other) = delete;
47 
52  CdrSolver(const CdrSolver&& a_other) = delete;
53 
58  CdrSolver&
59  operator=(const CdrSolver& a_other) = delete;
60 
65  CdrSolver&
66  operator=(const CdrSolver&& a_other) = delete;
67 
71  virtual ~CdrSolver();
72 
76  virtual void
77  parseOptions() = 0;
78 
82  virtual void
84 
91  void
93 
99  void
100  setDomainBcType(const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::BcType a_bcType);
101 
108  void
109  setDomainBcFunction(const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::FluxFunction a_fluxFunction);
110 
118  virtual void
119  advanceEuler(EBAMRCellData& a_newPhi, const EBAMRCellData& a_oldPhi, const Real a_dt);
120 
130  virtual void
132  const EBAMRCellData& a_oldPhi,
133  const EBAMRCellData& a_source,
134  const Real a_dt) = 0;
135 
143  virtual void
144  advanceCrankNicholson(EBAMRCellData& a_newPhi, const EBAMRCellData& a_oldPhi, const Real a_dt);
145 
153  virtual void
155  const EBAMRCellData& a_oldPhi,
156  const EBAMRCellData& a_source,
157  const Real a_dt) = 0;
158 
169  virtual void
171  EBAMRCellData& a_phi,
172  const Real a_extrapDt,
173  const bool a_conservativeOnly,
174  const bool a_ebFlux,
175  const bool a_domainFlux) = 0;
176 
188  virtual void
190  EBAMRCellData& a_phi,
191  const Real a_extrapDt,
192  const bool a_conservativeOnly,
193  const bool a_ebFlux,
194  const bool a_domainFlux) = 0;
195 
206  virtual void
208  EBAMRCellData& a_phi,
209  const bool a_conservativeOnly,
210  const bool a_ebFlux,
211  const bool a_domainFlux) = 0;
212 
220  virtual void
221  computeDivG(EBAMRCellData& a_divG, EBAMRFluxData& a_G, const EBAMRIVData& a_ebFlux, const bool a_conservativeOnly);
222 
229  virtual void
230  gwnDiffusionSource(EBAMRCellData& a_noiseSource, const EBAMRCellData& a_cellPhi);
231 
237  virtual void
239 
246  virtual void
247  preRegrid(const int a_lbase, const int a_oldFinestLevel);
248 
253  virtual void
254  deallocate();
255 
260  virtual void
262 
267  virtual void
268  setRealm(const std::string a_realm);
269 
273  virtual RefCountedPtr<CdrSpecies>&
274  getSpecies() noexcept;
275 
279  virtual const RefCountedPtr<CdrSpecies>&
280  getSpecies() const noexcept;
281 
286  virtual void
287  setSpecies(const RefCountedPtr<CdrSpecies>& a_species);
288 
293  virtual void
294  setComputationalGeometry(const RefCountedPtr<ComputationalGeometry>& a_computationalGeometry);
295 
300  virtual void
301  setAmr(const RefCountedPtr<AmrMesh>& a_amr);
302 
307  virtual void
308  setPhase(phase::which_phase a_phase);
309 
314  virtual void
315  setVerbosity(const int a_verbosity);
316 
324  virtual void
325  setTime(const int a_step, const Real a_time, const Real a_dt);
326 
332  virtual void
333  setVelocity(const EBAMRCellData& a_velocity);
334 
340  virtual void
341  setVelocity(const RealVect a_velocity);
342 
347  virtual void
348  setVelocity(const std::function<RealVect(const RealVect a_pos)>& a_velocity);
349 
356  virtual void
357  setDiffusionCoefficient(const EBAMRFluxData& a_diffusionCoefficient, const EBAMRIVData& a_ebDiffusionCoefficient);
358 
364  virtual void
365  setDiffusionCoefficient(const Real a_diffusionCoefficient);
366 
372  virtual void
373  setDiffusionCoefficient(const std::function<Real(const RealVect a_position)>& a_diffusionCoefficient);
374 
380  virtual void
381  setSource(const EBAMRCellData& a_source);
382 
388  virtual void
389  setSource(const Real a_source);
390 
396  virtual void
397  setSource(const std::function<Real(const RealVect a_position)> a_source);
398 
404  virtual void
405  setEbFlux(const EBAMRIVData& a_ebFlux);
406 
412  virtual void
413  setEbFlux(const Real a_ebFlux);
414 
419  virtual void
420  initialData();
421 
426  virtual void
427  allocate();
428 
434  virtual void
435  writePlotFile();
436 
446  virtual void
447  writePlotData(LevelData<EBCellFAB>& a_output,
448  int& a_icomp,
449  const std::string a_outputRealm,
450  const int a_level) const noexcept;
451 
457 #ifdef CH_USE_HDF5
458  virtual void
459  writeCheckpointLevel(HDF5Handle& a_handle, const int a_level) const;
460 #endif
461 
467 #ifdef CH_USE_HDF5
468  virtual void
469  readCheckpointLevel(HDF5Handle& a_handle, const int a_level);
470 #endif
471 
479  virtual void
480  regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel);
481 
486  virtual std::string
487  getRealm() const;
488 
493  virtual std::string
494  getName() const;
495 
500  virtual Vector<std::string>
501  getPlotVariableNames() const;
502 
507  virtual int
508  getNumberOfPlotVariables() const;
509 
515  virtual Real
517 
523  virtual Real
525 
531  virtual Real
533 
541  virtual Real
542  computeSourceDt(const Real a_max, const Real a_tolerance);
543 
551  virtual void
552  weightedUpwind(EBAMRCellData& a_weightedUpwindPhi, const int a_pow);
553 
558  virtual Real
559  computeMass();
560 
567  virtual Real
568  computeMass(const EBAMRCellData& a_phi, const bool a_kappaScale = true);
569 
574  virtual Real
575  computeCharge();
576 
580  virtual bool
581  isDiffusive();
582 
586  virtual bool
587  isMobile();
588 
593  virtual EBAMRCellData&
594  getPhi();
595 
600  virtual EBAMRCellData&
601  getSource();
602 
607  virtual EBAMRCellData&
609 
614  virtual EBAMRFluxData&
616 
621  virtual EBAMRIVData&
623 
627  virtual EBAMRCellData&
629 
634  virtual EBAMRFluxData&
636 
641  virtual EBAMRIVData&
643 
648  virtual EBAMRIVData&
649  getEbFlux();
650 
655  virtual EBAMRIFData&
656  getDomainFlux();
657 
664  virtual void
665  extrapolateAdvectiveFluxToEB() noexcept;
666 
673  virtual void
674  extrapolateAdvectiveFluxToEB(EBAMRIVData& a_ebFlux) const noexcept;
675 
681  virtual void
682  redistribute(EBAMRCellData& a_phi, const EBAMRIVData& a_delta) const noexcept;
683 
684 protected:
688  enum class Redistribution
689  {
690  VolumeWeighted,
691  None
692  };
693 
697  static constexpr int m_comp = 0;
698 
702  static constexpr int m_nComp = 1;
703 
707  RefCountedPtr<CdrSpecies> m_species;
708 
712  RefCountedPtr<ComputationalGeometry> m_computationalGeometry;
713 
717  RefCountedPtr<AmrMesh> m_amr;
718 
722  Vector<RefCountedPtr<LayoutData<BaseIFFAB<FaceStencil>>>> m_interpStencils[SpaceDim];
723 
727  phase::which_phase m_phase;
728 
732  std::string m_name;
733 
738  std::string m_className;
739 
743  std::string m_realm;
744 
749 
754 
759 
765 
771 
777 
782 
787 
792 
797 
802 
807 
812 
817 
823 
829 
835 
840  std::map<CdrDomainBC::DomainSide, CdrDomainBC::FluxFunction> m_domainFluxFunctions;
841 
847 
852 
856  Real m_time;
857 
861  Real m_dt;
862 
867 
872 
877 
882 
886  bool m_plotPhi;
887 
892 
897 
902 
907 
912 
917 
921  int m_seed;
922 
930  virtual void
931  averageVelocityToFaces(EBAMRFluxData& a_faceVelocity, const EBAMRCellData& a_cellVelocity);
932 
939  virtual void
940  advectToFaces(EBAMRFluxData& a_facePhi, const EBAMRCellData& a_phi, const Real a_extrapDt) = 0;
941 
951  virtual void
953  const EBAMRFluxData& a_facePhi,
954  const EBAMRFluxData& a_faceVelocity,
955  const bool a_addDomainFlux = true);
956 
967  virtual void
968  computeAdvectionFlux(LevelData<EBFluxFAB>& a_flux,
969  const LevelData<EBFluxFAB>& a_facePhi,
970  const LevelData<EBFluxFAB>& a_faceVelocity,
971  const int a_lvl);
972 
981  virtual void
982  computeDiffusionFlux(EBAMRFluxData& a_flux, const EBAMRCellData& a_phi, const bool a_addDomainFlux);
983 
991  virtual void
992  computeDiffusionFlux(LevelData<EBFluxFAB>& a_flux, const LevelData<EBCellFAB>& a_phi, const int a_lvl);
993 
1003  virtual void
1005  const EBAMRCellData& a_cellStates,
1006  const EBAMRFluxData& a_faceStates,
1007  const EBAMRFluxData& a_faceVelocities,
1008  const EBAMRFluxData& a_faceDiffCo,
1009  const bool a_addDomainFlux);
1010 
1015  virtual void
1016  resetDomainFlux(EBAMRFluxData& a_flux);
1017 
1022  virtual void
1023  fillDomainFlux(EBAMRFluxData& a_flux);
1024 
1030  virtual void
1031  fillDomainFlux(LevelData<EBFluxFAB>& a_flux, const int a_level);
1032 
1040  virtual void
1041  conservativeDivergenceNoKappaDivision(EBAMRCellData& a_conservativeDivergence,
1042  EBAMRFluxData& a_flux,
1043  const EBAMRIVData& a_ebFlux);
1044 
1051  virtual void
1052  nonConservativeDivergence(EBAMRIVData& a_nonConservativeDivergence, const EBAMRCellData& a_divG);
1053 
1060  virtual void
1061  hybridDivergence(EBAMRCellData& a_hybridDivergence,
1062  EBAMRIVData& a_massDifference,
1063  const EBAMRIVData& a_nonConservativeDivergence);
1064 
1072  virtual void
1073  hybridDivergence(LevelData<EBCellFAB>& a_hybridDivergence,
1074  LevelData<BaseIVFAB<Real>>& a_massDifference,
1075  const LevelData<BaseIVFAB<Real>>& a_nonConservativeDivergence,
1076  const int a_lvl);
1077 
1085  virtual void
1086  conservativeDivergenceRegular(LevelData<EBCellFAB>& a_divJ, const LevelData<EBFluxFAB>& a_flux, const int a_lvl);
1087 
1093  virtual void
1095 
1102  virtual void
1103  interpolateFluxToFaceCentroids(LevelData<EBFluxFAB>& a_flux, const int a_lvl);
1104 
1113  virtual void
1114  computeDivergenceIrregular(LevelData<EBCellFAB>& a_divG,
1115  const LevelData<EBFluxFAB>& a_centroidFluxes,
1116  const LevelData<BaseIVFAB<Real>>& a_ebFlux,
1117  const int a_lvl);
1118 
1123  virtual void
1125 
1130  virtual void
1132 
1137  virtual void
1139 
1143  virtual void
1144  parseDomainBc();
1145 
1149  virtual void
1151 
1155  virtual void
1156  parsePlotMode();
1157 
1161  virtual void
1163 
1167  virtual void
1169 
1176  virtual std::string
1177  makeBcString(const int a_dir, const Side::LoHiSide a_side) const;
1178 
1184  virtual void
1185  fillGwn(EBAMRFluxData& a_noise, const Real a_sigma);
1186 
1193  virtual void
1194  smoothHeavisideFaces(EBAMRFluxData& a_facePhi, const EBAMRCellData& a_cellPhi);
1195 
1206  virtual void
1207  writeData(LevelData<EBCellFAB>& a_output,
1208  int& a_comp,
1209  const EBAMRCellData& a_data,
1210  const std::string a_outputRealm,
1211  const int a_level,
1212  const bool a_interpToCentroids,
1213  const bool a_interpGhost) const noexcept;
1214 };
1215 
1216 #include <CD_NamespaceFooter.H>
1217 
1218 #endif
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Declaration of domain boundary condition types for CdrSolver.
Declaration of a class that passes information into CdrSolver (e.g., initial conditions).
Declaration of base class for defining geometries.
Class for handling spatial operations.
Definition: CD_AmrMesh.H:44
Class for encapsulating possible domain boundary conditions for CdrSolver.
Definition: CD_CdrDomainBC.H:31
std::function< Real(const RealVect a_position, const Real a_time)> FluxFunction
Function which maps f(R^3,t) : R. Used for setting the associated value and boundary condition type.
Definition: CD_CdrDomainBC.H:51
std::pair< int, Side::LoHiSide > DomainSide
Alias for mapping a direction and side. The first element in pair is the coordinate direction and the...
Definition: CD_CdrDomainBC.H:56
BcType
Boundary condition types for the CDR solvers.
Definition: CD_CdrDomainBC.H:37
Base class for solving convection-diffusion-reaction equations.
Definition: CD_CdrSolver.H:34
virtual void gwnDiffusionSource(EBAMRCellData &a_noiseSource, const EBAMRCellData &a_cellPhi)
Compute a random gaussian white noise source term.
Definition: CD_CdrSolver.cpp:2936
virtual void parseOptions()=0
Parse class options.
virtual void computeDivF(EBAMRCellData &a_divF, EBAMRCellData &a_phi, const Real a_extrapDt, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux)=0
Compute div(v*phi) explicitly.
bool m_isDiffusive
Is the solver diffusive or not.
Definition: CD_CdrSolver.H:876
virtual void computeAdvectionDiffusionFlux(EBAMRFluxData &a_flux, const EBAMRCellData &a_cellStates, const EBAMRFluxData &a_faceStates, const EBAMRFluxData &a_faceVelocities, const EBAMRFluxData &a_faceDiffCo, const bool a_addDomainFlux)
Compute the full advection-diffusion flux. This assumes that the solver is mobile and diffusive.
Definition: CD_CdrSolver.cpp:684
virtual void nonConservativeDivergence(EBAMRIVData &a_nonConservativeDivergence, const EBAMRCellData &a_divG)
Compute the non-conservative divergence.
Definition: CD_CdrSolver.cpp:1458
virtual RefCountedPtr< CdrSpecies > & getSpecies() noexcept
Get the CDR species.
Definition: CD_CdrSolver.cpp:46
bool m_plotPhi
If true, m_phi is added to plot files.
Definition: CD_CdrSolver.H:886
virtual EBAMRIVData & getEbCenteredDiffusionCoefficient()
Get the EB-centered diffusion coefficient.
Definition: CD_CdrSolver.cpp:2678
virtual void parseRuntimeOptions()=0
Parse runtime options.
virtual EBAMRIVData & getEbCenteredVelocity()
Get the eb-centered velocities.
Definition: CD_CdrSolver.cpp:2645
int m_timeStep
Time step.
Definition: CD_CdrSolver.H:851
EBAMRCellData m_source
Source term.
Definition: CD_CdrSolver.H:758
virtual EBAMRCellData & getSource()
Get the source term.
Definition: CD_CdrSolver.cpp:2612
CdrSolver(const CdrSolver &&a_other)=delete
Disallowed move constructor.
virtual void parsePlotVariables()
Parses plot variables.
Definition: CD_CdrSolver.cpp:2893
CdrSolver()
Default constructor.
Definition: CD_CdrSolver.cpp:29
virtual void parsePlotMode()
Parse plot mode.
Definition: CD_CdrSolver.cpp:3191
EBAMRFluxData m_faceCenteredDiffusionCoefficient
Diffusion coefficients on face centers.
Definition: CD_CdrSolver.H:828
virtual int getNumberOfPlotVariables() const
Get number of output fields.
Definition: CD_CdrSolver.cpp:187
virtual bool isMobile()
Return true if the solver is mobile and false otherwise.
Definition: CD_CdrSolver.cpp:2590
virtual EBAMRFluxData & getFaceCenteredVelocity()
Get the face-centered velocities.
Definition: CD_CdrSolver.cpp:2634
bool m_plotDiffusionCoefficient
Output diffusion coefficients.
Definition: CD_CdrSolver.H:896
virtual void setRealm(const std::string a_realm)
Set the realm for this solver.
Definition: CD_CdrSolver.cpp:138
EBAMRIVData m_massDifference
Scratch storage for the mass difference.
Definition: CD_CdrSolver.H:786
CdrSolver(const CdrSolver &a_other)=delete
Disallowed copy constructor.
static constexpr int m_nComp
Number of components that this solver solves for.
Definition: CD_CdrSolver.H:702
virtual void allocate()
Allocate internal storage.
Definition: CD_CdrSolver.cpp:269
virtual void setPhase(phase::which_phase a_phase)
Set phase.
Definition: CD_CdrSolver.cpp:1753
Real m_dt
Last time step increment.
Definition: CD_CdrSolver.H:861
virtual void hybridDivergence(EBAMRCellData &a_hybridDivergence, EBAMRIVData &a_massDifference, const EBAMRIVData &a_nonConservativeDivergence)
Use the non-conservative divergence to make the conservative divergence hold the hybrid divergence.
Definition: CD_CdrSolver.cpp:1303
Redistribution m_whichRedistribution
Which type of redistribution to use.
Definition: CD_CdrSolver.H:866
virtual Real computeAdvectionDt()
Compute the largest possible diffusive time step (for explicit methods)
Definition: CD_CdrSolver.cpp:1990
bool m_plotVelocity
Output velocities.
Definition: CD_CdrSolver.H:891
virtual EBAMRFluxData & getFaceCenteredDiffusionCoefficient()
Get the face-centered diffusion coefficient.
Definition: CD_CdrSolver.cpp:2667
RefCountedPtr< AmrMesh > m_amr
AMR; needed for grid stuff.
Definition: CD_CdrSolver.H:717
RefCountedPtr< CdrSpecies > m_species
Species through which e.g. mobility/diffusion and initial conditions is passed.
Definition: CD_CdrSolver.H:707
virtual void registerOperators()
Register operators for AMR operations.
Definition: CD_CdrSolver.cpp:1528
virtual void fillGwn(EBAMRFluxData &a_noise, const Real a_sigma)
Gaussian noise field.
Definition: CD_CdrSolver.cpp:3126
virtual void setEbFlux(const EBAMRIVData &a_ebFlux)
Data-based version of setting the EB flux.
Definition: CD_CdrSolver.cpp:1611
virtual void redistribute(EBAMRCellData &a_phi, const EBAMRIVData &a_delta) const noexcept
Add data through redistribution into cell-centered holders.
Definition: CD_CdrSolver.cpp:477
Vector< RefCountedPtr< LayoutData< BaseIFFAB< FaceStencil > > > > m_interpStencils[SpaceDim]
Stencils for interpolating face-centered fluxes to face centroids.
Definition: CD_CdrSolver.H:722
virtual void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set computational geometry.
Definition: CD_CdrSolver.cpp:1546
std::string m_realm
Realm where this solver is registered.
Definition: CD_CdrSolver.H:743
virtual void computeDivJ(EBAMRCellData &a_divJ, EBAMRCellData &a_phi, const Real a_extrapDt, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux)=0
Compute div(J) explicitly, where J = nV - D*grad(n)
EBAMRIVData m_nonConservativeDivG
Scratch storage for the non-conservative divergence.
Definition: CD_CdrSolver.H:781
CdrSolver & operator=(const CdrSolver &a_other)=delete
Disallowed assignment operator.
virtual EBAMRCellData & getPhi()
Get the cell-centered phi.
Definition: CD_CdrSolver.cpp:2601
virtual void initialDataDistribution()
Fill initial data from a distribution function.
Definition: CD_CdrSolver.cpp:1218
EBAMRCellData m_phi
Cell-centered data (i.e. the advected-diffused quantity)
Definition: CD_CdrSolver.H:753
CdrSolver & operator=(const CdrSolver &&a_other)=delete
Disallowed move assignement operator.
virtual Real computeAdvectionDiffusionDt()
Compute the largest possible diffusive time step (for explicit methods)
Definition: CD_CdrSolver.cpp:2143
virtual void advanceEuler(EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const Real a_dt)
Implicit diffusion Euler advance without source term.
Definition: CD_CdrSolver.cpp:219
virtual bool isDiffusive()
Return true if the solver is diffusive and false otherwise.
Definition: CD_CdrSolver.cpp:2579
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Computational geometry.
Definition: CD_CdrSolver.H:712
virtual void resetDomainFlux(EBAMRFluxData &a_flux)
Set flux to zero on domain boundaries.
Definition: CD_CdrSolver.cpp:784
virtual void computeDivG(EBAMRCellData &a_divG, EBAMRFluxData &a_G, const EBAMRIVData &a_ebFlux, const bool a_conservativeOnly)
Compute div(G) where G is a general face-centered flux on face centers and EB centers....
Definition: CD_CdrSolver.cpp:417
virtual EBAMRIFData & getDomainFlux()
Get the domain flux data holder.
Definition: CD_CdrSolver.cpp:2700
EBAMRIVData m_ebCenteredDiffusionCoefficient
Diffusion coefficients on EB faces.
Definition: CD_CdrSolver.H:834
bool m_plotEbFlux
Output EB fluxes.
Definition: CD_CdrSolver.H:901
EBAMRFluxData m_faceStates
Holder for face centered states.
Definition: CD_CdrSolver.H:770
Redistribution
Redistribution method.
Definition: CD_CdrSolver.H:689
EBAMRCellData m_cellVelocity
Cell-centered velocities.
Definition: CD_CdrSolver.H:764
virtual void initialData()
Fill m_phi state with initial data from m_species.
Definition: CD_CdrSolver.cpp:1193
virtual void smoothHeavisideFaces(EBAMRFluxData &a_facePhi, const EBAMRCellData &a_cellPhi)
Use Heaviside smoothing for computing face-centered states.
Definition: CD_CdrSolver.cpp:2995
std::map< CdrDomainBC::DomainSide, CdrDomainBC::FluxFunction > m_domainFluxFunctions
Domain flux functions.
Definition: CD_CdrSolver.H:840
bool m_regridSlopes
Use slopes when regridding.
Definition: CD_CdrSolver.H:916
virtual void parseDomainBc()
Parses domain BC options.
Definition: CD_CdrSolver.cpp:2821
virtual std::string getName() const
Get solver name.
Definition: CD_CdrSolver.cpp:116
virtual void conservativeDivergenceNoKappaDivision(EBAMRCellData &a_conservativeDivergence, EBAMRFluxData &a_flux, const EBAMRIVData &a_ebFlux)
Compute conservative divergence from fluxes.
Definition: CD_CdrSolver.cpp:980
void setDefaultDomainBC()
This sets default boundary conditions (wall type).
Definition: CD_CdrSolver.cpp:68
virtual void setVerbosity(const int a_verbosity)
Set verbosity.
Definition: CD_CdrSolver.cpp:1764
virtual Real computeCharge()
Compute the total charge in m_phi.
Definition: CD_CdrSolver.cpp:2564
virtual void parseRegridSlopes()
Parse slope regrid.
Definition: CD_CdrSolver.cpp:3215
std::string m_className
Class name.
Definition: CD_CdrSolver.H:738
virtual ~CdrSolver()
Constructor.
Definition: CD_CdrSolver.cpp:42
virtual void averageVelocityToFaces()
Average velocities to faces.
Definition: CD_CdrSolver.cpp:363
EBAMRIVData m_ebFlux
Flux through the embedded boundary.
Definition: CD_CdrSolver.H:811
EBAMRCellData m_cellCenteredDiffusionCoefficient
Diffusion coefficients on cell centers.
Definition: CD_CdrSolver.H:822
virtual void deallocate()
Deallocate internal storage.
Definition: CD_CdrSolver.cpp:344
virtual void setTime(const int a_step, const Real a_time, const Real a_dt)
Set the time for this solver.
Definition: CD_CdrSolver.cpp:1695
virtual std::string getRealm() const
Get the realm where this solver is registered.
Definition: CD_CdrSolver.cpp:127
int m_seed
RNG seed.
Definition: CD_CdrSolver.H:921
virtual Real computeDiffusionDt()
Compute the largest possible diffusive time step (for explicit methods)
Definition: CD_CdrSolver.cpp:2057
virtual void weightedUpwind(EBAMRCellData &a_weightedUpwindPhi, const int a_pow)
Compute an upwind-weighted version of phi.
Definition: CD_CdrSolver.cpp:2324
virtual void computeAdvectionFlux(EBAMRFluxData &a_flux, const EBAMRFluxData &a_facePhi, const EBAMRFluxData &a_faceVelocity, const bool a_addDomainFlux=true)
Set up face-centered advection flux.
Definition: CD_CdrSolver.cpp:511
EBAMRCellData m_cachePhi
Cached state vector for regrid.
Definition: CD_CdrSolver.H:796
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const noexcept
Write output data to a_output.
Definition: CD_CdrSolver.cpp:1829
virtual void advanceEuler(EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const EBAMRCellData &a_source, const Real a_dt)=0
Implicit diffusion Euler advance with source term.
virtual void fillDomainFlux(EBAMRFluxData &a_flux)
Set domain in data holder. This sets the flux on the boundary to either zero or to m_domainFlux.
Definition: CD_CdrSolver.cpp:848
bool m_plotNumbers
Plot numbers or densities.
Definition: CD_CdrSolver.H:911
virtual Real computeMass()
Compute the "physical mass" in m_phi.
Definition: CD_CdrSolver.cpp:2493
virtual void parseDivergenceComputation()
Parse the conservation.
Definition: CD_CdrSolver.cpp:2865
virtual void preRegrid(const int a_lbase, const int a_oldFinestLevel)
Perform pre-regrid operations.
Definition: CD_CdrSolver.cpp:400
virtual void advanceCrankNicholson(EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const EBAMRCellData &a_source, const Real a_dt)=0
Implicit diffusion Crank-Nicholson advance with source term.
virtual void defineInterpolationStencils()
Define stencils for doing face-centered to face-centroid-centered states.
Definition: CD_CdrSolver.cpp:1143
Real m_time
Current time.
Definition: CD_CdrSolver.H:856
EBAMRIVData m_ebZero
Scratch storage for the EB flux.
Definition: CD_CdrSolver.H:791
bool m_blendConservation
Flag for blending the hybrid divergence.
Definition: CD_CdrSolver.H:871
bool m_isMobile
Solve for advection/convection or not.
Definition: CD_CdrSolver.H:881
virtual void interpolateFluxToFaceCentroids(EBAMRFluxData &a_flux)
Interpolate flux to centroids.
Definition: CD_CdrSolver.cpp:1377
EBAMRIVData m_ebVelocity
EB-centered velocities.
Definition: CD_CdrSolver.H:806
void setDomainBcFunction(const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::FluxFunction a_fluxFunction)
Set domain bc function on particular domain side.
Definition: CD_CdrSolver.cpp:104
virtual void advectToFaces(EBAMRFluxData &a_facePhi, const EBAMRCellData &a_phi, const Real a_extrapDt)=0
Advection-only extrapolation to faces.
virtual void advanceCrankNicholson(EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const Real a_dt)
Implicit diffusion Crank-Nicholson advance without source term.
Definition: CD_CdrSolver.cpp:244
static constexpr int m_comp
Component number in data holder.
Definition: CD_CdrSolver.H:697
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
Write checkpoint data into HDF5 file. @paramo[out] a_handle HDF5 file.
Definition: CD_CdrSolver.cpp:1484
EBAMRFluxData m_faceVelocity
Face-centered velocities (only normal components)
Definition: CD_CdrSolver.H:776
virtual void setDiffusionCoefficient(const EBAMRFluxData &a_diffusionCoefficient, const EBAMRIVData &a_ebDiffusionCoefficient)
Data-based version of setting diffusion coefficients (which are stored on faces)
Definition: CD_CdrSolver.cpp:1561
EBAMRCellData m_cacheSource
Cached source term for regrids.
Definition: CD_CdrSolver.H:801
EBAMRIFData m_domainFlux
Domain flux.
Definition: CD_CdrSolver.H:816
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amr)
Set the amr object.
Definition: CD_CdrSolver.cpp:1515
virtual void setSpecies(const RefCountedPtr< CdrSpecies > &a_species)
Set species.
Definition: CD_CdrSolver.cpp:1635
virtual EBAMRCellData & getCellCenteredVelocity()
Get the cell-centered velocity.
Definition: CD_CdrSolver.cpp:2623
virtual EBAMRIVData & getEbFlux()
Get the eb flux data holder.
Definition: CD_CdrSolver.cpp:2689
virtual Real computeSourceDt(const Real a_max, const Real a_tolerance)
Compute the largest possible source time step (for explicit methods.
Definition: CD_CdrSolver.cpp:2261
int m_verbosity
Solver verbosity.
Definition: CD_CdrSolver.H:846
virtual void setSource(const EBAMRCellData &a_source)
Data based version of setting source terms.
Definition: CD_CdrSolver.cpp:1651
virtual void setVelocity(const EBAMRCellData &a_velocity)
Set velocity from data holder.
Definition: CD_CdrSolver.cpp:1708
virtual void writePlotFile()
Write plot file.
Definition: CD_CdrSolver.cpp:1775
virtual void conservativeDivergenceRegular(LevelData< EBCellFAB > &a_divJ, const LevelData< EBFluxFAB > &a_flux, const int a_lvl)
Compute the conservative divergence over regular cells.
Definition: CD_CdrSolver.cpp:1084
virtual void initialDataParticles()
Fill initial data from particles.
Definition: CD_CdrSolver.cpp:1244
virtual void computeDiffusionFlux(EBAMRFluxData &a_flux, const EBAMRCellData &a_phi, const bool a_addDomainFlux)
Compute the face-centered diffusion flux.
Definition: CD_CdrSolver.cpp:576
virtual void extrapolateAdvectiveFluxToEB() noexcept
Extrapolate advective flux to EB.
Definition: CD_CdrSolver.cpp:2711
virtual Vector< std::string > getPlotVariableNames() const
Get output plot names.
Definition: CD_CdrSolver.cpp:149
bool m_plotSource
Output source term.
Definition: CD_CdrSolver.H:906
virtual EBAMRCellData & getCellCenteredDiffusionCoefficient()
Get the cell-centered diffusion coefficient.
Definition: CD_CdrSolver.cpp:2656
virtual void computeDivergenceIrregular(LevelData< EBCellFAB > &a_divG, const LevelData< EBFluxFAB > &a_centroidFluxes, const LevelData< BaseIVFAB< Real >> &a_ebFlux, const int a_lvl)
Compute conservative divergence on irregular cells (not kappa divided)
Definition: CD_CdrSolver.cpp:1016
std::string m_name
Solver name.
Definition: CD_CdrSolver.H:732
virtual std::string makeBcString(const int a_dir, const Side::LoHiSide a_side) const
Shortcut for making a boundary condition string.
Definition: CD_CdrSolver.cpp:2788
phase::which_phase m_phase
Phase.
Definition: CD_CdrSolver.H:727
virtual void computeDivD(EBAMRCellData &a_divD, EBAMRCellData &a_phi, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux)=0
Compute div(D*grad(phi)) explicitly.
CdrDomainBC m_domainBC
Domain BCs.
Definition: CD_CdrSolver.H:748
virtual void writeData(LevelData< EBCellFAB > &a_output, int &a_comp, const EBAMRCellData &a_data, const std::string a_outputRealm, const int a_level, const bool a_interpToCentroids, const bool a_interpGhost) const noexcept
Write data to output. Convenience function.
Definition: CD_CdrSolver.cpp:1901
void setDomainBcType(const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::BcType a_bcType)
Set domain bc type on domain side.
Definition: CD_CdrSolver.cpp:93
Abstract class that describes the scalar quantity that is advected in CdrSolver.
Definition: CD_CdrSpecies.H:30
Abstract base class for geometries.
Definition: CD_ComputationalGeometry.H:36
phase names
Definition: CD_MultiFluidIndexSpace.H:27