TransFlow  0.1.0
A transient pipeline flow simulation library
EquationOfState Class Reference

The EquationOfState class is a wrapper around EquationOfStateBase that has one equation of state instance per grid point, and wraps the EquationOfStateBase::evaluate() function. More...

#include <equationofstate.hpp>

Public Member Functions

 ~EquationOfState ()
 Declared to avoid the inline compiler-generated default destructor.
 
 EquationOfState (const Pipeline &pipeline, const std::string &type)
 Construct from pipeline and string to determine the type of equation of state. More...
 
arma::mat evaluate (const Pipeline &state)
 This is a wrapper around EquationOfStateBase::evaluate() that calls that function for each grid point. More...
 
const EquationOfStateBaseat (std::size_t pos) const
 std::vector-like at(i) getter
 
auto size () const
 std::vector-like size() operator
 

Private Attributes

std::unique_ptr< std::vector< std::unique_ptr< EquationOfStateBase > > > m_eos
 Vector of EquationOfStateBase instances, one for each grid point.
 

Detailed Description

The EquationOfState class is a wrapper around EquationOfStateBase that has one equation of state instance per grid point, and wraps the EquationOfStateBase::evaluate() function.

Constructor & Destructor Documentation

◆ EquationOfState()

EquationOfState::EquationOfState ( const Pipeline pipeline,
const std::string &  type 
)

Construct from pipeline and string to determine the type of equation of state.

Parameters
pipelinePipeline instance
typeType of equation of state ("BWRS", "GERG04" or "IdealGas")

Member Function Documentation

◆ evaluate()

arma::mat EquationOfState::evaluate ( const Pipeline state)

This is a wrapper around EquationOfStateBase::evaluate() that calls that function for each grid point.

Parameters
statePipeline instance
Returns
Matrix containing the output from each EquationOfStateBase instance in each row. This way it's easy to update the relevant Pipeline members, which are stored as column vectors.

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