29 m_transport_option(-1),
54 m_nv = c_offset_Y + m_nsp;
57 m_do_species.resize(m_nsp,
true);
60 m_do_energy.resize(m_points,
false);
62 m_diff.resize(m_nsp*m_points);
63 m_multidiff.resize(m_nsp*m_nsp*m_points);
64 m_flux.
resize(m_nsp,m_points);
65 m_wdot.
resize(m_nsp,m_points, 0.0);
67 m_qdotRadiation.resize(m_points, 0.0);
71 setBounds(0, -1e20, 1e20);
72 setBounds(1, -1e20, 1e20);
73 setBounds(2, 200.0, 1e9);
74 setBounds(3, -1e20, 1e20);
77 for (
size_t k = 0; k < m_nsp; k++) {
78 setBounds(4+k, -1.0e-5, 1.0e5);
86 m_refiner->setActive(0,
false);
87 m_refiner->setActive(1,
false);
88 m_refiner->setActive(2,
false);
89 m_refiner->setActive(3,
false);
92 for (
size_t ng = 0; ng < m_points; ng++) {
93 gr.push_back(1.0*ng/m_points);
96 setID(
"stagnation flow");
109 m_rho.resize(m_points, 0.0);
110 m_wtm.resize(m_points, 0.0);
111 m_cp.resize(m_points, 0.0);
112 m_visc.resize(m_points, 0.0);
113 m_tcon.resize(m_points, 0.0);
115 if (m_transport_option == c_Mixav_Transport) {
116 m_diff.resize(m_nsp*m_points);
118 m_multidiff.resize(m_nsp*m_nsp*m_points);
119 m_diff.resize(m_nsp*m_points);
120 m_dthermal.
resize(m_nsp, m_points, 0.0);
122 m_flux.
resize(m_nsp,m_points);
123 m_wdot.
resize(m_nsp,m_points, 0.0);
124 m_do_energy.resize(m_points,
false);
125 m_qdotRadiation.resize(m_points, 0.0);
128 m_fixedtemp.resize(m_points);
130 m_dz.resize(m_points-1);
131 m_z.resize(m_points);
140 for (j = 1; j < m_points; j++) {
141 if (z[j] <= z[j-1]) {
143 "grid points must be monotonically increasing");
146 m_dz[j-1] = m_z[j] - m_z[j-1];
153 m_do_soret = withSoret;
155 int model = m_trans->
model();
156 if (model == cMulticomponent || model == CK_Multicomponent) {
157 m_transport_option = c_Multi_Transport;
158 m_multidiff.resize(m_nsp*m_nsp*m_points);
159 m_diff.resize(m_nsp*m_points);
160 m_dthermal.
resize(m_nsp, m_points, 0.0);
161 }
else if (model == cMixtureAveraged || model == CK_MixtureAveraged) {
162 m_transport_option = c_Mixav_Transport;
163 m_diff.resize(m_nsp*m_points);
166 "Thermal diffusion (the Soret effect) "
167 "requires using a multicomponent transport model.");
169 throw CanteraError(
"setTransport",
"unknown transport model.");
173 void StFlow::enableSoret(
bool withSoret)
175 if (m_transport_option == c_Multi_Transport) {
176 m_do_soret = withSoret;
178 throw CanteraError(
"setTransport",
179 "Thermal diffusion (the Soret effect) "
180 "requires using a multicomponent transport model.");
187 const doublereal* yy = x + m_nv*j + c_offset_Y;
195 const doublereal* yyj = x + m_nv*j + c_offset_Y;
196 const doublereal* yyjp = x + m_nv*(j+1) + c_offset_Y;
197 for (
size_t k = 0; k < m_nsp; k++) {
198 m_ybar[k] = 0.5*(yyj[k] + yyjp[k]);
208 size_t nz = m_zfix.size();
209 bool e = m_do_energy[0];
210 for (j = 0; j < m_points; j++) {
212 m_fixedtemp[j] = T(x, j);
214 zz = (z(j) - z(0))/(z(m_points - 1) - z(0));
218 for (k = 0; k < m_nsp; k++) {
228 doublereal* rg, integer* diagg, doublereal rdt)
243 doublereal* x = xg +
loc();
244 doublereal* rsd = rg +
loc();
245 integer* diag = diagg +
loc();
253 size_t jpt = (jg == 0) ? 0 : jg -
firstPoint();
254 jmin = std::max<size_t>(jpt, 1) - 1;
255 jmax = std::min(jpt+1,m_points-1);
259 size_t j0 = std::max<size_t>(jmin, 1) - 1;
260 size_t j1 = std::min(jmax+1,m_points-1);
284 doublereal sum, sum2, dtdzj;
301 if (m_do_radiation) {
304 doublereal k_P_ref = 1.0*
OneAtm;
307 const doublereal c_H2O[6] = {-0.23093, -1.12390, 9.41530, -2.99880,
308 0.51382, -1.86840e-5};
309 const doublereal c_CO2[6] = {18.741, -121.310, 273.500, -194.050,
313 double boundary_Rad_left = m_epsilon_left *
StefanBoltz * pow(T(x, 0), 4);
314 double boundary_Rad_right = m_epsilon_right *
StefanBoltz * pow(T(x, m_points - 1), 4);
317 for (
size_t j = jmin; j < jmax; j++) {
319 double radiative_heat_loss = 0;
326 for (
size_t n = 0; n <= 5; n++) {
327 k_P_H2O += c_H2O[n] * pow(1000 / T(x, j), (
double) n);
335 for (
size_t n = 0; n <= 5; n++) {
336 k_P_CO2 += c_CO2[n] * pow(1000 / T(x, j), (
double) n);
343 radiative_heat_loss = 2 * k_P *(2 *
StefanBoltz * pow(T(x, j), 4)
344 - boundary_Rad_left - boundary_Rad_right);
347 m_qdotRadiation[j] = radiative_heat_loss;
351 for (j = jmin; j <= jmax; j++) {
363 rsd[index(c_offset_U,0)] =
364 -(rho_u(x,1) - rho_u(x,0))/m_dz[0]
365 -(density(1)*V(x,1) + density(0)*V(x,0));
372 rsd[index(c_offset_V,0)] = V(x,0);
373 rsd[index(c_offset_T,0)] = T(x,0);
374 rsd[index(c_offset_L,0)] = -rho_u(x,0);
380 for (k = 0; k < m_nsp; k++) {
382 rsd[index(c_offset_Y + k, 0)] =
383 -(m_flux(k,0) + rho_u(x,0)* Y(x,k,0));
385 rsd[index(c_offset_Y, 0)] = 1.0 - sum;
388 else if (j == m_points - 1) {
401 rsd[index(c_offset_V,j)]
402 = (shear(x,j) - lambda(x,j) - rho_u(x,j)*dVdz(x,j)
403 - m_rho[j]*V(x,j)*V(x,j))/m_rho[j]
404 - rdt*(V(x,j) - V_prev(j));
405 diag[index(c_offset_V, j)] = 1;
416 doublereal convec, diffus;
417 for (k = 0; k < m_nsp; k++) {
418 convec = rho_u(x,j)*dYdz(x,k,j);
419 diffus = 2.0*(m_flux(k,j) - m_flux(k,j-1))
421 rsd[index(c_offset_Y + k, j)]
422 = (m_wt[k]*(wdot(k,j))
423 - convec - diffus)/m_rho[j]
424 - rdt*(Y(x,k,j) - Y_prev(k,j));
425 diag[index(c_offset_Y + k, j)] = 1;
437 if (m_do_energy[j]) {
448 for (k = 0; k < m_nsp; k++) {
449 flxk = 0.5*(m_flux(k,j-1) + m_flux(k,j));
450 sum += wdot(k,j)*h_RT[k];
451 sum2 += flxk*cp_R[k]/m_wt[k];
457 rsd[index(c_offset_T, j)] =
458 - m_cp[j]*rho_u(x,j)*dtdzj
459 - divHeatFlux(x,j) - sum - sum2;
460 rsd[index(c_offset_T, j)] /= (m_rho[j]*m_cp[j]);
462 rsd[index(c_offset_T, j)] -= rdt*(T(x,j) - T_prev(j));
463 rsd[index(c_offset_T, j)] -= (m_qdotRadiation[j] / (m_rho[j] * m_cp[j]));
464 diag[index(c_offset_T, j)] = 1;
467 rsd[index(c_offset_T, j)] = T(x,j) -
T_fixed(j);
468 diag[index(c_offset_T, j)] = 0;
471 rsd[index(c_offset_L, j)] = lambda(x,j) - lambda(x,j-1);
472 diag[index(c_offset_L, j)] = 0;
479 if (m_transport_option == c_Mixav_Transport) {
480 for (
size_t j = j0; j < j1; j++) {
482 m_visc[j] = (m_dovisc ? m_trans->
viscosity() : 0.0);
486 }
else if (m_transport_option == c_Multi_Transport) {
487 for (
size_t j = j0; j < j1; j++) {
490 doublereal rho = m_thermo->
density();
491 m_visc[j] = (m_dovisc ? m_trans->
viscosity() : 0.0);
495 for (
size_t k = 0; k < m_nsp; k++) {
496 m_diff[k+j*m_nsp] = m_wt[k] * rho / (wtm*wtm);
516 sprintf(buf,
" Pressure: %10.4g Pa \n", m_press);
518 for (i = 0; i < nn; i++) {
519 writeline(
'-', 79,
false,
true);
520 sprintf(buf,
"\n z ");
522 for (n = 0; n < 5; n++) {
526 writeline(
'-', 79,
false,
true);
527 for (j = 0; j < m_points; j++) {
528 sprintf(buf,
"\n %10.4g ",m_z[j]);
530 for (n = 0; n < 5; n++) {
531 sprintf(buf,
" %10.4g ",component(x, i*5+n,j));
537 size_t nrem = m_nv - 5*nn;
538 writeline(
'-', 79,
false,
true);
539 sprintf(buf,
"\n z ");
541 for (n = 0; n < nrem; n++) {
545 writeline(
'-', 79,
false,
true);
546 for (j = 0; j < m_points; j++) {
547 sprintf(buf,
"\n %10.4g ",m_z[j]);
549 for (n = 0; n < nrem; n++) {
550 sprintf(buf,
" %10.4g ",component(x, nn*5+n,j));
555 if (m_do_radiation) {
556 writeline(
'-', 79,
false,
true);
557 sprintf(buf,
"\n z radiative heat loss");
559 writeline(
'-', 79,
false,
true);
560 for (j = 0; j < m_points; j++) {
561 sprintf(buf,
"\n %10.4g %10.4g", m_z[j], m_qdotRadiation[j]);
571 doublereal sum, wtm, rho, dz, gradlogT;
573 switch (m_transport_option) {
575 case c_Mixav_Transport:
576 for (j = j0; j < j1; j++) {
582 for (k = 0; k < m_nsp; k++) {
583 m_flux(k,j) = m_wt[k]*(rho*m_diff[k+m_nsp*j]/wtm);
584 m_flux(k,j) *= (X(x,k,j) - X(x,k,j+1))/dz;
588 for (k = 0; k < m_nsp; k++) {
589 m_flux(k,j) += sum*Y(x,k,j);
594 case c_Multi_Transport:
595 for (j = j0; j < j1; j++) {
598 for (k = 0; k < m_nsp; k++) {
599 doublereal sum = 0.0;
600 for (
size_t m = 0; m < m_nsp; m++) {
601 sum += m_wt[m] * m_multidiff[mindex(k,m,j)] * (X(x,m,j+1)-X(x,m,j));
603 m_flux(k,j) = sum * m_diff[k+j*m_nsp] / dz;
609 throw CanteraError(
"updateDiffFluxes",
"unknown transport model");
613 for (m = j0; m < j1; m++) {
614 gradlogT = 2.0 * (T(x,m+1) - T(x,m)) /
615 ((T(x,m+1) + T(x,m)) * (z(m+1) - z(m)));
616 for (k = 0; k < m_nsp; k++) {
617 m_flux(k,m) -= m_dthermal(k,m)*gradlogT;
635 if (n >= c_offset_Y && n < (c_offset_Y + m_nsp)) {
643 size_t StFlow::componentIndex(
const std::string& name)
const
647 }
else if (name==
"V") {
649 }
else if (name==
"T") {
651 }
else if (name==
"lambda") {
654 for (
size_t n=4; n<m_nsp+4; n++) {
667 vector<string> ignored;
672 for (
size_t istr = 0; istr < str.size(); istr++) {
678 pp =
getFloat(dom,
"pressure",
"pressure");
682 size_t nd = d.size();
685 size_t n, np = 0, j, ks, k;
687 bool readgrid =
false, wrote_header =
false;
688 for (n = 0; n < nd; n++) {
701 "domain contains no grid points.");
704 writelog(
"Importing datasets:\n", loglevel >= 2);
705 for (n = 0; n < nd; n++) {
710 writelog(
"axial velocity ", loglevel >= 2);
711 if (x.size() != np) {
713 "axial velocity array size error");
715 for (j = 0; j < np; j++) {
716 soln[index(0,j)] = x[j];
718 }
else if (nm ==
"z") {
720 }
else if (nm ==
"V") {
721 writelog(
"radial velocity ", loglevel >= 2);
722 if (x.size() != np) {
724 "radial velocity array size error");
726 for (j = 0; j < np; j++) {
727 soln[index(1,j)] = x[j];
729 }
else if (nm ==
"T") {
730 writelog(
"temperature ", loglevel >= 2);
731 if (x.size() != np) {
733 "temperature array size error");
735 for (j = 0; j < np; j++) {
736 soln[index(2,j)] = x[j];
745 for (
size_t jj = 0; jj < np; jj++) {
746 zz[jj] = (grid(jj) - zmin())/(zmax() - zmin());
749 }
else if (nm ==
"L") {
751 if (x.size() != np) {
753 "lambda arary size error");
755 for (j = 0; j < np; j++) {
756 soln[index(3,j)] = x[j];
760 if (x.size() == np) {
763 for (j = 0; j < np; j++) {
764 soln[index(k+4,j)] = x[j];
768 ignored.push_back(nm);
772 if (loglevel >=2 && !ignored.empty()) {
775 size_t nn = ignored.size();
776 for (
size_t n = 0; n < nn; n++) {
782 for (ks = 0; ks < nsp; ks++) {
783 if (did_species[ks] == 0) {
785 writelog(
"Missing data for species:\n");
793 if (dom.
hasChild(
"energy_enabled")) {
796 for (
size_t i = 0; i < x.size(); i++) {
797 m_do_energy[i] = x[i];
799 }
else if (!x.empty()) {
800 throw CanteraError(
"StFlow::restore",
"energy_enabled is length" +
801 int2str(x.size()) +
"but should be length" +
806 if (dom.
hasChild(
"species_enabled")) {
808 if (x.size() == m_nsp) {
809 for (
size_t i = 0; i < x.size(); i++) {
810 m_do_species[i] = x[i];
812 }
else if (!x.empty()) {
816 writelog(
"\nWarning: StFlow::restore: species_enabled is length " +
817 int2str(x.size()) +
" but should be length " +
818 int2str(m_nsp) +
". Enabling all species equations by default.");
820 m_do_species.assign(m_nsp,
true);
824 if (dom.
hasChild(
"refine_criteria")) {
844 XML_Node& gv = flow.addChild(
"grid_data");
845 addFloat(flow,
"pressure", m_press,
"Pa",
"pressure");
864 for (k = 0; k < m_nsp; k++) {
867 x.size(),
DATA_PTR(x),
"",
"massFraction");
869 if (m_do_radiation) {
871 DATA_PTR(m_qdotRadiation),
"W/m^3",
"specificPower");
874 for (
size_t i = 0; i <
nPoints(); i++) {
875 values[i] = m_do_energy[i];
879 values.resize(m_nsp);
880 for (
size_t i = 0; i < m_nsp; i++) {
881 values[i] = m_do_species[i];
885 XML_Node& ref = flow.addChild(
"refine_criteria");
901 integer* diag, doublereal rdt)
903 size_t j = m_points - 1;
908 rsd[index(0,j)] = rho_u(x,j);
909 rsd[index(1,j)] = V(x,j);
910 rsd[index(2,j)] = T(x,j);
911 rsd[index(c_offset_L, j)] = lambda(x,j) - lambda(x,j-1);
912 diag[index(c_offset_L, j)] = 0;
913 doublereal sum = 0.0;
914 for (
size_t k = 0; k < m_nsp; k++) {
916 rsd[index(k+4,j)] = m_flux(k,j-1) + rho_u(x,j)*Y(x,k,j);
918 rsd[index(4,j)] = 1.0 - sum;
919 diag[index(4,j)] = 0;
923 integer* diag, doublereal rdt)
936 rsd[index(c_offset_U,j)] =
937 -(rho_u(x,j+1) - rho_u(x,j))/m_dz[j]
938 -(density(j+1)*V(x,j+1) + density(j)*V(x,j));
941 diag[index(c_offset_U, j)] = 0;
944 FreeFlame::FreeFlame(
IdealGasPhase* ph,
size_t nsp,
size_t points) :
954 integer* diag, doublereal rdt)
956 size_t j = m_points - 1;
963 rsd[index(0,j)] = rho_u(x,j) - rho_u(x,j-1);
964 rsd[index(1,j)] = V(x,j);
965 rsd[index(2,j)] = T(x,j) - T(x,j-1);
966 doublereal sum = 0.0;
967 rsd[index(c_offset_L, j)] = lambda(x,j) - lambda(x,j-1);
968 diag[index(c_offset_L, j)] = 0;
969 for (
size_t k = 0; k < m_nsp; k++) {
971 rsd[index(k+4,j)] = m_flux(k,j-1) + rho_u(x,j)*Y(x,k,j);
973 rsd[index(4,j)] = 1.0 - sum;
974 diag[index(4,j)] = 0;
978 integer* diag, doublereal rdt)
988 rsd[index(c_offset_U,j)] =
989 - (rho_u(x,j) - rho_u(x,j-1))/m_dz[j-1]
990 - (density(j-1)*V(x,j-1) + density(j)*V(x,j));
994 if (m_do_energy[j]) {
995 rsd[index(c_offset_U,j)] = (T(x,j) -
m_tfixed);
997 rsd[index(c_offset_U,j)] = (rho_u(x,j)
1001 rsd[index(c_offset_U,j)] =
1002 - (rho_u(x,j+1) - rho_u(x,j))/m_dz[j]
1003 - (density(j+1)*V(x,j+1) + density(j)*V(x,j));
1006 diag[index(c_offset_U, j)] = 0;
1016 for (
size_t j = 0; j < m_points; j++) {
1022 for (
size_t j = 0; j < m_points - 1; j++) {
void addFloatArray(XML_Node &node, const std::string &title, const size_t n, const doublereal *const vals, const std::string &units, const std::string &type, const doublereal minval, const doublereal maxval)
This function adds a child node with the name, "floatArray", with a value consisting of a comma separ...
virtual doublereal density() const
Density (kg/m^3).
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
virtual void _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
void updateThermo(const doublereal *x, size_t j0, size_t j1)
Update the thermodynamic properties from point j0 to point j1 (inclusive), based on solution x...
size_t nPoints() const
Number of grid points in this domain.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
virtual void evalRightBoundary(doublereal *x, doublereal *res, integer *diag, doublereal rdt)=0
Evaluate all residual components at the right boundary.
const doublereal StefanBoltz
Stefan-Boltzmann constant.
const doublereal OneAtm
One atmosphere [Pa].
virtual int model() const
Transport model.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with 'v'.
void addNamedFloatArray(XML_Node &node, const std::string &name, const size_t n, const doublereal *const vals, const std::string units, const std::string type, const doublereal minval, const doublereal maxval)
This function adds a child node with the name given by the first parameter with a value consisting of...
virtual void evalRightBoundary(doublereal *x, doublereal *res, integer *diag, doublereal rdt)
Evaluate all residual components at the right boundary.
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state...
const size_t npos
index returned by functions to indicate "no position"
size_t firstPoint() const
The index of the first (i.e., left-most) grid point belonging to this domain.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
virtual void _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
virtual void evalContinuity(size_t j, doublereal *x, doublereal *r, integer *diag, doublereal rdt)
Evaluate the residual corresponding to the continuity equation at all interior grid points...
void addString(XML_Node &node, const std::string &titleString, const std::string &valueString, const std::string &typeString)
This function adds a child node with the name string with a string value to the current node...
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
virtual size_t loc(size_t j=0) const
Location of the start of the local solution vector in the global solution vector,.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual XML_Node & save(XML_Node &o, const doublereal *const sol)
Save the current solution for this domain into an XML_Node.
Base class for transport property managers.
void setPressure(doublereal p)
Set the pressure.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
doublereal * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
virtual void evalContinuity(size_t j, doublereal *x, doublereal *r, integer *diag, doublereal rdt)=0
Evaluate the residual corresponding to the continuity equation at all interior grid points...
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
const doublereal Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
virtual XML_Node & save(XML_Node &o, const doublereal *const sol)
Save the current solution for this domain into an XML_Node.
doublereal m_tfixed
Temperature at the point used to fix the flame location.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
std::vector< int > vector_int
Vector of ints.
Base class for one-dimensional domains.
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
doublereal T_fixed(size_t j) const
The fixed temperature value at point j.
void setCriteria(doublereal ratio=10.0, doublereal slope=0.8, doublereal curve=0.8, doublereal prune=-0.1)
Set grid refinement criteria.
size_t lastPoint() const
The index of the last (i.e., right-most) grid point belonging to this domain.
void setID(const std::string &s)
Specify an identifying tag for this domain.
virtual void evalRightBoundary(doublereal *x, doublereal *res, integer *diag, doublereal rdt)
Evaluate all residual components at the right boundary.
size_t nColumns() const
Number of columns.
void setFixedTempProfile(vector_fp &zfixed, vector_fp &tfixed)
Sometimes it is desired to carry out the simulation using a specified temperature profile...
Base class for exceptions thrown by Cantera classes.
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
virtual doublereal viscosity()
std::vector< size_t > m_kRadiating
Indices within the ThermoPhase of the radiating species.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void resize(size_t nv, size_t np)
doublereal m_zfixed
Location of the point where temperature is fixed.
void setGridMin(double gridmin)
Set the minimum allowable spacing between adjacent grid points [m].
void addAttribute(const std::string &attrib, const std::string &value)
Add or modify an attribute of the current node.
Refiner & refiner()
Return a reference to the grid refiner.
void getWdot(doublereal *x, size_t j)
Write the net production rates at point j into array m_wdot
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual void setMassFractions_NoNorm(const doublereal *const y)
Set the mass fractions to the specified values without normalizing.
size_t nSpecies() const
Returns the number of species in the phase.
virtual void evalContinuity(size_t j, doublereal *x, doublereal *r, integer *diag, doublereal rdt)
Evaluate the residual corresponding to the continuity equation at all interior grid points...
Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplie...
virtual void getMultiDiffCoeffs(const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
void setGas(const doublereal *x, size_t j)
Set the gas object state to be consistent with the solution at point j.
std::string value() const
Return the value of an XML node as a string.
virtual void showSolution(const doublereal *x)
Print the solution.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
void addFloat(XML_Node &node, const std::string &title, const doublereal val, const std::string &units, const std::string &type, const doublereal minval, const doublereal maxval)
This function adds a child node with the name, "float", with a value consisting of a single floating ...
void setSteadyTolerances(doublereal rtol, doublereal atol, size_t n=npos)
Set tolerances for steady-state mode.
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
void updateTransport(doublereal *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 getMixDiffCoeffs(doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.
virtual void setupGrid(size_t n, const doublereal *z)
called to set up initial grid, and after grid refinement
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void setGasAtMidpoint(const doublereal *x, size_t j)
Set the gas state to be consistent with the solution at the midpoint between j and j + 1...
void setTransport(Transport &trans, bool withSoret=false)
set the transport manager
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
size_t getFloatArray(const XML_Node &node, std::vector< doublereal > &v, const bool convert, const std::string &unitsString, const std::string &nodeName)
This function reads the current node or a child node of the current node with the default name...
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
void updateDiffFluxes(const doublereal *x, size_t j0, size_t j1)
Update the diffusive mass fluxes.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
void getRow(size_t n, doublereal *const rw)
Get the nth row and return it in a vector.
void writelog(const std::string &msg)
Write a message to the screen.
void resize(size_t components, size_t points)
Change the grid size. Called after grid refinement.
void setMassFraction(size_t j, size_t k, doublereal y)
Header for a file containing miscellaneous numerical functions.
void setTransientTolerances(doublereal rtol, doublereal atol, size_t n=npos)
Set tolerances for time-stepping mode.
virtual void eval(size_t j, doublereal *x, doublereal *r, integer *mask, doublereal rdt)
std::string speciesName(size_t k) const
Name of the species with index k.
void getChildren(const std::string &name, std::vector< XML_Node * > &children) const
Get a vector of pointers to XML_Node containing all of the children of the current node which matches...
doublereal linearInterp(doublereal x, const vector_fp &xpts, const vector_fp &fpts)
Linearly interpolate a function defined on a discrete grid.
virtual XML_Node & save(XML_Node &o, const doublereal *const sol)
Save the current solution for this domain into an XML_Node.
virtual void setPressure(doublereal p)
Set the pressure at constant temperature and composition.
bool getOptionalFloat(const XML_Node &parent, const std::string &name, doublereal &fltRtn, const std::string &type)
Get an optional floating-point value from a child element.