Cantera  3.0.0
Loading...
Searching...
No Matches
StFlow.h
Go to the documentation of this file.
1//! @file StFlow.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_STFLOW_H
7#define CT_STFLOW_H
8
9#include "Domain1D.h"
10#include "cantera/base/Array.h"
14
15namespace Cantera
16{
17
18//------------------------------------------
19// constants
20//------------------------------------------
21
22//! Offsets of solution components in the 1D solution array.
24{
25 c_offset_U //! axial velocity
26 , c_offset_V //! strain rate
27 , c_offset_T //! temperature
28 , c_offset_L //! (1/r)dP/dr
29 , c_offset_E //! electric poisson's equation
30 , c_offset_Y //! mass fractions
31};
32
33class Transport;
34
35//! @defgroup flowGroup Flow Domains
36//! One-dimensional flow domains.
37//! @ingroup onedGroup
38
39/**
40 * This class represents 1D flow domains that satisfy the one-dimensional
41 * similarity solution for chemically-reacting, axisymmetric flows.
42 * @ingroup flowGroup
43 */
44class StFlow : public Domain1D
45{
46public:
47 //--------------------------------
48 // construction and destruction
49 //--------------------------------
50
51 //! Create a new flow domain.
52 //! @param ph Object representing the gas phase. This object will be used
53 //! to evaluate all thermodynamic, kinetic, and transport properties.
54 //! @param nsp Number of species.
55 //! @param points Initial number of grid points
56 StFlow(ThermoPhase* ph = 0, size_t nsp = 1, size_t points = 1);
57
58 //! Delegating constructor
59 StFlow(shared_ptr<ThermoPhase> th, size_t nsp = 1, size_t points = 1);
60
61 //! Create a new flow domain.
62 //! @param sol Solution object used to evaluate all thermodynamic, kinetic, and
63 //! transport properties
64 //! @param id name of flow domain
65 //! @param points initial number of grid points
66 StFlow(shared_ptr<Solution> sol, const string& id="", size_t points=1);
67
68 ~StFlow();
69
70 string type() const override;
71
72 //! @name Problem Specification
73 //! @{
74
75 void setupGrid(size_t n, const double* z) override;
76
77 void resetBadValues(double* xg) override;
78
79 ThermoPhase& phase() {
80 return *m_thermo;
81 }
82
83 Kinetics& kinetics() {
84 return *m_kin;
85 }
86
87 /**
88 * Set the thermo manager.
89 *
90 * @deprecated To be removed after %Cantera 3.0 (unused)
91 */
92 void setThermo(ThermoPhase& th);
93
94 void setKinetics(shared_ptr<Kinetics> kin) override;
95
96 //! Set the kinetics manager.
97 //! @deprecated To be removed after %Cantera 3.0;
98 //! replaced by Domain1D::setKinetics()
99 void setKinetics(Kinetics& kin);
100
101 void setTransport(shared_ptr<Transport> trans) override;
102
103 //! Set transport model to existing instance
104 //! @deprecated To be removed after %Cantera 3.0;
105 //! replaced by Domain1D::setKinetics()
106 void setTransport(Transport& trans);
107
108 //! Set the transport model
109 //! @since New in %Cantera 3.0.
110 void setTransportModel(const string& trans);
111
112 //! Retrieve transport model
113 //! @since New in %Cantera 3.0.
114 string transportModel() const;
115
116 //! Enable thermal diffusion, also known as Soret diffusion.
117 //! Requires that multicomponent transport properties be
118 //! enabled to carry out calculations.
119 void enableSoret(bool withSoret) {
120 m_do_soret = withSoret;
121 }
122 bool withSoret() const {
123 return m_do_soret;
124 }
125
126 //! Set the pressure. Since the flow equations are for the limit of small
127 //! Mach number, the pressure is very nearly constant throughout the flow.
128 void setPressure(double p) {
129 m_press = p;
130 }
131
132 //! The current pressure [Pa].
133 double pressure() const {
134 return m_press;
135 }
136
137 //! Write the initial solution estimate into array x.
138 void _getInitialSoln(double* x) override;
139
140 void _finalize(const double* x) override;
141
142 //! Sometimes it is desired to carry out the simulation using a specified
143 //! temperature profile, rather than computing it by solving the energy
144 //! equation. This method specifies this profile.
145 void setFixedTempProfile(vector<double>& zfixed, vector<double>& tfixed) {
146 m_zfix = zfixed;
147 m_tfix = tfixed;
148 }
149
150 /**
151 * Set the temperature fixed point at grid point j, and disable the energy
152 * equation so that the solution will be held to this value.
153 */
154 void setTemperature(size_t j, double t) {
155 m_fixedtemp[j] = t;
156 m_do_energy[j] = false;
157 }
158
159 //! The fixed temperature value at point j.
160 double T_fixed(size_t j) const {
161 return m_fixedtemp[j];
162 }
163
164 //! @}
165
166 string componentName(size_t n) const override;
167
168 size_t componentIndex(const string& name) const override;
169
170 //! Returns true if the specified component is an active part of the solver state
171 virtual bool componentActive(size_t n) const;
172
173 //! Print the solution.
174 void show(const double* x) override;
175
176 shared_ptr<SolutionArray> asArray(const double* soln) const override;
177 void fromArray(SolutionArray& arr, double* soln) override;
178
179 //! Set flow configuration for freely-propagating flames, using an internal point
180 //! with a fixed temperature as the condition to determine the inlet mass flux.
181 void setFreeFlow() {
182 m_type = cFreeFlow;
183 m_dovisc = false;
184 m_isFree = true;
185 m_usesLambda = false;
186 }
187
188 //! Set flow configuration for axisymmetric counterflow flames, using specified
189 //! inlet mass fluxes.
191 m_type = cAxisymmetricStagnationFlow;
192 m_dovisc = true;
193 m_isFree = false;
194 m_usesLambda = true;
195 }
196
197 //! Set flow configuration for burner-stabilized flames, using specified inlet mass
198 //! fluxes.
200 m_type = cAxisymmetricStagnationFlow;
201 m_dovisc = false;
202 m_isFree = false;
203 m_usesLambda = false;
204 }
205
206 //! Return the type of flow domain being represented, either "Free Flame" or
207 //! "Axisymmetric Stagnation".
208 //! @see setFreeFlow setAxisymmetricFlow
209 //! @deprecated To be removed after %Cantera 3.0; replaced by type().
210 virtual string flowType() const;
211
212 void solveEnergyEqn(size_t j=npos);
213
214 //! Get the solving stage (used by IonFlow specialization)
215 //! @since New in %Cantera 3.0
216 virtual size_t getSolvingStage() const;
217
218 //! Solving stage mode for handling ionized species (used by IonFlow specialization)
219 //! - @c stage=1: the fluxes of charged species are set to zero
220 //! - @c stage=2: the electric field equation is solved, and the drift flux for
221 //! ionized species is evaluated
222 virtual void setSolvingStage(const size_t stage);
223
224 //! Set to solve electric field in a point (used by IonFlow specialization)
225 virtual void solveElectricField(size_t j=npos);
226
227 //! Set to fix voltage in a point (used by IonFlow specialization)
228 virtual void fixElectricField(size_t j=npos);
229
230 //! Retrieve flag indicating whether electric field is solved or not (used by
231 //! IonFlow specialization)
232 virtual bool doElectricField(size_t j) const;
233
234 //! Turn radiation on / off.
235 /*!
236 * The simple radiation model used was established by Liu and Rogg
237 * @cite liu1991. This model considers the radiation of CO2 and H2O.
238 *
239 * This model uses the optically thin limit and the gray-gas approximation to
240 * simply calculate a volume specified heat flux out of the Planck absorption
241 * coefficients, the boundary emissivities and the temperature. Polynomial lines
242 * calculate the species Planck coefficients for H2O and CO2. The data for the
243 * lines are taken from the RADCAL program @cite RADCAL.
244 * The coefficients for the polynomials are taken from
245 * [TNF Workshop](https://tnfworkshop.org/radiation/) material.
246 */
247 void enableRadiation(bool doRadiation) {
248 m_do_radiation = doRadiation;
249 }
250
251 //! Returns `true` if the radiation term in the energy equation is enabled
252 bool radiationEnabled() const {
253 return m_do_radiation;
254 }
255
256 //! Return radiative heat loss at grid point j
257 double radiativeHeatLoss(size_t j) const {
258 return m_qdotRadiation[j];
259 }
260
261 //! Set the emissivities for the boundary values
262 /*!
263 * Reads the emissivities for the left and right boundary values in the
264 * radiative term and writes them into the variables, which are used for the
265 * calculation.
266 */
267 void setBoundaryEmissivities(double e_left, double e_right);
268
269 //! Return emissivity at left boundary
270 double leftEmissivity() const { return m_epsilon_left; }
271
272 //! Return emissivity at right boundary
273 double rightEmissivity() const { return m_epsilon_right; }
274
275 void fixTemperature(size_t j=npos);
276
277 bool doEnergy(size_t j) {
278 return m_do_energy[j];
279 }
280
281 //! Change the grid size. Called after grid refinement.
282 void resize(size_t components, size_t points) override;
283
284 //! Set the gas object state to be consistent with the solution at point j.
285 void setGas(const double* x, size_t j);
286
287 //! Set the gas state to be consistent with the solution at the midpoint
288 //! between j and j + 1.
289 void setGasAtMidpoint(const double* x, size_t j);
290
291 double density(size_t j) const {
292 return m_rho[j];
293 }
294
295 //! @deprecated To be removed after %Cantera 3.0. Superseded by isFree()
296 virtual bool fixed_mdot();
297
298 /**
299 * Retrieve flag indicating whether flow is freely propagating.
300 * The flow is unstrained and the axial mass flow rate is not specified.
301 * For free flame propagation, the axial velocity is determined by the solver.
302 * @since New in %Cantera 3.0
303 */
304 bool isFree() const {
305 return m_isFree;
306 }
307
308 /**
309 * Retrieve flag indicating whether flow uses radial momentum.
310 * If `true`, radial momentum equation for @f$ V @f$ as well as
311 * @f$ d\Lambda/dz = 0 @f$ are solved; if `false`, @f$ \Lambda(z) = 0 @f$ and
312 * @f$ V(z) = 0 @f$ by definition.
313 * @since New in %Cantera 3.0
314 */
315 bool isStrained() const {
316 return m_usesLambda;
317 }
318
319 void setViscosityFlag(bool dovisc) {
320 m_dovisc = dovisc;
321 }
322
323 /**
324 * Evaluate the residual function for axisymmetric stagnation flow. If
325 * j == npos, the residual function is evaluated at all grid points.
326 * Otherwise, the residual function is only evaluated at grid points
327 * j-1, j, and j+1. This option is used to efficiently evaluate the
328 * Jacobian numerically.
329 */
330 void eval(size_t j, double* x, double* r, integer* mask, double rdt) override;
331
332 //! Evaluate all residual components at the right boundary.
333 virtual void evalRightBoundary(double* x, double* res, int* diag, double rdt);
334
335 //! Evaluate the residual corresponding to the continuity equation at all
336 //! interior grid points.
337 virtual void evalContinuity(size_t j, double* x, double* r, int* diag, double rdt);
338
339 //! Index of the species on the left boundary with the largest mass fraction
340 size_t leftExcessSpecies() const {
341 return m_kExcessLeft;
342 }
343
344 //! Index of the species on the right boundary with the largest mass fraction
345 size_t rightExcessSpecies() const {
346 return m_kExcessRight;
347 }
348
349protected:
350 AnyMap getMeta() const override;
351 void setMeta(const AnyMap& state) override;
352
353 double wdot(size_t k, size_t j) const {
354 return m_wdot(k,j);
355 }
356
357 //! Write the net production rates at point `j` into array `m_wdot`
358 void getWdot(double* x, size_t j) {
359 setGas(x,j);
360 m_kin->getNetProductionRates(&m_wdot(0,j));
361 }
362
363 //! Update the properties (thermo, transport, and diffusion flux).
364 //! This function is called in eval after the points which need
365 //! to be updated are defined.
366 virtual void updateProperties(size_t jg, double* x, size_t jmin, size_t jmax);
367
368 //! Evaluate the residual function. This function is called in eval
369 //! after updateProperties is called.
370 virtual void evalResidual(double* x, double* rsd, int* diag,
371 double rdt, size_t jmin, size_t jmax);
372
373 /**
374 * Update the thermodynamic properties from point j0 to point j1
375 * (inclusive), based on solution x.
376 */
377 void updateThermo(const double* x, size_t j0, size_t j1) {
378 for (size_t j = j0; j <= j1; j++) {
379 setGas(x,j);
380 m_rho[j] = m_thermo->density();
381 m_wtm[j] = m_thermo->meanMolecularWeight();
382 m_cp[j] = m_thermo->cp_mass();
383 m_thermo->getPartialMolarEnthalpies(&m_hk(0, j));
384 }
385 }
386
387 //! @name Solution components
388 //! @{
389
390 double T(const double* x, size_t j) const {
391 return x[index(c_offset_T, j)];
392 }
393 double& T(double* x, size_t j) {
394 return x[index(c_offset_T, j)];
395 }
396 double T_prev(size_t j) const {
397 return prevSoln(c_offset_T, j);
398 }
399
400 double rho_u(const double* x, size_t j) const {
401 return m_rho[j]*x[index(c_offset_U, j)];
402 }
403
404 double u(const double* x, size_t j) const {
405 return x[index(c_offset_U, j)];
406 }
407
408 double V(const double* x, size_t j) const {
409 return x[index(c_offset_V, j)];
410 }
411 double V_prev(size_t j) const {
412 return prevSoln(c_offset_V, j);
413 }
414
415 double lambda(const double* x, size_t j) const {
416 return x[index(c_offset_L, j)];
417 }
418
419 double Y(const double* x, size_t k, size_t j) const {
420 return x[index(c_offset_Y + k, j)];
421 }
422
423 double& Y(double* x, size_t k, size_t j) {
424 return x[index(c_offset_Y + k, j)];
425 }
426
427 double Y_prev(size_t k, size_t j) const {
428 return prevSoln(c_offset_Y + k, j);
429 }
430
431 double X(const double* x, size_t k, size_t j) const {
432 return m_wtm[j]*Y(x,k,j)/m_wt[k];
433 }
434
435 double flux(size_t k, size_t j) const {
436 return m_flux(k, j);
437 }
438 //! @}
439
440 //! @name convective spatial derivatives.
441 //!
442 //! These use upwind differencing, assuming u(z) is negative
443 //! @{
444 double dVdz(const double* x, size_t j) const {
445 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
446 return (V(x,jloc) - V(x,jloc-1))/m_dz[jloc-1];
447 }
448
449 double dYdz(const double* x, size_t k, size_t j) const {
450 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
451 return (Y(x,k,jloc) - Y(x,k,jloc-1))/m_dz[jloc-1];
452 }
453
454 double dTdz(const double* x, size_t j) const {
455 size_t jloc = (u(x,j) > 0.0 ? j : j + 1);
456 return (T(x,jloc) - T(x,jloc-1))/m_dz[jloc-1];
457 }
458 //! @}
459
460 double shear(const double* x, size_t j) const {
461 double c1 = m_visc[j-1]*(V(x,j) - V(x,j-1));
462 double c2 = m_visc[j]*(V(x,j+1) - V(x,j));
463 return 2.0*(c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1));
464 }
465
466 double divHeatFlux(const double* x, size_t j) const {
467 double c1 = m_tcon[j-1]*(T(x,j) - T(x,j-1));
468 double c2 = m_tcon[j]*(T(x,j+1) - T(x,j));
469 return -2.0*(c2/(z(j+1) - z(j)) - c1/(z(j) - z(j-1)))/(z(j+1) - z(j-1));
470 }
471
472 size_t mindex(size_t k, size_t j, size_t m) {
473 return m*m_nsp*m_nsp + m_nsp*j + k;
474 }
475
476 //! Update the diffusive mass fluxes.
477 virtual void updateDiffFluxes(const double* x, size_t j0, size_t j1);
478
479 //! Get the gradient of species specific molar enthalpies
480 virtual void grad_hk(const double* x, size_t j);
481
482 //---------------------------------------------------------
483 // member data
484 //---------------------------------------------------------
485
486 double m_press = -1.0; // pressure
487
488 // grid parameters
489 vector<double> m_dz;
490
491 // mixture thermo properties
492 vector<double> m_rho;
493 vector<double> m_wtm;
494
495 // species thermo properties
496 vector<double> m_wt;
497 vector<double> m_cp;
498
499 // transport properties
500 vector<double> m_visc;
501 vector<double> m_tcon;
502 vector<double> m_diff;
503 vector<double> m_multidiff;
504 Array2D m_dthermal;
505 Array2D m_flux;
506
507 //! Array of size #m_nsp by #m_points for saving molar enthalpies
509
510 //! Array of size #m_nsp by #m_points-1 for saving enthalpy fluxes
512
513 // production rates
514 Array2D m_wdot;
515
516 size_t m_nsp; //!< Number of species in the mechanism
517
518 ThermoPhase* m_thermo = nullptr;
519 Kinetics* m_kin = nullptr;
520 Transport* m_trans = nullptr;
521
522 // boundary emissivities for the radiation calculations
523 double m_epsilon_left = 0.0;
524 double m_epsilon_right = 0.0;
525
526 //! Indices within the ThermoPhase of the radiating species. First index is
527 //! for CO2, second is for H2O.
528 vector<size_t> m_kRadiating;
529
530 // flags
531 vector<bool> m_do_energy;
532 bool m_do_soret = false;
533 vector<bool> m_do_species;
534 bool m_do_multicomponent = false;
535
536 //! flag for the radiative heat loss
537 bool m_do_radiation = false;
538
539 //! radiative heat loss vector
540 vector<double> m_qdotRadiation;
541
542 // fixed T and Y values
543 vector<double> m_fixedtemp;
544 vector<double> m_zfix;
545 vector<double> m_tfix;
546
547 //! Index of species with a large mass fraction at each boundary, for which
548 //! the mass fraction may be calculated as 1 minus the sum of the other mass
549 //! fractions
550 size_t m_kExcessLeft = 0;
551 size_t m_kExcessRight = 0;
552
553 bool m_dovisc;
554 bool m_isFree;
555 bool m_usesLambda;
556
557 //! Update the transport properties at grid points in the range from `j0`
558 //! to `j1`, based on solution `x`.
559 virtual void updateTransport(double* x, size_t j0, size_t j1);
560
561public:
562 //! Location of the point where temperature is fixed
563 double m_zfixed = Undef;
564
565 //! Temperature at the point used to fix the flame location
566 double m_tfixed = -1.0;
567
568private:
569 vector<double> m_ybar;
570};
571
572}
573
574#endif
Header file for class Cantera::Array2D.
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
Base class for one-dimensional domains.
Definition Domain1D.h:41
double prevSoln(size_t n, size_t j) const
Value of component n at point j in the previous solution.
Definition Domain1D.h:475
Public interface for kinetics managers.
Definition Kinetics.h:126
virtual void getNetProductionRates(double *wdot)
Species net production rates [kmol/m^3/s or kmol/m^2/s].
Definition Kinetics.cpp:435
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition Phase.h:760
virtual double density() const
Density (kg/m^3).
Definition Phase.h:687
A container class holding arrays of state information.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
Definition StFlow.h:45
virtual void evalResidual(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the residual function.
Definition StFlow.cpp:404
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...
Definition StFlow.h:154
virtual void evalRightBoundary(double *x, double *res, int *diag, double rdt)
Evaluate all residual components at the right boundary.
Definition StFlow.cpp:1009
virtual void evalContinuity(size_t j, double *x, double *r, int *diag, double rdt)
Evaluate the residual corresponding to the continuity equation at all interior grid points.
Definition StFlow.cpp:1039
size_t m_kExcessLeft
Index of species with a large mass fraction at each boundary, for which the mass fraction may be calc...
Definition StFlow.h:550
void setMeta(const AnyMap &state) override
Retrieve meta data.
Definition StFlow.cpp:861
void setTransportModel(const string &trans)
Set the transport model.
Definition StFlow.cpp:237
double leftEmissivity() const
Return emissivity at left boundary.
Definition StFlow.h:270
void setTransport(shared_ptr< Transport > trans) override
Set transport model to existing instance.
Definition StFlow.cpp:161
void setUnstrainedFlow()
Set flow configuration for burner-stabilized flames, using specified inlet mass fluxes.
Definition StFlow.h:199
void setKinetics(shared_ptr< Kinetics > kin) override
Set the kinetics manager.
Definition StFlow.cpp:143
void resetBadValues(double *xg) override
When called, this function should reset "bad" values in the state vector such as negative species con...
Definition StFlow.cpp:227
virtual string flowType() const
Return the type of flow domain being represented, either "Free Flame" or "Axisymmetric Stagnation".
Definition StFlow.cpp:849
size_t rightExcessSpecies() const
Index of the species on the right boundary with the largest mass fraction.
Definition StFlow.h:345
vector< double > m_qdotRadiation
radiative heat loss vector
Definition StFlow.h:540
double pressure() const
The current pressure [Pa].
Definition StFlow.h:133
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.
Definition StFlow.h:377
void resize(size_t components, size_t points) override
Change the grid size. Called after grid refinement.
Definition StFlow.cpp:186
void enableSoret(bool withSoret)
Enable thermal diffusion, also known as Soret diffusion.
Definition StFlow.h:119
void setFixedTempProfile(vector< double > &zfixed, vector< double > &tfixed)
Sometimes it is desired to carry out the simulation using a specified temperature profile,...
Definition StFlow.h:145
void setBoundaryEmissivities(double e_left, double e_right)
Set the emissivities for the boundary values.
Definition StFlow.cpp:971
string type() const override
String indicating the domain implemented.
Definition StFlow.cpp:128
void enableRadiation(bool doRadiation)
Turn radiation on / off.
Definition StFlow.h:247
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
Definition StFlow.cpp:785
size_t componentIndex(const string &name) const override
index of component with name name.
Definition StFlow.cpp:699
double rightEmissivity() const
Return emissivity at right boundary.
Definition StFlow.h:273
void setGas(const double *x, size_t j)
Set the gas object state to be consistent with the solution at point j.
Definition StFlow.cpp:280
double m_tfixed
Temperature at the point used to fix the flame location.
Definition StFlow.h:566
bool radiationEnabled() const
Returns true if the radiation term in the energy equation is enabled.
Definition StFlow.h:252
virtual bool componentActive(size_t n) const
Returns true if the specified component is an active part of the solver state.
Definition StFlow.cpp:722
Array2D m_hk
Array of size m_nsp by m_points for saving molar enthalpies.
Definition StFlow.h:508
void setFreeFlow()
Set flow configuration for freely-propagating flames, using an internal point with a fixed temperatur...
Definition StFlow.h:181
virtual bool doElectricField(size_t j) const
Retrieve flag indicating whether electric field is solved or not (used by IonFlow specialization)
Definition StFlow.cpp:965
void eval(size_t j, double *x, double *r, integer *mask, double rdt) override
Evaluate the residual function for axisymmetric stagnation flow.
Definition StFlow.cpp:353
void setupGrid(size_t n, const double *z) override
called to set up initial grid, and after grid refinement
Definition StFlow.cpp:212
size_t leftExcessSpecies() const
Index of the species on the left boundary with the largest mass fraction.
Definition StFlow.h:340
Array2D m_dhk_dz
Array of size m_nsp by m_points-1 for saving enthalpy fluxes.
Definition StFlow.h:511
double radiativeHeatLoss(size_t j) const
Return radiative heat loss at grid point j.
Definition StFlow.h:257
double m_zfixed
Location of the point where temperature is fixed.
Definition StFlow.h:563
void _finalize(const double *x) override
In some cases, a domain may need to set parameters that depend on the initial solution estimate.
Definition StFlow.cpp:306
virtual size_t getSolvingStage() const
Get the solving stage (used by IonFlow specialization)
Definition StFlow.cpp:941
size_t m_nsp
Number of species in the mechanism.
Definition StFlow.h:516
void getWdot(double *x, size_t j)
Write the net production rates at point j into array m_wdot
Definition StFlow.h:358
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
Definition StFlow.cpp:819
virtual bool fixed_mdot()
Definition StFlow.cpp:300
AnyMap getMeta() const override
Retrieve meta data.
Definition StFlow.cpp:736
virtual void updateDiffFluxes(const double *x, size_t j0, size_t j1)
Update the diffusive mass fluxes.
Definition StFlow.cpp:635
string componentName(size_t n) const override
Name of the nth component. May be overloaded.
Definition StFlow.cpp:677
bool isFree() const
Retrieve flag indicating whether flow is freely propagating.
Definition StFlow.h:304
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 StFlow.cpp:288
virtual void grad_hk(const double *x, size_t j)
Get the gradient of species specific molar enthalpies.
Definition StFlow.cpp:1077
bool isStrained() const
Retrieve flag indicating whether flow uses radial momentum.
Definition StFlow.h:315
string transportModel() const
Retrieve transport model.
Definition StFlow.cpp:248
virtual void updateProperties(size_t jg, double *x, size_t jmin, size_t jmax)
Update the properties (thermo, transport, and diffusion flux).
Definition StFlow.cpp:380
void setThermo(ThermoPhase &th)
Set the thermo manager.
Definition StFlow.cpp:138
void show(const double *x) override
Print the solution.
Definition StFlow.cpp:618
virtual void setSolvingStage(const size_t stage)
Solving stage mode for handling ionized species (used by IonFlow specialization)
Definition StFlow.cpp:947
void setPressure(double p)
Set the pressure.
Definition StFlow.h:128
virtual void fixElectricField(size_t j=npos)
Set to fix voltage in a point (used by IonFlow specialization)
Definition StFlow.cpp:959
void setAxisymmetricFlow()
Set flow configuration for axisymmetric counterflow flames, using specified inlet mass fluxes.
Definition StFlow.h:190
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.
Definition StFlow.cpp:588
virtual void solveElectricField(size_t j=npos)
Set to solve electric field in a point (used by IonFlow specialization)
Definition StFlow.cpp:953
void _getInitialSoln(double *x) override
Write the initial solution estimate into array x.
Definition StFlow.cpp:271
vector< size_t > m_kRadiating
Indices within the ThermoPhase of the radiating species.
Definition StFlow.h:528
double T_fixed(size_t j) const
The fixed temperature value at point j.
Definition StFlow.h:160
bool m_do_radiation
flag for the radiative heat loss
Definition StFlow.h:537
Base class for a phase with thermodynamic properties.
virtual void getPartialMolarEnthalpies(double *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
double cp_mass() const
Specific heat at constant pressure. Units: J/kg/K.
Base class for transport property managers.
Definition Transport.h:146
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
const size_t npos
index returned by functions to indicate "no position"
Definition ct_defs.h:195
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
Definition ct_defs.h:164
offset
Offsets of solution components in the 1D solution array.
Definition StFlow.h:24
@ c_offset_U
axial velocity
Definition StFlow.h:25
@ c_offset_L
(1/r)dP/dr
Definition StFlow.h:28
@ c_offset_V
strain rate
Definition StFlow.h:26
@ c_offset_E
electric poisson's equation
Definition StFlow.h:29
@ c_offset_Y
mass fractions
Definition StFlow.h:30
@ c_offset_T
temperature
Definition StFlow.h:27