Cantera 2.6.0

Public Member Functions | Protected Attributes | List of all members
ReactingSurf1D Class Reference
One-Dimensional Reacting Flows

A reacting surface. More...

`#include <Boundary1D.h>`

Inheritance diagram for ReactingSurf1D:
[legend]
Collaboration diagram for ReactingSurf1D:
[legend]

## Public Member Functions
void | setKineticsMgr (InterfaceKinetics *kin)
void | enableCoverageEquations (bool docov)
bool | coverageEnabled ()
virtual std::string | componentName (size_t n) const
| Name of the nth component. May be overloaded. More...
virtual void | init ()
virtual void | resetBadValues (double *xg)
virtual void | eval (size_t jg, double *xg, double *rg, integer *diagg, double rdt)
| Evaluate the residual function at point j. More...
virtual XML_Node & | save (XML_Node &o, const double *const soln)
| Save the current solution for this domain into an XML_Node. More...
virtual void | restore (const XML_Node &dom, double *soln, int loglevel)
| Restore the solution for this domain from an XML_Node. More...
virtual AnyMap | serialize (const double *soln) const
| Save the state of this domain as an AnyMap. More...
virtual void | restore (const AnyMap &state, double *soln, int loglevel)
| Restore the solution for this domain from an AnyMap. More...
virtual void | _getInitialSoln (double *x)
| Writes some or all initial solution values into the global solution array, beginning at the location pointed to by x. More...
virtual void | _finalize (const double *x)
| In some cases, a domain may need to set parameters that depend on the initial solution estimate. More...
virtual void | showSolution (const double *x)
| Print the solution. More...
Public Member Functions inherited from Boundary1D
virtual void | init ()
virtual void | setTemperature (double t)
| Set the temperature. More...
virtual double | temperature ()
| Temperature [K]. More...
virtual size_t | nSpecies ()
virtual void | setMoleFractions (const std::string &xin)
| Set the mole fractions by specifying a std::string. More...
virtual void | setMoleFractions (const double *xin)
| Set the mole fractions by specifying an array. More...
virtual double | massFraction (size_t k)
| Mass fraction of species k. More...
virtual void | setMdot (double mdot)
| Set the total mass flow rate. More...
virtual double | mdot ()
| The total mass flow rate [kg/m2/s]. More...
virtual void | setupGrid (size_t n, const double *z)
| called to set up initial grid, and after grid refinement More...
Public Member Functions inherited from Domain1D
| Domain1D (size_t nv=1, size_t points=1, double time=0.0)
| Constructor. More...
| Domain1D (const Domain1D &)=delete
Domain1D & | operator= (const Domain1D &)=delete
int | domainType ()
| Domain type flag. More...
size_t | domainIndex ()
| The left-to-right location of this domain. More...
bool | isConnector ()
| True if the domain is a connector domain. More...
const OneDim & | container () const
| The container holding this domain. More...
void | setContainer (OneDim *c, size_t index)
| Specify the container object for this domain, and the position of this domain in the list. More...
void | setBandwidth (int bw=-1)
| Set the Jacobian bandwidth. See the discussion of method bandwidth(). More...
size_t | bandwidth ()
| Set the Jacobian bandwidth for this domain. More...
virtual void | init ()
virtual void | setInitialState (doublereal *xlocal=0)
virtual void | setState (size_t point, const doublereal *state, doublereal *x)
virtual void | resetBadValues (double *xg)
virtual void | resize (size_t nv, size_t np)
Refiner & | refiner ()
| Return a reference to the grid refiner. More...
size_t | nComponents () const
| Number of components at each grid point. More...
void | checkComponentIndex (size_t n) const
| Check that the specified component index is in range. More...
void | checkComponentArraySize (size_t nn) const
| Check that an array size is at least nComponents(). More...
size_t | nPoints () const
| Number of grid points in this domain. More...
void | checkPointIndex (size_t n) const
| Check that the specified point index is in range. More...
void | checkPointArraySize (size_t nn) const
| Check that an array size is at least nPoints(). More...
virtual std::string | componentName (size_t n) const
| Name of the nth component. May be overloaded. More...
void | setComponentName (size_t n, const std::string &name)
virtual size_t | componentIndex (const std::string &name) const
| index of component with name name. More...
void | setBounds (size_t n, doublereal lower, doublereal upper)
void | setTransientTolerances (doublereal rtol, doublereal atol, size_t n=npos)
| Set tolerances for time-stepping mode. More...
void | setSteadyTolerances (doublereal rtol, doublereal atol, size_t n=npos)
| Set tolerances for steady-state mode. More...
doublereal | rtol (size_t n)
| Relative tolerance of the nth component. More...
doublereal | atol (size_t n)
| Absolute tolerance of the nth component. More...
double | steady_rtol (size_t n)
| Steady relative tolerance of the nth component. More...
double | steady_atol (size_t n)
| Steady absolute tolerance of the nth component. More...
double | transient_rtol (size_t n)
| Transient relative tolerance of the nth component. More...
double | transient_atol (size_t n)
| Transient absolute tolerance of the nth component. More...
doublereal | upperBound (size_t n) const
| Upper bound on the nth component. More...
doublereal | lowerBound (size_t n) const
| Lower bound on the nth component. More...
void | initTimeInteg (doublereal dt, const doublereal *x0)
| Prepare to do time stepping with time step dt. More...
void | setSteadyMode ()
| Prepare to solve the steady-state problem. More...
bool | steady ()
| True if in steady-state mode. More...
bool | transient ()
| True if not in steady-state mode. More...
void | needJacUpdate ()
virtual void | eval (size_t j, doublereal *x, doublereal *r, integer *mask, doublereal rdt=0.0)
| Evaluate the residual function at point j. More...
size_t | index (size_t n, size_t j) const
doublereal | value (const doublereal *x, size_t n, size_t j) const
virtual void | setJac (MultiJac *jac)
virtual XML_Node & | save (XML_Node &o, const doublereal *const sol)
| Save the current solution for this domain into an XML_Node. More...
virtual void | restore (const XML_Node &dom, doublereal *soln, int loglevel)
| Restore the solution for this domain from an XML_Node. More...
virtual AnyMap | serialize (const double *soln) const
| Save the state of this domain as an AnyMap. More...
virtual void | restore (const AnyMap &state, double *soln, int loglevel)
| Restore the solution for this domain from an AnyMap. More...
size_t | size () const
void | locate ()
| Find the index of the first grid point in this domain, and the start of its variables in the global solution vector. More...
virtual size_t | loc (size_t j=0) const
| Location of the start of the local solution vector in the global solution vector,. More...
size_t | firstPoint () const
| The index of the first (that is, left-most) grid point belonging to this domain. More...
size_t | lastPoint () const
| The index of the last (that is, right-most) grid point belonging to this domain. More...
void | linkLeft (Domain1D *left)
| Set the left neighbor to domain 'left. More...
void | linkRight (Domain1D *right)
| Set the right neighbor to domain 'right.'. More...
void | append (Domain1D *right)
| Append domain 'right' to this one, and update all links. More...
Domain1D * | left () const
| Return a pointer to the left neighbor. More...
Domain1D * | right () const
| Return a pointer to the right neighbor. More...
double | prevSoln (size_t n, size_t j) const
| Value of component n at point j in the previous solution. More...
void | setID (const std::string &s)
| Specify an identifying tag for this domain. More...
std::string | id () const
virtual void | showSolution_s (std::ostream &s, const doublereal *x)
virtual void | showSolution (const doublereal *x)
| Print the solution. More...
doublereal | z (size_t jlocal) const
doublereal | zmin () const
doublereal | zmax () const
void | setProfile (const std::string &name, double *values, double *soln)
vector_fp & | grid ()
const vector_fp & | grid () const
doublereal | grid (size_t point) const
virtual void | setupGrid (size_t n, const doublereal *z)
| called to set up initial grid, and after grid refinement More...
virtual void | _getInitialSoln (doublereal *x)
| Writes some or all initial solution values into the global solution array, beginning at the location pointed to by x. More...
virtual doublereal | initialValue (size_t n, size_t j)
| Initial value of solution component n at grid point j. More...
virtual void | _finalize (const doublereal *x)
| In some cases, a domain may need to set parameters that depend on the initial solution estimate. More...
void | forceFullUpdate (bool update)
| In some cases, for computational efficiency some properties (such as transport coefficients) may not be updated during Jacobian evaluations. More...

