Cantera  3.1.0a1

This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemically-reacting, axisymmetric flows. More...

#include <StFlow.h>

Inheritance diagram for StFlow:
[legend]

Detailed Description

This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemically-reacting, axisymmetric flows.

Definition at line 44 of file StFlow.h.

Public Member Functions

 StFlow (ThermoPhase *ph=0, size_t nsp=1, size_t points=1)
 Create a new flow domain. More...
 
 StFlow (shared_ptr< ThermoPhase > th, size_t nsp=1, size_t points=1)
 Delegating constructor. More...
 
 StFlow (shared_ptr< Solution > sol, const string &id="", size_t points=1)
 Create a new flow domain. More...
 
string domainType () const override
 Domain type flag. More...
 
string componentName (size_t n) const override
 Name of the nth component. May be overloaded. More...
 
size_t componentIndex (const string &name) const override
 index of component with name name. More...
 
virtual bool componentActive (size_t n) const
 Returns true if the specified component is an active part of the solver state. More...
 
void show (const double *x) override
 Print the solution. More...
 
shared_ptr< SolutionArrayasArray (const double *soln) const override
 Save the state of this domain as a SolutionArray. More...
 
void fromArray (SolutionArray &arr, double *soln) override
 Restore the solution for this domain from a SolutionArray. More...
 
void setFreeFlow ()
 Set flow configuration for freely-propagating flames, using an internal point with a fixed temperature as the condition to determine the inlet mass flux. More...
 
void setAxisymmetricFlow ()
 Set flow configuration for axisymmetric counterflow flames, using specified inlet mass fluxes. More...
 
void setUnstrainedFlow ()
 Set flow configuration for burner-stabilized flames, using specified inlet mass fluxes. More...
 
void solveEnergyEqn (size_t j=npos)
 
virtual size_t getSolvingStage () const
 Get the solving stage (used by IonFlow specialization) More...
 
virtual void setSolvingStage (const size_t stage)
 Solving stage mode for handling ionized species (used by IonFlow specialization) More...
 
virtual void solveElectricField (size_t j=npos)
 Set to solve electric field in a point (used by IonFlow specialization) More...
 
virtual void fixElectricField (size_t j=npos)
 Set to fix voltage in a point (used by IonFlow specialization) More...
 
virtual bool doElectricField (size_t j) const
 Retrieve flag indicating whether electric field is solved or not (used by IonFlow specialization) More...
 
void enableRadiation (bool doRadiation)
 Turn radiation on / off. More...
 
bool radiationEnabled () const
 Returns true if the radiation term in the energy equation is enabled. More...
 
double radiativeHeatLoss (size_t j) const
 Return radiative heat loss at grid point j. More...
 
void setBoundaryEmissivities (double e_left, double e_right)
 Set the emissivities for the boundary values. More...
 
double leftEmissivity () const
 Return emissivity at left boundary. More...
 
double rightEmissivity () const
 Return emissivity at right boundary. More...
 
void fixTemperature (size_t j=npos)
 
bool doEnergy (size_t j)
 
void resize (size_t components, size_t points) override
 Change the grid size. Called after grid refinement. More...
 
void setGas (const double *x, size_t j)
 Set the gas object state to be consistent with the solution at point j. More...
 
void setGasAtMidpoint (const double *x, size_t j)
 Set the gas state to be consistent with the solution at the midpoint between j and j + 1. More...
 
double density (size_t j) const
 
bool isFree () const
 Retrieve flag indicating whether flow is freely propagating. More...
 
bool isStrained () const
 Retrieve flag indicating whether flow uses radial momentum. More...
 
void setViscosityFlag (bool dovisc)
 
void eval (size_t jGlobal, double *xGlobal, double *rsdGlobal, integer *diagGlobal, double rdt) override
 Evaluate the residual functions for axisymmetric stagnation flow. More...
 
size_t leftExcessSpecies () const
 Index of the species on the left boundary with the largest mass fraction. More...
 
size_t rightExcessSpecies () const
 Index of the species on the right boundary with the largest mass fraction. More...
 
Problem Specification
void setupGrid (size_t n, const double *z) override
 called to set up initial grid, and after grid refinement More...
 
void resetBadValues (double *xg) override
 When called, this function should reset "bad" values in the state vector such as negative species concentrations. More...
 
ThermoPhasephase ()
 
Kineticskinetics ()
 
void setKinetics (shared_ptr< Kinetics > kin) override
 Set the kinetics manager. More...
 
void setTransport (shared_ptr< Transport > trans) override
 Set transport model to existing instance. More...
 
void setTransportModel (const string &trans)
 Set the transport model. More...
 
