TransFlow  0.1.0
A transient pipeline flow simulation library
EnthalpyDiscretizer Class Reference

Implementation of Discretizer for the enthalpy form of the energy equation. More...

#include <enthalpy.hpp>

Inheritance diagram for EnthalpyDiscretizer:
Discretizer

Public Member Functions

 EnthalpyDiscretizer (const arma::uword nGridPoints)
 Constructor. Calls Discretizer constructor with nEquations = 3. More...
 
virtual void discretize (const arma::uword dt, const Pipeline &currentState, const Pipeline &newState) override
 Discretize implementation. Calculates the coefficients of the discretized governing equations, with the enthalpy form of the energy equation. More...
 
void discretizeFromPrimitives (const arma::uword dt, const arma::vec &diameter, const arma::vec &height, const arma::vec &gridPoints, const arma::vec &currentSpecificGasConstant, const arma::vec &currentMassFlow, const arma::vec &currentPressure, const arma::vec &currentTemperature, const arma::vec &guessMassFlow, const arma::vec &guessPressure, const arma::vec &guessTemperature, const arma::vec &guessFriction, const arma::vec &guessHeatCapacityConstantPressure, const arma::vec &guessHeatFlux, const arma::vec &guessDensity, const arma::vec &guessCompressibilityFactor, const arma::vec &guess_dZdT_p, const arma::vec &guess_dZdp)
 Calculates the coefficients of the discretized governing equations, with the enthalpy form of the energy equation, and stores the result in Discretizer::m_term_i, Discretizer::m_term_ipp and Discretizer::m_boundaryTerm. More...
 
- Public Member Functions inherited from Discretizer
virtual ~Discretizer ()
 
 Discretizer (const arma::uword nGridPoints, const arma::uword nEquationsAndVariables)
 Construct from number of grid points and number of equations and variables. More...
 
const arma::cube & term_i () const
 Get coefficients of \(y_i\).
 
const arma::cube & term_ipp () const
 Get coefficients of \(y_{i+1}\).
 
const arma::mat & boundaryTerms () const
 Get constant terms.
 

Additional Inherited Members

- Protected Attributes inherited from Discretizer
arma::cube m_term_i
 The coefficients of \(y_i\) in the discretized governing equations. More...
 
arma::cube m_term_ipp
 The coefficients of \(y_i\) in the discretized governing equations. More...
 
arma::mat m_boundaryTerm
 The constant/known terms in the discretized governing equations. More...
 
double m_gravity = 9.81
 Gravity.
 

Detailed Description

Implementation of Discretizer for the enthalpy form of the energy equation.

Constructor & Destructor Documentation

◆ EnthalpyDiscretizer()

EnthalpyDiscretizer::EnthalpyDiscretizer ( const arma::uword  nGridPoints)
explicit

Constructor. Calls Discretizer constructor with nEquations = 3.

Parameters
nGridPointsNumber of grid points

Member Function Documentation

◆ discretize()

virtual void EnthalpyDiscretizer::discretize ( const arma::uword  dt,
const Pipeline currentState,
const Pipeline newState 
)
overridevirtual

Discretize implementation. Calculates the coefficients of the discretized governing equations, with the enthalpy form of the energy equation.

This is just a wrapper around discretizeFromPrimitives().

Parameters
dtTime step [s]
currentStateCurrent pipeline state
newStateNew/guess pipeline state

Implements Discretizer.

◆ discretizeFromPrimitives()

void EnthalpyDiscretizer::discretizeFromPrimitives ( const arma::uword  dt,
const arma::vec &  diameter,
const arma::vec &  height,
const arma::vec &  gridPoints,
const arma::vec &  currentSpecificGasConstant,
const arma::vec &  currentMassFlow,
const arma::vec &  currentPressure,
const arma::vec &  currentTemperature,
const arma::vec &  guessMassFlow,
const arma::vec &  guessPressure,
const arma::vec &  guessTemperature,
const arma::vec &  guessFriction,
const arma::vec &  guessHeatCapacityConstantPressure,
const arma::vec &  guessHeatFlux,
const arma::vec &  guessDensity,
const arma::vec &  guessCompressibilityFactor,
const arma::vec &  guess_dZdT_p,
const arma::vec &  guess_dZdp 
)

Calculates the coefficients of the discretized governing equations, with the enthalpy form of the energy equation, and stores the result in Discretizer::m_term_i, Discretizer::m_term_ipp and Discretizer::m_boundaryTerm.

Parameters
dtTime step [s]
diameterInner diameter [m]
heightHeight profile [m]
gridPointsGrid points [m]
currentSpecificGasConstantCurrent specific gas constant \(R_{\rm specific}\) [J/(kg K)]
currentMassFlowCurrent mass flow [kg/s]
currentPressureCurrent pressure [Pa]
currentTemperatureTemperature [K]
guessMassFlowNew mass flow [kg/s]
guessPressureNew pressure [Pa]
guessTemperatureNew temperature [K]
guessFrictionNew friction factor [-]
guessHeatCapacityConstantPressureNew heat capacity \(c_p\) [J/(kg K)]
guessHeatFluxNew heat flux [W/m2]
guessDensityNew gas density [kg/m3]
guessCompressibilityFactorNew gas compressibility factor \(Z\) [-]
guess_dZdT_pNew partial derivative \(\frac{\partial Z}{\partial T}|_p\) [-]
guess_dZdpNew partial derivative \(\frac{\partial Z}{\partial p}|_T\) [-]

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