## Protected Attributes
InterfaceKinetics * | m_kin
SurfPhase * | m_sphase
size_t | m_surfindex
size_t | m_nsp
bool | m_enabled
vector_fp | m_work
vector_fp | m_fixed_cov
Protected Attributes inherited from Boundary1D
StFlow * | m_flow_left
StFlow * | m_flow_right
size_t | m_ilr
size_t | m_left_nv
size_t | m_right_nv
size_t | m_left_loc
size_t | m_right_loc
size_t | m_left_points
size_t | m_left_nsp
size_t | m_right_nsp
size_t | m_sp_left
size_t | m_sp_right
size_t | m_start_left
size_t | m_start_right
ThermoPhase * | m_phase_left
ThermoPhase * | m_phase_right
double | m_temp
double | m_mdot
Protected Attributes inherited from Domain1D
doublereal | m_rdt
size_t | m_nv
size_t | m_points
vector_fp | m_slast
vector_fp | m_max
vector_fp | m_min
vector_fp | m_rtol_ss
vector_fp | m_rtol_ts
vector_fp | m_atol_ss
vector_fp | m_atol_ts
vector_fp | m_z
OneDim * | m_container
size_t | m_index
int | m_type
size_t | m_iloc
| Starting location within the solution vector for unknowns that correspond to this domain. More...
size_t | m_jstart
Domain1D * | m_left
Domain1D * | m_right
std::string | m_id
| Identity tag for the domain. More...
std::unique_ptr< Refiner > | m_refiner
std::vector< std::string > | m_name
int | m_bw
bool | m_force_full_update

