Ignis
Loading...
Searching...
No Matches
streams Class Reference

#include <streams.h>

Public Member Functions

void getProdOfCompleteComb (const double mixf, std::vector< double > &ypcc, double &hpcc, double &Tpcc)
 
void getEquilibrium_HP (const double mixf, std::vector< double > &yeq, double &heq, double &Teq)
 
void getEquilibrium_TP (const double mixf, double Teq, std::vector< double > &yeq, double &heq)
 
void getMixingState (const double mixf, std::vector< double > &ymix, double &hmix, double &Tmix)
 
double getMixtureFraction (const double *y, const bool doBeta01=false)
 
 streams ()
 
 streams (std::shared_ptr< Cantera::Solution > csol, const double _P, const double _h0, const double _h1, const std::vector< double > &_y0, const std::vector< double > &_y1)
 
 ~streams ()
 

Public Attributes

double h0
 stream mixf=0 enthalpy (J/kg)
 
double h1
 stream mixf=1 enthalpy (J/kg)
 
std::vector< double > y0
 stream mixf=0 composition vector
 
std::vector< double > y1
 stream mixf=1 composition vector
 
double P
 
std::shared_ptr< Cantera::ThermoPhase > gas
 
double mixfStoic
 stoichiometric mixture fraction
 
int nspc
 number of species in gas mechanism
 
double beta0
 mixf = (beta-beta0) / (beta1-beta0)
 
double beta1
 mixf = (beta-beta0) / (beta1-beta0)
 
std::vector< double > gCHON
 gammas, as in beta = sum_i (y_i*gamma_i)
 

Private Member Functions

void setStoicMixf ()
 
std::vector< double > getElementMassFracs (const double *y)
 
std::vector< double > getElementMoleFracs (const double *y)
 
std::vector< double > getElementMoles (const double *x, double &nOnotFromO2, double &nHnotFromH2O, double &nCnotFromCO2)
 

Detailed Description

Class implementing streams for use in mixing and or reaction problems. This is writting in terms of mixture fraction with streams defined in an input file. The class can implement products of complete combustion, or equilibrium (through the Cantera IdealGasPhase object, if desired). This class holds a pointer to a Cantera IdealGasPhase object (defined up front in main) that computes thermodynamic, kinetic, and transport data.

Definition at line 20 of file streams.h.

Constructor & Destructor Documentation

◆ streams() [1/2]

streams::streams ( )
inline

Definition at line 81 of file streams.h.

◆ streams() [2/2]

streams::streams ( std::shared_ptr< Cantera::Solution >  csol,
const double  _P,
const double  _h0,
const double  _h1,
const std::vector< double > &  _y0,
const std::vector< double > &  _y1 
)

◆ ~streams()

streams::~streams ( )
inline

Definition at line 89 of file streams.h.

Member Function Documentation

◆ getProdOfCompleteComb()

void streams::getProdOfCompleteComb ( const double  mixf,
std::vector< double > &  ypcc,
double &  hpcc,
double &  Tpcc 
)