string transportModel () const
 Retrieve transport model. More...
 
void enableSoret (bool withSoret)
 Enable thermal diffusion, also known as Soret diffusion. More...
 
bool withSoret () const
 
void setPressure (double p)
 Set the pressure. More...
 
double pressure () const
 The current pressure [Pa]. More...
 
void _getInitialSoln (double *x) override
 Write the initial solution estimate into array x. More...
 
void _finalize (const double *x) override
 In some cases, a domain may need to set parameters that depend on the initial solution estimate. More...
 
void setFixedTempProfile (vector< double > &zfixed, vector< double > &tfixed)
 Sometimes it is desired to carry out the simulation using a specified temperature profile, rather than computing it by solving the energy equation. More...
 
void setTemperature (size_t j, double t)
 Set the temperature fixed point at grid point j, and disable the energy equation so that the solution will be held to this value. More...
 
double T_fixed (size_t j) const
 The fixed temperature value at point j. More...
 
- Public Member Functions inherited from Domain1D
 Domain1D (size_t nv=1, size_t points=1, double time=0.0)
 Constructor. More...
 
 Domain1D (const Domain1D &)=delete
 
Domain1Doperator= (const Domain1D &)=delete
 
string type () const
 String indicating the domain implemented. More...
 
size_t domainIndex ()
 The left-to-right location of this domain. More...
 
virtual bool isConnector ()
 True if the domain is a connector domain. More...
 
void setSolution (shared_ptr< Solution > sol)
 Set the solution manager. More...
 
const OneDimcontainer () const
 The container holding this domain. More...
 
void setContainer (OneDim *c, size_t index)
 Specify the container object for this domain, and the position of this domain in the list. More...
 
void setBandwidth (int bw=-1)
 Set the Jacobian bandwidth. See the discussion of method bandwidth(). More...
 
size_t bandwidth ()
 Set the Jacobian bandwidth for this domain. More...
 
virtual void init ()
 Initialize. More...
 
virtual void setInitialState (double *xlocal=0)
 
virtual void setState (size_t point, const double *state, double *x)
 
Refinerrefiner ()
 Return a reference to the grid refiner. More...
 
size_t nComponents () const
 Number of components at each grid point. More...
 
void checkComponentIndex (size_t n) const
 Check that the specified component index is in range. More...
 
void checkComponentArraySize (size_t nn) const
 Check that an array size is at least nComponents(). More...
 
size_t nPoints () const
 Number of grid points in this domain. More...
 
void checkPointIndex (size_t n) const
 Check that the specified point index is in range. More...
 
void checkPointArraySize (size_t nn) const
 Check that an array size is at least nPoints(). More...
 
void setComponentName (size_t n, const string &name)
 
void setBounds (size_t n, double lower, double upper)
 
void setTransientTolerances (double rtol, double atol, size_t n=npos)
 Set tolerances for time-stepping mode. More...
 
void setSteadyTolerances (double rtol, double atol, size_t n=npos)
 Set tolerances for steady-state mode. More...
 
double rtol (size_t n)
 Relative tolerance of the nth component. More...
 
double atol (size_t n)
 Absolute tolerance of the nth component. More...
 
double steady_rtol (size_t n)
 Steady relative tolerance of the nth component. More...
 
double steady_atol (size_t n)
 Steady absolute tolerance of the nth component. More...
 
double transient_rtol (size_t n)
 Transient relative tolerance of the nth component. More...
 
double transient_atol (size_t n)
 Transient absolute tolerance of the nth component. More...
 
double upperBound (size_t n) const
 Upper bound on the nth component. More...
 
double lowerBound (size_t n) const
 Lower bound on the nth component. More...
 
void initTimeInteg (double dt, const double *x0)
 Prepare to do time stepping with time step dt. More...
 
void setSteadyMode ()
 Prepare to solve the steady-state problem. More...
 
bool steady ()
 True if in steady-state mode. More...
 
bool transient ()
 True if not in steady-state mode. More...
 
