26 const int LeftInlet = 1;
27 const int RightInlet = -1;
60 virtual size_t nSpecies() {
66 err(
"setMoleFractions");
71 err(
"setMoleFractions");
86 virtual doublereal
mdot() {
91 writelog(
"Bdry1D::_getInitialSoln called!\n");
94 virtual void setupGrid(
size_t n,
const doublereal* z) {}
99 StFlow* m_flow_left, *m_flow_right;
100 size_t m_ilr, m_left_nv, m_right_nv;
101 size_t m_left_loc, m_right_loc;
102 size_t m_left_points;
103 size_t m_nv, m_left_nsp, m_right_nsp;
104 size_t m_sp_left, m_sp_right;
105 size_t m_start_left, m_start_right;
107 doublereal m_temp, m_mdot;
110 void err(
const std::string& method) {
112 "attempt to call base class method "+method);
142 sprintf(buf,
" Mass Flux: %10.4g kg/m^2/s \n", m_mdot);
144 sprintf(buf,
" Temperature: %10.4g K \n", m_temp);
148 for (
size_t k = 0; k < m_flow->phase().
nSpecies(); k++) {
149 if (m_yin[k] != 0.0) {
150 sprintf(buf,
" %16s %10.4g \n",
166 virtual size_t nSpecies() {
177 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
178 integer* diagg, doublereal rdt);
180 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
207 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
208 integer* diagg, doublereal rdt);
211 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
235 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
236 integer* diagg, doublereal rdt);
239 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
256 m_type = cOutletType;
263 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
264 integer* diagg, doublereal rdt);
267 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
285 m_type = cOutletResType;
299 virtual size_t nSpecies() {
310 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
311 integer* diagg, doublereal rdt);
313 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
339 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
340 integer* diagg, doublereal rdt);
343 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
353 virtual void showSolution_s(std::ostream& s,
const doublereal* x) {
354 s <<
"------------------- Surface " <<
domainIndex() <<
" ------------------- " << std::endl;
355 s <<
" temperature: " << m_temp <<
" K" <<
" " << x[0] << std::endl;
360 sprintf(buf,
" Temperature: %10.4g K \n", m_temp);
374 m_kin(0), m_surfindex(0), m_nsp(0) {
386 void enableCoverageEquations(
bool docov) {
394 virtual void eval(
size_t jg, doublereal* xg, doublereal* rg,
395 integer* diagg, doublereal rdt);
398 virtual void restore(
const XML_Node& dom, doublereal* soln,
int loglevel);
407 std::copy(x+1,x+1+m_nsp,m_fixed_cov.begin());
412 sprintf(buf,
" Temperature: %10.4g K \n", x[0]);
415 for (
size_t k = 0; k < m_nsp; k++) {
416 sprintf(buf,
" %20s %10.4g \n", m_sphase->
speciesName(k).c_str(),
426 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 void setMoleFractions(doublereal *xin)
Set the mole fractions by specifying an array.
virtual void _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
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.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
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.
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
Base class for exceptions thrown by Cantera classes.
An outlet with specified composition.
virtual double spreadRate()
spreading rate
The base class for boundaries between one-dimensional spatial domains.
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 _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
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 _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...
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 _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
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 restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.