TransFlow  0.1.0
A transient pipeline flow simulation library
Pipeline Class Reference

Classes

class  State
 

Public Member Functions

 Pipeline (const arma::uword nGridPoints=100, const double length=100e3)
 Construct from number of grid points and pipeline length. More...
 
arma::uword size () const
 
BoundaryConditions getBoundaryConditions () const
 Get current inlet and outlet state as BoundaryConditions instance.
 
void enableBatchTracking ()
 Enable batch tracking. Also initializes the batch tracking state.
 
void initializeBatchTracking ()
 Initialize the batch tracking state.
 
void setLength (const double length)
 
arma::uword timestamp () const
 
arma::uword & timestamp ()
 
const Pipeline::Statestate () const
 
double length () const
 
const arma::vec & gridPoints () const
 
const arma::vec & diameter () const
 
const arma::vec & height () const
 
const arma::vec & elevation () const
 
const arma::vec & roughness () const
 
const arma::vec & burialDepth () const
 
const std::vector< PipeWall > & pipeWall () const
 
const std::vector< BurialMedium > & burialMedium () const
 
const std::vector< AmbientFluid > & ambientFluid () const
 
const arma::vec & flow () const
 
const arma::vec & pressure () const
 
const arma::vec & temperature () const
 
const std::vector< Composition > & composition () const
 
const arma::vec & heatCapacityConstantVolume () const
 
const arma::vec & heatCapacityConstantPressure () const
 
const arma::vec & density () const
 
const arma::vec & viscosity () const
 
const arma::vec & specificGasConstant () const
 
const arma::vec & molarMass () const
 
const arma::vec & compressibilityFactor () const
 
const arma::vec & dZdtAtConstantPressure () const
 
const arma::vec & dZdpAtConstantTemperature () const
 
const arma::vec & dZdtAtConstantDensity () const
 
const arma::vec & velocity () const
 
const arma::vec & frictionFactor () const
 
const arma::vec & reynoldsNumber () const
 
const arma::vec & ambientTemperature () const
 
const arma::vec & heatFlow () const
 
const std::vector< HeatTransferState > & heatTransferState () const
 
bool heatTransferIsInitialized () const
 
const BatchTrackingStatebatchTrackingState () const
 
bool batchTrackingIsInitialized () const
 
bool constantComposition () const
 
const arma::vec & inletComposition () const
 Get inlet composition.
 
const arma::vec & outletComposition () const
 Get outlet composition.
 
arma::vec & gridPoints ()
 
arma::vec & diameter ()
 
arma::vec & height ()
 
arma::vec & elevation ()
 
arma::vec & roughness ()
 
arma::vec & burialDepth ()
 
std::vector< PipeWall > & pipeWall ()
 
std::vector< BurialMedium > & burialMedium ()
 
std::vector< AmbientFluid > & ambientFluid ()
 
arma::vec & flow ()
 
arma::vec & pressure ()
 
arma::vec & temperature ()
 
arma::vec & heatCapacityConstantVolume ()
 
arma::vec & heatCapacityConstantPressure ()
 
arma::vec & density ()
 
arma::vec & viscosity ()
 
arma::vec & specificGasConstant ()
 
arma::vec & molarMass ()
 
arma::vec & compressibilityFactor ()
 
arma::vec & dZdtAtConstantPressure ()
 
arma::vec & dZdpAtConstantTemperature ()
 
arma::vec & dZdtAtConstantDensity ()
 
arma::vec & velocity ()
 
arma::vec & frictionFactor ()
 
arma::vec & reynoldsNumber ()
 
arma::vec & ambientTemperature ()
 
arma::vec & heatFlow ()
 
std::vector< HeatTransferState > & heatTransferState ()
 
bool & heatTransferIsInitialized ()
 
BatchTrackingStatebatchTrackingState ()
 
bool & batchTrackingIsInitialized ()
 
bool & constantComposition ()
 
void updateComposition (const std::vector< Composition > &composition)
 Set the composition. This also updates the batch tracking state to reflect the composition change. More...
 
void updateComposition (const Composition &composition)
 Set the composition of the whole pipeline. This also updates the batch tracking state to reflect the composition change. More...
 
void setCompositionUnsafe (const std::vector< Composition > &composition)
 Set the composition without updating batch tracking state. This is meant for internal use in Solver etc. More...
 

Private Member Functions

const Stateprop () const
 
Stateprop ()
 

Private Attributes

double m_length
 Total length [m].
 
arma::vec m_gridPoints
 Grid points [m].
 
arma::vec m_diameter
 Inner diameter [m].
 
arma::vec m_height
 Height profile/elevation [m].
 
arma::vec m_roughness
 Sand grain equivalent roughness [m].
 
arma::vec m_burialDepth
 Distance from burial medium to top of pipe [m].
 
std::vector< PipeWallm_pipeWall
 Pipe wall description.
 
std::vector< BurialMediumm_burialMedium
 Burial medium description.
 
std::vector< AmbientFluidm_ambientFluid
 Ambient fluid description.
 
bool m_constantComposition
 If we simulate using constant composition or not.
 
State m_state
 Pipeline::State instance with all properties like flow etc.
 
arma::uword m_timestamp = 0
 Current timestamp [s].
 

Constructor & Destructor Documentation

◆ Pipeline()

Pipeline::Pipeline ( const arma::uword  nGridPoints = 100,
const double  length = 100e3 
)

Construct from number of grid points and pipeline length.

Parameters
nGridPointsNumber of grid points
lengthTotal length [m]

Member Function Documentation

◆ setCompositionUnsafe()

void Pipeline::setCompositionUnsafe ( const std::vector< Composition > &  composition)

Set the composition without updating batch tracking state. This is meant for internal use in Solver etc.

Parameters
compositionNew composition at each grid point

◆ setLength()

void Pipeline::setLength ( const double  length)

Set the length of the pipeline. This updates the grid points and the batch tracking state.

◆ updateComposition() [1/2]

void Pipeline::updateComposition ( const Composition composition)

Set the composition of the whole pipeline. This also updates the batch tracking state to reflect the composition change.

Parameters
compositionNew composition (same for the whole pipeline)

◆ updateComposition() [2/2]

void Pipeline::updateComposition ( const std::vector< Composition > &  composition)

Set the composition. This also updates the batch tracking state to reflect the composition change.

Parameters
compositionNew composition at each grid point

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