void needJacUpdate ()
 Set this if something has changed in the governing equations (for example, the value of a constant has been changed, so that the last-computed Jacobian is no longer valid. More...
 
size_t index (size_t n, size_t j) const
 
double value (const double *x, size_t n, size_t j) const
 
virtual void setJac (MultiJac *jac)
 
shared_ptr< SolutionArraytoArray (bool normalize=false) const
 Save the state of this domain to a SolutionArray. More...
 
void fromArray (const shared_ptr< SolutionArray > &arr)
 Restore the solution for this domain from a SolutionArray. More...
 
shared_ptr< Solutionsolution () const
 Return thermo/kinetics/transport manager used in the domain. More...
 
size_t size () const
 
void locate ()
 Find the index of the first grid point in this domain, and the start of its variables in the global solution vector. More...
 
virtual size_t loc (size_t j=0) const
 Location of the start of the local solution vector in the global solution vector,. More...
 
size_t firstPoint () const
 The index of the first (that is, left-most) grid point belonging to this domain. More...
 
size_t lastPoint () const
 The index of the last (that is, right-most) grid point belonging to this domain. More...
 
void linkLeft (Domain1D *left)
 Set the left neighbor to domain 'left. More...
 
void linkRight (Domain1D *right)
 Set the right neighbor to domain 'right.'. More...
 
void append (Domain1D *right)
 Append domain 'right' to this one, and update all links. More...
 
Domain1Dleft () const
 Return a pointer to the left neighbor. More...
 
Domain1Dright () const
 Return a pointer to the right neighbor. More...
 
double prevSoln (size_t n, size_t j) const
 Value of component n at point j in the previous solution. More...
 
void setID (const string &s)
 Specify an identifying tag for this domain. More...
 
string id () const
 
virtual void show (std::ostream &s, const double *x)
 Print the solution. More...
 
double z (size_t jlocal) const
 
double zmin () const
 
double zmax () const
 
void setProfile (const string &name, double *values, double *soln)
 
vector< double > & grid ()
 
const vector< double > & grid () const
 
double grid (size_t point) const
 
virtual double initialValue (size_t n, size_t j)
 Initial value of solution component n at grid point j. More...
 
void forceFullUpdate (bool update)
 In some cases, for computational efficiency some properties (such as transport coefficients) may not be updated during Jacobian evaluations. More...
 
void setData (shared_ptr< vector< double >> &data)
 Set shared data pointer. More...
 

Public Attributes

double m_zfixed = Undef
 Location of the point where temperature is fixed. More...
 
double m_tfixed = -1.0
 Temperature at the point used to fix the flame location. More...
 

Protected Member Functions

AnyMap getMeta () const override
 Retrieve meta data. More...
 
void setMeta (const AnyMap &state) override
 Retrieve meta data. More...
 
double wdot (size_t k, size_t j) const
 
virtual void updateProperties (size_t jg, double *x, size_t jmin, size_t jmax)
 Update the properties (thermo, transport, and diffusion flux). More...
 
void computeRadiation (double *x, size_t jmin, size_t jmax)
 Computes the radiative heat loss vector over points jmin to jmax and stores the data in the qdotRadiation variable. More...
 
virtual void evalContinuity (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the continuity equation residual. More...
 
virtual void evalMomentum (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the momentum equation residual. More...
 
virtual void evalLambda (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the lambda equation residual. More...
 
virtual void evalEnergy (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the energy equation residual. More...
 
virtual void evalSpecies (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the species equations' residuals. More...
 
virtual void evalElectricField (double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
 Evaluate the electric field equation residual to be zero everywhere. More...
 
void updateThermo (const double *x, size_t j0, size_t j1)
 Update the thermodynamic properties from point j0 to point j1 (inclusive), based on solution x. More...
 
double shear (const double *x, size_t j) const
 
double divHeatFlux (const double *x, size_t j) const
 
size_t mindex (size_t k, size_t j, size_t m)
 
virtual void updateDiffFluxes (const double *x, size_t j0, size_t j1)
 Update the diffusive mass fluxes. More...
 
virtual void grad_hk (const double *x, size_t j)
 Get the gradient of species specific molar enthalpies. More...
 
virtual void updateTransport (double *x, size_t j0, size_t j1)
 Update the transport properties at grid points in the range from j0 to j1, based on solution x. More...
 
Solution components
double T (const double *x, size_t j) const
 
double & T (double *x, size_t j)
 
double T_prev (size_t j) const
 
double rho_u (const double *x, size_t j) const
 
double u (const double *x, size_t j) const
 
double V (const double *x, size_t j) const
 
double V_prev (size_t j) const
 
double lambda (const double *x, size_t j) const
 
double Y (const double *x, size_t k, size_t j) const
 
double & Y (double *x, size_t k, size_t j)
 
double Y_prev (size_t k, size_t j) const
 
double X (const double *x, size_t k, size_t j) const
 
double flux (size_t k, size_t j) const
 
convective spatial derivatives.

These use upwind differencing, assuming u(z) is negative

double dVdz (const double *x, size_t j) const
 
double dYdz (const double *x, size_t k, size_t j) const
 
double dTdz (const double *x, size_t j) const
 

Protected Attributes

double m_press = -1.0
 
vector< double > m_dz
 
vector< double > m_rho
 
vector< double > m_wtm
 
vector< double > m_wt
 
vector< double > m_cp
 
vector< double > m_visc
 
vector< double > m_tcon
 
vector< double > m_diff
 Array of size m_nsp by m_points for saving density times diffusion coefficient times species molar mass divided by mean molecular weight. More...
 
vector< double > m_multidiff
 
Array2D m_dthermal
 
Array2D m_flux
 
Array2D m_hk
 Array of size m_nsp by m_points for saving molar enthalpies. More...
 
Array2D m_dhk_dz
 Array of size m_nsp by m_points-1 for saving enthalpy fluxes. More...
 
Array2D m_wdot
 
size_t m_nsp
 Number of species in the mechanism. More...
 
ThermoPhasem_thermo = nullptr
 
Kineticsm_kin = nullptr
 
Transportm_trans = nullptr
 
double m_epsilon_left = 0.0
 
double m_epsilon_right = 0.0
 
vector< size_t > m_kRadiating
 Indices within the ThermoPhase of the radiating species. More...
 
vector< bool > m_do_energy
 
bool m_do_soret = false
 
vector< bool > m_do_species
 
bool m_do_multicomponent = false
 
bool m_do_radiation = false
 flag for the radiative heat loss More...
 
vector< double > m_qdotRadiation
 radiative heat loss vector More...
 
vector< double > m_fixedtemp
 
vector< double > m_zfix
 
vector< double > m_tfix
 
size_t m_kExcessLeft = 0
 Index of species with a large mass fraction at each boundary, for which the mass fraction may be calculated as 1 minus the sum of the other mass fractions. More...
 
size_t m_kExcessRight = 0
 
bool m_dovisc
 
bool m_isFree
 
bool m_usesLambda
 
- Protected Attributes inherited from Domain1D
shared_ptr< vector< double > > m_state
 data pointer shared from OneDim More...
 
double m_rdt = 0.0
 
size_t m_nv = 0
 
size_t m_points
 Number of grid points. More...
 
vector< double > m_slast
 
vector< double > m_max
 
vector< double > m_min
 
vector< double > m_rtol_ss
 
vector< double > m_rtol_ts
 
vector< double > m_atol_ss
 
vector< double > m_atol_ts
 
vector< double > m_z
 
OneDimm_container = nullptr
 
size_t m_index
 
size_t m_iloc = 0
 Starting location within the solution vector for unknowns that correspond to this domain. More...
 
size_t m_jstart = 0
 
Domain1Dm_left = nullptr
 
Domain1Dm_right = nullptr
 
string m_id
 Identity tag for the domain. More...
 
unique_ptr< Refinerm_refiner
 
vector< string > m_name
 
int m_bw = -1
 
bool m_force_full_update = false
 
shared_ptr< Solutionm_solution
 Composite thermo/kinetics/transport handler. More...
 

Private Attributes

vector< double > m_ybar
 

Constructor & Destructor Documentation

◆ StFlow() [1/3]

StFlow ( ThermoPhase ph = 0,
size_t  nsp = 1,
size_t  points = 1 
)

Create a new flow domain.

Parameters
phObject representing the gas phase. This object will be used to evaluate all thermodynamic, kinetic, and transport properties.
nspNumber of species.
pointsInitial number of grid points

Definition at line 19 of file StFlow.cpp.

◆ StFlow() [2/3]

StFlow ( shared_ptr< ThermoPhase th,
size_t  nsp = 1,
size_t  points = 1 
)

Delegating constructor.

Definition at line 92 of file StFlow.cpp.

◆ StFlow() [3/3]

StFlow ( shared_ptr< Solution sol,
const string &  id = "",
size_t  points = 1 
)

Create a new flow domain.

Parameters
solSolution object used to evaluate all thermodynamic, kinetic, and transport properties
idname of flow domain
pointsinitial number of grid points

Definition at line 99 of file StFlow.cpp.

Member Function Documentation

◆ domainType()

string domainType ( ) const
overridevirtual

Domain type flag.

Since
Starting in Cantera 3.1, the return type is a string.

Reimplemented from Domain1D.

Definition at line 124 of file StFlow.cpp.

◆ setupGrid()

void setupGrid ( size_t  n,
const double *  z 
)
overridevirtual

called to set up initial grid, and after grid refinement

Reimplemented from Domain1D.

Definition at line 186 of file StFlow.cpp.

◆ resetBadValues()

void resetBadValues ( double *  xg)
overridevirtual

When called, this function should reset "bad" values in the state vector such as negative species concentrations.

This function may be called after a failed solution attempt.

Reimplemented from Domain1D.

Definition at line 201 of file StFlow.cpp.

◆ setKinetics()

void setKinetics ( shared_ptr< Kinetics kin)
overridevirtual

Set the kinetics manager.

Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 134 of file StFlow.cpp.

◆ setTransport()

void setTransport ( shared_ptr< Transport trans)
overridevirtual

Set transport model to existing instance.

Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 140 of file StFlow.cpp.

◆ setTransportModel()

void setTransportModel ( const string &  trans)

Set the transport model.

Since
New in Cantera 3.0.

Definition at line 211 of file StFlow.cpp.

◆ transportModel()

string transportModel ( ) const

Retrieve transport model.

Since
New in Cantera 3.0.

Definition at line 216 of file StFlow.cpp.

◆ enableSoret()

void enableSoret ( bool  withSoret)
inline

Enable thermal diffusion, also known as Soret diffusion.

Requires that multicomponent transport properties be enabled to carry out calculations.

Definition at line 102 of file StFlow.h.

◆ setPressure()

void setPressure ( double  p)
inline

Set the pressure.

Since the flow equations are for the limit of small Mach number, the pressure is very nearly constant throughout the flow.

Definition at line 111 of file StFlow.h.

◆ pressure()

double pressure ( ) const
inline

The current pressure [Pa].

Definition at line 116 of file StFlow.h.

◆ _getInitialSoln()

void _getInitialSoln ( double *  x)
overridevirtual

Write the initial solution estimate into array x.

Reimplemented from Domain1D.

Definition at line 220 of file StFlow.cpp.

◆ _finalize()

void _finalize ( const double *  x)
overridevirtual

In some cases, a domain may need to set parameters that depend on the initial solution estimate.

In such cases, the parameters may be set in method _finalize. This method is called just before the Newton solver is called, and the x array is guaranteed to be the local solution vector for this domain that will be used as the initial guess. If no such parameters need to be set, then method _finalize does not need to be overloaded.

Reimplemented from Domain1D.

Definition at line 249 of file StFlow.cpp.

◆ setFixedTempProfile()

void setFixedTempProfile ( vector< double > &  zfixed,
vector< double > &  tfixed 
)
inline

Sometimes it is desired to carry out the simulation using a specified temperature profile, rather than computing it by solving the energy equation.

This method specifies this profile.

Definition at line 128 of file StFlow.h.

◆ setTemperature()

void setTemperature ( size_t  j,
double  t 
)
inline

Set the temperature fixed point at grid point j, and disable the energy equation so that the solution will be held to this value.

Definition at line 137 of file StFlow.h.

◆ T_fixed()

double T_fixed ( size_t  j) const
inline

The fixed temperature value at point j.

Definition at line 143 of file StFlow.h.

◆ componentName()

string componentName ( size_t  n) const
overridevirtual

Name of the nth component. May be overloaded.

Reimplemented from Domain1D.

Definition at line 700 of file StFlow.cpp.

◆ componentIndex()

size_t componentIndex ( const string &  name) const
overridevirtual

index of component with name name.

Reimplemented from Domain1D.

Definition at line 722 of file StFlow.cpp.

◆ componentActive()

bool componentActive ( size_t  n) const
virtual

Returns true if the specified component is an active part of the solver state.

Reimplemented in IonFlow.

Definition at line 745 of file StFlow.cpp.

◆ show()

void show ( const double *  x)
overridevirtual

Print the solution.

Reimplemented from Domain1D.

Definition at line 643 of file StFlow.cpp.

◆ asArray()

shared_ptr< SolutionArray > asArray ( const double *  soln) const
overridevirtual

Save the state of this domain as a SolutionArray.

Parameters
solnlocal solution vector for this domain
Todo:
Despite the method's name, data are copied; the intent is to access data directly in future revisions, where a non-const version will be implemented.
Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 808 of file StFlow.cpp.

◆ fromArray()

void fromArray ( SolutionArray arr,
double *  soln 
)
overridevirtual

Restore the solution for this domain from a SolutionArray.

Parameters
[in]arrSolutionArray defining the state of this domain
[out]solnValue of the solution vector, local to this domain
Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 842 of file StFlow.cpp.

◆ setFreeFlow()

void setFreeFlow ( )
inline

Set flow configuration for freely-propagating flames, using an internal point with a fixed temperature as the condition to determine the inlet mass flux.

Definition at line 164 of file StFlow.h.

◆ setAxisymmetricFlow()

void setAxisymmetricFlow ( )
inline

Set flow configuration for axisymmetric counterflow flames, using specified inlet mass fluxes.

Definition at line 172 of file StFlow.h.

◆ setUnstrainedFlow()

void setUnstrainedFlow ( )
inline

Set flow configuration for burner-stabilized flames, using specified inlet mass fluxes.

Definition at line 180 of file StFlow.h.

◆ getSolvingStage()

size_t getSolvingStage ( ) const
virtual

Get the solving stage (used by IonFlow specialization)

Since
New in Cantera 3.0

Reimplemented in IonFlow.

Definition at line 952 of file StFlow.cpp.

◆ setSolvingStage()

void setSolvingStage ( const size_t  stage)
virtual

Solving stage mode for handling ionized species (used by IonFlow specialization)

  • stage=1: the fluxes of charged species are set to zero
  • stage=2: the electric field equation is solved, and the drift flux for ionized species is evaluated

Reimplemented in IonFlow.

Definition at line 958 of file StFlow.cpp.

◆ solveElectricField()

void solveElectricField ( size_t  j = npos)
virtual

Set to solve electric field in a point (used by IonFlow specialization)

Reimplemented in IonFlow.

Definition at line 964 of file StFlow.cpp.

◆ fixElectricField()

void fixElectricField ( size_t  j = npos)
virtual

Set to fix voltage in a point (used by IonFlow specialization)

Reimplemented in IonFlow.

Definition at line 970 of file StFlow.cpp.

◆ doElectricField()

bool doElectricField ( size_t  j) const
virtual

Retrieve flag indicating whether electric field is solved or not (used by IonFlow specialization)

Reimplemented in IonFlow.

Definition at line 976 of file StFlow.cpp.

◆ enableRadiation()

void enableRadiation ( bool  doRadiation)
inline

Turn radiation on / off.

Definition at line 209 of file StFlow.h.

◆ radiationEnabled()

bool radiationEnabled ( ) const
inline

Returns true if the radiation term in the energy equation is enabled.

Definition at line 214 of file StFlow.h.

◆ radiativeHeatLoss()

double radiativeHeatLoss ( size_t  j) const
inline

Return radiative heat loss at grid point j.

Definition at line 219 of file StFlow.h.

◆ setBoundaryEmissivities()

void setBoundaryEmissivities ( double  e_left,
double  e_right 
)

Set the emissivities for the boundary values.

Reads the emissivities for the left and right boundary values in the radiative term and writes them into the variables, which are used for the calculation.

Definition at line 982 of file StFlow.cpp.

◆ leftEmissivity()

double leftEmissivity ( ) const
inline

Return emissivity at left boundary.

Definition at line 232 of file StFlow.h.

◆ rightEmissivity()

double rightEmissivity ( ) const
inline

Return emissivity at right boundary.

Definition at line 235 of file StFlow.h.

◆ resize()

void resize ( size_t  components,
size_t  points 
)
overridevirtual

Change the grid size. Called after grid refinement.

Reimplemented from Domain1D.

Definition at line 160 of file StFlow.cpp.

◆ setGas()

void setGas ( const double *  x,
size_t  j 
)

Set the gas object state to be consistent with the solution at point j.

Definition at line 229 of file StFlow.cpp.

◆ setGasAtMidpoint()

void setGasAtMidpoint ( const double *  x,
size_t  j 
)

Set the gas state to be consistent with the solution at the midpoint between j and j + 1.

Definition at line 237 of file StFlow.cpp.

◆ isFree()

bool isFree ( ) const
inline

Retrieve flag indicating whether flow is freely propagating.

The flow is unstrained and the axial mass flow rate is not specified. For free flame propagation, the axial velocity is determined by the solver.

Since
New in Cantera 3.0

Definition at line 263 of file StFlow.h.

◆ isStrained()

bool isStrained ( ) const
inline

Retrieve flag indicating whether flow uses radial momentum.

If true, radial momentum equation for \( V \) as well as \( d\Lambda/dz = 0 \) are solved; if false, \( \Lambda(z) = 0 \) and \( V(z) = 0 \) by definition.

Since
New in Cantera 3.0

Definition at line 274 of file StFlow.h.

◆ eval()

void eval ( size_t  jGlobal,
double *  xGlobal,
double *  rsdGlobal,
integer *  diagGlobal,
double  rdt 
)
overridevirtual

Evaluate the residual functions for axisymmetric stagnation flow.

If jGlobal == npos, the residual function is evaluated at all grid points. Otherwise, the residual function is only evaluated at grid points j-1, j, and j+1. This option is used to efficiently evaluate the Jacobian numerically.

These residuals at all the boundary grid points are evaluated using a default boundary condition that may be modified by a boundary object that is attached to the domain. The boundary object connected will modify these equations by subtracting the boundary object's values for V, T, mdot, etc. As a result, these residual equations will force the solution variables to the values of the connected boundary object.

Parameters
jGlobalGlobal grid point at which to update the residual
[in]xGlobalGlobal state vector
[out]rsdGlobalGlobal residual vector
[out]diagGlobalGlobal boolean mask indicating whether each solution component has a time derivative (1) or not (0).
[in]rdtReciprocal of the timestep (rdt=0 implies steady-state.)

Reimplemented from Domain1D.

Definition at line 296 of file StFlow.cpp.

◆ leftExcessSpecies()

size_t leftExcessSpecies ( ) const
inline

Index of the species on the left boundary with the largest mass fraction.

Definition at line 306 of file StFlow.h.

◆ rightExcessSpecies()

size_t rightExcessSpecies ( ) const
inline

Index of the species on the right boundary with the largest mass fraction.

Definition at line 311 of file StFlow.h.

◆ getMeta()

AnyMap getMeta ( ) const
overrideprotectedvirtual

Retrieve meta data.

Reimplemented from Domain1D.

Definition at line 759 of file StFlow.cpp.

◆ setMeta()

void setMeta ( const AnyMap meta)
overrideprotectedvirtual

Retrieve meta data.

Reimplemented from Domain1D.

Definition at line 872 of file StFlow.cpp.

◆ updateProperties()

void updateProperties ( size_t  jg,
double *  x,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Update the properties (thermo, transport, and diffusion flux).

This function is called in eval after the points which need to be updated are defined.

Definition at line 334 of file StFlow.cpp.

◆ computeRadiation()

void computeRadiation ( double *  x,
size_t  jmin,
size_t  jmax 
)
protected

Computes the radiative heat loss vector over points jmin to jmax and stores the data in the qdotRadiation variable.

The simple radiation model used was established by Liu and Rogg [21]. This model considers the radiation of CO2 and H2O.

This model uses the optically thin limit and the gray-gas approximation to simply calculate a volume specified heat flux out of the Planck absorption coefficients, the boundary emissivities and the temperature. Polynomial lines calculate the species Planck coefficients for H2O and CO2. The data for the lines are taken from the RADCAL program [8]. The coefficients for the polynomials are taken from TNF Workshop material.

Definition at line 358 of file StFlow.cpp.

◆ evalContinuity()

void evalContinuity ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the continuity equation residual.

This function calculates the residual of the continuity equation

\[ \frac{d(\rho u)}{dz} + 2\rho V = 0 \]

Axisymmetric flame: The continuity equation propagates information from right-to-left. The \( \rho u \) at point 0 is dependent on \( \rho u \) at point 1, but not on \( \dot{m} \) from the inlet.

Freely-propagating flame: The continuity equation propagates information away from a fixed temperature point that is set in the domain.

Unstrained flame: A specified mass flux; the main example being burner-stabilized flames.

The default boundary condition for the continuity equation is ( \( u = 0 \)) at the left and right boundary.

Parameters
[in]xLocal domain state vector, includes variables like temperature, density, etc.
[out]rsdLocal domain residual vector that stores the continuity equation residuals.
[out]diagLocal domain diagonal matrix that controls whether an entry has a time-derivative (used by the solver).
[in]rdtReciprocal of the timestep.
[in]jminThe index for the starting point in the local domain grid.
[in]jmaxThe index for the ending point in the local domain grid.

Definition at line 405 of file StFlow.cpp.

◆ evalMomentum()

void evalMomentum ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the momentum equation residual.

The function calculates the radial momentum equation defined as

\[ \rho u \frac{dV}{dz} + \rho V^2 = \frac{d}{dz}\left( \mu \frac{dV}{dz} \right) - \Lambda \]

The radial momentum equation is used for axisymmetric flows, and incorporates terms for time and spatial variations of radial velocity ( \( V \)). The default boundary condition is zero radial velocity ( \( V \)) at the left and right boundary.

For argument explanation, see evalContinuity().

Definition at line 462 of file StFlow.cpp.

◆ evalLambda()

void evalLambda ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the lambda equation residual.

The function calculates the lambda equation as

\[ \frac{d\Lambda}{dz} = 0 \]

The lambda equation serves as an eigenvalue that allows the momentum equation and continuity equations to be simultaneously satisfied in axisymmetric flows. The lambda equation propagates information from left-to-right. The default boundary condition is \( \Lambda = 0 \) at the left and zero flux at the right boundary.

For argument explanation, see evalContinuity().

Definition at line 494 of file StFlow.cpp.

◆ evalEnergy()

void evalEnergy ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the energy equation residual.

The function calculates the energy equation:

\[ \rho c_p u \frac{dT}{dz} = \frac{d}{dz}\left( \lambda \frac{dT}{dz} \right) - \sum_k h_kW_k\dot{\omega}_k - \sum_k j_k \frac{dh_k}{dz} \]

The energy equation includes contributions from chemical reactions and diffusion. Default is zero temperature ( \( T \)) at the left and right boundaries. These boundary values are updated by the specific boundary object connected to the domain.

For argument explanation, see evalContinuity().

Definition at line 522 of file StFlow.cpp.

◆ evalSpecies()

void evalSpecies ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the species equations' residuals.

The function calculates the species equations as

\[ \rho u \frac{dY_k}{dz} + \frac{dj_k}{dz} = W_k\dot{\omega}_k \]

The species equations include terms for temporal and spatial variations of species mass fractions ( \( Y_k \)). The default boundary condition is zero flux for species at the left and right boundary.

For argument explanation, see evalContinuity().

Reimplemented in IonFlow.

Definition at line 560 of file StFlow.cpp.

◆ evalElectricField()

void evalElectricField ( double *  x,
double *  rsd,
int *  diag,
double  rdt,
size_t  jmin,
size_t  jmax 
)
protectedvirtual

Evaluate the electric field equation residual to be zero everywhere.

The electric field equation is implemented in the IonFlow class. The default boundary condition is zero electric field ( \( E \)) at the boundary, and \( E \) is zero within the domain.

For argument explanation, see evalContinuity().

Reimplemented in IonFlow.

Definition at line 599 of file StFlow.cpp.

◆ updateThermo()

void updateThermo ( const double *  x,
size_t  j0,
size_t  j1 
)
inlineprotected

Update the thermodynamic properties from point j0 to point j1 (inclusive), based on solution x.

The gas state is set to be consistent with the solution at the points from j0 to j1.

Properties that are computed and cached are:

  • #m_rho (density)
  • #m_wtm (mean molecular weight)
  • #m_cp (specific heat capacity)
  • m_hk (species specific enthalpies)
  • #m_wdot (species production rates)

Definition at line 483 of file StFlow.h.

◆ updateDiffFluxes()

void updateDiffFluxes ( const double *  x,
size_t  j0,
size_t  j1 
)
protectedvirtual

Update the diffusive mass fluxes.

Reimplemented in IonFlow.

Definition at line 660 of file StFlow.cpp.

◆ grad_hk()

void grad_hk ( const double *  x,
size_t  j 
)
protectedvirtual

Get the gradient of species specific molar enthalpies.

Definition at line 1020 of file StFlow.cpp.

◆ updateTransport()

void updateTransport ( double *  x,
size_t  j0,
size_t  j1 
)
protectedvirtual

Update the transport properties at grid points in the range from j0 to j1, based on solution x.

Reimplemented in IonFlow.

Definition at line 608 of file StFlow.cpp.

Member Data Documentation

◆ m_diff

vector<double> m_diff
protected

Array of size m_nsp by m_points for saving density times diffusion coefficient times species molar mass divided by mean molecular weight.

Definition at line 611 of file StFlow.h.

◆ m_hk

Array2D m_hk
protected

Array of size m_nsp by m_points for saving molar enthalpies.

Definition at line 617 of file StFlow.h.

◆ m_dhk_dz

Array2D m_dhk_dz
protected

Array of size m_nsp by m_points-1 for saving enthalpy fluxes.

Definition at line 620 of file StFlow.h.

◆ m_nsp

size_t m_nsp
protected

Number of species in the mechanism.

Definition at line 625 of file StFlow.h.

◆ m_kRadiating

vector<size_t> m_kRadiating
protected

Indices within the ThermoPhase of the radiating species.

First index is for CO2, second is for H2O.

Definition at line 637 of file StFlow.h.

◆ m_do_radiation

bool m_do_radiation = false
protected

flag for the radiative heat loss

Definition at line 646 of file StFlow.h.

◆ m_qdotRadiation

vector<double> m_qdotRadiation
protected

radiative heat loss vector

Definition at line 649 of file StFlow.h.

◆ m_kExcessLeft

size_t m_kExcessLeft = 0
protected

Index of species with a large mass fraction at each boundary, for which the mass fraction may be calculated as 1 minus the sum of the other mass fractions.

Definition at line 659 of file StFlow.h.

◆ m_zfixed

double m_zfixed = Undef

Location of the point where temperature is fixed.

Definition at line 672 of file StFlow.h.

◆ m_tfixed

double m_tfixed = -1.0

Temperature at the point used to fix the flame location.

Definition at line 675 of file StFlow.h.


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