|
chombo-discharge
|
CdrPlasmaStepper subclass that advances plasma equations using a split-step Godunov method. More...
#include <CD_CdrPlasmaGodunovStepper.H>


Classes | |
| class | CdrStorage |
| Utility class for memory handling in CdrPlasmaStepper. More... | |
| class | FieldStorage |
| Utility class for memory handling in CdrPlasmaStepper. More... | |
| class | RtStorage |
| Utility class for memory handling in CdrPlasmaStepper. More... | |
| class | SigmaStorage |
| Utility class for memory handling in CdrPlasmaStepper. More... | |
Protected Types | |
| enum class | FieldCoupling { Explicit , SemiImplicit } |
| Coupling strategy between the electric field and charge transport. More... | |
| enum class | AdvectionSolver { Euler , RK2 , MUSCL } |
| Advection solver used for the CDR transport step. More... | |
| enum class | DiffusionAlgorithm { Explicit , Implicit , Automatic } |
| Diffusion treatment strategy for the CDR equations. More... | |
Protected Types inherited from Physics::CdrPlasma::CdrPlasmaStepper | |
| enum class | SourceTermComputation { Interpolated , Upwind } |
| Enum for switching between source term computations. 'Interpolated' interpolates the cell-centered data to cell centroids. InterpolatedStable is the same as Interpolated but with a stability fix near inflow EBs. CellAverage assumes centroid-centered data, and Upwind uses the upwind formulation in Villa et. al. | |
| enum class | TimeCode { Advection , Diffusion , AdvectionDiffusion , Source , RelaxationTime , Restricted , Hardcap , Error , Physics } |
| An enum for encapsulating how time steps were restricted. | |
Protected Member Functions | |
| RefCountedPtr< CdrStorage > & | getCdrStorage (const CdrIterator< CdrSolver > &a_solverIt) |
| Function for getting the transient storage associated with a particular CDR solver. | |
| RefCountedPtr< RtStorage > & | getRtStorage (const RtIterator< RtSolver > &a_solverIt) |
| Function for getting the transient storage associated with a particular RTE solver. | |
| void | regridInternals (int a_lmin, int a_oldFinestLevel, int a_newFinestLevel) override |
| For regridding internal storage. Does nothing. | |
| void | allocateInternals () override |
| Allocate internal storage. | |
| void | allocateScratch () |
| Allocate internal storage. | |
| void | deallocateInternals () override |
| Deallocate transient memory. | |
| void | deallocateScratch () |
| Allocate internal storage. | |
| void | computeElectricFieldIntoScratch () |
| Compute electric field into scratch storage. | |
| void | computeCdrGradients () |
| Compute gradients of the CDR densities into scratch storage. | |
| void | extrapolateWithSourceTerm (Real a_dt) |
| Extrapolate cell-centered states with the source term. | |
| void | extrapolateCdrToEB () |
| Extrapolate the cell-centered states to the EB. | |
| void | computeCdrFluxesEB () |
| Compute the CDR boundary condition fluxes on the EBs. | |
| void | extrapolateCdrToDomain () |
| Extrapolate the CDR cell-centered densities to domain edges/face. | |
| void | computeCdrDomainFluxes () |
| Compute the CDR boundary condition fluxes on the domain faces. | |
| void | computeSigmaFlux () |
| Compute the surface flux for the surface charge solver. | |
| void | advanceTransport (Real a_dt) |
| Advance the transport problem. | |
| void | advanceTransportExplicitField (Real a_dt) |
| Advance the transport problem using the explicit or explicit-implicit Euler rule. | |
| void | advanceTransportSemiImplicit (Real a_dt) |
| Advance the transport problem using a semi-implicit formulation for the electric field. | |
| void | advanceCdrReactions (Real a_dt) |
| Advance the reactive problem over a time step dt. | |
| void | advanceRadiativeTransfer (Real a_dt) |
| Advance the radiative transfer problem. | |
| void | floorMass (EBAMRCellData &a_data, const std::string &a_message, const RefCountedPtr< CdrSolver > &a_solver) const |
| Print how much mass was injected into the system. | |
| void | postStep () |
| Perform post-step operations. | |
| void | computeCdrDriftVelocities (Real a_time) |
| Compute CDR drift velocities. | |
| void | computeCdrDiffusionCoefficients (Real a_time) |
| Compute CDR diffusion coefficients. | |
| void | computeSourceTerms (Real a_dt) |
| Compute source terms for the CDR and RTE equations. | |
| void | parseAdvection () |
| Parse centering for the advective integrator. | |
| void | parseDiffusion () |
| Parse how we handle diffusion. | |
| void | parseField () |
| Parse the transport algorithm. | |
| void | parseFloor () |
| Parse whether or not we should floor the mass. | |
| void | parseDebug () |
| Parse debug mode. | |
| void | parseProfile () |
| Parse profiling mode. | |
| void | parseFHD () |
| Parse inclusion of random diffusion flux. | |
| void | parseRegridSlopes () |
| Parse whether or not to use slopes when regridding. | |
| void | parseFiltering () |
| Parse filtering settings. | |
| bool | solveSemiImplicitPoisson () |
| Solve the semi-implicit Poisson equation. | |
Protected Member Functions inherited from Physics::CdrPlasma::CdrPlasmaStepper | |
| virtual void | parseVerbosity () |
| Parse class verbosity. | |
| virtual void | parseSolverVerbosity () |
| Parse solver verbosities. | |
| virtual void | parseCFL () |
| Parse the CFL number. | |
| virtual void | parseRelaxationTime () |
| Parse the relaxation time restriction. | |
| virtual void | parseMinDt () |
| Parse the minimum allowed time step. | |
| virtual void | parseMaxDt () |
| Parse the maximum allowed time step. | |
| virtual void | parseFastPoisson () |
| Parse the "fast poisson" method, i.e. how often we solve the Poisson equation. | |
| virtual void | parseFastRadiativeTransfer () |
| Parse the "fast rte" method, i.e. how often we solve the Poisson equation. | |
| virtual void | parseSourceComputation () |
| Parse how we compute the source terms. | |
| virtual void | writeJ (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, const int a_level) const |
| Compute and put the current density in output data holder. | |
| virtual void | computePhysicsPlotVars (EBAMRCellData &a_plotVars) const noexcept |
| Calculate the user-supplied plot variables. | |
| 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. | |
Protected Attributes | |
| FieldCoupling | m_fieldCoupling |
| For figuring out which transport algorithm we use. | |
| DiffusionAlgorithm | m_diffusionAlgorithm |
| For figuring out how we handle diffusion. | |
| AdvectionSolver | m_advectionSolver |
| Advection solver. | |
| std::unique_ptr< Timer > | m_timer |
| Timer for run-time profiling. | |
| Vector< RefCountedPtr< CdrStorage > > | m_cdrScratch |
| Scratch storage for the CDR solvers. | |
| Vector< RefCountedPtr< RtStorage > > | m_rteScratch |
| Scratch storage for the RTE solvers. | |
| RefCountedPtr< FieldStorage > | m_fieldScratch |
| Scratch storage for the field solver. | |
| RefCountedPtr< SigmaStorage > | m_sigmaScratch |
| Scratch storage for the surface charge solver. | |
| EBAMRCellData | m_semiImplicitRho |
| Use for holding the "space charge" when doing semi-implicit solves. | |
| EBAMRCellData | m_conductivityFactorCell |
| Used for storing conductivity*dt/eps0 on the cell center. | |
| EBAMRFluxData | m_conductivityFactorFace |
| Used for storing conductivity*dt/eps0 on the face centers. | |
| EBAMRIVData | m_conductivityFactorEB |
| Used for storing conductivity*dt/eps0 on the EB centers. | |
| EBAMRCellData | m_scratchSemiImplicitRho |
| Scratch storage for storing m_semiImplicitRho on the old grids during regrid operations. | |
| EBAMRCellData | m_scratchConductivity |
| Scratch storage for storing m_conductivityFactorCell on the old grids during regrid operations. | |
| bool | m_extrapAdvect |
| A special flag for letting the CDR solvers know that we want to compute advective derivatives at half time steps. | |
| bool | m_debug |
| Enable for debugging this class. | |
| bool | m_profile |
| Enable performance profiling. | |
| bool | m_floor |
| True if we floor the CDR densities. Due to reactions/EBs, they are not generally non-negative. | |
| bool | m_fhd |
| If true, add a stochastic diffusion flux. | |
| bool | m_regridSlopes |
| Regrid slopes or not. | |
| bool | m_filterCompensate |
| Use compensation step in filter or not. | |
| Real | m_implicitDiffusionThreshold |
| Diffusion threshold factor. | |
| int | m_diffusionOrder |
| Integration order for diffusion equations. | |
| int | m_numFilterRho |
| Number of filterings for space charge. | |
| std::vector< bool > | m_useImplicitDiffusion |
| If true, we are using implicit diffusion. Otherwise it's explicit diffusion. | |
Protected Attributes inherited from Physics::CdrPlasma::CdrPlasmaStepper | |
| std::string | m_realm |
| Realm where the time stepper is registered. | |
| std::string | m_className |
| Time stepper class name. | |
| phase::which_phase | m_phase |
| Plasma phase. | |
| SourceTermComputation | m_whichSourceTermComputation |
| Which source term computation. | |
| RefCountedPtr< MultiFluidIndexSpace > | m_multifluidIndexSpace |
| Index space. | |
| RefCountedPtr< CdrPlasmaPhysics > | m_physics |
| Plasma kinetics. | |
| RefCountedPtr< CdrLayout< CdrSolver > > | m_cdr |
| CDR solvers. | |
| RefCountedPtr< RtLayout< RtSolver > > | m_rte |
| Radiative transfer solvers. | |
| RefCountedPtr< FieldSolver > | m_fieldSolver |
| Poisson solver. | |
| RefCountedPtr< SurfaceODESolver< 1 > > | m_sigma |
| Surface charge solver. | |
| EBAMRCellData | m_currentDensity |
| Storage for the current. | |
| EBAMRCellData | m_physicsPlotVars |
| Storage for physics-observables. | |
| std::function< Real(const Real a_time)> | m_voltage |
| Applied voltage as a function of time. Used to set the Poisson solver boundary condition. | |
| Real | m_minDt |
| Minimum allowed time step. | |
| Real | m_maxDt |
| Maximum allowed time step. | |
| Real | m_cfl |
| CFL number. | |
| Real | m_relaxTime |
| Scaling factor for the dielectric relaxation time step restriction. | |
| Real | m_time |
| Current simulation time in seconds. | |
| Real | m_dt |
| Previous time step size. | |
| Real | m_dtCFL |
| Computed CFL time step. | |
| TimeCode | m_timeCode |
| Time code for step restriction. | |
| int | m_solverVerbosity |
| Verbosity for solvers. | |
| int | m_fastRTE |
| Solve RTE every m_fastRTE steps instead of every step. 0 or 1 means every step. | |
| int | m_fastPoisson |
| Solve Poisson every m_fastPoisson steps instead of every step. 0 or 1 means every step. | |
| int | m_upwindFactor |
| Upwind factor. | |
Protected Attributes inherited from TimeStepper | |
| int | m_verbosity |
| Class verbosity. | |
| int | m_timeStep |
| Time step. | |
| Real | m_time |
| TIme. | |
| Real | m_dt |
| Previous time step size. | |
| bool | m_keepGoing |
| If false, Driver will stop the time loop after the current step. | |
| RefCountedPtr< AmrMesh > | m_amr |
| AmrMesh. | |
| RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
| Computational geometry. | |
CdrPlasmaStepper subclass that advances plasma equations using a split-step Godunov method.
This class implements an operator-split advance in which transport (advection and diffusion) and reactions are handled separately. Three electric field coupling strategies are supported:
Multiple advection solvers (Euler, RK2, MUSCL) and diffusion treatments (Explicit, Implicit, Automatic) are configurable at runtime. Transient scratch storage is managed via inner classes CdrStorage, FieldStorage, RtStorage, and SigmaStorage.
|
strongprotected |
|
strongprotected |
|
strongprotected |
| CdrPlasmaGodunovStepper::CdrPlasmaGodunovStepper | ( | RefCountedPtr< CdrPlasmaPhysics > & | a_physics | ) |
Full constructor.
| [in] | a_physics | Reference to the plasma physics implementation. |
Implementation of the advance method.
This will switch between the various available implementations.
| [in] | a_dt | Time step to try |
Implements Physics::CdrPlasma::CdrPlasmaStepper.
Advance the reactive problem over a time step dt.
| [in] | a_dt | Time step |
Advance the radiative transfer problem.
| [in] | a_dt | Time step |
Advance the transport problem.
| [in] | a_dt | Time step. |
Advance the transport problem using the explicit or explicit-implicit Euler rule.
| [in] | a_dt | Time step. |
Advance the transport problem using a semi-implicit formulation for the electric field.
Under the hood, this is still an Euler solve.
| [in] | a_dt | Time step. |
|
overrideprotectedvirtual |
Allocate internal storage.
This will set up extra memory needed in the semi-implicit coupling.
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
protected |
Allocate internal storage.
Set up some scratch storage needed in the time advancement algorithms.
Compute CDR diffusion coefficients.
This is just like the parent method, except that we use the electric field stored in the scratch storage.
| [in] | a_time | Time step |
|
protected |
Compute the CDR boundary condition fluxes on the domain faces.
Prior to calling this routine, one must extrapolated the CDR states to the domain faces (calling extrapolateCdrToDomain)
Compute CDR drift velocities.
This is just like the parent method, except that we use the electric field stored in the scratch storage.
| [in] | a_time | Time step |
|
protected |
Compute the CDR boundary condition fluxes on the EBs.
Prior to calling this routine, one must extrapolated the CDR states to the EB (calling extrapolateCdrToEB)
|
overridevirtual |
Compute the time step – this will be different for the different supported algorithms.
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
protected |
Compute electric field into scratch storage.
This computes the electric field into the scratch storages in m_fieldScratch
Compute source terms for the CDR and RTE equations.
| [in] | a_dt | Time step |
|
overrideprotectedvirtual |
Deallocate transient memory.
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
protected |
Allocate internal storage.
Set up some scratch storage needed in the algorithms
Extrapolate cell-centered states with the source term.
This will compute cell-centered states (in the scratch storage) as n = n(t) + 0.5*a_dt * S(t)
| [in] | a_dt | Time step size. |
|
protected |
Print how much mass was injected into the system.
Occasionally, mass injection can be necessary due to negative densities arising the reactive problem, or due to redistribution near the embedded boundaries (which does not preserve non-negativeness).
| [in] | a_message | Base message |
| [in] | a_solver | Which CDR solver to compute the mass for. |
| [in] | a_data | Description |
|
protected |
Function for getting the transient storage associated with a particular CDR solver.
| [in] | a_solverIt | Solver iterator |
|
protected |
Function for getting the transient storage associated with a particular RTE solver.
| [in] | a_solverIt | Solver iterator |
|
overridevirtual |
Parse startup options.
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
overridevirtual |
Parse run-time adjustable parameters.
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
overridevirtual |
Run post-checkpoint setup operations.
The override is only relevant for the semi-implicit scheme because the field needs to be computed from a different equation. Fortunately, we've stored the necessary quantities (conductivity and space charge) to HDF5 so we can just set up a standard semi-implicit Poisson solve here.
Reimplemented from Physics::CdrPlasma::CdrPlasmaStepper.
|
overridevirtual |
Perform post-regrid operations.
This releases transient memory needed during the regrid.
Reimplemented from Physics::CdrPlasma::CdrPlasmaStepper.
Pre-regrid method. Used for storing important variables for the solvers.
This is overridden because the semi-implicit scheme requires us to store some extra variables on the old grids.
| [in] | a_lbase | Coarsest level that changes during the regrid. |
| [in] | a_finestLevel | The finest level before the regrid. |
Reimplemented from Physics::CdrPlasma::CdrPlasmaStepper.
|
overridevirtual |
Regrid method.
This overrides the parent class regrid method when using a semi-implicit scheme.
| [in] | a_lmin | The coarsest level that changed. |
| [in] | a_oldFinestLevel | The finest level before the regrid. |
| [in] | a_newFinestLevel | The finest level after the regrid. |
Reimplemented from Physics::CdrPlasma::CdrPlasmaStepper.
|
overrideprotectedvirtual |
For regridding internal storage. Does nothing.
| [in] | a_lmin | The coarsest level that changed. |
| [in] | a_oldFinestLevel | The finest level before the regrid. |
| [in] | a_newFinestLevel | The finest level after the regrid. |
Implements Physics::CdrPlasma::CdrPlasmaStepper.
|
protected |
Solve the semi-implicit Poisson equation.
|
protected |
Use for holding the "space charge" when doing semi-implicit solves.
This is different from the actual space charge because it also includes a diffusive contribution