chombo-discharge
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
RtSolver Class Referenceabstract

Abstract RTE solver class for doing various kinds of radiative transfer equations. This class is a pure class and it is basically just an interface. More...

#include <CD_RtSolver.H>

Inheritance diagram for RtSolver:
Inheritance graph
[legend]
Collaboration diagram for RtSolver:
Collaboration graph
[legend]

Public Member Functions

 RtSolver ()
 Constructor.
 
virtual ~RtSolver ()
 Constructor (does nothing)
 
virtual std::string getName ()
 Get solver name.
 
virtual const std::string getRealm () const
 Get the realm where the solver lives.
 
virtual void parseOptions ()=0
 Parse options.
 
virtual void parseRuntimeOptions ()=0
 Parse runtime options.
 
virtual bool advance (const Real a_dt, const bool a_zeroPhi=false)
 Advance equation one time step. More...
 
virtual bool advance (const Real a_dt, EBAMRCellData &a_phi, const bool a_zeroPhi=false)
 Advance method. Advances one time step. More...
 
virtual bool advance (const Real a_dt, EBAMRCellData &a_phi, const EBAMRCellData &a_source, const bool a_zeroPhi=false)=0
 Advance method. Advances one time step. More...
 
virtual void setRealm (const std::string a_realm)
 Set realm where this solver lives. More...
 
virtual void setRtSpecies (const RefCountedPtr< RtSpecies > &a_species)
 Set the radiative transfer species (RtSpecies) More...
 
virtual void setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > a_computationalGeometry)
 Set computational geometry. More...
 
virtual void computeLoads (Vector< long long > &a_loads, const DisjointBoxLayout &a_dbl, const int a_level) const noexcept
 Get computational loads for a specific grid level. More...
 
virtual void setAmr (const RefCountedPtr< AmrMesh > &a_amr)
 Set the amr object. More...
 
virtual void setPhase (phase::which_phase a_phase=phase::gas)
 Set phase. More...
 
virtual void setVerbosity (const int a_verbosity)
 Set verbosity. 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 setStationary (const bool a_stationary)
 Set stationary solver or not. More...
 
virtual void sanityCheck ()
 Sanity check.
 
virtual bool isStationary ()
 Check if solver is stationary.
 
virtual void computeBoundaryFlux (EBAMRIVData &a_ebFlux, const EBAMRCellData &a_phi)=0
 Compute the boundary flux given a state (a_phi will be different for different RTE approximations) More...
 
virtual void computeDomainFlux (EBAMRIFData &a_domainflux, const EBAMRCellData &a_phi)=0
 Compute the domain flux given a state (a_phi will be different for different RTE approximations) More...
 
virtual void computeFlux (EBAMRCellData &a_flux, const EBAMRCellData &a_phi)=0
 Compute the flux. More...
 
virtual void computeDensity (EBAMRCellData &a_isotropic, const EBAMRCellData &a_phi)=0
 Get isotropic part. More...
 
virtual void allocate ()=0
 Allocate internal storage.
 
virtual void deallocate ()=0
 Deallocate internal storage.
 
virtual void preRegrid (const int a_lbase, const int a_oldFinestLevel)=0
 Perform pre-regrid operations. More...
 
virtual void regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)=0
 Regrid this solver. More...
 
virtual void registerOperators ()=0
 Register operators.
 
virtual void initialData ()
 Fill solver with initial data. By default, this sets internal data to zero. More...
 
virtual void setSource (const EBAMRCellData &a_source)
 Set source term. More...
 
virtual void setSource (const Real a_source)
 Set source. More...
 
virtual void setSource (const std::function< Real(const RealVect a_pos)> a_source)
 Set source. More...
 
virtual void writePlotFile ()=0
 Write plot file.
 
virtual int getNumberOfPlotVariables () const
 Get number of output fields. More...
 
virtual Vector< std::string > getPlotVariableNames () const
 Get output plot names.
 
virtual void writePlotData (LevelData< EBCellFAB > &a_output, int &a_comp, const std::string a_outputRealm, const int a_level) const noexcept
 Write output data to a_output. More...
 
virtual Real getTime () const
 Get current time. More...
 
virtual phase::which_phase getPhase ()
 Get the RTE phase. More...
 
virtual EBAMRCellDatagetPhi ()
 Get solver state. More...
 
virtual EBAMRCellDatagetSource ()
 Get multifluid source. More...
 
virtual EBAMRFluxDatagetKappa ()
 Get the absorption length. More...
 
virtual EBAMRIVDatagetKappaEb ()
 Get the absorption coefficient on irregular EB faces. More...
 
virtual RefCountedPtr< RtSpecies > & getSpecies ()
 Get species.
 

Protected Member Functions

void setEbIndexSpace (const RefCountedPtr< EBIndexSpace > &a_ebis)
 Set ebis.
 
void parseVerbosity () noexcept
 Parse verbosity.
 
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

Location::Cell m_dataLocation
 Data location.
 
