TransFlow  0.1.0
A transient pipeline flow simulation library
HeatTransferState Struct Reference

Container for the state of a HeatTransferBase instance. All HeatTransferBase subclasses operate on instances of State, and return State. More...

#include <heattransferstate.hpp>

Public Member Functions

 HeatTransferState (const double heatFlux=0)
 Construct from only heat flux (skip optional temperature vector). More...
 
 HeatTransferState (const double heatFlux, const arma::vec &temperature)
 Construct from heat flux and temperature vector, both with default values. More...
 
const arma::vec & temperature () const
 Temperature getter. This will throw an error if State::m_temperature is not set, since this is optional. Check State::hasTemperature() first if you want to be sure. More...
 
bool hasTemperature ()
 State::m_temperature is optional, so this getter returns true if State::m_temperature has been set properly. More...
 
double heatFlux () const
 Heat flux getter [W/m2].
 
void setTemperature (const arma::vec &temperature)
 Set the temperature. Needs a setter since temperature is std::optional.
 

Private Attributes

double m_heatFlux
 Heat flux [W/m2].
 
std::optional< arma::vec > m_temperature
 Pipe wall temperature (optional) [K].
 

Detailed Description

Container for the state of a HeatTransferBase instance. All HeatTransferBase subclasses operate on instances of State, and return State.

This uses std::optional for the temperature member, since this is only used by UnsteadyHeatTransferBase.

Constructor & Destructor Documentation

◆ HeatTransferState() [1/2]

HeatTransferState::HeatTransferState ( const double  heatFlux = 0)
explicit

Construct from only heat flux (skip optional temperature vector).

Parameters
heatFluxHeat flux between gas and surroundings [W/m2]

◆ HeatTransferState() [2/2]

HeatTransferState::HeatTransferState ( const double  heatFlux,
const arma::vec &  temperature 
)
explicit

Construct from heat flux and temperature vector, both with default values.

Parameters
heatFluxHeat flux between gas and surroundings [W/m2]
temperaturePipe wall and burial medium temperatures when using 1d radial model [K]

Member Function Documentation

◆ hasTemperature()

bool HeatTransferState::hasTemperature ( )
inline

State::m_temperature is optional, so this getter returns true if State::m_temperature has been set properly.

Returns
True if State::m_temperature is set (optional).

◆ temperature()

const arma::vec& HeatTransferState::temperature ( ) const
inline

Temperature getter. This will throw an error if State::m_temperature is not set, since this is optional. Check State::hasTemperature() first if you want to be sure.

Returns
Temperature [K]

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