chombo-discharge
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Physics::AdvectionDiffusion::AdvectionDiffusionStepper Class Reference

Implementation of TimeStepper which runs a single advection-diffusion-reaction solver. More...

#include <CD_AdvectionDiffusionStepper.H>

Inheritance diagram for Physics::AdvectionDiffusion::AdvectionDiffusionStepper:
Inheritance graph
[legend]
Collaboration diagram for Physics::AdvectionDiffusion::AdvectionDiffusionStepper:
Collaboration graph
[legend]

Public Member Functions

 AdvectionDiffusionStepper ()
 Default constructor – only parses options.
 
 AdvectionDiffusionStepper (RefCountedPtr< CdrSolver > &a_solver)
 Full constructor. More...
 
virtual ~AdvectionDiffusionStepper ()
 Destructor (does nothing)
 
void initialData () override
 Fill solver with initial data.
 
void allocate () override
 Allocate memory.
 
void postInitialize () override
 Perform post-initialization routines (there are none)
 
void postCheckpointSetup () override
 Perform post-checkpoint setup routines. More...
 
int getNumberOfPlotVariables () const override
 Get the number of plot variables.
 
Vector< std::string > getPlotVariableNames () const override
 Get plot variable name.
 
void writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const override
 Write plot data to output holder. More...
 
Real computeDt () override
 Compute a time step to be used by Driver.
 
void synchronizeSolverTimes (const int a_step, const Real a_time, const Real a_dt) override
 Synchronize solver times. More...
 
void printStepReport () override
 Print a step report if you want. More...
 
void parseRuntimeOptions () override
 Parse runtime options. More...
 
void registerRealms () override
 Register all realms that will be used.
 
void registerOperators () override
 Register all operators that will be used.
 
void preRegrid (const int a_lbase, const int a_finestLevel) override
 Perform pre-regrid operations. Calls CdrSolver::preRegrid. More...
 
void setupSolvers () override
 Instantiate the solver.
 
Real advance (const Real a_dt) override
 Advancement function – advances one time step. More...
 
void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override
 Regrid method – calls regrid method for solver. More...
 
void postRegrid () override
 Perform post-regrid routines. This does nothing.
 
void setCFL (const Real a_cfl)
 Set the CFL number. More...
 
void setInitialData (const std::function< Real(const RealVect &a_position)> &a_initData) noexcept
 Set the initial data.. More...
 
void setVelocity (const std::function< RealVect(const RealVect &a_position)> &a_velocity) noexcept
 Set the velocity field. More...
 
void setDiffusionCoefficient (const std::function< Real(const RealVect &a_position)> &a_diffusion) noexcept
 Set the diffusion coeffieint. More...
 
- Public Member Functions inherited from TimeStepper
 TimeStepper ()
 Default constructor (does nothing)
 
virtual ~TimeStepper ()
 Default destructor (does nothing)
 
void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set AmrMesh. More...
 
void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
 Set the computational geometry. More...
 
virtual void prePlot ()
 An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY before writing the plot file.
 
virtual void postPlot ()
 An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY after writing the plot file.
 
virtual Vector< long int > getCheckpointLoads (const std::string a_realm, const int a_level) const
 Get computational loads to be checkpointed. More...
 
virtual bool needToRegrid ()
 Fuction which can have Driver do regrids at arbitrary points in the simulation. More...
 
virtual bool loadBalanceThisRealm (const std::string a_realm) const
 Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines will be called during regrids. More...
 
virtual void loadBalanceBoxes (Vector< Vector< int >> &a_procs, Vector< Vector< Box >> &a_boxes, const std::string a_realm, const Vector< DisjointBoxLayout > &a_grids, const int a_lmin, const int a_finestLevel)
 Load balance grid boxes for a specified realm. More...
 

Protected Types

enum  Integrator { Heun , IMEX }
 Switch for different integrators.
 

Protected Member Functions

void parseIntegrator ()
 Parse the integration method.
 

Protected Attributes

RefCountedPtr< CdrSolverm_solver
 Reference to solver.
 
RefCountedPtr< AdvectionDiffusionSpeciesm_species
 Reference to advected species.
 
std::string m_realm
 Realm where the solver lives.
 
phase::which_phase m_phase
 Phase where the solver lives.
 
std::function< RealVect(const RealVect &a_position)> m_velocity
 Velocity field.
 
std::function< Real(const RealVect &a_position)> m_diffCo
 Diffusion coefficient.
 
std::function< Real(const RealVect &a_initialData)> m_initialData
 Initial data.
 
Real m_minDt
 Smallest acceptable time step.
 
Real m_maxDt
 Largest acceptable time step.
 
