TransFlow  0.1.0
A transient pipeline flow simulation library
GoverningEquationSolver< T > Class Template Reference

The GoverningEquationSolver class is a composition of Discretizer and MatrixEquation with a little bit of logic, that solves the governing equations for a 1d gas pipeline. More...

#include <governingequationsolver.hpp>

Inheritance diagram for GoverningEquationSolver< T >:
GoverningEquationSolverBase

Public Member Functions

virtual ~GoverningEquationSolver ()
 Declared to avoid the inline compiler-generated default destructor.
 
 GoverningEquationSolver (const arma::uword nGridPoints)
 Construct with string determining the type of energy equation. More...
 
 GoverningEquationSolver (std::unique_ptr< Discretizer > discretizer)
 Construct from Discretizer instance. More...
 
virtual arma::mat solve (const arma::uword dt, const Pipeline &currentState, const Pipeline &newState, const BoundaryConditions &boundaryConditions) override
 Solve the governing equations for a given time step and boundary conditions. More...
 
- Public Member Functions inherited from GoverningEquationSolverBase
virtual ~GoverningEquationSolverBase ()
 Declared to avoid the inline compiler-generated default destructor.
 
bool isOverDetermined (const BoundaryConditions &boundaryConditions)
 

Private Attributes

const arma::uword m_nVariables = 3
 Number of flow variables (flow, pressure and temperature)
 
std::unique_ptr< Discretizerm_discretizer
 
std::unique_ptr< MatrixEquationm_matrixEquation
 

Detailed Description

template<typename T = InternalEnergyDiscretizer>
class GoverningEquationSolver< T >

The GoverningEquationSolver class is a composition of Discretizer and MatrixEquation with a little bit of logic, that solves the governing equations for a 1d gas pipeline.

Constructor & Destructor Documentation

◆ GoverningEquationSolver() [1/2]

template<typename T = InternalEnergyDiscretizer>
GoverningEquationSolver< T >::GoverningEquationSolver ( const arma::uword  nGridPoints)
explicit

Construct with string determining the type of energy equation.

Parameters
nGridPointsNumber of grid points

◆ GoverningEquationSolver() [2/2]

template<typename T = InternalEnergyDiscretizer>
GoverningEquationSolver< T >::GoverningEquationSolver ( std::unique_ptr< Discretizer discretizer)
explicit

Construct from Discretizer instance.

Parameters
discretizerDiscretizer instance

Member Function Documentation

◆ solve()

template<typename T = InternalEnergyDiscretizer>
virtual arma::mat GoverningEquationSolver< T >::solve ( const arma::uword  dt,
const Pipeline currentState,
const Pipeline newState,
const BoundaryConditions boundaryConditions 
)
overridevirtual

Solve the governing equations for a given time step and boundary conditions.

Parameters
dtTime step [s]
currentStateCurrent Pipeline state
newStateNew/guess Pipeline state
boundaryConditionsBoundary conditions
Returns
Matrix containing flow, pressure and temperature columns

Implements GoverningEquationSolverBase.

Member Data Documentation

◆ m_discretizer

template<typename T = InternalEnergyDiscretizer>
std::unique_ptr<Discretizer> GoverningEquationSolver< T >::m_discretizer
private

Discretizer used when solving the governing equations. The main difference between the two options InternalEnergyDiscretizer and EnthalpyDiscretizer is the choice of energy equation.

See also
InternalEnergyDiscretizer
EnthalpyDiscretizer

◆ m_matrixEquation

template<typename T = InternalEnergyDiscretizer>
std::unique_ptr<MatrixEquation> GoverningEquationSolver< T >::m_matrixEquation
private

MatrixEquation instance used to solve the matrix equation set up when discretizing the governing equations.


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