Computes the temperature, enthalpy, and composition of complete combustion at the given mixf. For nonpremixed flames (don't do anything funny, like have oxygen in the fuel stream)

Parameters
mixfinput: mixture fraction, defines elemental composition.
ypccoutput: mass fractions of products of complete combustion.
hpccoutput: enthalpy of products of complete combustion.
Tpccoutput: temperature of products of complete combustion.

Definition at line 135 of file streams.cc.

Here is the call graph for this function:

◆ getEquilibrium_HP()

void streams::getEquilibrium_HP ( const double  mixf,
std::vector< double > &  yeq,
double &  heq,
double &  Teq 
)

Computes the temperature, enthalpy, and composition of equilibrium at the given mixf.

Parameters
mixfinput: mixture fraction, defines elemental composition.
yeqoutput: mass fractions
heqoutput: enthalpy
Teqoutput: temperature

Definition at line 76 of file streams.cc.

◆ getEquilibrium_TP()

void streams::getEquilibrium_TP ( const double  mixf,
double  Teq,
std::vector< double > &  yeq,
double &  heq 
)

Computes the enthalpy, and composition of equilibrium at the given mixf for given T

Parameters
mixfinput: mixture fraction, defines elemental composition.
Teqinput: temperature
yeqoutput: mass fractions
heqoutput: enthalpy

Definition at line 106 of file streams.cc.

◆ getMixingState()

void streams::getMixingState ( const double  mixf,
std::vector< double > &  ymix,
double &  hmix,
double &  Tmix 
)

Computes the temperature, enthalpy, and composition of mixing among streams.

Parameters
mixfinput: mixture fraction, defines elemental composition.
ymixoutput: mass fractions of products of complete combustion.
hmixoutput: enthalpy of products of complete combustion.
Tmixoutput: temperature of products of complete combustion.

Definition at line 53 of file streams.cc.

◆ getMixtureFraction()

double streams::getMixtureFraction ( const double *  y,
const bool  doBeta01 = false 
)

Compute the mixture fraction from the mass fractions using Bilger's mixf. Set doBeta01=true on first call to initialize members beta0, beta1. Later calls of this function only use the first parameter.

Parameters
yinput: vector of species mass fractions.
doBeta01input: flag=true on first call to set members beta0, beta1.
Returns
mixture fraction

Definition at line 337 of file streams.cc.

Here is the call graph for this function:

◆ setStoicMixf()

void streams::setStoicMixf ( )
private

Set the stoichiometric mixture fraction using Bilger's definition *‍/

Definition at line 238 of file streams.cc.

Here is the call graph for this function:

◆ getElementMassFracs()

vector< double > streams::getElementMassFracs ( const double *  y)
private

Sets the elements to have the correct Mass Fractions based on the specified array.

Parameters
yinput: mass fraction array to use to get corresponding element fractions.
Returns
vector of element mass fractions.

Definition at line 275 of file streams.cc.

Here is the caller graph for this function:

◆ getElementMoleFracs()

std::vector< double > streams::getElementMoleFracs ( const double *  y)
private

◆ getElementMoles()

vector< double > streams::getElementMoles ( const double *  x,
double &  nOnotFromO2,
double &  nHnotFromH2O,
double &  nCnotFromCO2 
)
private

Get amount of moles for each element.

Parameters
xinput: pointer to vector of species mole fractions.
nOnotFromO2input: number of moles of oxygen not from O2 (oxygen in the base fuel).
nHnotFromH2Oinput: number of moles of hydrogen not from H2O.
nCnotFromCO2input: number of moles of carbon not from CO2.
Returns
vector of element moles.

Definition at line 295 of file streams.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ h0

double streams::h0

stream mixf=0 enthalpy (J/kg)

Definition at line 26 of file streams.h.

◆ h1

double streams::h1

stream mixf=1 enthalpy (J/kg)

Definition at line 27 of file streams.h.

◆ y0

std::vector<double> streams::y0

stream mixf=0 composition vector

Definition at line 28 of file streams.h.

◆ y1

std::vector<double> streams::y1

stream mixf=1 composition vector

Definition at line 29 of file streams.h.

◆ P

double streams::P

Definition at line 31 of file streams.h.

◆ gas

std::shared_ptr<Cantera::ThermoPhase> streams::gas

Definition at line 33 of file streams.h.

◆ mixfStoic

double streams::mixfStoic

stoichiometric mixture fraction

Definition at line 35 of file streams.h.

◆ nspc

int streams::nspc

number of species in gas mechanism

Definition at line 36 of file streams.h.

◆ beta0

double streams::beta0

mixf = (beta-beta0) / (beta1-beta0)

Definition at line 37 of file streams.h.

◆ beta1

double streams::beta1

mixf = (beta-beta0) / (beta1-beta0)

Definition at line 38 of file streams.h.

◆ gCHON

std::vector<double> streams::gCHON

gammas, as in beta = sum_i (y_i*gamma_i)

Definition at line 40 of file streams.h.


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