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++) {
629 for (
size_t j = j0; j < j1; j++) {
631 m_visc[j] = (m_dovisc ? m_trans->
viscosity() : 0.0);
633 double rho = m_thermo->
density();
635 for (
size_t k=0; k <
m_nsp; k++) {
645 writelog(
" Pressure: {:10.4g} Pa\n", m_press);
650 writeline(
'-', 79,
false,
true);
651 writelog(
"\n z radiative heat loss");
652 writeline(
'-', 79,
false,
true);
653 for (
size_t j = 0; j <
m_points; j++) {
662 if (m_do_multicomponent) {
663 for (
size_t j = j0; j < j1; j++) {
664 double dz = z(j+1) - z(j);
665 for (
size_t k = 0; k <
m_nsp; k++) {
667 for (
size_t m = 0; m <
m_nsp; m++) {
668 sum += m_wt[m] * m_multidiff[mindex(k,m,j)] * (X(x,m,j+1)-X(x,m,j));
674 for (
size_t j = j0; j < j1; j++) {
676 double dz = z(j+1) - z(j);
677 for (
size_t k = 0; k <
m_nsp; k++) {
679 m_flux(k,j) *= (X(x,k,j) - X(x,k,j+1))/dz;
683 for (
size_t k = 0; k <
m_nsp; k++) {
684 m_flux(k,j) += sum*Y(x,k,j);
690 for (
size_t m = j0; m < j1; m++) {
691 double gradlogT = 2.0 * (T(x,m+1) - T(x,m)) /
692 ((T(x,m+1) + T(x,m)) * (z(m+1) - z(m)));
693 for (
size_t k = 0; k <
m_nsp; k++) {
694 m_flux(k,m) -= m_dthermal(k,m)*gradlogT;
706 return "spread_rate";
724 if (name==
"velocity") {
726 }
else if (name==
"spread_rate") {
728 }
else if (name==
"T") {
730 }
else if (name==
"lambda") {
732 }
else if (name ==
"eField") {
741 "no component named " + name);
764 state[
"phase"][
"name"] = m_thermo->
name();
766 state[
"phase"][
"source"] = source.
empty() ?
"<unknown>" : source.
asString();
770 state[
"emissivity-left"] = m_epsilon_left;
771 state[
"emissivity-right"] = m_epsilon_right;
774 set<bool> energy_flags(m_do_energy.begin(), m_do_energy.end());
775 if (energy_flags.size() == 1) {
776 state[
"energy-enabled"] = m_do_energy[0];
778 state[
"energy-enabled"] = m_do_energy;
781 state[
"Soret-enabled"] = m_do_soret;
783 set<bool> species_flags(m_do_species.begin(), m_do_species.end());
784 if (species_flags.size() == 1) {
785 state[
"species-enabled"] = m_do_species[0];
787 for (
size_t k = 0; k <
m_nsp; k++) {
788 state[
"species-enabled"][m_thermo->
speciesName(k)] = m_do_species[k];
792 state[
"refine-criteria"][
"ratio"] = m_refiner->maxRatio();
793 state[
"refine-criteria"][
"slope"] = m_refiner->maxDelta();
794 state[
"refine-criteria"][
"curve"] = m_refiner->maxSlope();
795 state[
"refine-criteria"][
"prune"] = m_refiner->prune();
796 state[
"refine-criteria"][
"grid-min"] = m_refiner->gridMin();
797 state[
"refine-criteria"][
"max-points"] =
798 static_cast<long int>(m_refiner->maxPoints());
801 state[
"fixed-point"][
"location"] =
m_zfixed;
802 state[
"fixed-point"][
"temperature"] =
m_tfixed;
812 arr->addExtra(
"grid",
false);
815 arr->setComponent(
"grid", value);
816 vector<double> data(
nPoints());
820 for (
size_t j = 0; j <
nPoints(); j++) {
821 data[j] = soln[index(i, j)];
823 if (!arr->hasComponent(name)) {
827 arr->setComponent(name, value);
831 arr->setComponent(
"D", value);
834 arr->addExtra(
"radiative-heat-loss",
true);
836 arr->setComponent(
"radiative-heat-loss", value);
846 auto phase = arr.
thermo();
858 const vector<double> data = arr.
getComponent(name).
as<vector<double>>();
859 for (
size_t j = 0; j <
nPoints(); j++) {
860 soln[index(i,j)] = data[j];
863 warn_user(
"StFlow::fromArray",
"Saved state does not contain values for "
864 "component '{}' in domain '{}'.", name,
id());
874 if (state.
hasKey(
"energy-enabled")) {
875 const AnyValue& ee = state[
"energy-enabled"];
885 if (state.
hasKey(
"Soret-enabled")) {
886 m_do_soret = state[
"Soret-enabled"].asBool();
889 if (state.
hasKey(
"species-enabled")) {
890 const AnyValue& se = state[
"species-enabled"];
898 if (state.
hasKey(
"radiation-enabled")) {
901 m_epsilon_left = state[
"emissivity-left"].asDouble();
902 m_epsilon_right = state[
"emissivity-right"].asDouble();
906 if (state.
hasKey(
"refine-criteria")) {
907 const AnyMap& criteria = state[
"refine-criteria"].as<
AnyMap>();
908 double ratio = criteria.
getDouble(
"ratio", m_refiner->maxRatio());
909 double slope = criteria.
getDouble(
"slope", m_refiner->maxDelta());
910 double curve = criteria.
getDouble(
"curve", m_refiner->maxSlope());
911 double prune = criteria.
getDouble(
"prune", m_refiner->prune());
912 m_refiner->setCriteria(ratio, slope, curve, prune);
914 if (criteria.
hasKey(
"grid-min")) {
915 m_refiner->setGridMin(criteria[
"grid-min"].asDouble());
917 if (criteria.
hasKey(
"max-points")) {
918 m_refiner->setMaxPoints(criteria[
"max-points"].asInt());
922 if (state.
hasKey(
"fixed-point")) {
923 m_zfixed = state[
"fixed-point"][
"location"].asDouble();
924 m_tfixed = state[
"fixed-point"][
"temperature"].asDouble();
928 void StFlow::solveEnergyEqn(
size_t j)
930 bool changed =
false;
932 for (
size_t i = 0; i <
m_points; i++) {
933 if (!m_do_energy[i]) {
936 m_do_energy[i] =
true;
939 if (!m_do_energy[j]) {
942 m_do_energy[j] =
true;
955 "Not used by '{}' objects.",
type());
961 "Not used by '{}' objects.",
type());
967 "Not used by '{}' objects.",
type());
973 "Not used by '{}' objects.",
type());
979 "Not used by '{}' objects.",
type());
984 if (e_left < 0 || e_left > 1) {
986 "The left boundary emissivity must be between 0.0 and 1.0!");
987 }
else if (e_right < 0 || e_right > 1) {
989 "The right boundary emissivity must be between 0.0 and 1.0!");
991 m_epsilon_left = e_left;
992 m_epsilon_right = e_right;
996 void StFlow::fixTemperature(
size_t j)
998 bool changed =
false;
1000 for (
size_t i = 0; i <
m_points; i++) {
1001 if (m_do_energy[i]) {
1004 m_do_energy[i] =
false;
1007 if (m_do_energy[j]) {
1010 m_do_energy[j] =
false;
1022 for(
size_t k = 0; k <
m_nsp; k++) {
1023 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.
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
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.
static shared_ptr< SolutionArray > create(const shared_ptr< Solution > &sol, int size=0, const AnyMap &meta={})
Instantiate a new SolutionArray reference.
AnyMap & meta()
SolutionArray meta data.
shared_ptr< ThermoPhase > thermo()
Retrieve associated ThermoPhase object.
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.
vector< double > m_diff
Array of size m_nsp by m_points for saving density times diffusion coefficient times species molar ma...
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