18 "To be removed after Cantera 3.1. Class replaced by Flow1D.");
25 "To be removed after Cantera 3.1. Class replaced by Flow1D.");
32 "To be removed after Cantera 3.1. Class replaced by Flow1D.");
35void StFlow::eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
44 double* x = xg +
loc();
45 double* rsd = rg +
loc();
46 integer* diag = diagg +
loc();
53 size_t jpt = (jg == 0) ? 0 : jg -
firstPoint();
54 jmin = std::max<size_t>(jpt, 1) - 1;
60 evalUo(x, rsd, diag, rdt, jmin, jmax);
64 double rdt,
size_t jmin,
size_t jmax)
75 double k_P_ref = 1.0*
OneAtm;
78 const double c_H2O[6] = {-0.23093, -1.12390, 9.41530, -2.99880,
79 0.51382, -1.86840e-5};
80 const double c_CO2[6] = {18.741, -121.310, 273.500, -194.050,
88 for (
size_t j = jmin; j < jmax; j++) {
90 double radiative_heat_loss = 0;
97 for (
size_t n = 0; n <= 5; n++) {
98 k_P_H2O += c_H2O[n] * pow(1000 /
T(x, j), (
double) n);
106 for (
size_t n = 0; n <= 5; n++) {
107 k_P_CO2 += c_CO2[n] * pow(1000 /
T(x, j), (
double) n);
114 radiative_heat_loss = 2 * k_P *(2 *
StefanBoltz * pow(
T(x, j), 4)
115 - boundary_Rad_left - boundary_Rad_right);
122 for (
size_t j = jmin; j <= jmax; j++) {
153 for (
size_t k = 0; k <
m_nsp; k++) {
193 for (
size_t k = 0; k <
m_nsp; k++) {
198 = (
m_wt[k]*(wdot(k,j))
199 - convec - diffus)/
m_rho[j]
200 - rdt*(
Y(x,k,j) -
Y_prev(k,j));
215 double dtdzj =
dTdz(x,j);
219 for (
size_t k = 0; k <
m_nsp; k++) {
221 sum += wdot(k,j)*
m_hk(k,j);
260 for (
size_t k = 0; k <
m_nsp; k++) {
size_t lastPoint() const
The index of the last (that is, right-most) grid point belonging to this domain.
double z(size_t jlocal) const
Get the coordinate [m] of the point with local index jlocal
size_t m_points
Number of grid points.
size_t firstPoint() const
The index of the first (that is, left-most) grid point belonging to this domain.
size_t index(size_t n, size_t j) const
Returns the index of the solution vector, which corresponds to component n at grid point j.
virtual size_t loc(size_t j=0) const
Location of the start of the local solution vector in the global solution vector.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
double dYdz(const double *x, size_t k, size_t j) const
Calculates the spatial derivative of the species mass fraction with respect to z for species k at po...
double dTdz(const double *x, size_t j) const
Calculates the spatial derivative of temperature T with respect to z at point j using upwind differen...
double density(size_t j) const
Get the density [kg/m³] at point j
double X(const double *x, size_t k, size_t j) const
Get the mole fraction of species k at point j from the local state vector x.
double T_prev(size_t j) const
Get the temperature at point j from the previous time step.
size_t rightExcessSpecies() const
Index of the species on the right boundary with the largest mass fraction.
vector< double > m_qdotRadiation
radiative heat loss vector
double dVdz(const double *x, size_t j) const
Calculates the spatial derivative of velocity V with respect to z at point j using upwind differencin...
bool m_usesLambda
Flag that is true for counterflow configurations that use the pressure eigenvalue in the radial mome...
vector< double > m_cp
Specific heat capacity at each grid point.
double shear(const double *x, size_t j) const
Compute the shear term from the momentum equation using a central three-point differencing scheme.
vector< double > m_rho
Density at each grid point.
vector< bool > m_do_energy
For each point in the domain, true if energy equation is solved or false if temperature is held const...
double m_epsilon_right
Emissivity of the surface to the right of the domain.
double Y_prev(size_t k, size_t j) const
Get the mass fraction of species k at point j from the previous time step.
vector< double > m_dz
Grid spacing. Element j holds the value of z(j+1) - z(j).
Array2D m_flux
Array of size m_nsp by m_points for saving diffusive mass fluxes.
void setGas(const double *x, size_t j)
Set the gas object state to be consistent with the solution at point j.
double m_epsilon_left
Emissivity of the surface to the left of the domain.
double m_tfixed
Temperature at the point used to fix the flame location.
Array2D m_hk
Array of size m_nsp by m_points for saving molar enthalpies.
double m_press
pressure [Pa]
double lambda(const double *x, size_t j) const
Get the radial pressure gradient [N/m⁴] at point j from the local state vector x
double V_prev(size_t j) const
Get the spread rate [1/s] at point j from the previous time step.
double conduction(const double *x, size_t j) const
Compute the conduction term from the energy equation using a central three-point differencing scheme.
vector< double > m_wt
Molecular weight of each species.
double Y(const double *x, size_t k, size_t j) const
Get the mass fraction of species k at point j from the local state vector x.
double T(const double *x, size_t j) const
Get the temperature at point j from the local state vector x.
size_t leftExcessSpecies() const
Index of the species on the left boundary with the largest mass fraction.
bool m_isFree
Flag that is true for freely propagating flames anchored by a temperature fixed point.
Array2D m_dhk_dz
Array of size m_nsp by m_points-1 for saving enthalpy fluxes.
double m_zfixed
Location of the point where temperature is fixed.
size_t m_nsp
Number of species in the mechanism.
double rho_u(const double *x, size_t j) const
Get the axial mass flux [kg/m²/s] at point j from the local state vector x.
virtual void grad_hk(const double *x, size_t j)
Compute the spatial derivative of species specific molar enthalpies using upwind differencing.
double V(const double *x, size_t j) const
Get the spread rate (tangential velocity gradient) [1/s] at point j from the local state vector x.
virtual void updateProperties(size_t jg, double *x, size_t jmin, size_t jmax)
Update the properties (thermo, transport, and diffusion flux).
virtual void evalUo(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the oxidizer axial velocity equation residual.
vector< size_t > m_kRadiating
Indices within the ThermoPhase of the radiating species.
double T_fixed(size_t j) const
The fixed temperature value at point j.
bool m_do_radiation
Determines whether radiative heat loss is calculated.
virtual void evalResidual(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the residual function.
virtual void evalRightBoundary(double *x, double *res, int *diag, double rdt)
Evaluate all residual components at the right boundary.
StFlow(ThermoPhase *ph=0, size_t nsp=1, size_t points=1)
Create a new flow domain.
void evalContinuity(size_t j, double *x, double *r, int *diag, double rdt) override
Alternate version of evalContinuity with legacy signature.
void eval(size_t j, double *x, double *r, integer *mask, double rdt) override
Evaluate the residual functions for axisymmetric stagnation flow.
void getWdot(double *x, size_t j)
Write the net production rates at point j into array m_wdot
Base class for a phase with thermodynamic properties.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
const double OneAtm
One atmosphere [Pa].
const double StefanBoltz
Stefan-Boltzmann constant [W/m2/K4].
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
@ c_offset_U
axial velocity [m/s]
@ c_offset_E
electric field
@ c_offset_Y
mass fractions
@ c_offset_T
temperature [kelvin]
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.