chombo-discharge
CD_DischargeInceptionStepper.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2022 SINTEF Energy Research.
3  * Copyright © 2022 NTNU.
4  * Copyright © 2022 Fanny Skirbekk.
5  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
6  */
7 
16 #ifndef CD_DischargeInceptionStepper_H
17 #define CD_DischargeInceptionStepper_H
18 
19 // Our includes
20 #include <CD_TimeStepper.H>
22 #include <CD_TracerParticle.H>
23 #include <CD_FieldSolver.H>
25 #include <CD_CdrSolver.H>
26 #include <CD_CdrCTU.H>
27 #include <CD_NamespaceHeader.H>
28 
29 namespace Physics {
30  namespace DischargeInception {
31 
36  {
37  Euler,
38  Trapezoidal
39  };
40 
44  enum class StepSizeMethod
45  {
46  Fixed,
47  Dx,
48  Alpha
49  };
50 
54  enum class TransportAlgorithm
55  {
56  Euler,
57  Heun,
58  ImExCTU
59  };
60 
64  enum class Mode
65  {
66  Stationary,
67  Transient
68  };
69 
74  {
75  Unknown,
76  CDR,
77  VoltageCurve,
78  MinHardcap,
79  MaxHardcap
80  };
81 
88  template <typename P = TracerParticle<2, 2>, typename F = FieldSolverMultigrid, typename C = CdrCTU>
90  {
91  public:
96 
101 
106 
110  virtual ~DischargeInceptionStepper();
111 
117 
123 
127  void
128  setupSolvers() override;
129 
133  void
134  allocate() override;
135 
139  void
140  initialData() override;
141 
145  void
146  postInitialize() override;
147 
152  void
154  {}
155 
159  void
160  registerRealms() override;
161 
166  void
167  registerOperators() override;
168 
172  void
173  parseOptions();
174 
178  void
179  parseRuntimeOptions() override;
180 
181 #ifdef CH_USE_HDF5
188  virtual void
189  writeCheckpointData(HDF5Handle& a_handle, const int a_lvl) const override;
190 #endif
191 
192 #ifdef CH_USE_HDF5
199  virtual void
200  readCheckpointData(HDF5Handle& a_handle, const int a_lvl) override;
201 #endif
202 
208  virtual int
209  getNumberOfPlotVariables() const override;
210 
214  virtual Vector<std::string>
215  getPlotVariableNames() const override;
216 
224  virtual void
225  writePlotData(LevelData<EBCellFAB>& a_output,
226  int& a_icomp,
227  const std::string a_outputRealm,
228  const int a_level) const override;
229 
233  virtual Vector<std::string>
234  getStationaryPlotVariableNames() const noexcept;
235 
239  virtual Vector<std::string>
240  getTransientPlotVariableNames() const noexcept;
241 
245  virtual Real
246  computeDt() override;
247 
253  virtual Real
254  advance(const Real a_dt) override;
255 
259  virtual void
260  advanceIons(const Real a_dt) noexcept;
261 
268  virtual void
269  synchronizeSolverTimes(const int a_step, const Real a_time, const Real a_dt) override;
270 
274  virtual void
275  printStepReport() override;
276 
282  virtual void
283  preRegrid(const int a_lmin, const int a_oldFinestLevel) override;
284 
291  virtual void
292  regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override;
293 
298  virtual void
299  postRegrid() override;
300 
305  virtual void
306  setVoltageCurve(const std::function<Real(const Real& a_time)>& a_voltageCurve) noexcept;
307 
312  virtual void
313  setRho(const std::function<Real(const RealVect& x)>& a_rho) noexcept;
314 
319  virtual void
320  setSigma(const std::function<Real(const RealVect& x)>& a_sigma) noexcept;
321 
326  virtual void
327  setIonDensity(const std::function<Real(const RealVect x)>& a_density) noexcept;
328 
333  virtual void
334  setIonMobility(const std::function<Real(const Real E)>& a_mobility) noexcept;
335 
340  virtual void
341  setIonDiffusion(const std::function<Real(const Real E)>& a_diffCo) noexcept;
342 
347  virtual void
348  setAlpha(const std::function<Real(const Real& E, const RealVect& x)>& a_alpha) noexcept;
349 
354  virtual void
355  setEta(const std::function<Real(const Real& E, const RealVect& x)>& a_eta) noexcept;
356 
360  virtual const std::function<Real(const Real& E, const RealVect& x)>&
361  getAlpha() const noexcept;
362 
366  virtual const std::function<Real(const Real& E, const RealVect& x)>&
367  getEta() const noexcept;
368 
373  virtual void
374  setBackgroundRate(const std::function<Real(const Real& E, const RealVect& x)>& a_backgroundRate) noexcept;
375 
381  virtual void
382  setDetachmentRate(const std::function<Real(const Real& E, const RealVect& x)>& a_detachmentRate) noexcept;
383 
388  virtual void
389  setFieldEmission(const std::function<Real(const Real& E, const RealVect& x)>& a_currentDensity) noexcept;
390 
395  virtual void
396  setSecondaryEmission(const std::function<Real(const Real& E, const RealVect& x)>& a_coeff) noexcept;
397 
401  virtual Mode
402  getMode() const noexcept;
403 
407  virtual const EBAMRCellData*
408  getElectricField() const noexcept;
409 
410  protected:
415 
420 
425 
430 
435 
440 
444  RefCountedPtr<FieldSolver> m_fieldSolver;
445 
449  RefCountedPtr<CdrSolver> m_ionSolver;
450 
455 
460 
465 
470 
475 
480 
485 
490 
495 
501 
507 
513 
519 
525 
531 
537 
543 
549 
555 
561 
567 
573 
579 
585 
590 
595 
600  std::vector<Real> m_maxKPlus;
601 
606  std::vector<Real> m_maxKMinu;
607 
612  std::vector<Real> m_maxTPlus;
613 
618  std::vector<Real> m_maxTMinu;
619 
624  std::vector<std::pair<Real, Real>> m_maxK;
625 
630  std::vector<std::pair<Real, Real>> m_maxT;
631 
636  std::vector<Real> m_criticalVolumePlus;
637 
642  std::vector<Real> m_criticalVolumeMinu;
643 
648  std::vector<Real> m_criticalAreaPlus;
649 
654  std::vector<Real> m_criticalAreaMinu;
655 
660  std::vector<Real> m_ionizationVolume;
661 
666  std::vector<Real> m_RdotPlus;
667 
672  std::vector<Real> m_RdotMinu;
673 
678  std::vector<Real> m_voltageSweeps;
679 
685  std::vector<std::pair<Real, Real>> m_Rdot;
686 
691  std::vector<std::pair<Real, Real>> m_inceptionProbability;
692 
697  std::vector<std::pair<Real, Real>> m_criticalVolume;
698 
703  std::vector<std::pair<Real, Real>> m_criticalArea;
704 
709  std::vector<std::pair<Real, Real>> m_ionizationVolumeTransient;
710 
714  Real m_cfl;
715 
719  Real m_firstDt;
720 
724  Real m_maxDt;
725 
729  Real m_minDt;
730 
735 
740 
746 
751 
755  bool m_profile;
756 
760  bool m_debug;
761 
766 
771 
776 
781 
786 
791 
796 
801 
806 
811 
816 
821 
826 
830  bool m_plotEta;
831 
836 
840  std::function<Real(const Real a_time)> m_voltageCurve;
841 
845  std::string m_realm;
846 
850  std::string m_dataOutputFile;
851 
855  std::string m_outputFile;
856 
860  phase::which_phase m_phase;
861 
865  std::function<Real(const RealVect& x)> m_rho;
866 
870  std::function<Real(const RealVect& x)> m_sigma;
871 
875  std::function<Real(const RealVect& x)> m_initialIonDensity;
876 
880  std::function<Real(const Real& E)> m_ionMobility;
881 
885  std::function<Real(const Real& E)> m_ionDiffusion;
886 
890  std::function<Real(const Real& E, const RealVect& x)> m_alpha;
891 
895  std::function<Real(const Real& E, const RealVect& x)> m_eta;
896 
900  std::function<Real(const Real& E, const RealVect& x)> m_detachmentRate;
901 
905  std::function<Real(const Real& E, const RealVect& x)> m_backgroundRate;
906 
910  std::function<Real(const Real& E, const RealVect& x)> m_fieldEmission;
911 
915  std::function<Real(const Real& E, const RealVect& x)> m_secondaryEmission;
916 
920  virtual void
921  seedUniformParticles() noexcept;
922 
927  virtual void
928  seedIonizationParticles(const Real a_voltage) noexcept;
929 
935  virtual void
937 
944  virtual void
945  computeInceptionIntegralTransient(const Real& a_voltage) noexcept;
946 
950  virtual void
951  inceptionIntegrateEuler(const Real& a_voltage) noexcept;
952 
957  virtual void
958  inceptionIntegrateTrapezoidal(const Real& a_voltage) noexcept;
959 
965  virtual void
967 
973  virtual void
974  computeTownsendCriterionTransient(const Real& a_voltage) noexcept;
975 
980  virtual void
981  townsendTrackEuler(const Real& a_voltage) noexcept;
982 
987  virtual void
988  townsendTrackTrapezoidal(const Real& a_voltage) noexcept;
989 
994  virtual Real
995  computeRdot(const Real& a_voltage) const noexcept;
996 
1000  virtual void
1001  rewindTracerParticles() noexcept;
1002 
1006  virtual void
1007  resetTracerParticles() noexcept;
1008 
1013  virtual void
1019  virtual void
1020  computeDetachmentStationary() noexcept;
1021 
1026  virtual void
1027  computeFieldEmissionStationary() noexcept;
1028 
1035  virtual void
1036  computeFieldEmission(EBAMRCellData& a_emissionRate, const Real& a_voltage) const noexcept;
1037 
1045  virtual void
1047  const Real& a_voltage,
1048  const std::function<Real(const Real E, const RealVect x)>& a_func) const noexcept;
1049 
1058  virtual void
1059  evaluateFunction(LevelData<EBCellFAB>& a_data,
1060  const Real& a_voltage,
1061  const std::function<Real(const Real E, const RealVect x)>& a_func,
1062  const int a_level) const noexcept;
1063 
1068  virtual void
1069  computeInceptionVoltageVolume() noexcept;
1070 
1075  virtual std::pair<Real, RealVect>
1076  computeMinimumInceptionVoltage(const EBAMRCellData& a_Uinc) const noexcept;
1077 
1082  virtual void
1084 
1089  virtual Real
1090  computeCriticalVolumeTransient() const noexcept;
1091 
1096  virtual void
1097  computeCriticalAreaStationary() noexcept;
1098 
1103  virtual Real
1104  computeCriticalAreaTransient() const noexcept;
1105 
1110  virtual void
1112 
1117  virtual Real
1118  computeIonizationVolumeTransient(const Real& a_voltage) const noexcept;
1119 
1124  virtual void
1125  writeReportStationary() const noexcept;
1126 
1131  virtual void
1132  writeReportTransient() const noexcept;
1133 
1141  virtual void
1142  writePlotDataStationary(LevelData<EBCellFAB>& a_output,
1143  int& a_icomp,
1144  const std::string a_outputRealm,
1145  const int a_level) const noexcept;
1146 
1154  virtual void
1155  writePlotDataTransient(LevelData<EBCellFAB>& a_output,
1156  int& a_icomp,
1157  const std::string a_outputRealm,
1158  const int a_level) const noexcept;
1159 
1167  inline bool
1168  particleOutsideGrid(const RealVect& a_pos, const RealVect& a_probLo, const RealVect& a_probHi) const noexcept;
1169 
1175  inline bool
1176  particleInsideEB(const RealVect a_pos) const noexcept;
1177 
1182  inline void
1183  computeIonVelocity(const Real& a_voltage) noexcept;
1184 
1189  inline void
1190  computeIonDiffusion(const Real& a_voltage) noexcept;
1191 
1195  inline void
1196  parseMode() noexcept;
1197 
1201  inline void
1202  parseVoltages() noexcept;
1203 
1207  inline void
1208  parseOutput() noexcept;
1209 
1213  inline void
1214  parseVerbosity() noexcept;
1215 
1219  inline void
1220  parseInceptionAlgorithm() noexcept;
1221 
1225  inline void
1226  parseTransportAlgorithm() noexcept;
1227 
1231  inline void
1232  parsePlotVariables() noexcept;
1233 
1237  inline void
1238  solvePoisson() noexcept;
1239 
1247  inline void
1248  superposition(EBAMRCellData& a_sumField,
1249  const MFAMRCellData& a_inhomogeneousField,
1250  const MFAMRCellData& a_homogeneousField,
1251  const Real a_voltage) const noexcept;
1252 
1258  inline void
1259  superposition(EBAMRCellData& a_sumField, const Real a_voltage) const noexcept;
1260 
1271  virtual void
1272  writeData(LevelData<EBCellFAB>& a_output,
1273  int& a_comp,
1274  const EBAMRCellData& a_data,
1275  const std::string a_outputRealm,
1276  const int a_level,
1277  const bool a_interpToCentroids,
1278  const bool a_interpGhost) const noexcept;
1279  };
1280  } // namespace DischargeInception
1281 } // namespace Physics
1282 
1283 #include <CD_NamespaceFooter.H>
1284 
1286 
1287 #endif
Declaration of a class which implements CdrMultigrid using MUSCL for advection.
Declaration of an abstract class for solving scalar convection-diffusion-reaction problems.
Implementation of CD_DischargeInceptionStepper.H.
Mode
For specifying whether the module is run in stationary or transient mode.
Definition: CD_DischargeInceptionStepper.H:65
TimeStepRestriction
For specifying how the time step was restricted.
Definition: CD_DischargeInceptionStepper.H:74
TransportAlgorithm
Algorithm for negative ion advancement.
Definition: CD_DischargeInceptionStepper.H:55
IntegrationAlgorithm
Integration algorithm for the particles.
Definition: CD_DischargeInceptionStepper.H:36
StepSizeMethod
Step size selection method.
Definition: CD_DischargeInceptionStepper.H:45
Declaration of FieldSolverMultigrid.
Contains declaration of a base electrostatics solver class.
Declaration of main (abstract) time stepper class.
Declaration of a solver class that advances tracer particles.
Declaration of a tracer particle class.
Base class for solving convection-diffusion-reaction equations.
Definition: CD_CdrSolver.H:34
Base class for electrostatic solvers.
Definition: CD_FieldSolver.H:32
Class for streamer inception integral evaluations.
Definition: CD_DischargeInceptionStepper.H:90
virtual const std::function< Real(const Real &E, const RealVect &x)> & getAlpha() const noexcept
Get ionization coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:2063
void parseRuntimeOptions() override
Parse runtime options.
Definition: CD_DischargeInceptionStepperImplem.H:406
RefCountedPtr< FieldSolver > m_fieldSolver
Field solver.
Definition: CD_DischargeInceptionStepper.H:444
std::function< Real(const Real &E, const RealVect &x)> m_secondaryEmission
Secondary emission coefficient.
Definition: CD_DischargeInceptionStepper.H:915
TimeStepRestriction m_timeStepRestriction
Time step restriction.
Definition: CD_DischargeInceptionStepper.H:434
virtual const EBAMRCellData * getElectricField() const noexcept
Get the electric field.
Definition: CD_DischargeInceptionStepperImplem.H:5289
RefCountedPtr< TracerParticleSolver< P > > m_tracerParticleSolver
Tracer particle solver.
Definition: CD_DischargeInceptionStepper.H:439
void parseMode() noexcept
Parse simulation mode.
Definition: CD_DischargeInceptionStepperImplem.H:436
EBAMRCellData m_townsendInceptionVoltageMinu
Computed Townsend inception voltage.
Definition: CD_DischargeInceptionStepper.H:578
EBAMRCellData m_detachment
Detachment rates.
Definition: CD_DischargeInceptionStepper.H:524
void computeIonVelocity(const Real &a_voltage) noexcept
Set the negative ion velocity. Note.
Definition: CD_DischargeInceptionStepperImplem.H:5055
virtual void setIonMobility(const std::function< Real(const Real E)> &a_mobility) noexcept
Set the negative ion mobility (field-dependent)
Definition: CD_DischargeInceptionStepperImplem.H:2014
bool m_plotPoisson
Plot Poisson solver or not.
Definition: CD_DischargeInceptionStepper.H:785
bool m_plotTownsend
Plot the Townsend-criterion for initiatory ions.
Definition: CD_DischargeInceptionStepper.H:835
std::function< Real(const RealVect &x)> m_sigma
Surface charge distribution.
Definition: CD_DischargeInceptionStepper.H:870
MFAMRCellData m_potentialInho
Electric potential with charges.
Definition: CD_DischargeInceptionStepper.H:464
virtual void writeReportStationary() const noexcept
Print report to the terminal.
Definition: CD_DischargeInceptionStepperImplem.H:4843
MFAMRCellData m_electricField
Electric field.
Definition: CD_DischargeInceptionStepper.H:479
virtual Real advance(const Real a_dt) override
Advancement method. Swaps between various kernels.
Definition: CD_DischargeInceptionStepperImplem.H:1585
std::vector< std::pair< Real, Real > > m_criticalArea
Critical area at various time instances.
Definition: CD_DischargeInceptionStepper.H:703
virtual void townsendTrackTrapezoidal(const Real &a_voltage) noexcept
Track particles (positive ions) using a trapezoidal rule and check if the collide with a cathode.
Definition: CD_DischargeInceptionStepperImplem.H:3338
virtual void seedUniformParticles() noexcept
Distribute particles in every grid cell.
Definition: CD_DischargeInceptionStepperImplem.H:2136
virtual void resetTracerParticles() noexcept
Reset particles.
Definition: CD_DischargeInceptionStepperImplem.H:3687
virtual void setIonDensity(const std::function< Real(const RealVect x)> &a_density) noexcept
Set the negative ion density.
Definition: CD_DischargeInceptionStepperImplem.H:2002
virtual void computeCriticalVolumeStationary() noexcept
Compute the critical volume of the K values for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4413
virtual void postRegrid() override
Perform post-regrid operations.
Definition: CD_DischargeInceptionStepperImplem.H:1953
std::function< Real(const Real &E)> m_ionMobility
Negative ion mobility.
Definition: CD_DischargeInceptionStepper.H:880
virtual void inceptionIntegrateTrapezoidal(const Real &a_voltage) noexcept
K integral: Add integration parts after particles move.
Definition: CD_DischargeInceptionStepperImplem.H:2738
virtual void setBackgroundRate(const std::function< Real(const Real &E, const RealVect &x)> &a_backgroundRate) noexcept
Set the background ionization rate (e.g. from cosmic radiation etc).
Definition: CD_DischargeInceptionStepperImplem.H:2077
std::function< Real(const Real &E, const RealVect &x)> m_eta
Attachment coefficient.
Definition: CD_DischargeInceptionStepper.H:895
void computeIonDiffusion(const Real &a_voltage) noexcept
Set the negative ion diffusion coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:5121
virtual std::pair< Real, RealVect > computeMinimumInceptionVoltage(const EBAMRCellData &a_Uinc) const noexcept
Compute the minimum inception voltage and the starting electron position.
Definition: CD_DischargeInceptionStepperImplem.H:4338
virtual void computeTownsendCriterionStationary() noexcept
Solve for the Townsend criterion for each particle in each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:3038
virtual void synchronizeSolverTimes(const int a_step, const Real a_time, const Real a_dt) override
Synchronize solver times and time steps.
Definition: CD_DischargeInceptionStepperImplem.H:1783
virtual void inceptionIntegrateEuler(const Real &a_voltage) noexcept
Integrate the inception integral using the Euler rule.
Definition: CD_DischargeInceptionStepperImplem.H:2549
EBAMRCellData m_emissionRatesMinu
Field emission rates.
Definition: CD_DischargeInceptionStepper.H:536
std::function< Real(const RealVect &x)> m_rho
Space charge distribution.
Definition: CD_DischargeInceptionStepper.H:865
std::vector< Real > m_ionizationVolume
Ionization volumes for each voltage.
Definition: CD_DischargeInceptionStepper.H:660
EBAMRCellData m_inceptionIntegralPlus
Inception integral values.
Definition: CD_DischargeInceptionStepper.H:506
std::function< Real(const RealVect &x)> m_initialIonDensity
Negative ion density.
Definition: CD_DischargeInceptionStepper.H:875
virtual void computeInceptionVoltageVolume() noexcept
Interpolate between K values to find voltage giving K_inception and store values in m_inceptionVoltag...
Definition: CD_DischargeInceptionStepperImplem.H:4083
Real m_epsVoltage
Permitted relative deviation in V(t) when computing voltage-curve based time steps.
Definition: CD_DischargeInceptionStepper.H:734
EBAMRCellData m_homogeneousFieldGas
Gas-phase homogeneous field.
Definition: CD_DischargeInceptionStepper.H:494
std::vector< Real > m_maxTMinu
Max Townsend value (exp(K)/gamma) for every voltage.
Definition: CD_DischargeInceptionStepper.H:618
DischargeInceptionStepper & operator=(const DischargeInceptionStepper &&)=delete
Disallowed assignment.
StepSizeMethod m_stepSizeMethod
Step size selection method.
Definition: CD_DischargeInceptionStepper.H:424
bool m_fullIntegration
Use full reconstruction of critical volume or not.
Definition: CD_DischargeInceptionStepper.H:770
std::vector< std::pair< Real, Real > > m_maxK
Max K value for every time step.
Definition: CD_DischargeInceptionStepper.H:624
std::string m_realm
Realm where the solver lives.
Definition: CD_DischargeInceptionStepper.H:845
Real m_stepSizeFactor
Fixed step size (physical dimensions)
Definition: CD_DischargeInceptionStepper.H:745
virtual Real computeIonizationVolumeTransient(const Real &a_voltage) const noexcept
Compute the ionization volume for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4761
virtual void computeFieldEmission(EBAMRCellData &a_emissionRate, const Real &a_voltage) const noexcept
Compute field emission rates.
Definition: CD_DischargeInceptionStepperImplem.H:3937
std::vector< Real > m_criticalAreaPlus
Critical area of K values for each voltage.
Definition: CD_DischargeInceptionStepper.H:648
DischargeInceptionStepper(const DischargeInceptionStepper &)=delete
Disallowed constructor.
virtual int getNumberOfPlotVariables() const override
Get the number of plot variables for this time stepper.
Definition: CD_DischargeInceptionStepperImplem.H:702
DischargeInceptionStepper(const DischargeInceptionStepper &&)=delete
Disallowed constructor.
virtual Real computeCriticalVolumeTransient() const noexcept
Compute the critical volume of the K values for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4495
EBAMRCellData m_townsendCriterionMinu
Townsend criterion for starting positive ions.
Definition: CD_DischargeInceptionStepper.H:594
void registerOperators() override
Register operators.
Definition: CD_DischargeInceptionStepperImplem.H:377
EBAMRCellData m_townsendInceptionVoltagePlus
Computed Townsend inception voltage.
Definition: CD_DischargeInceptionStepper.H:572
virtual void evaluateFunction(EBAMRCellData &a_data, const Real &a_voltage, const std::function< Real(const Real E, const RealVect x)> &a_func) const noexcept
Evaluate a function f = f(E, x) in a volume.
Definition: CD_DischargeInceptionStepperImplem.H:3996
std::vector< Real > m_voltageSweeps
Voltage sweeps.
Definition: CD_DischargeInceptionStepper.H:678
MFAMRCellData m_scratchInho
Scratch storage used during regrids.
Definition: CD_DischargeInceptionStepper.H:474
bool m_profile
Profile calculation or not.
Definition: CD_DischargeInceptionStepper.H:755
std::function< Real(const Real &E)> m_ionDiffusion
Negative ion diffusion coefficient.
Definition: CD_DischargeInceptionStepper.H:885
EBAMRCellData m_emissionRatesPlus
Field emission rates.
Definition: CD_DischargeInceptionStepper.H:530
std::function< Real(const Real &E, const RealVect &x)> m_fieldEmission
Field emission current.
Definition: CD_DischargeInceptionStepper.H:910
TransportAlgorithm m_transportAlgorithm
Transport algorithm for advancing negative ions in the transient mode.
Definition: CD_DischargeInceptionStepper.H:429
void allocate() override
Allocate storage for solvers and time stepper.
Definition: CD_DischargeInceptionStepperImplem.H:166
EBAMRCellData m_emissionRate
Field emission rates.
Definition: CD_DischargeInceptionStepper.H:542
virtual Vector< std::string > getTransientPlotVariableNames() const noexcept
Get plot variable names for transient mode.
Definition: CD_DischargeInceptionStepperImplem.H:1040
virtual Mode getMode() const noexcept
Get the solver mode.
Definition: CD_DischargeInceptionStepperImplem.H:2129
void parseInceptionAlgorithm() noexcept
Parse the inception algorithm.
Definition: CD_DischargeInceptionStepperImplem.H:515
virtual ~DischargeInceptionStepper()
Destructor.
Definition: CD_DischargeInceptionStepperImplem.H:106
Real m_firstDt
First time step.
Definition: CD_DischargeInceptionStepper.H:719
void postCheckpointSetup() override
Post checkpoint operations.
Definition: CD_DischargeInceptionStepper.H:153
bool m_plotInceptionIntegral
If true, plot the K-values.
Definition: CD_DischargeInceptionStepper.H:800
void solvePoisson() noexcept
Solve the Poisson equation.
Definition: CD_DischargeInceptionStepperImplem.H:268
virtual void setAlpha(const std::function< Real(const Real &E, const RealVect &x)> &a_alpha) noexcept
Set the ionization coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:2038
EBAMRCellData m_inceptionVoltageMinu
Computed inception voltage.
Definition: CD_DischargeInceptionStepper.H:554
MFAMRCellData m_potential
Electric potential.
Definition: CD_DischargeInceptionStepper.H:454
bool m_plotDetachment
If true, plot electron detachment rate, i.e. dne/dt due to detachment from negative ions.
Definition: CD_DischargeInceptionStepper.H:815
Mode m_mode
Mode.
Definition: CD_DischargeInceptionStepper.H:414
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override
Time stepper regrid method.
Definition: CD_DischargeInceptionStepperImplem.H:1874
MFAMRCellData m_electricFieldHomo
Electric field without space/surface charge and V = 1 on live electrodes.
Definition: CD_DischargeInceptionStepper.H:484
bool m_plotTracer
Plot tracer particle solver or not.
Definition: CD_DischargeInceptionStepper.H:790
bool particleOutsideGrid(const RealVect &a_pos, const RealVect &a_probLo, const RealVect &a_probHi) const noexcept
Check if particle is outside grid boundaries.
Definition: CD_DischargeInceptionStepperImplem.H:5015
virtual void writeReportTransient() const noexcept
Print report to the terminal.
Definition: CD_DischargeInceptionStepperImplem.H:4935
virtual void rewindTracerParticles() noexcept
Move particles back to their original position.
Definition: CD_DischargeInceptionStepperImplem.H:3655
virtual void townsendTrackEuler(const Real &a_voltage) noexcept
Track particles (positive ions) using an Euler rule and check if the collide with a cathode.
Definition: CD_DischargeInceptionStepperImplem.H:3198
std::vector< Real > m_RdotMinu
Rate of appearance of first electron (in critical volume)
Definition: CD_DischargeInceptionStepper.H:672
std::vector< Real > m_maxTPlus
Max Townsend value (exp(K)/gamma) for every voltage.
Definition: CD_DischargeInceptionStepper.H:612
virtual 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_DischargeInceptionStepperImplem.H:1105
EBAMRCellData m_streamerInceptionVoltageMinu
Computed streamer inception voltage.
Definition: CD_DischargeInceptionStepper.H:566
void superposition(EBAMRCellData &a_sumField, const MFAMRCellData &a_inhomogeneousField, const MFAMRCellData &a_homogeneousField, const Real a_voltage) const noexcept
Calculate the total electric field = inhomogeneous + V * homogeneous.
Definition: CD_DischargeInceptionStepperImplem.H:5200
std::vector< std::pair< Real, Real > > m_Rdot
Integral factor for cumulative integration.
Definition: CD_DischargeInceptionStepper.H:685
void parseOptions()
Parse options.
Definition: CD_DischargeInceptionStepperImplem.H:391
std::vector< std::pair< Real, Real > > m_ionizationVolumeTransient
Ionization volume at various time instances.
Definition: CD_DischargeInceptionStepper.H:709
void setupSolvers() override
Instantiate the tracer particle solver.
Definition: CD_DischargeInceptionStepperImplem.H:116
std::vector< Real > m_criticalVolumePlus
Critical volumes of K values for each voltage.
Definition: CD_DischargeInceptionStepper.H:636
MFAMRCellData m_scratchHomo
Scratch storage used during regrids.
Definition: CD_DischargeInceptionStepper.H:469
virtual void setEta(const std::function< Real(const Real &E, const RealVect &x)> &a_eta) noexcept
Set the attachment coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:2051
virtual void writePlotDataTransient(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const noexcept
Write plot data for the 'transient' mode.
Definition: CD_DischargeInceptionStepperImplem.H:1328
bool m_plotFieldEmission
If true, plot the field emission.
Definition: CD_DischargeInceptionStepper.H:820
IntegrationAlgorithm m_inceptionAlgorithm
Integration algorithm for K-value.
Definition: CD_DischargeInceptionStepper.H:419
std::function< Real(const Real &E, const RealVect &x)> m_backgroundRate
Background ionization rate expression.
Definition: CD_DischargeInceptionStepper.H:905
EBAMRCellData m_streamerInceptionVoltagePlus
Computed streamer inception voltage.
Definition: CD_DischargeInceptionStepper.H:560
virtual Vector< std::string > getStationaryPlotVariableNames() const noexcept
Get plot variable names for stationary mode.
Definition: CD_DischargeInceptionStepperImplem.H:895
bool m_plotInceptionVoltage
If true, plot the inception voltage.
Definition: CD_DischargeInceptionStepper.H:805
std::string m_outputFile
Output file.
Definition: CD_DischargeInceptionStepper.H:855
EBAMRCellData m_inceptionVoltagePlus
Computed inception voltage.
Definition: CD_DischargeInceptionStepper.H:548
EBAMRCellData m_inceptionIntegralMinu
Inception integral values.
Definition: CD_DischargeInceptionStepper.H:512
std::function< Real(const Real &E, const RealVect &x)> m_detachmentRate
Detachment probability for negative ion.
Definition: CD_DischargeInceptionStepper.H:900
virtual void setDetachmentRate(const std::function< Real(const Real &E, const RealVect &x)> &a_detachmentRate) noexcept
Set the detachment rate for negative ions.
Definition: CD_DischargeInceptionStepperImplem.H:2090
virtual void computeTownsendCriterionTransient(const Real &a_voltage) noexcept
Solve for the Townsend criterion for each particle in each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:3145
virtual void computeIonizationVolumeStationary() noexcept
Compute the ionization volume for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4673
std::vector< Real > m_maxKMinu
Max K value for every voltage.
Definition: CD_DischargeInceptionStepper.H:606
std::function< Real(const Real a_time)> m_voltageCurve
Time-dependent voltage.
Definition: CD_DischargeInceptionStepper.H:840
phase::which_phase m_phase
Phase (gas/solid) where the solver lives.
Definition: CD_DischargeInceptionStepper.H:860
virtual void computeFieldEmissionStationary() noexcept
Compute field emission rates.
Definition: CD_DischargeInceptionStepperImplem.H:3858
std::string m_dataOutputFile
output data file
Definition: CD_DischargeInceptionStepper.H:850
void parseOutput() noexcept
Parse output settings.
Definition: CD_DischargeInceptionStepperImplem.H:501
std::function< Real(const Real &E, const RealVect &x)> m_alpha
Ionization coefficient.
Definition: CD_DischargeInceptionStepper.H:890
MFAMRCellData m_potentialHomo
Electric potential without charges.
Definition: CD_DischargeInceptionStepper.H:459
std::vector< Real > m_maxKPlus
Max K value for every voltage.
Definition: CD_DischargeInceptionStepper.H:600
EBAMRCellData m_inceptionIntegral
Inception integral values.
Definition: CD_DischargeInceptionStepper.H:500
bool m_plotEta
If true, plot eta.
Definition: CD_DischargeInceptionStepper.H:830
bool m_debug
Debug or not.
Definition: CD_DischargeInceptionStepper.H:760
virtual void computeInceptionIntegralStationary() noexcept
Solve streamer inception integral for each particle in each voltage and store K values in m_inception...
Definition: CD_DischargeInceptionStepperImplem.H:2403
virtual Real computeCriticalAreaTransient() const noexcept
Compute the critical area of the K values for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4622
virtual Vector< std::string > getPlotVariableNames() const override
Get plot variable names.
Definition: CD_DischargeInceptionStepperImplem.H:839
Real m_maxDt
Maximum permitted time step.
Definition: CD_DischargeInceptionStepper.H:724
virtual void computeDetachmentStationary() noexcept
Compute the detachment ionization rate for all voltages.
Definition: CD_DischargeInceptionStepperImplem.H:3784
bool m_plotField
Plot field.
Definition: CD_DischargeInceptionStepper.H:780
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 used for IO.
Definition: CD_DischargeInceptionStepperImplem.H:5230
DischargeInceptionStepper & operator=(const DischargeInceptionStepper &)=delete
Disallowed assignment.
void parseVoltages() noexcept
Parse voltage levels.
Definition: CD_DischargeInceptionStepperImplem.H:461
EBAMRCellData m_backgroundIonization
Background ionization rates.
Definition: CD_DischargeInceptionStepper.H:518
bool m_plotAlpha
If true, plot alpha.
Definition: CD_DischargeInceptionStepper.H:825
virtual void setIonDiffusion(const std::function< Real(const Real E)> &a_diffCo) noexcept
Set the negative ion diffusion coefficient (field-dependent)
Definition: CD_DischargeInceptionStepperImplem.H:2026
void postInitialize() override
Perform any post-initialization steps.
Definition: CD_DischargeInceptionStepperImplem.H:2319
virtual void setSigma(const std::function< Real(const RealVect &x)> &a_sigma) noexcept
Set surface charge distribution.
Definition: CD_DischargeInceptionStepperImplem.H:1990
EBAMRCellData m_townsendCriterionPlus
Townsend criterion for starting positive ions.
Definition: CD_DischargeInceptionStepper.H:589
EBAMRCellData m_townsendCriterion
Townsend criterion.
Definition: CD_DischargeInceptionStepper.H:584
void parseTransportAlgorithm() noexcept
Parse the transport algorithm.
Definition: CD_DischargeInceptionStepperImplem.H:565
bool m_ionTransport
Ion transport on/off.
Definition: CD_DischargeInceptionStepper.H:775
virtual void seedIonizationParticles(const Real a_voltage) noexcept
Add particles to every cell where alpha - eta > 0.0.
Definition: CD_DischargeInceptionStepperImplem.H:2213
DischargeInceptionStepper()
Default constructor.
Definition: CD_DischargeInceptionStepperImplem.H:35
bool m_plotNegativeIons
Plot negative ions or not.
Definition: CD_DischargeInceptionStepper.H:795
MFAMRCellData m_electricFieldInho
Electric field with space/surface charge and V = 0 on all electrodes.
Definition: CD_DischargeInceptionStepper.H:489
Real m_cfl
CFL-step for negative ions.
Definition: CD_DischargeInceptionStepper.H:714
std::vector< Real > m_criticalAreaMinu
Critical area of K values for each voltage.
Definition: CD_DischargeInceptionStepper.H:654
void parsePlotVariables() noexcept
Parse plot variables.
Definition: CD_DischargeInceptionStepperImplem.H:605
void initialData() override
Fill problem with initial data.
Definition: CD_DischargeInceptionStepperImplem.H:256
virtual const std::function< Real(const Real &E, const RealVect &x)> & getEta() const noexcept
Get attachment coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:2070
RefCountedPtr< CdrSolver > m_ionSolver
Negative ion solver.
Definition: CD_DischargeInceptionStepper.H:449
virtual void setSecondaryEmission(const std::function< Real(const Real &E, const RealVect &x)> &a_coeff) noexcept
Set the secondary emission coefficient.
Definition: CD_DischargeInceptionStepperImplem.H:2116
virtual Real computeDt() override
Compute a time step to be used by Driver.
Definition: CD_DischargeInceptionStepperImplem.H:1498
std::vector< std::pair< Real, Real > > m_criticalVolume
Critical volume at various time instances.
Definition: CD_DischargeInceptionStepper.H:697
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) override
Perform pre-regrid operations.
Definition: CD_DischargeInceptionStepperImplem.H:1854
virtual void printStepReport() override
Print a step report. Used in transient simulations.
Definition: CD_DischargeInceptionStepperImplem.H:1801
virtual void setRho(const std::function< Real(const RealVect &x)> &a_rho) noexcept
Set space charge distribution.
Definition: CD_DischargeInceptionStepperImplem.H:1978
virtual void writePlotDataStationary(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const noexcept
Write plot data for the 'stationary' mode.
Definition: CD_DischargeInceptionStepperImplem.H:1148
void parseVerbosity() noexcept
Parse class verbosity.
Definition: CD_DischargeInceptionStepperImplem.H:421
bool m_evaluateTownsend
Evaluate secondary emission.
Definition: CD_DischargeInceptionStepper.H:765
Real m_minDt
Minimum permitted time step.
Definition: CD_DischargeInceptionStepper.H:729
bool m_plotBackgroundIonization
If true, plot the background ionization rates.
Definition: CD_DischargeInceptionStepper.H:810
void registerRealms() override
Register realms. Primal is the only realm we need.
Definition: CD_DischargeInceptionStepperImplem.H:365
Real m_inceptionK
Inception criteria (read from input)
Definition: CD_DischargeInceptionStepper.H:750
virtual void computeBackgroundIonizationStationary() noexcept
Compute the background ionization rate for all voltages.
Definition: CD_DischargeInceptionStepperImplem.H:3717
virtual void computeInceptionIntegralTransient(const Real &a_voltage) noexcept
Solve streamer inception integral.
Definition: CD_DischargeInceptionStepperImplem.H:2514
virtual void setVoltageCurve(const std::function< Real(const Real &a_time)> &a_voltageCurve) noexcept
Set the voltage curve (used for transient mode)
Definition: CD_DischargeInceptionStepperImplem.H:1966
virtual void computeCriticalAreaStationary() noexcept
Compute the critical area of the K values for each voltage.
Definition: CD_DischargeInceptionStepperImplem.H:4559
std::vector< Real > m_RdotPlus
Rate of appearance of first electron (in critical volume)
Definition: CD_DischargeInceptionStepper.H:666
virtual void advanceIons(const Real a_dt) noexcept
Advance negative ions.
Definition: CD_DischargeInceptionStepperImplem.H:1697
std::vector< std::pair< Real, Real > > m_inceptionProbability
Cumulative probability of breakdown by time t.
Definition: CD_DischargeInceptionStepper.H:691
bool particleInsideEB(const RealVect a_pos) const noexcept
Check if particle is inside electrode.
Definition: CD_DischargeInceptionStepperImplem.H:5039
std::vector< std::pair< Real, Real > > m_maxT
Max Townsend value for every time step.
Definition: CD_DischargeInceptionStepper.H:630
virtual Real computeRdot(const Real &a_voltage) const noexcept
Compute integral_Vcr(dne/dt * (1 - eta/alpha) dV)
Definition: CD_DischargeInceptionStepperImplem.H:3553
virtual void setFieldEmission(const std::function< Real(const Real &E, const RealVect &x)> &a_currentDensity) noexcept
Set the field emission current.
Definition: CD_DischargeInceptionStepperImplem.H:2103
std::vector< Real > m_criticalVolumeMinu
Critical volumes of K values for each voltage.
Definition: CD_DischargeInceptionStepper.H:642
Real m_maxDtGrowth
Maximum permitted time step growth.
Definition: CD_DischargeInceptionStepper.H:739
Base class for advancing equations.
Definition: CD_TimeStepper.H:30
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition: CD_TracerParticleSolver.H:37
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15
phase names
Definition: CD_MultiFluidIndexSpace.H:27