24 const int LeftInlet = 1;
25 const int RightInlet = -1;
58 virtual size_t nSpecies() {
83 virtual doublereal
mdot() {
88 writelog(
"Bdry1D::_getInitialSoln called!\n");
91 virtual void setupGrid(
size_t n,
const doublereal* z) {}
96 StFlow* m_flow_left, *m_flow_right;
97 size_t m_ilr, m_left_nv, m_right_nv;
98 size_t m_left_loc, m_right_loc;
100 size_t m_nv, m_left_nsp, m_right_nsp;
101 size_t m_sp_left, m_sp_right;
102 size_t m_start_left, m_start_right;
104 doublereal m_temp, m_mdot;
133 sprintf(buf,
" Mass Flux: %10.4g kg/m^2/s \n", m_mdot);
135 sprintf(buf,
" Temperature: %10.4g K \n", m_temp);
139 for (
size_t k = 0; k < m_flow->phase().
nSpecies(); k++) {
140 if (m_yin[k] != 0.0) {
141 sprintf(buf,
" %16s %10.4g \n",
155 virtual size_t nSpecies() {
166 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
167 integer* diagg, doublereal rdt);
169 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
196 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
197 integer* diagg, doublereal rdt);
200 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
223 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
224 integer* diagg, doublereal rdt);
227 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
241 m_type = cOutletType;
248 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
249 integer* diagg, doublereal rdt);
252 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
267 m_type = cOutletResType;
277 virtual size_t nSpecies() {
288 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
289 integer* diagg, doublereal rdt);
291 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
317 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
318 integer* diagg, doublereal rdt);
321 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
327 virtual void showSolution_s(std::ostream& s,
const doublereal* x) {
328 s <<
"------------------- Surface " <<
domainIndex() <<
" ------------------- " << std::endl;
329 s <<
" temperature: " << m_temp <<
" K" <<
" " << x[0] << std::endl;
334 sprintf(buf,
" Temperature: %10.4g K \n", m_temp);
348 m_kin(0), m_surfindex(0), m_nsp(0) {
360 void enableCoverageEquations(
bool docov) {
368 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
369 integer* diagg, doublereal rdt);
372 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
381 std::copy(x+1,x+1+m_nsp,m_fixed_cov.begin());
386 sprintf(buf,
" Temperature: %10.4g K \n", x[0]);
389 for (
size_t k = 0; k < m_nsp; k++) {
390 sprintf(buf,
" %20s %10.4g \n", m_sphase->
speciesName(k).c_str(),
400 size_t m_surfindex, m_nsp;
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase, assuming an ideal solution model (see Thermodynamic Properties and class SurfPhase).
virtual void showSolution(const doublereal *x)
Print the solution.
virtual doublereal mdot()
The total mass flow rate [kg/m2/s].
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
An error indicating that an unimplemented function has been called.
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism...
virtual void setMoleFractions(const std::string &xin)
Set the mole fractions by specifying a std::string.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual void showSolution(const doublereal *x)
Print the solution.
virtual void showSolution(const doublereal *x)
Print the solution.
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual void setMoleFractions(const std::string &xin)
Set the mole fractions by specifying a std::string.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void setTemperature(doublereal t)
Set the temperature.
virtual doublereal massFraction(size_t k)
Mass fraction of species k.
virtual void showSolution(const doublereal *x)
Print the solution.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
A terminator that does nothing.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
virtual doublereal massFraction(size_t k)
Mass fraction of species k.
virtual doublereal temperature()
Temperature [K].
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
void getCoverages(doublereal *theta) const
Return a vector of surface coverages.
Base class for a phase with thermodynamic properties.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
Base class for one-dimensional domains.
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
size_t surfacePhaseIndex()
This returns the integer index of the phase which has ThermoPhase type cSurf.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
A kinetics manager for heterogeneous reaction mechanisms.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual void setMdot(doublereal mdot)
Set the total mass flow rate.
virtual void setSpreadRate(doublereal V0)
set spreading rate
virtual void setupGrid(size_t n, const doublereal *z)
called to set up initial grid, and after grid refinement
An outlet with specified composition.
virtual double spreadRate()
spreading rate
The base class for boundaries between one-dimensional spatial domains.
virtual void setMoleFractions(const doublereal *xin)
Set the mole fractions by specifying an array.
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
virtual void setMoleFractions(const std::string &xin)
Set the mole fractions by specifying a std::string.
size_t domainIndex()
The left-to-right location of this domain.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
size_t nSpecies() const
Returns the number of species in the phase.
virtual void showSolution(const doublereal *x)
Print the solution.
Domain1D(size_t nv=1, size_t points=1, doublereal time=0.0)
Constructor.
virtual void eval(size_t jg, doublereal *xg, doublereal *rg, integer *diagg, doublereal rdt)
Evaluate the residual function at point j.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
virtual void _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
void writelog(const std::string &msg)
Write a message to the screen.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
virtual XML_Node & save(XML_Node &o, const doublereal *const soln)
Save the current solution for this domain into an XML_Node.
virtual doublereal massFraction(size_t k)
Mass fraction of species k.
std::string speciesName(size_t k) const
Name of the species with index k.
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.