std::string m_realm
 Realm where this solver lives.
 
RefCountedPtr< EBIndexSpace > m_ebis
 EBIndexSpace for this solver.
 
RefCountedPtr< RtSpeciesm_rtSpecies
 Radiative transfer species (contains meta-information like initial conditions)
 
RefCountedPtr< ComputationalGeometrym_computationalGeometry
 Computational geometry.
 
RefCountedPtr< AmrMeshm_amr
 AMR; needed for grid stuff.
 
phase::which_phase m_phase
 Phase.
 
std::string m_name
 Name for this solver.
 
std::string m_className
 Class name – needed because inherited classes will be named different.
 
EBAMRCellData m_cachePhi
 Cached state used for regridding.
 
EBAMRCellData m_phi
 Internal state. More...
 
EBAMRCellData m_source
 Source term. More...
 
EBAMRFluxData m_kappa
 Absorption coefficient.
 
EBAMRIVData m_kappaEB
 Absorption coefficient on EB faces.
 
Real m_time
 Time.
 
Real m_dt
 Time increment.
 
bool m_stationary
 Stationary solver or not.
 
bool m_plotPhi
 Output state.
 
bool m_plotSource
 Output source term.
 
int m_verbosity
 
int m_timeStep
 Time step.
 

Static Protected Attributes

static constexpr int m_comp = 0
 Default component that we solve for.
 
static constexpr int m_nComp = 1
 Default number of components.
 

Detailed Description

Abstract RTE solver class for doing various kinds of radiative transfer equations. This class is a pure class and it is basically just an interface.

Member Function Documentation

◆ advance() [1/3]

bool RtSolver::advance ( const Real  a_dt,
const bool  a_zeroPhi = false 
)
virtual

Advance equation one time step.

Parameters
[in]a_dtTime step
[in]a_zeroPhiAn optional argument for e.g. elliptic solves which can start from previous solution or zero.

◆ advance() [2/3]

bool RtSolver::advance ( const Real  a_dt,
EBAMRCellData a_phi,
const bool  a_zeroPhi = false 
)
virtual

Advance method. Advances one time step.

Parameters
[in]a_dtTime step
[in]a_phiMesh solution
[in]a_zeroPhiAn optional argument for e.g. elliptic solves which can start from previous solution or zero.

◆ advance() [3/3]

virtual bool RtSolver::advance ( const Real  a_dt,
EBAMRCellData a_phi,
const EBAMRCellData a_source,
const bool  a_zeroPhi = false 
)
pure virtual

Advance method. Advances one time step.

Parameters
[in]a_dtTime step
[in]a_phiMesh solution
[in]a_sourceSource term
[in]a_zeroPhiAn optional argument for e.g. elliptic solves which can start from previous solution or zero.

Implemented in McPhoto, and EddingtonSP1.

◆ computeBoundaryFlux()

virtual void RtSolver::computeBoundaryFlux ( EBAMRIVData a_ebFlux,
const EBAMRCellData a_phi 
)
pure virtual

Compute the boundary flux given a state (a_phi will be different for different RTE approximations)

Parameters
[in,out]a_ebFluxThe flux on the EB
[in]a_phiCell-centered solution for the RTE state (e.g. for Eddington this is just the isotropic part).

Implemented in McPhoto, and EddingtonSP1.

◆ computeDensity()

virtual void RtSolver::computeDensity ( EBAMRCellData a_isotropic,
const EBAMRCellData a_phi 
)
pure virtual

Get isotropic part.

Parameters
[in,out]a_isotropicIsotropic part of the RTE solution
[in]a_phiFull RTE solution.

This is normally just a copy, but I need the function signature in order to have a clear plasma-coupling interface

Implemented in McPhoto, and EddingtonSP1.

◆ computeDomainFlux()

virtual void RtSolver::computeDomainFlux ( EBAMRIFData a_domainflux,
const EBAMRCellData a_phi 
)
pure virtual

Compute the domain flux given a state (a_phi will be different for different RTE approximations)

Parameters
[in,out]a_domainFluxThe flux on the domain wall
[in]a_phiCell-centered solution for the RTE state (e.g. for Eddington this is just the isotropic part).

Implemented in McPhoto, and EddingtonSP1.

◆ computeFlux()

virtual void RtSolver::computeFlux ( EBAMRCellData a_flux,
const EBAMRCellData a_phi 
)
pure virtual

Compute the flux.

Parameters
[in,out]a_fluxThe RTE flux on the domain wall
[in]a_phiCell-centered solution for the RTE state (e.g. for Eddington this is just the isotropic part).

For diffusive models, the flux will be something like grad(a_phi). For higher-order models, the flux will be contained in a_phi (somehow).

Implemented in McPhoto, and EddingtonSP1.

◆ computeLoads()

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

Get computational loads for a specific grid level.

Parameters
[out]a_loadsGrid loads for this level.
[in]a_dblGrids on input level
[in]a_levelInput level
Returns
Loads for each box on a grid level.
Note
The return vector should have the same order as the boxes in a_dbl. E.g. ret[0] must be the load for a_dbl.boxArray()[0];

