chombo-discharge
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ItoSolver Class Reference

Base class for Ito diffusion particle models. More...

#include <CD_ItoSolver.H>

Collaboration diagram for ItoSolver:
Collaboration graph
[legend]

Public Types

enum class  WhichContainer {
  Bulk , EB , Domain , Source ,
  Covered , Scratch
}
 Enum class for distinguishing various types of particle containers. More...
 

Public Member Functions

 ItoSolver ()
 Constructor – user must subsequently set the realm and, parse class options, set the species etc.
 
virtual ~ItoSolver ()
 Destructor (does nothing).
 
virtual void setParticleMerger (const ParticleManagement::ParticleMerger< ItoParticle > &a_particleMerger) noexcept
 Set the particle merger. This will get called when merging particles using makeSuperparticles. More...
 
virtual std::string getName () const
 Get this solver's name. More...
 
virtual const std::string getRealm () const
 Get the realm where this solver is registered. More...
 
virtual void setRealm (const std::string a_realm)
 Set the realm where this solver will live. More...
 
virtual void parseOptions ()
 Parse class options.
 
virtual void parseRuntimeOptions ()
 Parse class runtime configurable options.
 
virtual EBIntersection getIntersectionAlgorithm () const noexcept
 Get the EB-particle intersection algorithm.
 
virtual void initialData ()
 Set the initial data. More...
 
virtual void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
 Regrid this solver. More...
 
virtual void allocate ()
 Allocate internal storage. More...
 
virtual void clear (const WhichContainer a_container)
 Clear a particle container – this will delete all the particles in the input container. More...
 
virtual void clear (ParticleContainer< ItoParticle > &a_particles) const
 Clear a particle container – this will delete all the particles in the input container. More...
 
virtual void clear (AMRParticles< ItoParticle > &a_particles) const
 Clear particles – this will deleted all the particles in the input container. More...
 
virtual void depositConductivity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Deposit conductivities (i.e. mass*mobility / volume) More...
 
virtual void depositConductivity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Deposit conductivities (i.e. mass*mobility / volume) More...
 
virtual void depositDiffusivity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Deposit diffusivity (i.e. mass*D/volume) More...
 
virtual void depositDiffusivity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Deposit diffusivity (i.e. mass*D/volume) More...
 
virtual void depositEnergyDensity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Deposit energy densities (i.e. mass*energy/volume => total energy per unit volume) More...
 
