chombo-discharge
CD_RadiativeTransferStepper.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_RadiativeTransferStepper_H
13 #define CD_RadiativeTransferStepper_H
14 
15 // Our includes
16 #include <CD_TimeStepper.H>
17 #include <CD_RtSolver.H>
18 #include <CD_NamespaceHeader.H>
19 
20 namespace Physics {
21 
25  namespace RadiativeTransfer {
26 
31  template <class T>
33  {
34  public:
39 
43  virtual ~RadiativeTransferStepper();
44 
48  void
49  setupSolvers() override;
50 
54  void
55  initialData() override;
56 
60  void
61  allocate() override;
62 
66  void
67  postInitialize() override;
68 
69 #ifdef CH_USE_HDF5
75  void
76  writeCheckpointData(HDF5Handle& a_handle, const int a_lvl) const override;
77 #endif
78 
79 #ifdef CH_USE_HDF5
85  void
86  readCheckpointData(HDF5Handle& a_handle, const int a_lvl) override;
87 #endif
88 
92  void
93  postCheckpointSetup() override;
94 
98  int
99  getNumberOfPlotVariables() const override;
100 
104  Vector<std::string>
105  getPlotVariableNames() const override;
106 
114  void
115  writePlotData(LevelData<EBCellFAB>& a_output,
116  int& a_icomp,
117  const std::string a_outputRealm,
118  const int a_level) const override;
119 
123  Real
124  computeDt() override;
125 
131  Real
132  advance(const Real a_dt) override;
133 
140  void
141  synchronizeSolverTimes(const int a_step, const Real a_time, const Real a_dt) override;
142 
147  void
148  printStepReport() override;
149 
153  void
154  parseRuntimeOptions() override;
155 
159  void
160  registerRealms() override;
161 
165  void
166  registerOperators() override;
167 
174  void
175  preRegrid(const int a_lmin, const int a_oldFinestLevel) override;
176 
183  void
184  regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override;
185 
189  void
190  postRegrid() override;
191 
197  void
198  forceDt(const Real a_dt);
199 
203  Real
204  getDt() const;
205 
209  const EBAMRCellData&
210  getPhi() const;
211 
212  protected:
216  std::string m_realm;
217 
221  Real m_dt;
222 
227  Real m_forceDt;
228 
232  RefCountedPtr<RtSolver> m_solver;
233 
237  RefCountedPtr<RtSpecies> m_species;
238 
242  void
244  };
245  } // namespace RadiativeTransfer
246 } // namespace Physics
247 
248 #include <CD_NamespaceFooter.H>
249 
251 
252 #endif
Implementation of CD_RadiativeTransferStepper.H.
Abstract parent class for various radiative transfer solvers.
Declaration of main (abstract) time stepper class.
Implementation of TimeStepper for solving for a single radiative transfer species....
Definition: CD_RadiativeTransferStepper.H:33
void registerOperators() override
Register operators – calls the solver registration routine.
Definition: CD_RadiativeTransferStepperImplem.H:293
void postCheckpointSetup() override
Perform post-checkpoint setup routines (sets the source in the solver)
Definition: CD_RadiativeTransferStepperImplem.H:172
void registerRealms() override
Register realms.
Definition: CD_RadiativeTransferStepperImplem.H:281
void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override
Regrid function. Calls the solver function.
Definition: CD_RadiativeTransferStepperImplem.H:317
void allocate() override
Allocate necessary memory for solvers.
Definition: CD_RadiativeTransferStepperImplem.H:93
RadiativeTransferStepper()
Constructor. Reads a couple of input options.
Definition: CD_RadiativeTransferStepperImplem.H:28
void writePlotData(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const override
Write plot data to output holder.
Definition: CD_RadiativeTransferStepperImplem.H:208
Real m_forceDt
Forced time step.
Definition: CD_RadiativeTransferStepper.H:227
void postInitialize() override
Post-initialization functionality – sets the source term.
Definition: CD_RadiativeTransferStepperImplem.H:122
Real m_dt
Time step to use.
Definition: CD_RadiativeTransferStepper.H:221
Real advance(const Real a_dt) override
Advancement method. Calls the solver function.
Definition: CD_RadiativeTransferStepperImplem.H:241
Vector< std::string > getPlotVariableNames() const override
Get plot variable names.
Definition: CD_RadiativeTransferStepperImplem.H:196
int getNumberOfPlotVariables() const override
Get number of plot variables for this physics module.
Definition: CD_RadiativeTransferStepperImplem.H:184
void preRegrid(const int a_lmin, const int a_oldFinestLevel) override
Perform pre-regrid operations – calls the solver function. operation takes a lot of memory.
Definition: CD_RadiativeTransferStepperImplem.H:305
void parseRuntimeOptions() override
Parse runtime options.
Definition: CD_RadiativeTransferStepperImplem.H:76
RefCountedPtr< RtSpecies > m_species
Reference to species.
Definition: CD_RadiativeTransferStepper.H:237
Real computeDt() override
Compute a time step to be used by Driver.
Definition: CD_RadiativeTransferStepperImplem.H:223
std::string m_realm
Realm where solver lives.
Definition: CD_RadiativeTransferStepper.H:216
void setGaussianSource()
For setting a Gaussian source in the radiative transfer equation solver.
Definition: CD_RadiativeTransferStepperImplem.H:353
void forceDt(const Real a_dt)
Force usage of a time step.
Definition: CD_RadiativeTransferStepperImplem.H:132
void printStepReport() override
Print a step report (does nothing)
Definition: CD_RadiativeTransferStepperImplem.H:271
void setupSolvers() override
Set up the solver.
Definition: CD_RadiativeTransferStepperImplem.H:54
RefCountedPtr< RtSolver > m_solver
Reference to solver.
Definition: CD_RadiativeTransferStepper.H:232
void postRegrid() override
Post-regrid function. Sets a Gaussian source.
Definition: CD_RadiativeTransferStepperImplem.H:329
void initialData() override
Fill simulation with initial data.
Definition: CD_RadiativeTransferStepperImplem.H:105
void synchronizeSolverTimes(const int a_step, const Real a_time, const Real a_dt) override
Synchronzie solver times and time steps.
Definition: CD_RadiativeTransferStepperImplem.H:255
virtual ~RadiativeTransferStepper()
Destructor (does nothing)
Definition: CD_RadiativeTransferStepperImplem.H:44
const EBAMRCellData & getPhi() const
Get the solver solution.
Definition: CD_RadiativeTransferStepperImplem.H:341
Base class for advancing equations.
Definition: CD_TimeStepper.H:30
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15