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,
84 double boundary_Rad_left = m_epsilon_left *
StefanBoltz * pow(T(x, 0), 4);
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++) {
134 -(rho_u(x,1) - rho_u(x,0))/m_dz[0]
135 -(density(1)*V(x,1) + density(0)*V(x,0));
153 for (
size_t k = 0; k <
m_nsp; k++) {
156 -(
m_flux(k,0) + rho_u(x,0)* Y(x,k,0));
177 (
shear(x, j) - lambda(x, j) - rho_u(x, j) *
dVdz(x, j)
179 - rdt * (V(x, j) - V_prev(j));
193 for (
size_t k = 0; k <
m_nsp; k++) {
194 double convec = rho_u(x,j)*
dYdz(x,k,j);
198 = (m_wt[k]*(wdot(k,j))
199 - convec - diffus)/
m_rho[j]
200 - rdt*(Y(x,k,j) - Y_prev(k,j));
212 if (m_do_energy[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);
222 sum += flxk *
m_dhk_dz(k,j) / m_wt[k];
260 for (
size_t k = 0; k <
m_nsp; k++) {
291 -(rho_u(x,j+1) - rho_u(x,j))/m_dz[j]
292 -(density(j+1)*V(x,j+1) + density(j)*V(x,j));
293 }
else if (m_isFree) {
297 - (rho_u(x,j) - rho_u(x,j-1))/m_dz[j-1];
299 if (m_do_energy[j]) {
307 - (rho_u(x,j+1) - rho_u(x,j))/m_dz[j];
size_t lastPoint() const
The index of the last (that is, right-most) grid point belonging to this domain.
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...
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...
vector< double > m_cp
Vector of size m_nsp to cache specific heat capacities.
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
Vector of size m_nsp to cache densities.
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_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 conduction(const double *x, size_t j) const
Compute the conduction term from the energy equation using a central three-point differencing scheme.
size_t leftExcessSpecies() const
Index of the species on the left boundary with the largest mass fraction.
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.
virtual void grad_hk(const double *x, size_t j)
Compute the spatial derivative of species specific molar enthalpies using upwind differencing.
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
flag for the radiative heat loss
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.