virtual void depositEnergyDensity (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Deposit energy densities (i.e. mass*energy/volume => total energy per unit volume) More...
 
virtual void computeAverageMobility (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Compute average mobility. More...
 
virtual void computeAverageDiffusion (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Compute average diffusion coefficient. More...
 
virtual void computeAverageEnergy (EBAMRCellData &a_phi, ParticleContainer< ItoParticle > &a_particles) const
 Compute average particle energy.. More...
 
virtual void depositParticles ()
 Deposit particles onto mesh. More...
 
virtual void depositParticles (const WhichContainer a_container)
 Deposit particles on to mesh. More...
 
template<class P , const Real &(P ::*)() const particleScalarField>
void depositParticlesNGP (LevelData< EBCellFAB > &a_output, const ParticleContainer< P > &a_particles, const int a_level) const noexcept
 Do an NGP deposit on a specific grid level. Used for IO. More...
 
template<class P , Real(P ::*)() const particleScalarField>
void depositParticlesNGP (LevelData< EBCellFAB > &a_output, const ParticleContainer< P > &a_particles, const int a_level) const noexcept
 Do an NGP deposit on a specific grid level. Used for IO. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void depositParticles (EBAMRCellData &a_phi, ParticleContainer< P > &a_particles) const
 Generic deposition function which deposits a particle field onto the mesh using a specified deposition method. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void depositParticles (EBAMRCellData &a_phi, ParticleContainer< P > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Generic deposition function which deposits a particle field onto the mesh using a specified deposition method. More...
 
template<class P , Real(P::*)() const particleScalarField>
void depositParticles (EBAMRCellData &a_phi, ParticleContainer< P > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Generic deposition function which deposits a particle field onto the mesh using a specified deposition method. More...
 
virtual void removeCoveredParticles (const EBRepresentation a_representation, const Real a_tol)
 Remove particles that are inside the EB. More...
 
virtual void removeCoveredParticles (const WhichContainer a_container, const EBRepresentation a_representation, const Real a_tol)
 Remove particles that are inside the EB. More...
 
virtual void removeCoveredParticles (ParticleContainer< ItoParticle > &a_particles, const EBRepresentation a_representation, const Real a_tol) const
 Remove particles that are inside the EB. More...
 
virtual void transferCoveredParticles (const EBRepresentation a_representation, const Real a_tol)
 Transfer particles that are covered (within a_tol distance from EB) to another container. More...
 
virtual void transferCoveredParticles (const WhichContainer a_containerFrom, const WhichContainer a_containerTo, const EBRepresentation a_representation, const Real a_tol)
 Transfer particles that are covered (within a_tol distance from EB) to another container. More...
 
virtual void transferCoveredParticles (ParticleContainer< ItoParticle > &a_particlesFrom, ParticleContainer< ItoParticle > &a_particlesTo, const EBRepresentation a_representation, const Real a_tol) const
 Transfer particles that are inside the EB to another container. More...
 
virtual void intersectParticles (const EBIntersection a_ebIntersection, const bool a_deleteParticles, const std::function< void(ItoParticle &)> a_nonDeletionModifier=[](ItoParticle &) -> void { return;})
 Do boundary intersection tests. More...
 
virtual void intersectParticles (const WhichContainer a_particles, const WhichContainer a_ebParticles, const WhichContainer a_domainParticles, const EBIntersection a_ebIntersection, const bool a_deleteParticles, const std::function< void(ItoParticle &)> a_nonDeletionModifier=[](ItoParticle &) -> void { return;})
 Do boundary intersection tests. More...
 
virtual void intersectParticles (ParticleContainer< ItoParticle > &a_particles, ParticleContainer< ItoParticle > &a_ebParticles, ParticleContainer< ItoParticle > &a_domainParticles, const EBIntersection a_ebIntersection, const bool a_deleteParticles, const std::function< void(ItoParticle &)> a_nonDeletionModifier=[](ItoParticle &) -> void { return;})
 Do boundary intersection tests. More...
 
virtual void computeLoads (Vector< long int > &a_loads, const DisjointBoxLayout &a_dbl, const int a_level)
 Compute particle load on a specific grid level – this will compute the number of particles in each box in the input grids. More...
 
virtual int getNumberOfPlotVariables () const
 Get number of plot variables. More...
 
virtual Vector< std::string > getPlotVariableNames () const
 Get output plot names. More...
 
virtual void writePlotData (LevelData< EBCellFAB > &a_output, int &a_comp, const std::string a_outputRealm, const int a_level) const noexcept
 Write plot data. More...
 
virtual unsigned long long getNumParticles (const WhichContainer a_container, const bool a_localOnly) const
 Get number of particles in a specified particle container. More...
 
virtual void registerOperators () const
 Register operators. More...
 
virtual void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set computational geometry. More...
 
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set the AmrMesh object. More...
 
virtual void setPhase (const phase::which_phase a_phase)
 Set phase where the particles will live. More...
 
virtual void setVerbosity (const int a_verbosity)
 Set verbosity level for this solver. More...
 
virtual void setTime (const int a_step, const Real a_time, const Real a_dt)
 Set the time for this solver. More...
 
virtual void setSpecies (const RefCountedPtr< ItoSpecies > &a_species)
 Set the species. More...
 
virtual void preRegrid (const int a_lbase, const int a_oldFinestLevel)
 Perform pre-regrid operations. More...
 
template<ItoSolver::WhichContainer C = WhichContainer::Bulk>
void addParticles (ListBox< ItoParticle > &a_inputParticles, const int a_lvl, const DataIndex a_dit, const bool a_destructive)
 Add particles to a contain. This adds into a specific grid level and patch. The user can delete the input particles. More...
 
virtual bool isMobile () const
 Check if solver is mobile. More...
 
virtual bool isDiffusive () const
 Check if solver is diffusive. More...
 
virtual ParticleContainer< ItoParticle > & getParticles (const WhichContainer a_container)
 Get a general particle container. More...
 
virtual const ParticleContainer< ItoParticle > & getParticles (const WhichContainer a_container) const
 Get a general particle container. More...
 
virtual const RefCountedPtr< ItoSpecies > & getSpecies () const
 Get the species. More...
 
virtual EBAMRCellDatagetPhi ()
 Get the mesh data. More...
 
virtual EBAMRCellDatagetVelocityFunction ()
 Get cell-centered velocity mesh data. More...
 
virtual const EBAMRCellDatagetVelocityFunction () const
 Get cell-centered velocity mesh data. More...
 
virtual EBAMRCellDatagetDiffusionFunction ()
 Get the diffusion function. More...
 
virtual const EBAMRCellDatagetDiffusionFunction () const
 Get the diffusion function. More...
 
virtual EBAMRCellDatagetMobilityFunction ()
 Get mobility function. More...
 
virtual const EBAMRCellDatagetMobilityFunction () const
 Get mobility function. More...
 
virtual void setDiffusionFunction (const Real a_diffusionCoefficient)
 Utility function – set a constant diffusion coefficient. More...
 
virtual void setVelocityFunction (const RealVect a_velocity)
 Utility function – set a constant velocity. More...
 
virtual void setParticleMobility (const Real a_mobility)
 Sets mobility coefficient for all particles. More...
 
virtual void setParticleDiffusion (const Real a_diffusion)
 Sets diffusion coefficient for all particles. More...
 
virtual void interpolateVelocities ()
 Interpolate the particle velocities. More...
 
virtual void interpolateVelocities (const int a_level, const DataIndex &a_dit)
 Interpolate the particle velocities. More...
 
virtual void interpolateMobilities ()
 Interpolate mobilities. More...
 
virtual void updateMobilities ()
 Update mobilities parametrically from the particle energy. More...
 
virtual void interpolateDiffusion ()
 Interpolate the diffusion field to the particle positions. More...
 
virtual void updateDiffusion ()
 Update mobilities parametrically from the particle energy. More...
 
virtual void organizeParticlesByCell (const WhichContainer a_container)
 Sort the input particle container by cell. More...
 
virtual void organizeParticlesByPatch (const WhichContainer a_container)
 Sort the input particle container by patch. More...
 
virtual void makeSuperparticles (const WhichContainer a_container, const int a_particlesPerCell)
 Make superparticles for a full container – this is the AMR version that users will usually call. More...
 
virtual void makeSuperparticles (const WhichContainer a_container, const Vector< int > a_particlesPerCell)
 Make superparticles for a full container – this is the AMR version that users will usually call. More...
 
virtual void makeSuperparticles (const WhichContainer a_container, const int a_particlesPerCell, const int a_level)
 Make superparticles for a particle container – this is used for a specified grid level. More...
 
virtual void makeSuperparticles (const WhichContainer a_container, const int a_particlesPerCell, const int a_level, const DataIndex a_dit)
 Make superparticles for a particle container – this is used for a specified grid level and patch. More...
 
virtual void mergeParticles (List< ItoParticle > &a_particles, const CellInfo &a_cellInfo, const int a_particlesPerCell) const noexcept
 General superparticle merging with underlying algorithm through m_particleMerger. More...
 
virtual void makeSuperparticlesEqualWeightKD (List< ItoParticle > &a_particles, const CellInfo &a_cellInfo, const int a_particlesPerCell) const noexcept
 Superparticle merging with KD/BVH trees. More...
 
virtual void reinitializeParticles (List< ItoParticle > &a_particles, const CellInfo &a_cellInfo, const int a_particlesPerCell) const noexcept
 Particle re-initialization algorithm. More...
 
virtual void remap ()
 Remap the bulk particle container.
 
virtual void remap (const WhichContainer a_container)
 Remap all particles in the input container. More...
 
virtual void remapAll ()
 Remap all particle containers.
 
RealVect randomGaussian () const
 Draw a random N-dimensional Gaussian number from a normal distribution with zero with and unit standard deviation. More...
 
RealVect randomDirection () const
 Draw a random direction in N-dimensional space. More...
 
virtual Real computeDt () const
 Compute a time step for the advance – this calls the level function. More...
 
virtual Real computeDt (const int a_lvl) const
 Compute a time step for the advance – this returns the maximum permitted time step on the input grid level. More...
 
virtual Real computeDt (const int a_lvl, const DataIndex &a_dit) const
 Compute a time step for the advance – this returns the maximum permitted time step on the input grid patch. More...
 
virtual Real computeHopDt (const Real a_maxCellsToMove) const
 Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on any grid level. More...
 
virtual Real computeHopDt (const Real a_maxCellsToMove, const int a_lvl) const
 Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on the input grid level. More...
 
virtual Real computeHopDt (const Real a_maxCellsToMove, const int a_lvl, const DataIndex &a_dit) const
 Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on the input grid level. More...
 
virtual Real computeAdvectiveDt () const
 Compute advection time step dt = dx/vMax where vMax is the largest velocity component of the particle.
 
virtual Real computeAdvectiveDt (const int a_lvl) const
 Compute the drift dt. This computes the minimum dt = dx/vMax on the input level. More...
 
virtual Real computeAdvectiveDt (const int a_lvl, const DataIndex &a_dit) const
 Compute the drift dt. This computes the minimum dt = dx/vMax on one level and one box. More...
 
virtual Real computeDiffusiveDt () const
 Compute the diffusive dt. This computes dt = dx*dx/(2*D) for all particles.
 
virtual Real computeDiffusiveDt (const int a_lvl) const
 Compute the diffusive dt. This computes dt = dx*dx/(2*D) for all particles on the input level. More...
 
virtual Real computeDiffusiveDt (const int a_lvl, const DataIndex &a_dit) const
 Compute the diffusive dt. This computes dt = dx*dx/(2*D) for all particles on the input grid patch. More...
 
DepositionType getDeposition () const
 Get deposition method. More...
 
CoarseFineDeposition getCoarseFineDeposition () const
 Get the coarse-fine deposition strategy.
 
phase::which_phase getPhase () const
 Return phase. More...
 

Protected Types

enum class  WhichCheckpoint { Particles , Numbers }
 How to checkpoint files. More...
 
enum class  WhichMobilityInterpolation { Direct , Velocity }
 Enum for deciding how to interpolate particle mobilities. More...
 

Protected Member Functions

void parseRNG ()
 Parse RNG options – this parses the RNG seed and instantiates the distributions.
 
void parseTruncation ()
 Parse the normal distribution truncation level.
 
void parseDeposition ()
 Parse particle deposition methods.
 
void parseParticleMerger ()
 Parse the super-particle merger.
 
void parseIntersectionEB ()
 Parse EB intersection algorithms.
 
void parseVerbosity ()
 Parse class verbosity.
 
void parsePlotVariables ()
 Parse plot variables.
 
void parseDiffusionHop ()
 Parse diffusion hop.
 
void parseRedistribution ()
 Parse whether or not to use redistribution.
 
void parseDivergenceComputation ()
 Parse whether or not to compute a "non-conservative" divergence when redistributing mass.
 
void parseCheckpointing ()
 Parse checkpointing method.
 
void drawNewParticles (const LevelData< EBCellFAB > &a_particlesPerCell, const int a_level, const int a_newPPC)
 Restart particles from a specified number of particles in the grid cell. More...
 
template<class P , const Real &(P::*)() const particleScalarField>
void depositKappaConservative (EBAMRCellData &a_phi, ParticleContainer< P > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Compute the cell-centered deposition – this is the main deposition function. More...
 
template<class P , Real(P::*)() const particleScalarField>
void depositKappaConservative (EBAMRCellData &a_phi, ParticleContainer< P > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const
 Compute the cell-centered deposition – this is the main deposition function. More...
 
virtual void redistributeAMR (EBAMRCellData &a_phi) const
 Redistribute mass in an AMR context. More...
 
virtual void depositNonConservative (EBAMRIVData &a_depositionNC, const EBAMRCellData &a_depositionKappaC) const
 Make the "non-conservative" kappa deposition – computing depositionNC = sum(kappa*depositionC)/sum(kappa) in a neighborhood around each vof. More...
 
virtual void depositHybrid (EBAMRCellData &a_depositionH, EBAMRIVData &a_massDifference, const EBAMRIVData &a_depositionNC) const
 Make the "hybrid" deposition phiH = kappa*phiC + (1-kappa)*phiNC. On input, a_depositionH should contain phiC. More...
 
virtual void interpolateMobilities (const int a_level, const DataIndex &a_dit, const EBCellFAB &a_velocityMagnitude) noexcept
 Interpolate mobilities – this will switch between the two ways of computing the particle mobility. More...
 
virtual void interpolateMobilitiesDirect (const int a_level, const DataIndex &a_dit) noexcept
 Directly interpolate mobilities. Interpolates for all particles in the specified grid patch. More...
 
virtual void interpolateMobilitiesVelocity (const int a_level, const DataIndex &a_dit, const EBCellFAB &a_velocityMagnitude) noexcept
 Interpolate mobilities through the velocity. Interpolates for all particles in the specified grid patch. More...
 
virtual void updateMobilities (const int a_level, const DataIndex a_dit)
 Update mobilities parametrically from the particle energy. More...
 
virtual void interpolateDiffusion (const int a_level, const DataIndex &a_dit)
 Interpolate the diffusion field to the particle positions. More...
 
virtual void updateDiffusion (const int a_level, const DataIndex a_dit)
 Update mobilities parametrically from the particle energy. More...
 
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. More...
 

Protected Attributes

WhichCheckpoint m_checkpointing
 How to checkpoint files. particles => write particles to HDF5. numbers => write numbers to HDF5.
 
WhichMobilityInterpolation m_mobilityInterp
 Switch for deciding how to interpolate mobilities, i.e. interpolating either mu*E or just mu (to the particle position)
 
ParticleManagement::ParticleMerger< ItoParticlem_particleMerger
 Particle merger.
 
int m_restartPPC
 Number of particles used when restarting a simulation – this is relevant only when restarting from a "fluid" checkpoint file.
 
std::string m_realm
 Realm where this solve lives.
 
RefCountedPtr< ComputationalGeometrym_computationalGeometry
 Computational geometry.
 
RefCountedPtr< AmrMeshm_amr
 AMR; needed for grid stuff.
 
RefCountedPtr< ItoSpeciesm_species
 Species that this solver solves for.
 
phase::which_phase m_phase
 Phase where this solver lives.
 
std::string m_name
 Solver name.
 
std::string m_className
 Class name. More...
 
Real m_normalDistributionTruncation
 Truncation value for normal distribution. More...
 
Real m_bisectionStep
 Bisection step size to use for particle intersection tests with EBs.
 
int m_verbosity
 Verbosity level for this solver.
 
int m_timeStep
 Time step.
 
int m_haloBuffer
 Size of refinement boundary halo.
 
Real m_time
 Current time.
 
Real m_dt
 Time step.
 
bool m_forceIrregDepositionNGP
 NGP deposition in cut cells or not.
 
bool m_forceIrregInterpolationNGP
 NGP interpolation in cut cells or not.
 
bool m_forceHaloNGP
 Force usage of NGP when depositing "halo" particles.
 
bool m_useRedistribution
 Use mass redistribution or not.
 
bool m_blendConservation
 Flag for blending the deposition clouds with the "non-conservative" divergence.
 
bool m_isDiffusive
 If true, solver is diffusive.
 
bool m_isMobile
 If true, solver is mobile, i.e. advection is turned on.
 
bool m_plotPhi
 Flag for outputting m_phi to plot files.
 
bool m_plotVelocity
 Flag for outputting m_velocityFunction to plot files.
 
bool m_plotDiffCo
 Flag for outputting m_diffusionFunction to plot files.
 
bool m_plotParticles
 Flag for depositing and plotting the bulk particles on the mesh.
 
bool m_plotParticlesEB
 Flag for depositing and plotting the EB particles on the mesh.
 
bool m_plotParticlesDomain
 Flag for depositing and plotting the domain particles on the mesh.
 
bool m_plotParticlesSource
 Flag for depositing and plotting the source particles on the mesh.
 
bool m_plotParticlesCovered
 Flag for depositing and plotting the covered particles on the mesh.
 
bool m_plotEnergyDensity
 Flag for plotting the energy density on the mesh.
 
bool m_plotAverageEnergy
 Flag for plotting the average particle energy on the mesh.
 
DepositionType m_deposition
 Deposition method when depositing particles to the mesh.
 
CoarseFineDeposition m_coarseFineDeposition
 Coarse-fine deposition strategy.
 
DepositionType m_plotDeposition
 Deposition method when depositing particles to mesh during plotting.
 
EBAMRCellData m_phi
 Storage for particle mesh data.
 
EBAMRCellData m_mobilityFunction
 Mobility function – used when interpolating particle mobilities.
 
EBAMRCellData m_velocityFunction
 Cell-centered field used for interpolating velocities.
 
EBAMRCellData m_diffusionFunction
 Diffusion-centerer field used for interpolating diffusion coefficients.
 
EBAMRIVData m_depositionNC
 Scratch storage for holding the non-conservative deposition.
 
EBAMRIVData m_massDiff
 Scratch storage for holding the mass difference when using hybrid deposition.
 
std::map< WhichContainer, ParticleContainer< ItoParticle > > m_particleContainers
 Various particle containers with identifiers.
 
EBIntersection m_intersectionAlg
 Algorithm for EB intersection.
 

Static Protected Attributes

static constexpr int m_comp = 0
 Default component in data holders (do not touch).
 
static constexpr int m_nComp = 1
 Default number of component in data holders (do not touch).
 

Detailed Description

Base class for Ito diffusion particle models.

This is a particle class for solving Ito diffusion problems dX = v*dt + sqrt(2*D)*dW_t (dW_t is a Wiener process over dt) over an AMR hierarchy. The diffusion coefficient is related to the hydrodynamic diffusion coefficient by D(fluid) = sqrt(2*D(Ito)).

Note
To use this class, the user must add a species and set the realm and phase where the solver will live.

Member Enumeration Documentation

◆ WhichCheckpoint

enum ItoSolver::WhichCheckpoint
strongprotected

How to checkpoint files.

Particles => Write particles to HDF5. Numbers => Write particle numbers to HDF5 (and lose information)

◆ WhichContainer

Enum class for distinguishing various types of particle containers.

This exists because the ItoSolver can partition particles into various containers, which is very useful when one wants to add particles from a source term, remove particles that fall inside the EB, or parse boundary conditions on the EB and domain faces. Here, Bulk = "Active" particles, EB = Particles on the EBs , Domain = Particles on the domain sides, Source = Source particles – used to e.g. add new particles to the bulk particles, Covered = Particles inside the EB, Scratch = Scratch particles

◆ WhichMobilityInterpolation

Enum for deciding how to interpolate particle mobilities.

Direct => Interpolate particle mobilities from the mesh. Velocity => Set particle mobilitys by computing mu = |v|/|V| where v is the particle velocity and V is the "velocity field".

Member Function Documentation

◆ addParticles()

template<ItoSolver::WhichContainer C>
void ItoSolver::addParticles ( ListBox< ItoParticle > &  a_inputParticles,
const int  a_lvl,
const DataIndex  a_dit,
const bool  a_destructive 
)

Add particles to a contain. This adds into a specific grid level and patch. The user can delete the input particles.

Parameters
[in,out]a_inputParticlesInput particles – can be destroyed if a_destructive=true
[in]a_lvlGrid level
[in]a_ditGrid index
[in]a_destructiveIf true, delete the input particles.

◆ allocate()

void ItoSolver::allocate ( )
virtual

Allocate internal storage.

This will allocate the required mesh data as well as all the particle data holders.

Note
Storage for diffusion and advection fields are only allocate if the species is diffusive/mobile.

◆ clear() [1/3]

void ItoSolver::clear ( AMRParticles< ItoParticle > &  a_particles) const
virtual

Clear particles – this will deleted all the particles in the input container.

Parameters
[in]a_particlesParticle container to be emptied.

◆ clear() [2/3]

void ItoSolver::clear ( const WhichContainer  a_container)
virtual

Clear a particle container – this will delete all the particles in the input container.

Parameters
[in]a_whichContainerParticle container to be cleared.

◆ clear() [3/3]

void ItoSolver::clear ( ParticleContainer< ItoParticle > &  a_particles) const
virtual

Clear a particle container – this will delete all the particles in the input container.

Parameters
[in]a_particlesParticle container to be emptied.

◆ computeAdvectiveDt() [1/2]

Real ItoSolver::computeAdvectiveDt ( const int  a_lvl) const
virtual

Compute the drift dt. This computes the minimum dt = dx/vMax on the input level.

Parameters
[in]a_lvlGrid level

◆ computeAdvectiveDt() [2/2]

Real ItoSolver::computeAdvectiveDt ( const int  a_lvl,
const DataIndex &  a_dit 
) const
virtual

Compute the drift dt. This computes the minimum dt = dx/vMax on one level and one box.

Parameters
[in]a_lvlGrid level
[in]a_ditGrid index

◆ computeAverageDiffusion()

void ItoSolver::computeAverageDiffusion ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Compute average diffusion coefficient.

This computes the average diffusion coefficient as D_avg = sum(mass*D)/sum(mass) by depositing on the mesh.

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data

◆ computeAverageEnergy()

void ItoSolver::computeAverageEnergy ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Compute average particle energy..

This computes the average energy as E_avg = sum(mass*energy)/sum(mass) by depositing on the mesh.

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data

◆ computeAverageMobility()

void ItoSolver::computeAverageMobility ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Compute average mobility.

This computes the average mobility as mu_avg = sum(mass*mu)/sum(mass) by depositing on the mesh.

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data

◆ computeDiffusiveDt() [1/2]

Real ItoSolver::computeDiffusiveDt ( const int  a_lvl) const
virtual

Compute the diffusive dt. This computes dt = dx*dx/(2*D) for all particles on the input level.

Parameters
[in]a_lvlGrid level

◆ computeDiffusiveDt() [2/2]

Real ItoSolver::computeDiffusiveDt ( const int  a_lvl,
const DataIndex &  a_dit 
) const
virtual

Compute the diffusive dt. This computes dt = dx*dx/(2*D) for all particles on the input grid patch.

Parameters
[in]a_lvlGrid level
[in]a_ditGrid index

◆ computeDt() [1/3]

Real ItoSolver::computeDt ( ) const
virtual

Compute a time step for the advance – this calls the level function.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not have a fundamental time step limitation, so these limits "replicate" the time step selections in a 1D fluid model. If we only use advection advection the time step is computed as dt = dx/Vmax = dtA, where Vmax is the largest velocity component along any of the directions. If only diffusion is active the time step is computed as dt = (dx*dx)/(2*D) = dtD. If both advection and diffusion are active the time step is computed as dt = 1/(1/dtA + 1/dtD).

◆ computeDt() [2/3]

Real ItoSolver::computeDt ( const int  a_lvl) const
virtual

Compute a time step for the advance – this returns the maximum permitted time step on the input grid level.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not have a fundamental time step limitation, so these limits "replicate" the time step selections in a 1D fluid model. If we only use advection advection the time step is computed as dt = dx/Vmax = dtA, where Vmax is the largest velocity component along any of the directions. If only diffusion is active the time step is computed as dt = (dx*dx)/(2*D) = dtD. If both advection and diffusion are active the time step is computed as dt = 1/(1/dtA + 1/dtD).

Parameters
[in]a_lvlGrid level

◆ computeDt() [3/3]

Real ItoSolver::computeDt ( const int  a_lvl,
const DataIndex &  a_dit 
) const
virtual

Compute a time step for the advance – this returns the maximum permitted time step on the input grid patch.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not have a fundamental time step limitation, so these limits "replicate" the time step selections in a 1D fluid model. If we only use advection advection the time step is computed as dt = dx/Vmax = dtA, where Vmax is the largest velocity component along any of the directions. If only diffusion is active the time step is computed as dt = (dx*dx)/(2*D) = dtD. If both advection and diffusion are active the time step is computed as dt = 1/(1/dtA + 1/dtD).

Parameters
[in]a_lvlGrid level
[in]a_ditGrid index

◆ computeHopDt() [1/3]

Real ItoSolver::computeHopDt ( const Real  a_maxCellsToMove) const
virtual

Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on any grid level.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not a fundamental time step limitation, so this function does its best at computing a time step such that the particles do not move more than the specified amount of grid cells. If only advection is active the time step is computed as dt = a_maxCellsToMove * dx/vMax where vMax is the largest velocity component. If only diffusion is active the usual kernel is dX = dWt which yields a "hop" of length L_d = sqrt(2*D*dt)*N0 where N0 is the diffusion hop in one of the coordinates. We do not need to worry about SpaceDim-related corrections because the hops in each direction are independent, so solving for dt we find dtD = L_d^2/(2*D*N0^2). If both advectino and diffusion are active then we can move up to L_d = v_d*dt + sqrt(2*D*dt)*N0 in any one coordinate direction (this is the usual Ito kernel). This requires a solution to a quadratic equation. Fortunately, this is easy to solve for.

Parameters
[in]a_maxCellsToMove

◆ computeHopDt() [2/3]

Real ItoSolver::computeHopDt ( const Real  a_maxCellsToMove,
const int  a_lvl 
) const
virtual

Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on the input grid level.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not a fundamental time step limitation, so this function does its best at computing a time step such that the particles do not move more than the specified amount of grid cells. If only advection is active the time step is computed as dt = a_maxCellsToMove * dx/vMax where vMax is the largest velocity component. If only diffusion is active the usual kernel is dX = dWt which yields a "hop" of length L_d = sqrt(2*D*dt)*N0 where N0 is the diffusion hop in one of the coordinates. We do not need to worry about SpaceDim-related corrections because the hops in each direction are independent, so solving for dt we find dtD = L_d^2/(2*D*N0^2). If both advectino and diffusion are active then we can move up to L_d = v_d*dt + sqrt(2*D*dt)*N0 in any one coordinate direction (this is the usual Ito kernel). This requires a solution to a quadratic equation. Fortunately, this is easy to solve for.

Parameters
[in]a_maxCellsToMoveMaximum number of cells to move with a standard Ito kernel dX = v*dt + sqrt(2*D*dt)*N
[in]a_lvlGrid level

◆ computeHopDt() [3/3]

Real ItoSolver::computeHopDt ( const Real  a_maxCellsToMove,
const int  a_lvl,
const DataIndex &  a_dit 
) const
virtual

Compute the largest possible time step such that the particles does not move more than a specified number of grid cells on the input grid level.

This computes the time step differently whether or not diffusion and advection are active. The Ito particle model does not a fundamental time step limitation, so this function does its best at computing a time step such that the particles do not move more than the specified amount of grid cells. If only advection is active the time step is computed as dt = a_maxCellsToMove * dx/vMax where vMax is the largest velocity component. If only diffusion is active the usual kernel is dX = dWt which yields a "hop" of length L_d = sqrt(2*D*dt)*N0 where N0 is the diffusion hop in one of the coordinates. We do not need to worry about SpaceDim-related corrections because the hops in each direction are independent, so solving for dt we find dtD = L_d^2/(2*D*N0^2). If both advectino and diffusion are active then we can move up to L_d = v_d*dt + sqrt(2*D*dt)*N0 in any one coordinate direction (this is the usual Ito kernel). This requires a solution to a quadratic equation. Fortunately, this is easy to solve for.

Parameters
[in]a_maxCellsToMoveMaximum number of cells to move with a standard Ito kernel dX = v*dt + sqrt(2*D*dt)*N
[in]a_lvlGrid level
[in]a_ditGrid index

◆ computeLoads()

void ItoSolver::computeLoads ( Vector< long int > &  a_loads,
const DisjointBoxLayout &  a_dbl,
const int  a_level 
)
virtual

Compute particle load on a specific grid level – this will compute the number of particles in each box in the input grids.

Parameters
[out]a_loadsLoads on each grid patch. This follows the order from a_dbl.boxArray()
[in]a_dblGrids
[in]a_levelGrid level

◆ depositConductivity() [1/2]

void ItoSolver::depositConductivity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Deposit conductivities (i.e. mass*mobility / volume)

This deposits mass*mobility (not multiplied by charge)

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data

◆ depositConductivity() [2/2]

void ItoSolver::depositConductivity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const
virtual

Deposit conductivities (i.e. mass*mobility / volume)

This deposits mass*mobility (not multiplied by charge)

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data
[in]a_depositionDeposition method
[in]a_coarseFineDepositionCoarse-fine deposition method.

◆ depositDiffusivity() [1/2]

void ItoSolver::depositDiffusivity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Deposit diffusivity (i.e. mass*D/volume)

This deposits mass*diffusion (not multiplied by charge)

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data
Note
Calls the other versions with a_deposition = m_deposition

◆ depositDiffusivity() [2/2]

void ItoSolver::depositDiffusivity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const
virtual

Deposit diffusivity (i.e. mass*D/volume)

This deposits mass*mobility (not multiplied by charge)

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data
[in]a_depositionDeposition method
[in]a_coarseFineDepositionCoarse-fine deposition method.

◆ depositEnergyDensity() [1/2]

void ItoSolver::depositEnergyDensity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles 
) const
virtual

Deposit energy densities (i.e. mass*energy/volume => total energy per unit volume)

This deposits mass*energy

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data
Note
Calls the other versions with a_deposition = m_deposition

◆ depositEnergyDensity() [2/2]

void ItoSolver::depositEnergyDensity ( EBAMRCellData a_phi,
ParticleContainer< ItoParticle > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const
virtual

Deposit energy densities (i.e. mass*energy/volume => total energy per unit volume)

This deposits mass*energy

Parameters
[out]a_phiMesh data
[in]a_particlesParticle data
[in]a_depositionDeposition method
[in]a_coarseFineDepositionCoarse-fine deposition method.

◆ depositHybrid()

void ItoSolver::depositHybrid ( EBAMRCellData a_depositionH,
EBAMRIVData a_massDifference,
const EBAMRIVData a_depositionNC 
) const
protectedvirtual

Make the "hybrid" deposition phiH = kappa*phiC + (1-kappa)*phiNC. On input, a_depositionH should contain phiC.

Parameters
[in,out]a_depositionHOn input, contains phiC. On output, contain phiH
[out]a_massDifferenceOn output, contains mass loss in each cut-cell.
[in]a_depositionNCThe "non-conservative" deposited variable.

◆ depositKappaConservative() [1/2]

template<class P , Real(P::*)() const particleScalarField>
void ItoSolver::depositKappaConservative ( EBAMRCellData a_phi,
ParticleContainer< P > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const
protected

Compute the cell-centered deposition – this is the main deposition function.

The template parameters indicate the particle type and quantity to be deposited. The second template parameter must be a pointer to a member function in the particle class with signature 'const Real& P::function() const'. E.g. 'const Real& P::mass() const' which is the default quantity to be deposited.

Parameters
[out]a_phiCell-centered mesh data. Must have exactly one component.
[in]a_particlesParticles to be deposited.
[in]a_depositionDeposition type
[in]a_coarseFineDepositionCoarse-fine deposition strategy

◆ depositKappaConservative() [2/2]

template<class P , Real(P::*)() const particleScalarField>
void ItoSolver::depositKappaConservative ( EBAMRCellData a_phi,
ParticleContainer< P > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const
protected

Compute the cell-centered deposition – this is the main deposition function.

Just like the version above except that the function signature is Real P::particleScalarField() const.

Parameters
[out]a_phiCell-centered mesh data. Must have exactly one component.
[in]a_particlesParticles to be deposited.
[in]a_depositionDeposition type
[in]a_coarseFineDepositionCoarse-fine deposition strategy

◆ depositNonConservative()

void ItoSolver::depositNonConservative ( EBAMRIVData a_depositionNC,
const EBAMRCellData a_depositionKappaC 
) const
protectedvirtual

Make the "non-conservative" kappa deposition – computing depositionNC = sum(kappa*depositionC)/sum(kappa) in a neighborhood around each vof.

Parameters
[out]a_depositionNCNon-conservative deposition
[in]a_depositionKappaCConserved deposition

◆ depositParticles() [1/5]

void ItoSolver::depositParticles ( )
virtual

Deposit particles onto mesh.

This will deposit the mass (i.e., computational weight) "bulk" particles into m_phi.

Note
Cells the other version with a_container = WhichContainer::Bulk

◆ depositParticles() [2/5]

void ItoSolver::depositParticles ( const WhichContainer  a_container)
virtual

Deposit particles on to mesh.

Parameters
[in]a_containerWhich container to deposit.

This will deposit mass (i.e., computational weight) of the the input particle container particles onto the classes member 'm_phi'.

Note
Calls the general version with arguments: m_phi, m_particles.at(a_container), m_deposition.

◆ depositParticles() [3/5]

template<class P , const Real &(P::*)() const particleScalarField>
void ItoSolver::depositParticles ( EBAMRCellData a_phi,
ParticleContainer< P > &  a_particles 
) const

Generic deposition function which deposits a particle field onto the mesh using a specified deposition method.

The template parameters indicate the particle type and quantity to be deposited. The second template parameter must be a pointer to a member function in the particle class with signature 'const Real& P::function() const'. E.g. 'const Real& P::mass() const' which is the default quantity to be deposited.

Parameters
[out]a_phiMesh data – must have exactly one component.
[in]a_particlesParticles to be deposited

◆ depositParticles() [4/5]

template<class P , Real(P::*)() const particleScalarField>
void ItoSolver::depositParticles ( EBAMRCellData a_phi,
ParticleContainer< P > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const

Generic deposition function which deposits a particle field onto the mesh using a specified deposition method.

The template parameters indicate the particle type and quantity to be deposited. The second template parameter must be a pointer to a member function in the particle class with signature 'const Real& P::function() const'. E.g. 'const Real& P::mass() const' which is the default quantity to be deposited.

Parameters
[out]a_phiMesh data – must have exactly one component.
[in]a_particlesParticles to be deposited
[in]a_depositionDeposition method
[in]a_coarseFineDepositionCoarse-fine deposition strategy

◆ depositParticles() [5/5]

template<class P , Real(P::*)() const particleScalarField>
void ItoSolver::depositParticles ( EBAMRCellData a_phi,
ParticleContainer< P > &  a_particles,
const DepositionType  a_deposition,
const CoarseFineDeposition  a_coarseFineDeposition 
) const

Generic deposition function which deposits a particle field onto the mesh using a specified deposition method.

Just like the version above, but with a different function signature.

Parameters
[out]a_phiMesh data – must have exactly one component.
[in]a_particlesParticles to be deposited
[in]a_depositionDeposition method
[in]a_coarseFineDepositionCoarse-fine deposition strategy

◆ depositParticlesNGP() [1/2]

template<class P , Real(P ::*)() const particleScalarField>
void ItoSolver::depositParticlesNGP ( LevelData< EBCellFAB > &  a_output,
const ParticleContainer< P > &  a_particles,
const int  a_level 
) const
noexcept

Do an NGP deposit on a specific grid level. Used for IO.

Parameters
[out]a_outputContains NGP deposition of particles. Ignores cut-cells.
[in]a_particlesParticles
[in]a_levelGrid level

◆ depositParticlesNGP() [2/2]

template<class P , Real(P ::*)() const particleScalarField>
void ItoSolver::depositParticlesNGP ( LevelData< EBCellFAB > &  a_output,
const ParticleContainer< P > &  a_particles,
const int  a_level 
) const
noexcept

Do an NGP deposit on a specific grid level. Used for IO.

Parameters
[out]a_outputContains NGP deposition of particles. Ignores cut-cells.
[in]a_particlesParticles
[in]a_levelGrid level

◆ drawNewParticles()

void ItoSolver::drawNewParticles ( const LevelData< EBCellFAB > &  a_particlesPerCell,
const int  a_level,
const int  a_newPPC 
)
protected

Restart particles from a specified number of particles in the grid cell.

This will instantiate the bulk particles by randomly drawing new particles in each grid cell.

Parameters
[in]a_particlesPerCellMesh data showing how many particles are in each cell.
[in]a_levelGrid level.
[in]a_newPPCDesired number of computational particles per cell

◆ getDeposition()

DepositionType ItoSolver::getDeposition ( ) const

Get deposition method.

Returns
Returns m_deposition

◆ getDiffusionFunction() [1/2]

EBAMRCellData & ItoSolver::getDiffusionFunction ( )
virtual

Get the diffusion function.

Returns
m_diffusionFunction

◆ getDiffusionFunction() [2/2]

const EBAMRCellData & ItoSolver::getDiffusionFunction ( ) const
virtual

Get the diffusion function.

Returns
m_diffusionFunction

◆ getMobilityFunction() [1/2]

EBAMRCellData & ItoSolver::getMobilityFunction ( )
virtual

Get mobility function.

Returns
m_mobilityFunction

◆ getMobilityFunction() [2/2]

const EBAMRCellData & ItoSolver::getMobilityFunction ( ) const
virtual

Get mobility function.

Returns
m_mobilityFunction

◆ getName()

std::string ItoSolver::getName ( ) const
virtual

Get this solver's name.

Returns
Returns m_name

◆ getNumberOfPlotVariables()

int ItoSolver::getNumberOfPlotVariables ( ) const
virtual

Get number of plot variables.

Returns
Returns the number of plot variables (Note: Scalars-> one variable and vectors -> SpaceDim variables).

◆ getNumParticles()

unsigned long long ItoSolver::getNumParticles ( const WhichContainer  a_container,
const bool  a_localOnly 
) const
virtual

Get number of particles in a specified particle container.

Parameters
[in]a_whichContainerWhich container to count particles in.
[in]a_localOnlyOnly report local particles (i.e. not reduced over MPI ranks)

◆ getParticles() [1/2]

ParticleContainer< ItoParticle > & ItoSolver::getParticles ( const WhichContainer  a_container)
virtual

Get a general particle container.

Parameters
[in]a_containerWhich container to fetch.

◆ getParticles() [2/2]

const ParticleContainer< ItoParticle > & ItoSolver::getParticles ( const WhichContainer  a_container) const
virtual

Get a general particle container.

Parameters
[in]a_containerWhich container to fetch.

◆ getPhase()

phase::which_phase ItoSolver::getPhase ( ) const

Return phase.

Returns
Returns m_phase

◆ getPhi()

EBAMRCellData & ItoSolver::getPhi ( )
virtual

Get the mesh data.

Returns
Returns m_phi

◆ getPlotVariableNames()

Vector< std::string > ItoSolver::getPlotVariableNames ( ) const
virtual

Get output plot names.

Returns
Returns a string of all variables that this solver can add to plot files.

◆ getRealm()

const std::string ItoSolver::getRealm ( ) const
virtual

Get the realm where this solver is registered.

Returns
m_realm

◆ getSpecies()

const RefCountedPtr< ItoSpecies > & ItoSolver::getSpecies ( ) const
virtual

Get the species.

Returns
Returns m_species

◆ getVelocityFunction() [1/2]

EBAMRCellData & ItoSolver::getVelocityFunction ( )
virtual

Get cell-centered velocity mesh data.

Returns
m_velocityFunction

◆ getVelocityFunction() [2/2]

const EBAMRCellData & ItoSolver::getVelocityFunction ( ) const
virtual

Get cell-centered velocity mesh data.

Returns
m_velocityFunction

◆ initialData()

void ItoSolver::initialData ( )
virtual

Set the initial data.

This will add the initial particles and deposit them.

◆ interpolateDiffusion() [1/2]

void ItoSolver::interpolateDiffusion ( )
virtual

Interpolate the diffusion field to the particle positions.

This computes D_p = Df(X_p) where Df is the diffusion field on the mesh.

◆ interpolateDiffusion() [2/2]

void ItoSolver::interpolateDiffusion ( const int  a_level,
const DataIndex &  a_dit 
)
protectedvirtual

Interpolate the diffusion field to the particle positions.

This computes D_p = Df(X_p) where Df is the diffusion field on the mesh.

Parameters
[in]a_levelGrid level
[in]a_ditGrid index

◆ interpolateMobilities() [1/2]

void ItoSolver::interpolateMobilities ( )
virtual

Interpolate mobilities.

This will switch between the two ways of computing the particle mobility.

◆ interpolateMobilities() [2/2]

void ItoSolver::interpolateMobilities ( const int  a_level,
const DataIndex &  a_dit,
const EBCellFAB &  a_velocityMagnitude 
)
protectedvirtualnoexcept

Interpolate mobilities – this will switch between the two ways of computing the particle mobility.

Parameters
[in]a_levelGrid level.
[in]a_ditGrid index.
[in]a_velocityMagnitudeVelocity magnitude.

◆ interpolateMobilitiesDirect()

void ItoSolver::interpolateMobilitiesDirect ( const int  a_level,
const DataIndex &  a_dit 
)
protectedvirtualnoexcept

Directly interpolate mobilities. Interpolates for all particles in the specified grid patch.

Parameters
[in]a_levelGrid level.
[in]a_ditGrid index.

◆ interpolateMobilitiesVelocity()

void ItoSolver::interpolateMobilitiesVelocity ( const int  a_level,
const DataIndex &  a_dit,
const EBCellFAB &  a_velocityMagnitude 
)
protectedvirtualnoexcept

Interpolate mobilities through the velocity. Interpolates for all particles in the specified grid patch.

Parameters
[in]a_levelGrid level.
[in]a_ditGrid index.
[in]a_velocityMagnitudeVelocity magnitude.

◆ interpolateVelocities() [1/2]

void ItoSolver::interpolateVelocities ( )
virtual

Interpolate the particle velocities.

This will compute the particle velocities as v = mu * V(Xp) where mu is the particle mobility and V(Xp) is the interpolation of m_velocityFunction to the particle position.

◆ interpolateVelocities() [2/2]

void ItoSolver::interpolateVelocities ( const int  a_level,
const DataIndex &  a_dit 
)
virtual

Interpolate the particle velocities.

This will compute the particle velocities as v = mu * V(Xp) where mu is the particle mobility and V(Xp) is the interpolation of m_velocityFunction to the particle position.

Parameters
[in]a_levelGrid level
[in]a_ditGrid index

◆ intersectParticles() [1/3]

void ItoSolver::intersectParticles ( const EBIntersection  a_ebIntersection,
const bool  a_deleteParticles,
const std::function< void(ItoParticle &)>  a_nonDeletionModifier = [](ItoParticle&) -> void { return; } 
)
virtual

Do boundary intersection tests.

This will intersect the particles in the "bulk" particles data holder with the domain faces and EBs. If a particle crossed the EB it will be put into the "EB" particle data holder and likewise for the particles that crossed the domain side.

Parameters
[in]a_ebIntersectionEnum for switching between various types of intersection tests.
[in]a_deleteParticlesIf true, the origin particle will also be removed from the bulk particle data holder.
[in]a_nonDeletionModifierOptional input argument for letting the user manipulate particles that were intersected but not deleted
Note
This will call the other version with WhichContainer::Bulk, WhichContainer::EB, and WhichContainer::Domain.

◆ intersectParticles() [2/3]

void ItoSolver::intersectParticles ( const WhichContainer  a_particles,
const WhichContainer  a_ebParticles,
const WhichContainer  a_domainParticles,
const EBIntersection  a_ebIntersection,
const bool  a_deleteParticles,
const std::function< void(ItoParticle &)>  a_nonDeletionModifier = [](ItoParticle&) -> void { return; } 
)
virtual

Do boundary intersection tests.

This will intersect the particles in the a_particles data holder with the domain faces and EBs. If a particle crossed the EB it will be put into the a_eb_particles particle data holder and likewise for the particles that crossed the domain side.

Parameters
[in]a_particlesWhich particle container to use for the "active" particles
[in]a_ebParticlesWhich particle container to put the EB particles
[in]a_domainParticlesWhich particle container to put the domain particles
[in]a_ebIntersectionEnum for switching between various types of intersection tests.
[in]a_deleteParticlesIf true, the origin particle will also be removed from the bulk particle data holder.
[in]a_nonDeletionModifierOptional input argument for letting the user manipulate particles that were intersected but not deleted
Note
This will look up the ParticleContainer and call the other version.

◆ intersectParticles() [3/3]

void ItoSolver::intersectParticles ( ParticleContainer< ItoParticle > &  a_particles,
ParticleContainer< ItoParticle > &  a_ebParticles,
ParticleContainer< ItoParticle > &  a_domainParticles,
const EBIntersection  a_ebIntersection,
const bool  a_deleteParticles,
const std::function< void(ItoParticle &)>  a_nonDeletionModifier = [](ItoParticle&) -> void { return; } 
)
virtual

Do boundary intersection tests.

This will intersect the particles in the a_particles data holder with the domain faces and EBs. If a particle crossed the EB it will be put into the a_eb_particles particle data holder and likewise for the particles that crossed the domain side.

Parameters
[in]a_particlesWhich particle container to use for the "active" particles
[in]a_ebParticlesWhich particle container to put the EB particles
[in]a_domainParticlesWhich particle container to put the domain particles
[in]a_ebIntersectionEnum for switching between various types of intersection tests.
[in]a_deleteParticlesIf true, the origin particle will also be removed from the bulk particle data holder.
[in]a_nonDeletionModifierOptional input argument for letting the user manipulate particles that were intersected but not deleted

◆ isDiffusive()

bool ItoSolver::isDiffusive ( ) const
virtual

Check if solver is diffusive.

Returns
Returns m_isDiffusive

◆ isMobile()

bool ItoSolver::isMobile ( ) const
virtual

Check if solver is mobile.

Returns
Returns m_isMobile

◆ makeSuperparticles() [1/4]

void ItoSolver::makeSuperparticles ( const WhichContainer  a_container,
const int  a_particlesPerCell 
)
virtual

Make superparticles for a full container – this is the AMR version that users will usually call.

Parameters
[in]a_containerWhich container to repartition into new superparticles
[in]a_particlesPerCellTarget number of particles per cell

◆ makeSuperparticles() [2/4]

void ItoSolver::makeSuperparticles ( const WhichContainer  a_container,
const int  a_particlesPerCell,
const int  a_level 
)
virtual

Make superparticles for a particle container – this is used for a specified grid level.

Parameters
[in]a_containerWhich container to repartition into new superparticles
[in]a_particlesPerCellTarget number of particles per cell
[in]a_levelGrid level

◆ makeSuperparticles() [3/4]

void ItoSolver::makeSuperparticles ( const WhichContainer  a_container,
const int  a_particlesPerCell,
const int  a_level,
const DataIndex  a_dit 
)
virtual

Make superparticles for a particle container – this is used for a specified grid level and patch.

Parameters
[in]a_containerWhich container to repartition into new superparticles
[in]a_particlesPerCellTarget number of particles per cell
[in]a_levelGrid level
[in]a_ditGrid index

◆ makeSuperparticles() [4/4]

void ItoSolver::makeSuperparticles ( const WhichContainer  a_container,
const Vector< int >  a_particlesPerCell 
)
virtual

Make superparticles for a full container – this is the AMR version that users will usually call.

Parameters
[in]a_containerWhich container to repartition into new superparticles
[in]a_particlesPerCellTarget number of particles per cell. Vector indicates grid levels.

◆ makeSuperparticlesEqualWeightKD()

void ItoSolver::makeSuperparticlesEqualWeightKD ( List< ItoParticle > &  a_particles,
const CellInfo a_cellInfo,
const int  a_particlesPerCell 
) const
virtualnoexcept

Superparticle merging with KD/BVH trees.

Parameters
[in,out]a_particlesParticles to be merged/split
[in]a_cellInfoArithmetic information about the current grid cell.
[in]a_particlesPerCellTarget number of particles per cell

◆ mergeParticles()

void ItoSolver::mergeParticles ( List< ItoParticle > &  a_particles,
const CellInfo a_cellInfo,
const int  a_particlesPerCell 
) const
virtualnoexcept

General superparticle merging with underlying algorithm through m_particleMerger.

Parameters
[in,out]a_particlesParticles to be merged/split
[in]a_cellInfoArithmetic information about the current grid cell.
[in]a_particlesPerCellTarget number of particles per cell

◆ organizeParticlesByCell()

void ItoSolver::organizeParticlesByCell ( const WhichContainer  a_container)
virtual

Sort the input particle container by cell.

Parameters
[in]a_containerContainer to be sorted.

◆ organizeParticlesByPatch()

void ItoSolver::organizeParticlesByPatch ( const WhichContainer  a_container)
virtual

Sort the input particle container by patch.

Parameters
[in]a_containerContainer to be sorted.

◆ preRegrid()

void ItoSolver::preRegrid ( const int  a_lbase,
const int  a_oldFinestLevel 
)
virtual

Perform pre-regrid operations.

Parameters
[in]a_lbaseCoarsest level that changed during regrid.
[in]a_oldFinestLevelFinest grid level before the regrid operation.
Note
This caches the bulk particles.

◆ randomDirection()

RealVect ItoSolver::randomDirection ( ) const
inline

Draw a random direction in N-dimensional space.

We use the algorithm by Marsaglia (1972).

◆ randomGaussian()

RealVect ItoSolver::randomGaussian ( ) const
inline

Draw a random N-dimensional Gaussian number from a normal distribution with zero with and unit standard deviation.

Note
The distribution is truncated at m_normalDistributionTruncation – values above that threshold will be replaced by m_normalDistributionTruncation.

◆ redistributeAMR()

void ItoSolver::redistributeAMR ( EBAMRCellData a_phi) const
protectedvirtual

Redistribute mass in an AMR context.

We will have deposited particles into each cell, i.e. phi_i = m_i/dx^3. To obtain the true density in an EB context we need to divide by kappa such that phi_i = m_i/(kappa_i*dx^3). Unfortunately, this is numerically unstable because kappa_i can be arbitrarily small. We can set the density as phi_i = m_i/dx^3 but we will be missing a mass m_i*(1-kappa_i) from the cell. This mass can be smooshed into neighboring cells such as to make the total scheme conservative. As an option, we can also use a "non-conservative" divergence but the scheme is not guaranteed to be non-negative. All of this is just to say that we take the mass that fell inside the EB and put it back into the domain.

Parameters
[in,out]a_phiQuantity to be redistributed.

◆ registerOperators()

void ItoSolver::registerOperators ( ) const
virtual

Register operators.

This will register the required operators for running this class.

◆ regrid()

void ItoSolver::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
virtual

Regrid this solver.

Parameters
[in]a_lminCoarsest level where grids did not change.
[in]a_oldFinestLevelFinest AMR level before the regrid.
[in]a_newFinestLevelFinest AMR level after the regrid.

◆ reinitializeParticles()

void ItoSolver::reinitializeParticles ( List< ItoParticle > &  a_particles,
const CellInfo a_cellInfo,
const int  a_particlesPerCell 
) const
virtualnoexcept

Particle re-initialization algorithm.

Parameters
[in,out]a_particlesParticles to be merged/split
[in]a_cellInfoArithmetic information about the current grid cell.
[in]a_particlesPerCellTarget number of particles per cell

◆ remap()

void ItoSolver::remap ( const WhichContainer  a_container)
virtual

Remap all particles in the input container.

Parameters
[in]a_containerParticle container

◆ removeCoveredParticles() [1/3]

void ItoSolver::removeCoveredParticles ( const EBRepresentation  a_representation,
const Real  a_tol 
)
virtual

Remove particles that are inside the EB.

Parameters
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.

Calls the other version with m_particles.

◆ removeCoveredParticles() [2/3]

void ItoSolver::removeCoveredParticles ( const WhichContainer  a_container,
const EBRepresentation  a_representation,
const Real  a_tol 
)
virtual

Remove particles that are inside the EB.

Parameters
[in]a_containerWhich particle container to remove particles from
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.
Note
Calls the other version with ParticleContainer = m_particles.at(a_container)

◆ removeCoveredParticles() [3/3]

void ItoSolver::removeCoveredParticles ( ParticleContainer< ItoParticle > &  a_particles,
const EBRepresentation  a_representation,
const Real  a_tol 
) const
virtual

Remove particles that are inside the EB.

Parameters
[in]a_particlesParticles to remove.
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.

◆ setAmr()

void ItoSolver::setAmr ( const RefCountedPtr< AmrMesh > &  a_amr)
virtual

Set the AmrMesh object.

Parameters
[in]a_amrAmrMesh object.

◆ setComputationalGeometry()

void ItoSolver::setComputationalGeometry ( const RefCountedPtr< ComputationalGeometry > &  a_computationalGeometry)
virtual

Set computational geometry.

Parameters
[in]a_computationalGeometryComputational geometry.

◆ setDiffusionFunction()

void ItoSolver::setDiffusionFunction ( const Real  a_diffusionCoefficient)
virtual

Utility function – set a constant diffusion coefficient.

Parameters
[in]a_diffusionCoefficientDiffusion coefficient

◆ setParticleDiffusion()

void ItoSolver::setParticleDiffusion ( const Real  a_diffusion)
virtual

Sets diffusion coefficient for all particles.

Parameters
[in]a_diffusionParticle diffusion value.

◆ setParticleMerger()

void ItoSolver::setParticleMerger ( const ParticleManagement::ParticleMerger< ItoParticle > &  a_particleMerger)
virtualnoexcept

Set the particle merger. This will get called when merging particles using makeSuperparticles.

Parameters
[in]a_particleMergerParticle merger

◆ setParticleMobility()

void ItoSolver::setParticleMobility ( const Real  a_mobility)
virtual

Sets mobility coefficient for all particles.

Parameters
[in]a_mobilityParticle mobility.

◆ setPhase()

void ItoSolver::setPhase ( const phase::which_phase  a_phase)
virtual

Set phase where the particles will live.

Parameters
[in]a_phasePhase

◆ setRealm()

void ItoSolver::setRealm ( const std::string  a_realm)
virtual

Set the realm where this solver will live.

Parameters
[in]a_realmRealm name.

◆ setSpecies()

void ItoSolver::setSpecies ( const RefCountedPtr< ItoSpecies > &  a_species)
virtual

Set the species.

Parameters
[in]a_speciesSpecies to be solved for.

◆ setTime()

void ItoSolver::setTime ( const int  a_step,
const Real  a_time,
const Real  a_dt 
)
virtual

Set the time for this solver.

Parameters
[in]a_stepTime step number
[in]a_timeTime (in seconds)
[in]a_dtTime step increment
Note
This sets m_step=a_step, m_time=a_time, m_dt=a_dt

◆ setVelocityFunction()

void ItoSolver::setVelocityFunction ( const RealVect  a_velocity)
virtual

Utility function – set a constant velocity.

Parameters
[in]a_velocityVelocity

◆ setVerbosity()

void ItoSolver::setVerbosity ( const int  a_verbosity)
virtual

Set verbosity level for this solver.

Parameters
[in]a_verbosityVerbosity level.

◆ transferCoveredParticles() [1/3]

void ItoSolver::transferCoveredParticles ( const EBRepresentation  a_representation,
const Real  a_tol 
)
virtual

Transfer particles that are covered (within a_tol distance from EB) to another container.

Calls the other version with m_particles and m_coveredParticles

Parameters
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.

◆ transferCoveredParticles() [2/3]

void ItoSolver::transferCoveredParticles ( const WhichContainer  a_containerFrom,
const WhichContainer  a_containerTo,
const EBRepresentation  a_representation,
const Real  a_tol 
)
virtual

Transfer particles that are covered (within a_tol distance from EB) to another container.

Parameters
[in]a_containerFromWhich particle container to transfer particles from
[in]a_containerFromWhich particle container to move particles into
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.

◆ transferCoveredParticles() [3/3]

void ItoSolver::transferCoveredParticles ( ParticleContainer< ItoParticle > &  a_particlesFrom,
ParticleContainer< ItoParticle > &  a_particlesTo,
const EBRepresentation  a_representation,
const Real  a_tol 
) const
virtual

Transfer particles that are inside the EB to another container.

Parameters
[in]a_particlesFromWhich particle container to transfer particles from
[in]a_particlesToWhich particle container to move particles into
[in]a_ebRepresentationEB representation (e.g. implicit function, discrete, voxel)
[in]a_tolTolerance – removes particles if they are less than a_tol*dx away from the boundary.

◆ updateDiffusion() [1/2]

void ItoSolver::updateDiffusion ( )
virtual

Update mobilities parametrically from the particle energy.

This calls the diffusion function implemented by ItoSpecies. The particle diffusion is set D = f(p.energy()) where f is the diffusion function in ItoSpecies

◆ updateDiffusion() [2/2]

void ItoSolver::updateDiffusion ( const int  a_level,
const DataIndex  a_dit 
)
protectedvirtual

Update mobilities parametrically from the particle energy.

This calls the diffusion function implemented by ItoSpecies. The particle diffusion is set D = f(p.energy()) where f is the diffusion function in ItoSpecies

Parameters
[in]a_levelGrid level
[in]a_ditGrid index

◆ updateMobilities() [1/2]

void ItoSolver::updateMobilities ( )
virtual

Update mobilities parametrically from the particle energy.

This calls the mobility function implemented by ItoSpecies. The particle mobility is set mu = f(p.energy()) where f is the mobility function in ItoSpecies

◆ updateMobilities() [2/2]

void ItoSolver::updateMobilities ( const int  a_level,
const DataIndex  a_dit 
)
protectedvirtual

Update mobilities parametrically from the particle energy.

This calls the mobility function implemented by ItoSpecies. The particle mobility is set mu = f(p.energy()) where f is the mobility function in ItoSpecies

Parameters
[in]a_levelGrid level
[in]a_ditGrid index

◆ writeData()

void ItoSolver::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
protectedvirtualnoexcept

Write data to output. Convenience function.

Parameters
[in,out]a_outputOutput data holder.
[in,out]a_icompStarting component where this solver begins writing the output.
[in]a_dataData to write.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level
[in]a_interpToCentroidsIf true, a_data will be interpolated to cell centroids before writing to a_output.
[in]a_interpGhostIf true, interpolate ghost cells

◆ writePlotData()

void ItoSolver::writePlotData ( LevelData< EBCellFAB > &  a_output,
int &  a_comp,
const std::string  a_outputRealm,
const int  a_level 
) const
virtualnoexcept

Write plot data.

Parameters
[in,out]a_outputOutput data holder.
[in,out]a_icompStarting component where this solver begins writing the output.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level
Note
This will write the plot data in this solver to a_output, starting on a_comp

Member Data Documentation

◆ m_className

std::string ItoSolver::m_className
protected

Class name.

ItoSolver for parent class – derived classes might be named something else.

◆ m_normalDistributionTruncation

Real ItoSolver::m_normalDistributionTruncation
protected

Truncation value for normal distribution.

This is used when drawing numbers from the Gaussian distribution, replacing all values above m_normalDistributionTruncation by m_normalDistributionTruncation.


The documentation for this class was generated from the following files: