chombo-discharge
Loading...
Searching...
No Matches
CdrCTU Class Reference

Class that uses a slope limited method for advection, in combination with corner transport upwind (CTU). More...

#include <CD_CdrCTU.H>

Inheritance diagram for CdrCTU:
Collaboration diagram for CdrCTU:

Public Member Functions

 CdrCTU ()
 Default constructor.
virtual ~CdrCTU ()
 Destructor (does nothing).
virtual void parseOptions () override
 Parse class options to put object in usable state.
virtual void parseRuntimeOptions () override
 Parse runtime options.
virtual void advectToFaces (EBAMRFluxData &a_facePhi, const EBAMRCellData &a_cellPhi, const Real a_extrapDt, const Real a_dt) override
 MUSCL advection to faces.
virtual Real computeAdvectionDt () override
 Compute the largest possible advective time step (for explicit methods).
virtual void allocate () override
 Allocate internal storage and build pre-built VoF iterators.
virtual void regrid (const int a_lbase, const int a_oldFinestLevel, const int a_newFinestLevel) override
 Regrid method — also rebuilds the grown VoF iterators.
virtual void preRegrid (const int a_lbase, const int a_oldFinestLevel) override
 Pre-regrid hook — releases the grown VoF iterators.
Public Member Functions inherited from CdrMultigrid
 CdrMultigrid ()
 Constructor.
virtual ~CdrMultigrid ()
 Destructor.
virtual void registerOperators () override
 Register operator.
virtual void computeDivJ (EBAMRCellData &a_divJ, EBAMRCellData &a_phi, const Real a_extrapDt, const Real a_dt, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux) override final
 Compute div(J) explicitly, where J = nV - D*grad(n).
virtual void computeDivF (EBAMRCellData &a_divF, EBAMRCellData &a_phi, const Real a_extrapDt, const Real a_dt, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux) override final
 Compute div(v*phi) explicitly.
virtual void computeDivD (EBAMRCellData &a_divD, EBAMRCellData &a_phi, const Real a_dt, const bool a_conservativeOnly, const bool a_ebFlux, const bool a_domainFlux) override final
 Compute div(D*grad(phi)) explicitly.
virtual void advanceEuler (EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const EBAMRCellData &a_source, const Real a_dt) override final
 Implicit diffusion Euler advance with source term.
virtual void advanceCrankNicholson (EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const EBAMRCellData &a_source, const Real a_dt) override final
 Implicit diffusion Crank-Nicholson advance with source term.
Public Member Functions inherited from CdrSolver
 CdrSolver ()
 Default constructor.
 CdrSolver (const CdrSolver &a_other)=delete
 Disallowed copy constructor.
 CdrSolver (const CdrSolver &&a_other)=delete
 Disallowed move constructor.
CdrSolver & operator= (const CdrSolver &a_other)=delete
 Disallowed assignment operator.
CdrSolver & operator= (const CdrSolver &&a_other)=delete
 Disallowed move assignment operator.
virtual ~CdrSolver ()
 Constructor.
void setDefaultDomainBC ()
 This sets default boundary conditions (wall type).
void setDomainBcType (const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::BcType a_bcType)
 Set domain bc type on domain side.
void setDomainBcFunction (const CdrDomainBC::DomainSide a_domainSide, const CdrDomainBC::FluxFunction &a_fluxFunction)
 Set domain bc function on particular domain side.
virtual void advanceEuler (EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const Real a_dt)
 Implicit diffusion Euler advance without source term.
virtual void advanceCrankNicholson (EBAMRCellData &a_newPhi, const EBAMRCellData &a_oldPhi, const Real a_dt)
 Implicit diffusion Crank-Nicholson advance without source term.
virtual void computeDivG (EBAMRCellData &a_divG, EBAMRFluxData &a_G, const EBAMRIVData &a_ebFlux, const EBAMRCellData &a_phi, const Real a_dt, const bool a_conservativeOnly)
 Compute div(G) where G is a general face-centered flux on face centers and EB centers. This can involve mass redistribution.
virtual void redistributeDivergence (EBAMRCellData &a_divG, const EBAMRCellData &a_phi, const Real a_dt)
 Turn a conservative divergence into the right-hand side of the stabilized update.
bool usesStateRedistribution () const noexcept
 Check if the cut-cell stabilization is state redistribution.
virtual void gwnDiffusionSource (EBAMRCellData &a_noiseSource, const EBAMRCellData &a_cellPhi, const Real a_dt)
 Compute a random gaussian white noise source term.
virtual void averageVelocityToFaces ()
 Average velocities to faces.
virtual void deallocate ()
 Deallocate internal storage.
virtual void setRealm (const std::string &a_realm)
 Set the realm for this solver.
virtual RefCountedPtr< CdrSpecies > & getSpecies () noexcept
 Get the CDR species.
virtual const RefCountedPtr< CdrSpecies > & getSpecies () const noexcept
 Get the CDR species. Const version.
virtual void setSpecies (const RefCountedPtr< CdrSpecies > &a_species)
 Set species.
virtual void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set computational geometry.
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set the amr object.
virtual void setPhase (phase::which_phase a_phase)
 Set phase.
virtual void setVerbosity (const int a_verbosity)
 Set verbosity.
virtual void setTime (const int a_step, const Real a_time, const Real a_dt)
 Set the time for this solver.
virtual void setVelocity (const EBAMRCellData &a_velocity)
 Set velocity from data holder.
virtual void setVelocity (const RealVect &a_velocity)
 Set constant velocity.
virtual void setVelocity (const std::function< RealVect(const RealVect a_pos)> &a_velocity)
 Set velocity using a polymorphic function.
virtual void setDiffusionCoefficient (const EBAMRFluxData &a_diffusionCoefficient, const EBAMRIVData &a_ebDiffusionCoefficient)
 Data-based version of setting diffusion coefficients (which are stored on faces).
virtual void setDiffusionCoefficient (const Real a_diffusionCoefficient)
 Set diffusion coefficient to be constant everywhere (they are stored on faces).
virtual void setDiffusionCoefficient (const std::function< Real(const RealVect a_position)> &a_diffCo)
 Polymorphic way of setting diffusion coefficients every.
virtual void setSource (const EBAMRCellData &a_source)
 Data based version of setting source terms.
virtual void setSource (const Real a_source)
 Set constant source terms everywhere.
virtual void setSource (const std::function< Real(const RealVect a_position)> &a_source)
 Polymorphic way of setting source terms.
virtual void setEbFlux (const EBAMRIVData &a_ebFlux)
 Data-based version of setting the EB flux.
virtual void setEbFlux (const Real a_ebFlux)
 Set the eb flux to a constant.
virtual void initialData ()
 Fill m_phi state with initial data from m_species.
virtual void writePlotFile ()
 Write plot file.
virtual void writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, const int a_level) const noexcept
 Write output data to a_output.
virtual std::string getRealm () const
 Get the realm where this solver is registered.
virtual std::string getName () const
 Get solver name.
virtual Vector< std::string > getPlotVariableNames () const
 Get output plot names.
virtual int getNumberOfPlotVariables () const
 Get number of output fields.
virtual Real computeDiffusionDt ()
 Compute the largest possible diffusive time step (for explicit methods).
virtual Real computeAdvectionDiffusionDt ()
 Compute the largest possible diffusive time step (for explicit methods).
