13#ifndef CD_ITOKMCGODUNOVSTEPPER_H
14#define CD_ITOKMCGODUNOVSTEPPER_H
21#include <CD_NamespaceHeader.H>
30template <
typename I = ItoSolver,
typename C = CdrCTU,
typename R = McPhoto,
typename F = FieldSolverGMG>
65 advance(
const Real a_dt)
override;
93 preRegrid(const
int a_lmin, const
int a_oldFinestLevel) noexcept override;
108 regrid(const
int a_lmin, const
int a_oldFinestLevel, const
int a_newFinestLevel) noexcept override;
117 writeCheckpointData(HDF5Handle& a_handle,
const int a_lvl)
const noexcept override;
126 readCheckpointHeader(HDF5HeaderData& a_header)
noexcept override;
135 writeCheckpointHeader(HDF5HeaderData& a_header)
const noexcept override;
145 readCheckpointData(HDF5Handle& a_handle,
const int a_lvl)
noexcept override;
448 const RealVect& a_disp,
452 const Real a_bisectStep) const noexcept;
526 const
bool a_useStoredCdrConductivity) noexcept;
539 const
bool a_useStoredCdrConductivity) noexcept;
579 const Real a_tolerance) const noexcept;
609 const Real a_dt) noexcept;
650#include <CD_NamespaceFooter.H>
Enum for putting some logic into EB intersection tests.
EBIntersection
Enum for putting some logic into how we think about intersection between particles and EBs.
Definition CD_EBIntersection.H:22
EBRepresentation
Enum for putting some logic into how we think about EBs. This is just a simply supporting class for v...
Definition CD_EBRepresentation.H:23
Implementation of CD_ItoKMCGodunovStepper.H.
Declaration of the Physics::ItoKMC::ItoKMCStepper abstract TimeStepper.
SpeciesSubset
Enum for selecting a subset of plasma species by mobility/diffusion/charge properties.
Definition CD_ItoKMCStepper.H:43
Declaration of an AMR-hierarchy container that owns per-patch ParticleSoA leaves.
Implementation of CD_Timer.H.
AMR-hierarchy container of computational particles, stored per patch in Struct-of-Arrays form.
Definition CD_ParticleContainer.H:123
Implementation of ItoKMCStepper that uses a semi-implicit split-step formalism for advancing the Ito-...
Definition CD_ItoKMCGodunovStepper.H:32
virtual void setupSemiImplicitPoisson(const Real a_dt) noexcept
Set up the semi-implicit Poisson solver.
Definition CD_ItoKMCGodunovStepperImplem.H:1708
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) noexcept override
Regrid methods – puts all data on the new mesh.
Definition CD_ItoKMCGodunovStepperImplem.H:900
virtual void computeDiffusionTermCDR(EBAMRCellData &m_semiImplicitRhoCDR, const Real a_dt) noexcept
Compute the diffusion term for the CDR equations as well as the resulting CDR-contributions to the sp...
Definition CD_ItoKMCGodunovStepperImplem.H:2242
virtual void allocate() noexcept override
Allocate storage required for advancing the equations.
Definition CD_ItoKMCGodunovStepperImplem.H:101
bool m_readCheckpointParticles
If true, then the HDF5 checkpoint file contained particles that we can read.
Definition CD_ItoKMCGodunovStepper.H:222
DiffusiveDeposit
What to do with a diffusion hop that would carry a particle, or its charge, inside the embedded bound...
Definition CD_ItoKMCGodunovStepper.H:197
@ ReflectIto
Reflect the particle's displacement about the boundary. The deposit follows the corrected hop.
@ ReflectRho
Reflect the deposit about the boundary. The particle's own displacement is untouched.
@ Inside
Deposit from inside the solid, into a covered cell that contributes nothing to rho.
@ Cancel
Deposit at the pre-hop position. Conserves charge, but biases density towards where it started.
Vector< RefCountedPtr< ParticleContainer< NoPayload > > > m_rhoDaggerParticles
Storage for particles that gave rho^dagger.
Definition CD_ItoKMCGodunovStepper.H:314
virtual Real advance(const Real a_dt) override
Advance the Ito-Poisson-KMC system over a_dt.
Definition CD_ItoKMCGodunovStepperImplem.H:529
EBAMRCellData m_particleScratchSum
Particle-realm accumulator for per-species sums, one component.
Definition CD_ItoKMCGodunovStepper.H:361
bool m_emitSecondaryParticlesBeforeReactions
If true, particles will be emitted before the reactive step.
Definition CD_ItoKMCGodunovStepper.H:238
virtual void allocateInternals() noexcept override
Allocate "internal" storage.
Definition CD_ItoKMCGodunovStepperImplem.H:134
Real m_maxFieldAbort
Limit for maximum field abort.
Definition CD_ItoKMCGodunovStepper.H:288
Real m_reactiveFieldCentering
Time-centering of the electric field that the chemistry is evaluated at.
Definition CD_ItoKMCGodunovStepper.H:297
virtual void stepEulerMaruyamaCDR(const Real a_dt) noexcept
Step the CDR equations according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:2339
EBAMRCellData m_particleScratchSumSolid
Per-species accumulator on the particle realm, solid phase. One component.
Definition CD_ItoKMCGodunovStepper.H:373
DiffusiveDeposit m_diffusiveDeposit
What to do with a rho^dagger deposit that would land inside the embedded boundary....
Definition CD_ItoKMCGodunovStepper.H:243
virtual void computeConductivities(const Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const bool a_useStoredCdrConductivity) noexcept
Compute all conductivities (cell, face, and EB) from the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1430
WhichAlgorithm m_algorithm
Which advancement algorithm to use.
Definition CD_ItoKMCGodunovStepper.H:248
EBAMRCellData m_semiImplicitRhoCDR
Storage for CDR densities used during the semi-implicit solve.
Definition CD_ItoKMCGodunovStepper.H:321
virtual void parseAlgorithm() noexcept
Parse advancement algorithm.
Definition CD_ItoKMCGodunovStepperImplem.H:236
virtual void clearPointParticles(const Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const SpeciesSubset a_subset) noexcept
Clear the input particle data holders.
Definition CD_ItoKMCGodunovStepperImplem.H:1294
int m_condFilterNum
Number of filterings of the conductivity.
Definition CD_ItoKMCGodunovStepper.H:273
WhichAlgorithm
Simple enum for distinguishing between algorithms.
Definition CD_ItoKMCGodunovStepper.H:168
Vector< RefCountedPtr< ParticleContainer< NoPayload > > > m_conductivityParticles
Storage for simplified particles that gave us sigma^k.
Definition CD_ItoKMCGodunovStepper.H:303
virtual void postPlot() noexcept override
Perform post-plot operations.
Definition CD_ItoKMCGodunovStepperImplem.H:2532
EBAMRCellData m_reactiveElectricField
Storage for the electric field that the chemistry is evaluated at.
Definition CD_ItoKMCGodunovStepper.H:352
virtual Real computeDt() override
Compute a time step used for the advance method.
Definition CD_ItoKMCGodunovStepperImplem.H:509
Vector< EBAMRCellData > m_cdrDivD
Storage for the finite-volume approximation of div(D*grad(phi)) for the CDR equations.
Definition CD_ItoKMCGodunovStepper.H:345
EBAMRCellData m_scratchSemiImplicitRhoCDR
Scratch storage for CDR contribution to space charge density.
Definition CD_ItoKMCGodunovStepper.H:334
virtual void diffuseParticlesEulerMaruyama(Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_rhoDaggerParticles, const Real a_dt) noexcept
Perform the explicit half of the Ito advance in the Euler-Maruyama step.
Definition CD_ItoKMCGodunovStepperImplem.H:1968
virtual void parseSecondaryEmissionSpecification() noexcept
Parse when secondary particles are emitted.
Definition CD_ItoKMCGodunovStepperImplem.H:311
virtual void parseFiltering() noexcept
Parse filter settings.
Definition CD_ItoKMCGodunovStepperImplem.H:261
virtual void parseRuntimeOptions() noexcept override
Parse run-time options.
Definition CD_ItoKMCGodunovStepperImplem.H:216
Real m_condFilterAlpha
Factor for strided filter. Alpha=0.5 yields a bilinear filter.
Definition CD_ItoKMCGodunovStepper.H:283
EBAMRCellData m_particleScratchSolid
Deposition target on the particle realm, solid phase. One component.
Definition CD_ItoKMCGodunovStepper.H:367
virtual void depositPointParticles(const Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const SpeciesSubset a_subset) noexcept
Deposit the input point particles on the mesh.
Definition CD_ItoKMCGodunovStepperImplem.H:1192
virtual bool solvePoisson() noexcept override
Solve the electrostatic problem.
Definition CD_ItoKMCGodunovStepperImplem.H:1843
bool m_canRegridOnRestart
If true, then the class supports regrid-on-restart.
Definition CD_ItoKMCGodunovStepper.H:228
virtual void computeFaceConductivity() noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1531
virtual void computeCellConductivity(EBAMRCellData &a_conductivityCell, const Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const bool a_useStoredCdrConductivity) noexcept
Compute the cell-centered conductivity.
Definition CD_ItoKMCGodunovStepperImplem.H:1445
EBAMRCellData m_fluidScratchSolid
Cross-realm landing buffer on the fluid realm, solid phase. One component.
Definition CD_ItoKMCGodunovStepper.H:379
int m_condFilterMaxStride
Stride when filtering the conductivity.
Definition CD_ItoKMCGodunovStepper.H:278
EBAMRCellData m_semiImplicitConductivityCDR
Storage for conductivity term due to mobile CDR species.
Definition CD_ItoKMCGodunovStepper.H:328
virtual void removeCoveredPointParticles(Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const EBRepresentation a_representation, const Real a_tolerance) const noexcept
Remove covered particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1745
bool m_rhoDaggerHop
If true, the stochastic diffusion hop enters rho^dagger along with the rest of the explicit displacem...
Definition CD_ItoKMCGodunovStepper.H:217
virtual void remapPointParticles(Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_particles, const SpeciesSubset a_subset) noexcept
Remap the input point particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1087
virtual void prePlot() noexcept override
Perform pre-plot operations.
Definition CD_ItoKMCGodunovStepperImplem.H:2504
virtual ~ItoKMCGodunovStepper()
Destructor. Does nothing.
Definition CD_ItoKMCGodunovStepperImplem.H:75
bool m_extendConductivityEB
For achieving a slightly smoother gradient in the conductivity near the EB.
Definition CD_ItoKMCGodunovStepper.H:233
virtual void setOldPositions() noexcept
Set the starting positions for the ItoSolver particles.
Definition CD_ItoKMCGodunovStepperImplem.H:1048
virtual void parseDiffusiveDeposit() noexcept
Parse what happens to a diffusion hop that would cross the embedded boundary.
Definition CD_ItoKMCGodunovStepperImplem.H:439
bool m_writeCheckpointParticles
If true, then the particles are checkpointed so we can regrid on checkpoint-restart.
Definition CD_ItoKMCGodunovStepper.H:207
virtual void parseRhoDaggerHop() noexcept
Parse whether the stochastic diffusion hop enters rho^dagger.
Definition CD_ItoKMCGodunovStepperImplem.H:475
virtual void computeSemiImplicitRho() noexcept
Set up the space charge density for the regrid operation.
Definition CD_ItoKMCGodunovStepperImplem.H:1566
virtual void advanceEulerMaruyama(const Real a_dt) noexcept
Advance the particles using the Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:1882
virtual void preRegrid(const int a_lmin, const int a_oldFinestLevel) noexcept override
Perform pre-regrid operations.
Definition CD_ItoKMCGodunovStepperImplem.H:861
virtual void registerOperators() noexcept override
Register operators used for the simulation.
Definition CD_ItoKMCGodunovStepperImplem.H:85
virtual RealVect reflectDiffusionHop(const RealVect &a_pos, const RealVect &a_disp, const Real a_fOld, const Real a_dx, const EBIntersection a_intersectionAlg, const Real a_bisectStep) const noexcept
Reflect a rho^dagger deposit displacement that crosses the embedded boundary back into the fluid.
Definition CD_ItoKMCGodunovStepperImplem.H:342
EBAMRCellData m_scratchSemiImplicitConductivityCDR
Scratch storage for CDR contribution to conductivity.
Definition CD_ItoKMCGodunovStepper.H:340
virtual void plotParticles() const noexcept
Utility function for plotting the ItoSolver particles. These are written in a particles folder.
Definition CD_ItoKMCGodunovStepperImplem.H:2546
ItoKMCGodunovStepper()=delete
Disallowed default constructor. Use the full constructor.
Vector< RefCountedPtr< ParticleContainer< NoPayload > > > m_irregularParticles
Storage for particles that fell inside the EB but should still contribute to the conductivity.
Definition CD_ItoKMCGodunovStepper.H:308
Real m_rhoFilterAlpha
Factor for strided filter. Alpha=0.5 yields a bilinear filter.
Definition CD_ItoKMCGodunovStepper.H:268
int m_rhoFilterNum
Number of filterings when computing the semi-implicit space charge density.
Definition CD_ItoKMCGodunovStepper.H:258
Timer m_timer
Timer used for run-time logging of routines.
Definition CD_ItoKMCGodunovStepper.H:253
virtual void parseReactiveFieldCentering() noexcept
Parse the time-centering of the electric field used for the reactive substep.
Definition CD_ItoKMCGodunovStepperImplem.H:489
virtual void parseCheckpointParticles() noexcept
Parse checkpoint-restart functionality.
Definition CD_ItoKMCGodunovStepperImplem.H:297
virtual void barrier() const noexcept
Set an MPI barrier if using debug mode.
Definition CD_ItoKMCGodunovStepperImplem.H:182
virtual void parseOptions() noexcept override
Parse options.
Definition CD_ItoKMCGodunovStepperImplem.H:196
int m_rhoFilterMaxStride
Stride when filtering the space charge density.
Definition CD_ItoKMCGodunovStepper.H:263
virtual void computeCdrConductivity() noexcept
Compute the CDR contribution to the semi-implicit conductivity, i.e. sum(|Z| * phi * mu).
Definition CD_ItoKMCGodunovStepperImplem.H:1400
virtual void stepEulerMaruyamaParticles(const Real a_dt) noexcept
Step the particles according to the regular Euler-Maruyama scheme.
Definition CD_ItoKMCGodunovStepperImplem.H:2282
virtual void copyConductivityParticles(Vector< RefCountedPtr< ParticleContainer< NoPayload > > > &a_conductivityParticles) noexcept
Copy particles from the ItoSolver into PointParticles whose weight are ItoParticle::m_weight * ItoPar...
Definition CD_ItoKMCGodunovStepperImplem.H:1785
Abstract TimeStepper for the Ito-KMC-Poisson system of equations.
Definition CD_ItoKMCStepper.H:66
Class which is used for run-time monitoring of events.
Definition CD_Timer.H:32
Namespace containing physics models for use with chombo-discharge.
Definition CD_AdvectionDiffusion.H:16
Empty payload: ParticleSoA<> is a position+weight+metadata point particle.
Definition CD_ParticleSoA.H:289