Real m_cfl
 CFL number to use.
 
Real m_forceCFL
 Forced CFL (overrides input options)
 
bool m_debug
 For activating debugging. This is an option.
 
bool m_mobile
 Mobile or not.
 
bool m_diffusive
 Diffusive or not.
 
Integrator m_integrator
 Integrator.
 
- Protected Attributes inherited from TimeStepper
int m_verbosity
 Class verbosity.
 
int m_timeStep
 Time step.
 
Real m_time
 TIme.
 
Real m_dt
 Previous time step size.
 
RefCountedPtr< AmrMeshm_amr
 AmrMesh.
 
RefCountedPtr< ComputationalGeometrym_computationalGeometry
 Computational geometry.
 

Detailed Description

Implementation of TimeStepper which runs a single advection-diffusion-reaction solver.

Constructor & Destructor Documentation

◆ AdvectionDiffusionStepper()

AdvectionDiffusionStepper::AdvectionDiffusionStepper ( RefCountedPtr< CdrSolver > &  a_solver)

Full constructor.

Parameters
[in]a_solverCDR solver.

Member Function Documentation

◆ advance()

Real AdvectionDiffusionStepper::advance ( const Real  a_dt)
overridevirtual

Advancement function – advances one time step.

Parameters
[in]a_dtTime step to be used for advancement
Returns
a_dt

Implements TimeStepper.

◆ parseRuntimeOptions()

void AdvectionDiffusionStepper::parseRuntimeOptions ( )
overridevirtual

Parse runtime options.

Reads in verbosity level, integrator, and CFL number to use.

Reimplemented from TimeStepper.

◆ postCheckpointSetup()

void AdvectionDiffusionStepper::postCheckpointSetup ( )
overridevirtual

Perform post-checkpoint setup routines.

This will set source terms, velocities, and diffusion coefficients.

Implements TimeStepper.

◆ preRegrid()

void AdvectionDiffusionStepper::preRegrid ( const int  a_lbase,
const int  a_finestLevel 
)
overridevirtual

Perform pre-regrid operations. Calls CdrSolver::preRegrid.

Parameters
[in]a_lminThe coarsest level that changes
[in]a_oldFinestLevelThe finest level before the regrid.

Implements TimeStepper.

◆ printStepReport()

void Physics::AdvectionDiffusion::AdvectionDiffusionStepper::printStepReport ( )
inlineoverridevirtual

Print a step report if you want.

Note
Implementation does nothing.

Implements TimeStepper.

◆ regrid()

void AdvectionDiffusionStepper::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
overridevirtual

Regrid method – calls regrid method for solver.

Parameters
[in]a_lminThe coarsest level that changed.
[in]a_oldFinestLevelThe finest level before the regrid.
[in]a_newFinestLevelThe finest level after the regrid.

Implements TimeStepper.

◆ setCFL()

void AdvectionDiffusionStepper::setCFL ( const Real  a_cfl)

Set the CFL number.

Parameters
[in]a_cfl;

◆ setDiffusionCoefficient()

void AdvectionDiffusionStepper::setDiffusionCoefficient ( const std::function< Real(const RealVect &a_position)> &  a_diffusion)
noexcept

Set the diffusion coeffieint.

Parameters
[in]a_diffusionDiffusion coefficient

◆ setInitialData()

void AdvectionDiffusionStepper::setInitialData ( const std::function< Real(const RealVect &a_position)> &  a_initData)
noexcept

Set the initial data..

Parameters
[in]a_initDataInitial data function.

◆ setVelocity()

void AdvectionDiffusionStepper::setVelocity ( const std::function< RealVect(const RealVect &a_position)> &  a_velocity)
noexcept

Set the velocity field.

Parameters
[in]a_velocityVelocity field.

◆ synchronizeSolverTimes()

void AdvectionDiffusionStepper::synchronizeSolverTimes ( const int  a_step,
const Real  a_time,
const Real  a_dt 
)
overridevirtual

Synchronize solver times.

Parameters
[in]a_stepTime step
[in]a_timeTime (in seconds)
[in]a_dtTime step that was used.

Implements TimeStepper.

◆ writePlotData()

void AdvectionDiffusionStepper::writePlotData ( LevelData< EBCellFAB > &  a_output,
int &  a_icomp,
const std::string  a_outputRealm,
const int  a_level 
) const
overridevirtual

Write plot data to output holder.

Parameters
[in,out]a_outputOutput data holder.
[in,out]a_icompStarting component in a_output to begin at.
[in]a_outputRealmRealm where a_output belongs
[in]a_levelGrid level

Implements TimeStepper.


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