virtual Real computeSourceDt (const Real a_max, const Real a_tolerance)
 Compute the largest possible source time step (for explicit methods.
virtual void weightedUpwind (EBAMRCellData &a_weightedUpwindPhi, const int a_pow)
 Compute an upwind-weighted version of phi.
virtual Real computeMass ()
 Compute the "physical mass" in m_phi.
virtual Real computeMass (const EBAMRCellData &a_phi, const bool a_kappaScale=true)
 Compute the "physical mass" in the input argument.
virtual Real computeCharge ()
 Compute the total charge in m_phi.
virtual bool isDiffusive ()
 Return true if the solver is diffusive and false otherwise.
virtual bool isMobile ()
 Return true if the solver is mobile and false otherwise.
virtual EBAMRCellData & getPhi ()
 Get the cell-centered phi.
virtual EBAMRCellData & getSource ()
 Get the source term.
virtual EBAMRCellData & getCellCenteredVelocity ()
 Get the cell-centered velocity.
virtual EBAMRFluxData & getFaceCenteredVelocity ()
 Get the face-centered velocities.
virtual EBAMRIVData & getEbCenteredVelocity ()
 Get the eb-centered velocities.
virtual EBAMRCellData & getCellCenteredDiffusionCoefficient ()
 Get the cell-centered diffusion coefficient.
virtual EBAMRFluxData & getFaceCenteredDiffusionCoefficient ()
 Get the face-centered diffusion coefficient.
virtual EBAMRIVData & getEbCenteredDiffusionCoefficient ()
 Get the EB-centered diffusion coefficient.
virtual EBAMRIVData & getEbFlux ()
 Get the eb flux data holder.
virtual EBAMRIFData & getDomainFlux ()
 Get the domain flux data holder.
virtual void extrapolateAdvectiveFluxToEB () noexcept
 Extrapolate advective flux to EB.
virtual void extrapolateAdvectiveFluxToEB (EBAMRIVData &a_ebFlux) const noexcept
 Extrapolate advective flux to EB.
virtual void redistribute (EBAMRCellData &a_phi, const EBAMRIVData &a_delta) const noexcept
 Add data through redistribution into cell-centered holders.

Protected Types

enum class  Limiter { None , MinMod , Superbee , MonotonizedCentral }
 Supported limiters.
Protected Types inherited from CdrMultigrid
enum class  BottomSolverType { Simple , BiCGStab , GMRES }
 Enum class for supported bottom solvers in multigrid.
enum class  MultigridType { VCycle , WCycle }
 Enum for multigrid cycle types.
Protected Types inherited from CdrSolver
enum class  Redistribution { VolumeWeighted , State , None }
 Redistribution method.

Protected Member Functions

RealVect getEbNormalIntoFluid (const VolIndex &a_vof, const EBISBox &a_ebisbox) const noexcept
 Get the EB normal of a cut cell, pointing into the fluid.
bool getEbInflowState (Real &a_phiEB, const VolIndex &a_vof, const EBISBox &a_ebisbox, const int a_level, const DataIndex &a_dit) const noexcept
 Get the state of the fluid that enters a cut cell through the EB.
void fluxCorrection (EBAMRFluxData &a_facePhi, const EBAMRFluxData &a_facePhiLow, const EBAMRCellData &a_cellPhi, const Real a_dt) noexcept
 Flux-corrected transport that keeps the update non-negative.
void ebInflowState (EBFaceFAB &a_facePhi, const EBCellFAB &a_cellVel, const EBFaceFAB &a_faceVel, const Box &a_cellBox, const int a_dir, const int a_level, const DataIndex &a_dit, const Real a_dt) noexcept
 Correct the states on the outgoing faces of cut cells for the fluid that enters through the EB.
void defineIterators ()
 Build m_grownVofIter and m_levelCells for all AMR levels.
virtual void computeNormalSlopes (EBCellFAB &a_normalSlopes, const EBCellFAB &a_cellPhi, const Box &a_cellBox, const ProblemDomain &a_domain, const int a_level, const DataIndex &a_dit)
 Compute slopes.
virtual void upwind (EBFluxFAB &a_facePhi, const EBCellFAB &a_normalSlopes, const EBCellFAB &a_cellPhi, const EBCellFAB &a_cellVel, const EBFluxFAB &a_faceVel, const ProblemDomain &a_domain, const Box &a_cellBox, const int &a_level, const DataIndex &a_dit, const Real &a_dt)
 Upwind/Riemann solve. This extrapolates the cell-centered data to the inside face centers and selects the upwind side.
virtual void parseSlopeLimiter ()
 Parse slope limiting on/off.
Protected Member Functions inherited from CdrMultigrid
virtual void setupDiffusionSolver ()
 Set up diffusion solver.
virtual void setupHelmholtzFactory ()
 Setup the operator factory.
virtual void setupMultigrid ()
 Setup multigrid.
virtual void setMultigridSolverCoefficients ()
 Set the multigrid solver coefficients.
virtual void resetAlphaAndBeta (const Real a_alpha, const Real a_beta)
 Reset alpha and beta-coefficients in the multigrid solvers.
virtual void computeKappaLphi (EBAMRCellData &a_kappaLphi, const EBAMRCellData &a_phi)
 Compute kappa * L(phi) using the multigrid operator. This is different from computeDivD.
virtual void parseMultigridSettings ()
 Parse solver settings for geometric multigrid.
Protected Member Functions inherited from CdrSolver
virtual void averageVelocityToFaces (EBAMRFluxData &a_faceVelocity, const EBAMRCellData &a_cellVelocity)
 Average cell-centered velocities to face centers.
virtual void computeAdvectionFlux (EBAMRFluxData &a_flux, const EBAMRFluxData &a_facePhi, const EBAMRFluxData &a_faceVelocity, const bool a_addDomainFlux=true)
 Set up face-centered advection flux.
virtual void computeAdvectionFlux (LevelData< EBFluxFAB > &a_flux, const LevelData< EBFluxFAB > &a_facePhi, const LevelData< EBFluxFAB > &a_faceVelocity, const int a_lvl)
 Set up face-centered advection flux on a grid level.
virtual void computeDiffusionFlux (EBAMRFluxData &a_flux, const EBAMRCellData &a_phi, const bool a_addDomainFlux)
 Compute the face-centered diffusion flux.
virtual void computeDiffusionFlux (LevelData< EBFluxFAB > &a_flux, const LevelData< EBCellFAB > &a_phi, const int a_lvl)
 Compute the face-centered diffusion flux.
virtual void computeAdvectionDiffusionFlux (EBAMRFluxData &a_flux, const EBAMRCellData &a_cellStates, const EBAMRFluxData &a_faceStates, const EBAMRFluxData &a_faceVelocities, const EBAMRFluxData &a_faceDiffCo, const bool a_addDomainFlux)
 Compute the full advection-diffusion flux. This assumes that the solver is mobile and diffusive.
virtual void resetDomainFlux (EBAMRFluxData &a_flux)
 Set flux to zero on domain boundaries.
virtual void fillDomainFlux (EBAMRFluxData &a_flux)
 Set domain in data holder. This sets the flux on the boundary to either zero or to m_domainFlux.
virtual void fillDomainFlux (LevelData< EBFluxFAB > &a_flux, const int a_level)
 Set domain in data holder. This sets the flux on the boundary to either zero or to m_domainFlux.
virtual void conservativeDivergenceNoKappaDivision (EBAMRCellData &a_conservativeDivergence, EBAMRFluxData &a_flux, const EBAMRIVData &a_ebFlux)
 Compute conservative divergence from fluxes.
virtual void conservativeDivergenceRegular (LevelData< EBCellFAB > &a_divJ, const LevelData< EBFluxFAB > &a_flux, const int a_lvl)
 Compute the conservative divergence over regular cells.
virtual void interpolateFluxToFaceCentroids (EBAMRFluxData &a_flux)
 Interpolate flux to centroids.
virtual void interpolateFluxToFaceCentroids (LevelData< EBFluxFAB > &a_flux, const int a_lvl)
 Interpolate flux to centroids.
virtual void computeDivergenceIrregular (LevelData< EBCellFAB > &a_divG, const LevelData< EBFluxFAB > &a_centroidFluxes, const LevelData< BaseIVFAB< Real > > &a_ebFlux, const int a_lvl)
 Compute conservative divergence on irregular cells (not kappa divided).
virtual void initialDataDistribution ()
 Fill initial data from a distribution function.
virtual void initialDataParticles ()
 Fill initial data from particles.
virtual void defineInterpolationStencils ()
 Define stencils for doing face-centered to face-centroid-centered states.
virtual void parseDomainBc ()
 Parses domain BC options.
virtual void parsePlotVariables ()
 Parses plot variables.
virtual void parsePlotMode ()
 Parse plot mode.
virtual void defineRedistribution ()
 Build the cut-cell stabilization (m_redistribution) from the current settings and grids.
virtual void parseDivergenceComputation ()
 Parse the conservation.
virtual void parseRegridSlopes ()
 Parse slope regrid.
virtual std::string makeBcString (const int a_dir, const Side::LoHiSide a_side) const
 Shortcut for making a boundary condition string.
virtual void fillGwn (EBAMRFluxData &a_noise, const Real a_sigma)
 Gaussian noise field.
virtual void smoothHeavisideFaces (EBAMRFluxData &a_facePhi, const EBAMRCellData &a_cellPhi)
 Use Heaviside smoothing for computing face-centered states.
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.

Static Protected Member Functions

static Real minmod (const Real &dwl, const Real &dwr) noexcept
 minmod slope function.
static Real superbee (const Real &dwl, const Real &dwr) noexcept
 Superbee slope limiter.
static Real monotonizedCentral (const Real &dwl, const Real &dwr) noexcept
 Monotonized central difference slope limiter.

Protected Attributes

Vector< RefCountedPtr< LayoutData< VoFIterator > > > m_grownVofIter
 Pre-built VoFIterators over grow(validBox,1) for the irregular kernel in computeNormalSlopes.
Vector< RefCountedPtr< LevelData< FArrayBox > > > m_levelCells
 1 in the cells of each level's grids (with one ghost cell, filled where other boxes cover it), 0 elsewhere. The EB inflow state is only used where the EB flux is known, which excludes ghost cells on refinement boundaries.
Limiter m_limiter
 If true, slopes are limited in the normal direction.
bool m_useCTU
 If true, the discretization uses CTU. Otherwise it's DCU (donor cell upwind).
bool m_ebInflowState
 If true, the EB is an inflow boundary where the flow leaves it. The slope of a cut cell without a face on one side uses the EB inflow state as the neighbour on that side, and the state on an outgoing face of a cut cell accounts for the fluid that enters through the EB during the time step of the update. See CdrCTU::ebInflowState.
bool m_fluxCorrection
 If true, the second-order part of the face states is limited by flux-corrected transport so that the update stays non-negative. See fluxCorrection.
Protected Attributes inherited from CdrMultigrid
EBHelmholtzOp::Smoother m_smoother
 Relaxation type for gmg.
int m_chebyOrder
 Chebyshev polynomial degree (only used when m_smoother is Smoother::Chebyshev).
Real m_chebyEigRatio
 Chebyshev eigenvalue ratio lambda_max/lambda_min (only used when m_smoother is Smoother::Chebyshev).
int m_rasInnerSweeps
 Number of inner frozen-ghost sweeps per restricted-additive-Schwarz iteration (only used when m_smoother is Smoother::RestrictedAdditiveSchwarz).
MultigridType m_multigridType
 GMG multigrid type.
RefCountedPtr< AMRMultiGrid< LevelData< EBCellFAB > > > m_multigridSolver
 Geometric multigrid solver.
RefCountedPtr< EBHelmholtzOpFactory > m_helmholtzOpFactory
 Operator factory.
BiCGStabSolver< LevelData< EBCellFAB > > m_bicgstab
 Conjugate gradient solver bottom MG level.
EBSimpleSolver m_simpleSolver
 Simple solver.
GMRESSolver< LevelData< EBCellFAB > > m_gmres
 GMRES solver.
EllipticSolverChain::Settings m_krylovSettings
 Outer-Krylov settings (selects gmg/gmres/bicgstab and the krylov_* parameters).
EllipticSolverChain::FallbackPolicy m_fallbackPolicy
 Fallback-chain latch policy (persists across regrids; re-probes GMG every krylov_retry_interval solves).
EllipticSolverChain::KrylovSolver< EBCellFAB > m_krylov
 Outer-Krylov driver (V-cycle-preconditioned BiCGStab/GMRES with persistent work vectors).
bool m_hasMultigridSolver
 Is multigrid solver defined or not?
bool m_multigridRefluxFree
 Use reflux-free AMR operator in GMG.
EBAMRCellData m_helmAcoef
 Storage for Helmholtz a-coefficient. Always 1.
EBAMRCellData m_residual
 Storage for multigrid residual.
int m_multigridVerbosity
 Verbosity for geometric multigrid.
int m_multigridPreSmooth
 Number of smoothings before averaging.
int m_multigridPostSmooth
 Number of smoothings before averaging.
int m_multigridBottomSmooth
 Number of smoothing before bottom solver.
int m_multigridMaxIterations
 Maximum number of iterations.
int m_multigridMinIterations
 Minimum number of iterations.
BottomSolverType m_bottomSolverType
 Bottom solver type.
int m_numSmoothingsForSimpleSolver
 Number of smoothing for bottom solver.
int m_minCellsBottom
 Set bottom drop depth.
Real m_multigridExitTolerance
 Multigrid tolerance.
Real m_multigridExitHang
 Multigrid hand.
Protected Attributes inherited from CdrSolver
RefCountedPtr< CdrSpecies > m_species
 Species through which e.g. mobility/diffusion and initial conditions is passed.
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
 Computational geometry.
RefCountedPtr< AmrMesh > m_amr
 AMR; needed for grid stuff.
Vector< RefCountedPtr< LayoutData< BaseIFFAB< FaceStencil > > > > m_interpStencils [SpaceDim]
 Stencils for interpolating face-centered fluxes to face centroids.
phase::which_phase m_phase
 Phase.
std::string m_name
 Solver name.
std::string m_className
 Class name.
std::string m_realm
 Realm where this solver is registered.
CdrDomainBC m_domainBC
 Domain BCs.
EBAMRCellData m_phi
 Cell-centered data (i.e. the advected-diffused quantity).
EBAMRCellData m_source
 Source term.
EBAMRCellData m_cellVelocity
 Cell-centered velocities.
EBAMRFluxData m_faceStates
 Holder for face centered states.
EBAMRFluxData m_faceVelocity
 Face-centered velocities (only normal components).
RefCountedPtr< EBRedistribution > m_redistribution
 Cut-cell stabilization of the explicit divergences. Rebuilt in allocate().
EBAMRIVData m_ebZero
 Scratch storage for the EB flux.
EBAMRCellData m_cachePhi
 Cached state vector for regrid.
EBAMRCellData m_cacheSource
 Cached source term for regrids.
EBAMRIVData m_ebVelocity
 EB-centered velocities.
EBAMRIVData m_ebFlux
 Flux through the embedded boundary.
EBAMRIFData m_domainFlux
 Domain flux.
EBAMRCellData m_cellCenteredDiffusionCoefficient
 Diffusion coefficients on cell centers.
EBAMRFluxData m_faceCenteredDiffusionCoefficient
 Diffusion coefficients on face centers.
EBAMRIVData m_ebCenteredDiffusionCoefficient
 Diffusion coefficients on EB faces.
std::map< CdrDomainBC::DomainSide, CdrDomainBC::FluxFunction > m_domainFluxFunctions
 Domain flux functions.
int m_verbosity
 Solver verbosity.
int m_timeStep
 Time step.
Real m_time
 Current time.
Real m_dt
 Last time step increment.
Redistribution m_whichRedistribution
 Which type of redistribution to use.
bool m_blendConservation
 Flag for blending the hybrid divergence.
bool m_isDiffusive
 Is the solver diffusive or not.
bool m_isMobile
 Solve for advection/convection or not.
bool m_plotPhi
 If true, m_phi is added to plot files.
bool m_plotVelocity
 Output velocities.
bool m_plotDiffusionCoefficient
 Output diffusion coefficients.
bool m_plotEbFlux
 Output EB fluxes.
bool m_plotSource
 Output source term.
bool m_plotNumbers
 Plot numbers or densities.
bool m_regridSlopes
 Use slopes when regridding.
int m_seed
 RNG seed.

Additional Inherited Members

Static Protected Attributes inherited from CdrSolver
static constexpr int m_comp = 0
 Component number in data holder.
static constexpr int m_nComp = 1
 Number of components that this solver solves for.

Detailed Description

Class that uses a slope limited method for advection, in combination with corner transport upwind (CTU).

Member Function Documentation

◆ advectToFaces()

void CdrCTU::advectToFaces ( EBAMRFluxData & a_facePhi,
const EBAMRCellData & a_cellPhi,
const Real a_extrapDt,
const Real a_dt )
overridevirtual

MUSCL advection to faces.

Parameters
[out]a_facePhiPhi on face centers
[in]a_cellPhiPhi on cell centers
[in]a_extrapDtTime step (i.e. extrapolation) of the face-centered states.
[in]a_dtTime step of the update that the face states enter, or 0 if they enter no update. Used for the EB inflow state on outgoing faces of cut cells and for the flux correction.

The flux correction keeps the update phi - a_dt*div(F) non-negative in single-valued cells away from refinement boundaries if the first-order update is, which needs a_extrapDt = a_dt (CTU) or a_extrapDt = 0 (donor cell). It counts the EB flux and the computed fluxes on domain faces, whether or not the caller adds them to the divergence, so it can limit more than needed but not less.

Implements CdrMultigrid.

◆ allocate()

void CdrCTU::allocate ( )
overridevirtual

Allocate internal storage and build pre-built VoF iterators.

Reimplemented from CdrMultigrid.

◆ computeAdvectionDt()

Real CdrCTU::computeAdvectionDt ( )
overridevirtual

Compute the largest possible advective time step (for explicit methods).

This computes dt = dx/max(|vx|,|vy|,|vz|), minimized over all grid levels and patches.

Returns
Maximum stable advection time step.

Reimplemented from CdrSolver.

◆ computeNormalSlopes()

void CdrCTU::computeNormalSlopes ( EBCellFAB & a_normalSlopes,
const EBCellFAB & a_cellPhi,
const Box & a_cellBox,
const ProblemDomain & a_domain,
const int a_level,
const DataIndex & a_dit )
protectedvirtual

Compute slopes.

Parameters
[out]a_normalSlopesCell slopes. Must have SpaceDim components (for slopes in each direction).
[in]a_cellPhiCell-centered states
[in]a_cellBoxCell-centered box identifying the cells where we compute the slopes.
[in]a_domainDomain on grid level
[in]a_levelAMR level
[in]a_ditGrid index

◆ ebInflowState()

void CdrCTU::ebInflowState ( EBFaceFAB & a_facePhi,
const EBCellFAB & a_cellVel,
const EBFaceFAB & a_faceVel,
const Box & a_cellBox,
const int a_dir,
const int a_level,
const DataIndex & a_dit,
const Real a_dt )
protectednoexcept

Correct the states on the outgoing faces of cut cells for the fluid that enters through the EB.

Where the flow leaves the EB, the fluid that crosses an outgoing face of a cut cell during the time step comes from the cell only until the flow has carried the EB (as a plane through the EB centroid) to the face. After that it is fluid that entered through the EB, whose state is phi_EB = -F_EB/(v.n), with n the EB normal pointing into the fluid and F_EB the EB flux (positive out of the fluid). With t_EB the time it takes the flow to reach the face from the EB plane, the face state becomes the time average over the step,

f * phi_face + (1-f) * phi_EB, f = min(1, t_EB/dt).

The correction only changes the face state, which is the same for the cells on both sides of the face, so the update stays conservative.

Parameters
[in,out]a_facePhiFace states in direction a_dir.
[in]a_cellVelCell-centered velocity.
[in]a_faceVelFace-centered velocity in direction a_dir.
[in]a_cellBoxGrid box.
[in]a_dirFace direction.
[in]a_levelGrid level.
[in]a_ditGrid index.
[in]a_dtTime step of the update that the face states enter.

◆ fluxCorrection()

void CdrCTU::fluxCorrection ( EBAMRFluxData & a_facePhi,
const EBAMRFluxData & a_facePhiLow,
const EBAMRCellData & a_cellPhi,
const Real a_dt )
protectednoexcept

Flux-corrected transport that keeps the update non-negative.

The first-order states (CTU without slopes) give a non-negative update for Courant numbers up to 1 in regular cells. The difference between the second-order and the first-order states is a correction that can make the update negative. For each cell, the corrections that take mass out of it are summed, and limited to the mass that the first-order update leaves in the cell: the fraction R = min(1, mass/removed). The correction on a face is multiplied by R of the cell that it takes mass from. The fractions are exchanged so that faces on box boundaries are corrected the same way on both sides, and each face state stays single-valued, so the update is conservative. Ghost cells on refinement boundaries and faces of multi-valued cells are not limited.

Parameters
[in,out]a_facePhiOn input the second-order face states, on output the corrected states.
[in]a_facePhiLowFirst-order face states.
[in]a_cellPhiCell states.
[in]a_dtTime step of the update that the face states enter.

◆ getEbInflowState()

bool CdrCTU::getEbInflowState ( Real & a_phiEB,
const VolIndex & a_vof,
const EBISBox & a_ebisbox,
const int a_level,
const DataIndex & a_dit ) const
protectednoexcept

Get the state of the fluid that enters a cut cell through the EB.

Where the flow leaves the EB (v.n > 0, with n the EB normal pointing into the fluid), the state is phi_EB = max(0, -F_EB/(v.n)), with F_EB the EB flux (positive out of the fluid) and v the cell velocity. An EB flux out of the fluid where the flow leaves the EB gives a zero inflow state.

Parameters
[out]a_phiEBThe EB inflow state, if the flow leaves the EB.
[in]a_vofCut cell
[in]a_ebisboxEBISBox of the grid box
[in]a_levelGrid level
[in]a_ditGrid index
Returns
True if the cell has an EB and the flow leaves it, false otherwise.

◆ getEbNormalIntoFluid()

RealVect CdrCTU::getEbNormalIntoFluid ( const VolIndex & a_vof,
const EBISBox & a_ebisbox ) const
protectednoexcept

Get the EB normal of a cut cell, pointing into the fluid.

This is EBISBox::normal, which points into the fluid.

Parameters
[in]a_vofCut cell
[in]a_ebisboxEBISBox of the grid box
Returns
The unit normal.

◆ minmod()

Real CdrCTU::minmod ( const Real & dwl,
const Real & dwr )
staticprotectednoexcept

minmod slope function.

Parameters
[in]dwlLeft slope.
[in]dwrRight slope.
Returns
Limited slope.

◆ monotonizedCentral()

Real CdrCTU::monotonizedCentral ( const Real & dwl,
const Real & dwr )
staticprotectednoexcept

Monotonized central difference slope limiter.

Parameters
[in]dwlLeft slope.
[in]dwrRight slope.
Returns
Limited slope.

◆ parseOptions()

void CdrCTU::parseOptions ( )
overridevirtual

Parse class options to put object in usable state.

Implements CdrMultigrid.

◆ parseRuntimeOptions()

void CdrCTU::parseRuntimeOptions ( )
overridevirtual

Parse runtime options.

Implements CdrMultigrid.

◆ preRegrid()

void CdrCTU::preRegrid ( const int a_lbase,
const int a_oldFinestLevel )
overridevirtual

Pre-regrid hook — releases the grown VoF iterators.

Parameters
[in]a_lbaseCoarsest level that changes
[in]a_oldFinestLevelFinest level before regrid

Reimplemented from CdrMultigrid.

◆ regrid()

void CdrCTU::regrid ( const int a_lbase,
const int a_oldFinestLevel,
const int a_newFinestLevel )
overridevirtual

Regrid method — also rebuilds the grown VoF iterators.

Parameters
[in]a_lbaseCoarsest level that changes
[in]a_oldFinestLevelFinest level before regrid
[in]a_newFinestLevelFinest level after regrid

Reimplemented from CdrSolver.

◆ superbee()

Real CdrCTU::superbee ( const Real & dwl,
const Real & dwr )
staticprotectednoexcept

Superbee slope limiter.

Parameters
[in]dwlLeft slope.
[in]dwrRight slope.
Returns
Limited slope.

◆ upwind()

void CdrCTU::upwind ( EBFluxFAB & a_facePhi,
const EBCellFAB & a_normalSlopes,
const EBCellFAB & a_cellPhi,
const EBCellFAB & a_cellVel,
const EBFluxFAB & a_faceVel,
const ProblemDomain & a_domain,
const Box & a_cellBox,
const int & a_level,
const DataIndex & a_dit,
const Real & a_dt )
protectedvirtual

Upwind/Riemann solve. This extrapolates the cell-centered data to the inside face centers and selects the upwind side.

This uses the Colella CTU method where we extrapolate with the corner cells as well. a_normalSlopes holds the slopes normal to the face direction, and the transverse slopes are added inside this method. This routine also solves the corresponding Riemann problem (which is just the upwind face).

Parameters
[out]a_facePhiFace-centered states.
[in]a_normalSlopesNormal cell slopes
[in]a_cellPhiCell-centered states
[in]a_cellVelCell-centered velocities.
[in]a_faceVelFace-centered velocities.
[in]a_domainDomain on grid level.
[in]a_cellBoxGrid box/patch
[in]a_levelAMR level
[in]a_ditGrid index.
[in]a_dtTime step.

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