8#include "cantera/oneD/refine.h"
48 m_do_species.resize(
m_nsp,
true);
70 for (
size_t k = 0; k <
m_nsp; k++) {
81 for (
size_t ng = 0; ng <
m_points; ng++) {
93 :
StFlow(th.get(), nsp, points)
100 :
StFlow(sol->thermo().get(), sol->thermo()->nSpecies(), points)
108 "An appropriate transport model\nshould be set when instantiating the "
109 "Solution ('gas') object.");
111 m_solution->registerChangedCallback(
this, [
this]() {
129 return "axisymmetric-flow";
131 return "unstrained-flow";
143 throw CanteraError(
"StFlow::setTransport",
"Unable to set empty transport.");
145 m_trans = trans.get();
147 throw CanteraError(
"StFlow::setTransport",
"Invalid Transport model 'none'.");
149 m_do_multicomponent = (m_trans->
transportModel() ==
"multicomponent" ||
153 if (m_do_multicomponent) {
170 if (m_do_multicomponent) {
191 for (
size_t j = 1; j <
m_points; j++) {
192 if (z[j] <= z[j-1]) {
194 "grid points must be monotonically increasing");
197 m_dz[j-1] = m_z[j] - m_z[j-1];
203 double* x = xg +
loc();
204 for (
size_t j = 0; j <
m_points; j++) {
222 for (
size_t j = 0; j <
m_points; j++) {
225 m_rho[j] = m_thermo->
density();
241 const double* yyjp = x + m_nv*(j+1) +
c_offset_Y;
242 for (
size_t k = 0; k <
m_nsp; k++) {
243 m_ybar[k] = 0.5*(yyj[k] + yyjp[k]);
251 if (!m_do_multicomponent && m_do_soret) {
253 "Thermal diffusion (the Soret effect) is enabled, and requires "
254 "using a multicomponent transport model.");
257 size_t nz = m_zfix.size();
258 bool e = m_do_energy[0];
259 for (
size_t j = 0; j <
m_points; j++) {
261 m_fixedtemp[j] = T(x, j);
263 double zz = (z(j) - z(0))/(z(
m_points - 1) - z(0));
277 for (
size_t j = 0; j <
m_points; j++) {
283 for (
size_t j = 0; j <
m_points - 1; j++) {
297 integer* diagGlobal,
double rdt)
306 double* x = xGlobal +
loc();
307 double* rsd = rsdGlobal +
loc();
308 integer* diag = diagGlobal +
loc();
311 if (jGlobal ==
npos) {
315 size_t jpt = (jGlobal == 0) ? 0 : jGlobal -
firstPoint();
316 jmin = std::max<size_t>(jpt, 1) - 1;
337 size_t j0 = std::max<size_t>(jmin, 1) - 1;
338 size_t j1 = std::min(jmax+1,
m_points-1);
341 if (jg ==
npos || m_force_full_update) {
350 m_kExcessRight = distance(Yright, max_element(Yright, Yright +
m_nsp));
362 double k_P_ref = 1.0*
OneAtm;
365 const double c_H2O[6] = {-0.23093, -1.12390, 9.41530, -2.99880,
366 0.51382, -1.86840e-5};
367 const double c_CO2[6] = {18.741, -121.310, 273.500, -194.050,
371 double boundary_Rad_left = m_epsilon_left *
StefanBoltz * pow(T(x, 0), 4);
374 for (
size_t j = jmin; j < jmax; j++) {
380 for (
size_t n = 0; n <= 5; n++) {
381 k_P_H2O += c_H2O[n] * pow(1000 / T(x, j), (
double) n);
389 for (
size_t n = 0; n <= 5; n++) {
390 k_P_CO2 += c_CO2[n] * pow(1000 / T(x, j), (
double) n);
397 double radiative_heat_loss = 2 * k_P *(2 *
StefanBoltz * pow(T(x, j), 4)
398 - boundary_Rad_left - boundary_Rad_right);
406 double rdt,
size_t jmin,
size_t jmax)
410 rsd[index(
c_offset_U,jmin)] = -(rho_u(x,jmin + 1) - rho_u(x,jmin))/m_dz[jmin]
411 -(density(jmin + 1)*V(x,jmin + 1)
412 + density(jmin)*V(x,jmin));
418 rsd[index(
c_offset_U, jmax)] = rho_u(x, jmax);
420 rsd[index(
c_offset_U, jmax)] = rho_u(x, jmax) - rho_u(x, jmax - 1);
426 size_t j0 = std::max<size_t>(jmin, 1);
427 size_t j1 = std::min(jmax,
m_points - 2);
429 for (
size_t j = j0; j <= j1; j++) {
434 rsd[index(
c_offset_U,j)] = -(rho_u(x,j+1) - rho_u(x,j))/m_dz[j]
435 -(density(j+1)*V(x,j+1) + density(j)*V(x,j));
438 }
else if (m_isFree) {
439 for (
size_t j = j0; j <= j1; j++) {
442 rsd[index(
c_offset_U,j)] = -(rho_u(x,j) - rho_u(x,j-1))/m_dz[j-1];
444 if (m_do_energy[j]) {
447 rsd[index(
c_offset_U,j)] = (rho_u(x,j) - m_rho[0]*0.3);
450 rsd[index(
c_offset_U,j)] = -(rho_u(x,j+1) - rho_u(x,j))/m_dz[j];
455 for (
size_t j = j0; j <= j1; j++) {
456 rsd[index(
c_offset_U, j)] = rho_u(x, j) - rho_u(x, j - 1);
463 double rdt,
size_t jmin,
size_t jmax)
466 for (
size_t j = jmin; j <= jmax; j++) {
483 size_t j0 = std::max<size_t>(jmin, 1);
484 size_t j1 = std::min(jmax,
m_points - 2);
485 for (
size_t j = j0; j <= j1; j++) {
486 rsd[index(
c_offset_V,j)] = (shear(x, j) - lambda(x, j)
487 - rho_u(x, j) * dVdz(x, j)
488 - m_rho[j] * V(x, j) * V(x, j)) / m_rho[j]
489 - rdt * (V(x, j) - V_prev(j));
495 double rdt,
size_t jmin,
size_t jmax)
498 for (
size_t j = jmin; j <= jmax; j++) {
506 rsd[index(
c_offset_L, jmin)] = -rho_u(x, jmin);
510 rsd[index(
c_offset_L, jmax)] = lambda(x, jmax) - lambda(x, jmax-1);
515 size_t j0 = std::max<size_t>(jmin, 1);
516 size_t j1 = std::min(jmax,
m_points - 2);
517 for (
size_t j = j0; j <= j1; j++) {
518 rsd[index(
c_offset_L, j)] = lambda(x, j) - lambda(x, j - 1);
523 double rdt,
size_t jmin,
size_t jmax)
534 size_t j0 = std::max<size_t>(jmin, 1);
535 size_t j1 = std::min(jmax,
m_points - 2);
536 for (
size_t j = j0; j <= j1; j++) {
537 if (m_do_energy[j]) {
540 for (
size_t k = 0; k <
m_nsp; k++) {
541 double flxk = 0.5*(m_flux(k,j-1) + m_flux(k,j));
542 sum += wdot(k,j)*
m_hk(k,j);
543 sum += flxk *
m_dhk_dz(k,j) / m_wt[k];
546 rsd[index(
c_offset_T, j)] = - m_cp[j]*rho_u(x,j)*dTdz(x,j)
547 - divHeatFlux(x,j) - sum;
548 rsd[index(
c_offset_T, j)] /= (m_rho[j]*m_cp[j]);
549 rsd[index(
c_offset_T, j)] -= rdt*(T(x,j) - T_prev(j));
561 double rdt,
size_t jmin,
size_t jmax)
565 for (
size_t k = 0; k <
m_nsp; k++) {
567 rsd[index(
c_offset_Y + k, jmin)] = -(m_flux(k,jmin) +
568 rho_u(x,jmin) * Y(x,k,jmin));
575 for (
size_t k = 0; k <
m_nsp; k++) {
577 rsd[index(k+
c_offset_Y,jmax)] = m_flux(k,jmax-1) +
578 rho_u(x,jmax)*Y(x,k,jmax);
585 size_t j0 = std::max<size_t>(jmin, 1);
586 size_t j1 = std::min(jmax,
m_points - 2);
587 for (
size_t j = j0; j <= j1; j++) {
588 for (
size_t k = 0; k <
m_nsp; k++) {
589 double convec = rho_u(x,j)*dYdz(x,k,j);
590 double diffus = 2.0*(m_flux(k,j) - m_flux(k,j-1)) / (z(j+1) - z(j-1));
591 rsd[index(
c_offset_Y + k, j)] = (m_wt[k]*(wdot(k,j))
592 - convec - diffus)/m_rho[j]
593 - rdt*(Y(x,k,j) - Y_prev(k,j));
600 double rdt,
size_t jmin,
size_t jmax)
602 for (
size_t j = jmin; j <= jmax; j++) {
610 if (m_do_multicomponent) {
611 for (
size_t j = j0; j < j1; j++) {
614 double rho = m_thermo->
density();
615 m_visc[j] = (m_dovisc ? m_trans->
viscosity() : 0.0);
619 for (
size_t k = 0; k <
m_nsp; k++) {
620 m_diff[k+j*
m_nsp] = m_wt[k] * rho / (wtm*wtm);
629 for (
size_t j = j0; j < j1; j++) {
631 m_visc[j] = (m_dovisc ? m_trans->
viscosity() : 0.0);
640 writelog(
" Pressure: {:10.4g} Pa\n", m_press);
645 writeline(
'-', 79,
false,
true);
646 writelog(
"\n z radiative heat loss");
647 writeline(
'-', 79,
false,
true);
648 for (
size_t j = 0; j <
m_points; j++) {
657 if (m_do_multicomponent) {
658 for (
size_t j = j0; j < j1; j++) {
659 double dz = z(j+1) - z(j);
660 for (
size_t k = 0; k <
m_nsp; k++) {
662 for (
size_t m = 0; m <
m_nsp; m++) {
663 sum += m_wt[m] * m_multidiff[mindex(k,m,j)] * (X(x,m,j+1)-X(x,m,j));
665 m_flux(k,j) = sum * m_diff[k+j*
m_nsp] / dz;
669 for (
size_t j = j0; j < j1; j++) {
671 double wtm = m_wtm[j];
672 double rho = density(j);
673 double dz = z(j+1) - z(j);
674 for (
size_t k = 0; k <
m_nsp; k++) {
675 m_flux(k,j) = m_wt[k]*(rho*m_diff[k+
m_nsp*j]/wtm);
676 m_flux(k,j) *= (X(x,k,j) - X(x,k,j+1))/dz;
680 for (
size_t k = 0; k <
m_nsp; k++) {
681 m_flux(k,j) += sum*Y(x,k,j);
687 for (
size_t m = j0; m < j1; m++) {
688 double gradlogT = 2.0 * (T(x,m+1) - T(x,m)) /
689 ((T(x,m+1) + T(x,m)) * (z(m+1) - z(m)));
690 for (
size_t k = 0; k <
m_nsp; k++) {
691 m_flux(k,m) -= m_dthermal(k,m)*gradlogT;
703 return "spread_rate";
721 if (name==
"velocity") {
723 }
else if (name==
"spread_rate") {
725 }
else if (name==
"T") {
727 }
else if (name==
"lambda") {
729 }
else if (name ==
"eField") {
738 "no component named " + name);
761 state[
"phase"][
"name"] = m_thermo->
name();
763 state[
"phase"][
"source"] = source.
empty() ?
"<unknown>" : source.
asString();
767 state[
"emissivity-left"] = m_epsilon_left;
768 state[
"emissivity-right"] = m_epsilon_right;
771 set<bool> energy_flags(m_do_energy.begin(), m_do_energy.end());
772 if (energy_flags.size() == 1) {
773 state[
"energy-enabled"] = m_do_energy[0];
775 state[
"energy-enabled"] = m_do_energy;
778 state[
"Soret-enabled"] = m_do_soret;
780 set<bool> species_flags(m_do_species.begin(), m_do_species.end());
781 if (species_flags.size() == 1) {
782 state[
"species-enabled"] = m_do_species[0];
784 for (
size_t k = 0; k <
m_nsp; k++) {
785 state[
"species-enabled"][m_thermo->
speciesName(k)] = m_do_species[k];
789 state[
"refine-criteria"][
"ratio"] = m_refiner->maxRatio();
790 state[
"refine-criteria"][
"slope"] = m_refiner->maxDelta();
791 state[
"refine-criteria"][
"curve"] = m_refiner->maxSlope();
792 state[
"refine-criteria"][
"prune"] = m_refiner->prune();
793 state[
"refine-criteria"][
"grid-min"] = m_refiner->gridMin();
794 state[
"refine-criteria"][
"max-points"] =
795 static_cast<long int>(m_refiner->maxPoints());
798 state[
"fixed-point"][
"location"] =
m_zfixed;
799 state[
"fixed-point"][
"temperature"] =
m_tfixed;
809 arr->addExtra(
"grid",
false);
812 arr->setComponent(
"grid", value);
813 vector<double> data(
nPoints());
817 for (
size_t j = 0; j <
nPoints(); j++) {
818 data[j] = soln[index(i, j)];
820 if (!arr->hasComponent(name)) {
824 arr->setComponent(name, value);
828 arr->setComponent(
"D", value);
831 arr->addExtra(
"radiative-heat-loss",
true);
833 arr->setComponent(
"radiative-heat-loss", value);
843 auto phase = arr.
thermo();
855 const vector<double> data = arr.
getComponent(name).
as<vector<double>>();
856 for (
size_t j = 0; j <
nPoints(); j++) {
857 soln[index(i,j)] = data[j];
860 warn_user(
"StFlow::fromArray",
"Saved state does not contain values for "
861 "component '{}' in domain '{}'.", name,
id());
871 if (state.
hasKey(
"energy-enabled")) {
872 const AnyValue& ee = state[
"energy-enabled"];
882 if (state.
hasKey(
"Soret-enabled")) {
883 m_do_soret = state[
"Soret-enabled"].asBool();
886 if (state.
hasKey(
"species-enabled")) {
887 const AnyValue& se = state[
"species-enabled"];
895 if (state.
hasKey(
"radiation-enabled")) {
898 m_epsilon_left = state[
"emissivity-left"].asDouble();
899 m_epsilon_right = state[
"emissivity-right"].asDouble();
903 if (state.
hasKey(
"refine-criteria")) {
904 const AnyMap& criteria = state[
"refine-criteria"].as<
AnyMap>();
905 double ratio = criteria.
getDouble(
"ratio", m_refiner->maxRatio());
906 double slope = criteria.
getDouble(
"slope", m_refiner->maxDelta());
907 double curve = criteria.
getDouble(
"curve", m_refiner->maxSlope());
908 double prune = criteria.
getDouble(
"prune", m_refiner->prune());
909 m_refiner->setCriteria(ratio, slope, curve, prune);
911 if (criteria.
hasKey(
"grid-min")) {
912 m_refiner->setGridMin(criteria[
"grid-min"].asDouble());
914 if (criteria.
hasKey(
"max-points")) {
915 m_refiner->setMaxPoints(criteria[
"max-points"].asInt());
919 if (state.
hasKey(
"fixed-point")) {
920 m_zfixed = state[
"fixed-point"][
"location"].asDouble();
921 m_tfixed = state[
"fixed-point"][
"temperature"].asDouble();
925void StFlow::solveEnergyEqn(
size_t j)
927 bool changed =
false;
929 for (
size_t i = 0; i <
m_points; i++) {
930 if (!m_do_energy[i]) {
933 m_do_energy[i] =
true;
936 if (!m_do_energy[j]) {
939 m_do_energy[j] =
true;
952 "Not used by '{}' objects.",
type());
958 "Not used by '{}' objects.",
type());
964 "Not used by '{}' objects.",
type());
970 "Not used by '{}' objects.",
type());
976 "Not used by '{}' objects.",
type());
981 if (e_left < 0 || e_left > 1) {
983 "The left boundary emissivity must be between 0.0 and 1.0!");
984 }
else if (e_right < 0 || e_right > 1) {
986 "The right boundary emissivity must be between 0.0 and 1.0!");
988 m_epsilon_left = e_left;
989 m_epsilon_right = e_right;
993void StFlow::fixTemperature(
size_t j)
995 bool changed =
false;
997 for (
size_t i = 0; i <
m_points; i++) {
998 if (m_do_energy[i]) {
1001 m_do_energy[i] =
false;
1004 if (m_do_energy[j]) {
1007 m_do_energy[j] =
false;
1019 for(
size_t k = 0; k <
m_nsp; k++) {
1020 if (u(x, j) > 0.0) {
Header file defining class TransportFactory (see TransportFactory)
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
const AnyValue & getMetadata(const string &key) const
Get a value from the metadata applicable to the AnyMap tree containing this node.
A map of string keys to values whose type can vary at runtime.
double getDouble(const string &key, double default_) const
If key exists, return it as a double, otherwise return default_.
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
const string & getString(const string &key, const string &default_) const
If key exists, return it as a string, otherwise return default_.
A wrapper for a variable whose type is determined at runtime.
const string & asString() const
Return the held value, if it is a string.
bool & asBool()
Return the held value, if it is a bool.
bool empty() const
Return boolean indicating whether AnyValue is empty.
bool isScalar() const
Returns true if the held value is a scalar type (such as double, long int, string,...
const vector< T > & asVector(size_t nMin=npos, size_t nMax=npos) const
Return the held value, if it is a vector of type T.
const T & as() const
Get the value of this key as the specified type.
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Base class for exceptions thrown by Cantera classes.
Base class for one-dimensional domains.
size_t lastPoint() const
The index of the last (that is, right-most) grid point belonging to this domain.
shared_ptr< Solution > m_solution
Composite thermo/kinetics/transport handler.
size_t nComponents() const
Number of components at each grid point.
virtual void setMeta(const AnyMap &meta)
Retrieve meta data.
size_t nPoints() const
Number of grid points in this domain.
virtual void resize(size_t nv, size_t np)
Resize the domain to have nv components and np grid points.
size_t m_points
Number of grid points.
string m_id
Identity tag for the domain.
string type() const
String indicating the domain implemented.
size_t firstPoint() const
The index of the first (that is, left-most) grid point belonging to this domain.
void needJacUpdate()
Set this if something has changed in the governing equations (for example, the value of a constant ha...
virtual size_t loc(size_t j=0) const
Location of the start of the local solution vector in the global solution vector,.
virtual AnyMap getMeta() const
Retrieve meta data.
virtual void show(std::ostream &s, const double *x)
Print the solution.
An error indicating that an unimplemented function has been called.
size_t nSpecies() const
Returns the number of species in the phase.
virtual void setMassFractions_NoNorm(const double *const y)
Set the mass fractions to the specified values without normalizing.
double temperature() const
Temperature (K).
virtual void setPressure(double p)
Set the internally stored pressure (Pa) at constant temperature and composition.
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
string speciesName(size_t k) const
Name of the species with index k.
const vector< double > & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
virtual double density() const
Density (kg/m^3).
virtual void setTemperature(double temp)
Set the internally stored temperature of the phase (K).
virtual void setMassFractions(const double *const y)
Set the mass fractions to the specified values and normalize them.
void getMassFractions(double *const y) const
Get the species mass fractions.
virtual double pressure() const
Return the thermodynamic pressure (Pa).
string name() const
Return the name of the phase.
A container class holding arrays of state information.
void setLoc(int loc, bool restore=true)
Update the buffered location used to access SolutionArray entries.
AnyValue getComponent(const string &name) const
Retrieve a component of the SolutionArray by name.
bool hasComponent(const string &name) const
Check whether SolutionArray contains a component.
AnyMap & meta()
SolutionArray meta data.
shared_ptr< ThermoPhase > thermo()
Retrieve associated ThermoPhase object.
static shared_ptr< SolutionArray > create(const shared_ptr< Solution > &sol, int size=0, const AnyMap &meta={})
Instantiate a new SolutionArray reference.
static shared_ptr< Solution > create()
Create an empty Solution object.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
void eval(size_t jGlobal, double *xGlobal, double *rsdGlobal, integer *diagGlobal, double rdt) override
Evaluate the residual functions for axisymmetric stagnation flow.
size_t m_kExcessLeft
Index of species with a large mass fraction at each boundary, for which the mass fraction may be calc...
void setMeta(const AnyMap &state) override
Retrieve meta data.
void setTransportModel(const string &trans)
Set the transport model.
void setTransport(shared_ptr< Transport > trans) override
Set transport model to existing instance.
void setKinetics(shared_ptr< Kinetics > kin) override
Set the kinetics manager.
void resetBadValues(double *xg) override
When called, this function should reset "bad" values in the state vector such as negative species con...
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
virtual void evalMomentum(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the momentum equation residual.
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.
void resize(size_t components, size_t points) override
Change the grid size. Called after grid refinement.
StFlow(ThermoPhase *ph=0, size_t nsp=1, size_t points=1)
Create a new flow domain.
virtual void evalContinuity(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the continuity equation residual.
void setBoundaryEmissivities(double e_left, double e_right)
Set the emissivities for the boundary values.
virtual void evalEnergy(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the energy equation residual.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
size_t componentIndex(const string &name) const override
index of component with name name.
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.
virtual bool componentActive(size_t n) const
Returns true if the specified component is an active part of the solver state.
Array2D m_hk
Array of size m_nsp by m_points for saving molar enthalpies.
virtual bool doElectricField(size_t j) const
Retrieve flag indicating whether electric field is solved or not (used by IonFlow specialization)
virtual void evalSpecies(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the species equations' residuals.
void setupGrid(size_t n, const double *z) override
called to set up initial grid, and after grid refinement
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.
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.
double m_zfixed
Location of the point where temperature is fixed.
void _finalize(const double *x) override
In some cases, a domain may need to set parameters that depend on the initial solution estimate.
virtual size_t getSolvingStage() const
Get the solving stage (used by IonFlow specialization)
size_t m_nsp
Number of species in the mechanism.
virtual void evalLambda(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
Evaluate the lambda equation residual.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
AnyMap getMeta() const override
Retrieve meta data.
virtual void updateDiffFluxes(const double *x, size_t j0, size_t j1)
Update the diffusive mass fluxes.
string componentName(size_t n) const override
Name of the nth component. May be overloaded.
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.
virtual void grad_hk(const double *x, size_t j)
Get the gradient of species specific molar enthalpies.
string transportModel() const
Retrieve transport model.
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 qdotRadia...
virtual void updateProperties(size_t jg, double *x, size_t jmin, size_t jmax)
Update the properties (thermo, transport, and diffusion flux).
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
virtual void setSolvingStage(const size_t stage)
Solving stage mode for handling ionized species (used by IonFlow specialization)
void setPressure(double p)
Set the pressure.
virtual void fixElectricField(size_t j=npos)
Set to fix voltage in a point (used by IonFlow specialization)
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.
virtual void solveElectricField(size_t j=npos)
Set to solve electric field in a point (used by IonFlow specialization)
void _getInitialSoln(double *x) override
Write the initial solution estimate into array x.
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
Base class for a phase with thermodynamic properties.
virtual double maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
const AnyMap & input() const
Access input data associated with the phase description.
virtual void getThermalDiffCoeffs(double *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
virtual string transportModel() const
Identifies the model represented by this Transport object.
virtual void getMixDiffCoeffs(double *const d)
Returns a vector of mixture averaged diffusion coefficients.
virtual double thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
virtual double viscosity()
The viscosity in Pa-s.
virtual void getMultiDiffCoeffs(const size_t ld, double *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
Header for a file containing miscellaneous numerical functions.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
double linearInterp(double x, const vector< double > &xpts, const vector< double > &fpts)
Linearly interpolate a function defined on a discrete grid.
const double OneAtm
One atmosphere [Pa].
const double StefanBoltz
Stefan-Boltzmann constant [W/m2/K4].
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
@ c_offset_U
axial velocity
@ c_offset_E
electric field equation
@ c_offset_Y
mass fractions