## Additional Inherited Members
Protected Member Functions inherited from Boundary1D
void | _init (size_t n)

## Detailed Description

A reacting surface.

Definition at line 283 of file Boundary1D.h.

## Constructor & Destructor Documentation

## ◆ ReactingSurf1D()

ReactingSurf1D | ( |  | ) |

Definition at line 724 of file Boundary1D.cpp.

## Member Function Documentation

## ◆ setKineticsMgr()

void setKineticsMgr | ( | InterfaceKinetics * | kin | ) |

Definition at line 732 of file Boundary1D.cpp.

## ◆ enableCoverageEquations()

void enableCoverageEquations | ( | bool | docov | ) |
| inline

Definition at line 290 of file Boundary1D.h.

## ◆ coverageEnabled()

bool coverageEnabled | ( |  | ) |
| inline

Definition at line 294 of file Boundary1D.h.

## ◆ componentName()

string componentName | ( | size_t | n | ) | const
| virtual

Name of the nth component. May be overloaded.

Reimplemented from Domain1D.

Definition at line 741 of file Boundary1D.cpp.

References Phase::speciesName().

## ◆ init()

void init | ( |  | ) |
| virtual

Initialize. This method is called by OneDim::init() for each domain once at the beginning of a simulation. Base class method does nothing, but may be overloaded.

Reimplemented from Boundary1D.

Definition at line 750 of file Boundary1D.cpp.

References Kinetics::nTotalSpecies().

## ◆ resetBadValues()

void resetBadValues | ( | double * | xg | ) |
| virtual

When called, this function should reset "bad" values in the state vector such as negative species concentrations. This function may be called after a failed solution attempt.

Reimplemented from Domain1D.

Definition at line 763 of file Boundary1D.cpp.

References SurfPhase::getCoverages(), Domain1D::loc(), and SurfPhase::setCoverages().

## ◆ eval()

void eval | ( | size_t | j,
|  | double * | x,
|  | double * | r,
|  | integer * | mask,
|  | double | rdt
| ) |  |
| virtual

Evaluate the residual function at point j.

If j == npos, evaluate the residual function at all points.

This function must be implemented in classes derived from Domain1D.

Parameters

  | j | Grid point at which to update the residual
  [in] | x | State vector
  [out] | r | residual vector
  [out] | mask | Boolean mask indicating whether each solution component has a time derivative (1) or not (0).
  [in] | rdt | Reciprocal of the timestep (`rdt=0` implies steady- state.)

Reimplemented from Domain1D.

Definition at line 769 of file Boundary1D.cpp.

References Domain1D::firstPoint(), Kinetics::getNetProductionRates(), Kinetics::kineticsSpeciesIndex(), Domain1D::lastPoint(), Domain1D::loc(), Phase::molecularWeights(), Domain1D::nComponents(), Kinetics::nPhases(), Domain1D::nPoints(), Cantera::npos, Domain1D::prevSoln(), StFlow::rightExcessSpecies(), SurfPhase::setCoveragesNoNorm(), StFlow::setGas(), Phase::setTemperature(), SurfPhase::siteDensity(), SurfPhase::size(), and Kinetics::thermo().

## ◆ save()

XML_Node & save | ( | XML_Node & | o,
|  | const double *const | sol
| ) |  |
| virtual

Save the current solution for this domain into an XML_Node.

Base class version of the general domain1D save function. Derived classes should call the base class method in addition to saving their own data.

Parameters

  o | XML_Node to save the solution to.
  sol | Current value of the solution vector. The object will pick out which part of the solution vector pertains to this object.