The default implementation returns the number of cells in the grid patch as a proxy for the load.

Reimplemented in McPhoto.

◆ getKappa()

EBAMRFluxData & RtSolver::getKappa ( )
virtual

Get the absorption length.

Returns
m_kappa

◆ getKappaEb()

EBAMRIVData & RtSolver::getKappaEb ( )
virtual

Get the absorption coefficient on irregular EB faces.

Returns
m_kappaEB

◆ getNumberOfPlotVariables()

int RtSolver::getNumberOfPlotVariables ( ) const
virtual

Get number of output fields.

Returns
Returns number of variables that will be plotted to file.

Reimplemented in McPhoto.

◆ getPhase()

phase::which_phase RtSolver::getPhase ( )
virtual

Get the RTE phase.

Returns
Returns m_phase

◆ getPhi()

EBAMRCellData & RtSolver::getPhi ( )
virtual

Get solver state.

Returns
Returns m_phi. For diffusive solves this will have a single component.

◆ getSource()

EBAMRCellData & RtSolver::getSource ( )
virtual

Get multifluid source.

Returns
Returns m_source. For diffusive solves this will have a single component.

◆ getTime()

Real RtSolver::getTime ( ) const
virtual

Get current time.

Returns
Returns m_time

◆ initialData()

void RtSolver::initialData ( )
virtual

Fill solver with initial data. By default, this sets internal data to zero.

Default implementation sets to zero – override if you want to have different initial conditions.

◆ preRegrid()

virtual void RtSolver::preRegrid ( const int  a_lbase,
const int  a_oldFinestLevel 
)
pure virtual

Perform pre-regrid operations.

Parameters
[in]a_lbaseCoarsest level that changed during regrid.
[in]a_oldFinestLevelFinest grid level before the regrid operation.

Implemented in McPhoto, and EddingtonSP1.

◆ regrid()

virtual void RtSolver::regrid ( const int  a_lmin,
const int  a_oldFinestLevel,
const int  a_newFinestLevel 
)
pure 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.

Implemented in McPhoto, and EddingtonSP1.

◆ setAmr()

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

Set the amr object.

Parameters
[in]a_amrAmrMesh object.

◆ setComputationalGeometry()

void RtSolver::setComputationalGeometry ( const RefCountedPtr< ComputationalGeometry a_computationalGeometry)
virtual

Set computational geometry.

Parameters
[in]a_computationalGeometryComputational geometry

◆ setPhase()

void RtSolver::setPhase ( phase::which_phase  a_phase = phase::gas)
virtual

Set phase.

Parameters
[in]a_phasePhase (gas/solid) where the solver lives.

This must be done BEFORE callilng setComputationalGeometry

◆ setRealm()

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

Set realm where this solver lives.

Parameters
[in]a_realmRealm

◆ setRtSpecies()

void RtSolver::setRtSpecies ( const RefCountedPtr< RtSpecies > &  a_species)
virtual

Set the radiative transfer species (RtSpecies)

Parameters
[in]a_speciesSpecies (see RtSpecies.H)

◆ setSource() [1/3]

void RtSolver::setSource ( const EBAMRCellData a_source)
virtual

Set source term.

Parameters
[in]a_sourceSource term

◆ setSource() [2/3]

void RtSolver::setSource ( const Real  a_source)
virtual

Set source.

Parameters
[in]a_sourceSource term

◆ setSource() [3/3]

void RtSolver::setSource ( const std::function< Real(const RealVect a_pos)>  a_source)
virtual

Set source.

Parameters
[in]a_sourceSource term (varies in space)

◆ setStationary()

void RtSolver::setStationary ( const bool  a_stationary)
virtual

Set stationary solver or not.

Parameters
[in]a_stationaryIf true, the solver is set to stationary mode.

◆ setTime()

void RtSolver::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

◆ setVerbosity()

void RtSolver::setVerbosity ( const int  a_verbosity)
virtual

Set verbosity.

Parameters
[in]a_verbosityVerbosity level.

◆ writeData()

void RtSolver::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_levelGrid level
[in]a_outputRealmRealm to which a_output belongs
[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 RtSolver::writePlotData ( LevelData< EBCellFAB > &  a_output,
int &  a_comp,
const std::string  a_outputRealm,
const int  a_level 
) const
virtualnoexcept

Write output data to a_output.

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 routine writes m_phi on centroids (and not cell-centers).

Reimplemented in McPhoto.

Member Data Documentation

◆ m_phi

EBAMRCellData RtSolver::m_phi
protected

Internal state.

For diffusive models, this will only contain the isotropic density. For higher order models, this should also include the flux, Eddigton tensor etc.

◆ m_source

EBAMRCellData RtSolver::m_source
protected

Source term.

For diffusive models, this will only contain the isotropic source. For higher order models, this should also include beam sources.


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