Returns
  XML_Node created to represent this domain

Deprecated:
  The XML output format is deprecated and will be removed in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 853 of file Boundary1D.cpp.

References XML_Node::addAttribute(), Cantera::addFloat(), Domain1D::loc(), Domain1D::save(), and Phase::speciesName().

## ◆ restore() [1/2]

void restore | ( | const XML_Node & | dom,
|  | double * | soln,
|  | int | loglevel
| ) |  |
| virtual

Restore the solution for this domain from an XML_Node.

Base class version of the general Domain1D restore function. Derived classes should call the base class method in addition to restoring their own data.

Parameters

  dom | XML_Node for this domain
  soln | Current value of the solution vector, local to this object.
  loglevel | 0 to suppress all output; 1 to show warnings; 2 for verbose output

Deprecated:
  The XML input format is deprecated and will be removed in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 865 of file Boundary1D.cpp.

References XML_Node::attrib(), XML_Node::child(), XML_Node::fp_value(), Cantera::getFloat(), XML_Node::name(), XML_Node::nChildren(), Cantera::npos, Domain1D::resize(), Domain1D::restore(), SurfPhase::setCoverages(), and Phase::speciesIndex().

## ◆ serialize()

AnyMap serialize | ( | const double * | soln | ) | const
| virtual

Save the state of this domain as an AnyMap.

Parameters

  soln | local solution vector for this domain

Reimplemented from Domain1D.

Definition at line 886 of file Boundary1D.cpp.

References AnyValue::asString(), AnyValue::empty(), AnyBase::getMetadata(), ThermoPhase::input(), Phase::name(), Domain1D::serialize(), and Phase::speciesName().

## ◆ restore() [2/2]

void restore | ( | const AnyMap & | state,
|  | double * | soln,
|  | int | loglevel
| ) |  |
| virtual

Restore the solution for this domain from an AnyMap.

Parameters

  [in] | state | AnyMap defining the state of this domain
  [out] | soln | Value of the solution vector, local to this domain
  [in] | loglevel | 0 to suppress all output; 1 to show warnings; 2 for verbose output

Reimplemented from Domain1D.

Definition at line 903 of file Boundary1D.cpp.

References AnyMap::getDouble(), Phase::name(), Cantera::npos, Domain1D::restore(), Phase::speciesIndex(), Phase::speciesName(), and Cantera::warn_user().

## ◆ _getInitialSoln()

virtual void _getInitialSoln | ( | double * | x | ) |
| inline virtual

Writes some or all initial solution values into the global solution array, beginning at the location pointed to by x.

This method is called by the Sim1D constructor, and allows default values or ones that have been set locally prior to installing this domain into the container to be written to the global solution vector.

Reimplemented from Domain1D.

Definition at line 311 of file Boundary1D.h.

References SurfPhase::getCoverages().

## ◆ _finalize()

virtual void _finalize | ( | const double * | x | ) |
| inline virtual

In some cases, a domain may need to set parameters that depend on the initial solution estimate.

In such cases, the parameters may be set in method _finalize. This method is called just before the Newton solver is called, and the x array is guaranteed to be the local solution vector for this domain that will be used as the initial guess. If no such parameters need to be set, then method _finalize does not need to be overloaded.

Reimplemented from Domain1D.

Definition at line 315 of file Boundary1D.h.

## ◆ showSolution()

void showSolution | ( | const double * | x | ) |
| virtual

Print the solution.

Reimplemented from Domain1D.

Definition at line 925 of file Boundary1D.cpp.

References Phase::speciesName(), and Cantera::writelog().

## Member Data Documentation

## ◆ m_kin

InterfaceKinetics* m_kin
| protected

Definition at line 322 of file Boundary1D.h.

## ◆ m_sphase

SurfPhase* m_sphase
| protected

Definition at line 323 of file Boundary1D.h.

## ◆ m_surfindex

size_t m_surfindex
| protected

Definition at line 324 of file Boundary1D.h.

## ◆ m_nsp

size_t m_nsp
| protected

Definition at line 324 of file Boundary1D.h.

## ◆ m_enabled

bool m_enabled
| protected

Definition at line 325 of file Boundary1D.h.

## ◆ m_work

vector_fp m_work
| protected

Definition at line 326 of file Boundary1D.h.

## ◆ m_fixed_cov

vector_fp m_fixed_cov
| protected

Definition at line 327 of file Boundary1D.h.

The documentation for this class was generated from the following files:

- Boundary1D.h
- Boundary1D.cpp