Cantera  3.1.0a1
ReactingSurf1D Class Reference

A reacting surface. More...

#include <Boundary1D.h>

Inheritance diagram for ReactingSurf1D:
[legend]

Detailed Description

A reacting surface.

Definition at line 331 of file Boundary1D.h.

Public Member Functions

 ReactingSurf1D (shared_ptr< Solution > solution, const string &id="")
 
string domainType () const override
 Domain type flag. More...
 
void setKinetics (shared_ptr< Kinetics > kin) override
 Set the kinetics manager. More...
 
void enableCoverageEquations (bool docov)
 
bool coverageEnabled ()
 
string componentName (size_t n) const override
 Name of the nth component. May be overloaded. More...
 
void init () override
 Initialize. More...
 
void resetBadValues (double *xg) override
 When called, this function should reset "bad" values in the state vector such as negative species concentrations. More...
 
void eval (size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
 Evaluate the residual function at point j. More...
 
shared_ptr< SolutionArrayasArray (const double *soln) const override
 Save the state of this domain as a SolutionArray. More...
 
void fromArray (SolutionArray &arr, double *soln) override
 Restore the solution for this domain from a SolutionArray. More...
 
void _getInitialSoln (double *x) override
 Writes some or all initial solution values into the global solution array, beginning at the location pointed to by x. More...
 
void _finalize (const double *x) override
 In some cases, a domain may need to set parameters that depend on the initial solution estimate. More...
 
void show (const double *x) override
 Print the solution. More...
 
- Public Member Functions inherited from Boundary1D
bool isConnector () override
 True if the domain is a connector domain. More...
 
virtual void setTemperature (double t)
 Set the temperature. More...
 
virtual double temperature ()
 Temperature [K]. More...
 
virtual size_t nSpecies ()
 
virtual void setMoleFractions (const string &xin)
 Set the mole fractions by specifying a 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 void setSpreadRate (double V0)
 Set tangential velocity gradient [1/s] at this boundary. More...
 
virtual double spreadRate ()
 Tangential velocity gradient [1/s] at this boundary. More...
 
virtual double mdot ()
 The total mass flow rate [kg/m2/s]. More...
 
void setupGrid (size_t n, const double *z) override
 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
 
Domain1Doperator= (const Domain1D &)=delete
 
string type () const
 String indicating the domain implemented. More...
 
size_t domainIndex ()
 The left-to-right location of this domain. More...
 
void setSolution (shared_ptr< Solution > sol)
 Set the solution manager. More...
 
virtual void setTransport (shared_ptr< Transport > trans)
 Set transport model to existing instance. More...
 
const OneDimcontainer () 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 setInitialState (double *xlocal=0)
 
virtual void setState (size_t point, const double *state, double *x)
 
virtual void resize (size_t nv, size_t np)
 Resize the domain to have nv components and np grid points. More...
 
Refinerrefiner ()
 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...
 
void setComponentName (size_t n, const string &name)
 
virtual size_t componentIndex (const string &name) const
 index of component with name name. More...
 
void setBounds (size_t n, double lower, double upper)
 
void setTransientTolerances (double rtol, double atol, size_t n=npos)
 Set tolerances for time-stepping mode. More...
 
void setSteadyTolerances (double rtol, double atol, size_t n=npos)
 Set tolerances for steady-state mode. More...
 
double rtol (size_t n)
 Relative tolerance of the nth component. More...
 
double 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...
 
double upperBound (size_t n) const
 Upper bound on the nth component. More...
 
double lowerBound (size_t n) const
 Lower bound on the nth component. More...
 
void initTimeInteg (double dt, const double *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 ()
 Set this if something has changed in the governing equations (for example, the value of a constant has been changed, so that the last-computed Jacobian is no longer valid. More...
 
size_t index (size_t n, size_t j) const
 
double value (const double *x, size_t n, size_t j) const
 
virtual void setJac (MultiJac *jac)
 
shared_ptr< SolutionArraytoArray (bool normalize=false) const
 Save the state of this domain to a SolutionArray. More...
 
void fromArray (const shared_ptr< SolutionArray > &arr)
 Restore the solution for this domain from a SolutionArray. More...
 
shared_ptr< Solutionsolution () const
 Return thermo/kinetics/transport manager used in the domain. 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...
 
Domain1Dleft () const
 Return a pointer to the left neighbor. More...
 
Domain1Dright () 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 string &s)
 Specify an identifying tag for this domain. More...
 
string id () const
 
virtual void show (std::ostream &s, const double *x)
 Print the solution. More...
 
double z (size_t jlocal) const
 
double zmin () const
 
double zmax () const
 
void setProfile (const string &name, double *values, double *soln)
 
vector< double > & grid ()
 
const vector< double > & grid () const
 
double grid (size_t point) const
 
virtual double initialValue (size_t n, size_t j)
 Initial value of solution component n at grid point j. 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...
 
void setData (shared_ptr< vector< double >> &data)
 Set shared data pointer. More...
 

Protected Attributes

InterfaceKineticsm_kin = nullptr
 
SurfPhasem_sphase = nullptr
 
size_t m_nsp = 0
 
bool m_enabled = false
 
vector< double > m_work
 
vector< double > m_fixed_cov
 
- Protected Attributes inherited from Boundary1D
StFlowm_flow_left = nullptr
 
StFlowm_flow_right = nullptr
 
size_t m_ilr = 0
 
size_t m_left_nv = 0
 
size_t m_right_nv = 0
 
size_t m_left_loc = 0
 
size_t m_right_loc = 0
 
size_t m_left_points = 0
 
size_t m_left_nsp = 0
 
size_t m_right_nsp = 0
 
size_t m_sp_left = 0
 
size_t m_sp_right = 0
 
size_t m_start_left = 0
 
size_t m_start_right = 0
 
ThermoPhasem_phase_left = nullptr
 
ThermoPhasem_phase_right = nullptr
 
double m_temp = 0.0
 
double m_mdot = 0.0
 
- Protected Attributes inherited from Domain1D
shared_ptr< vector< double > > m_state
 data pointer shared from OneDim More...
 
double m_rdt = 0.0
 
size_t m_nv = 0
 
size_t m_points
 Number of grid points. More...
 
vector< double > m_slast
 
vector< double > m_max
 
vector< double > m_min
 
vector< double > m_rtol_ss
 
vector< double > m_rtol_ts
 
vector< double > m_atol_ss
 
vector< double > m_atol_ts
 
vector< double > m_z
 
OneDimm_container = nullptr
 
size_t m_index
 
size_t m_iloc = 0
 Starting location within the solution vector for unknowns that correspond to this domain. More...
 
size_t m_jstart = 0
 
Domain1Dm_left = nullptr
 
Domain1Dm_right = nullptr
 
string m_id
 Identity tag for the domain. More...
 
unique_ptr< Refinerm_refiner
 
vector< string > m_name
 
int m_bw = -1
 
bool m_force_full_update = false
 
shared_ptr< Solutionm_solution
 Composite thermo/kinetics/transport handler. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Boundary1D
void _init (size_t n)
 
- Protected Member Functions inherited from Domain1D
virtual AnyMap getMeta () const
 Retrieve meta data. More...
 
virtual void setMeta (const AnyMap &meta)
 Retrieve meta data. More...
 

Member Function Documentation

◆ domainType()

string domainType ( ) const
inlineoverridevirtual

Domain type flag.

Since
Starting in Cantera 3.1, the return type is a string.

Reimplemented from Boundary1D.

Definition at line 337 of file Boundary1D.h.

◆ setKinetics()

void setKinetics ( shared_ptr< Kinetics kin)
overridevirtual

Set the kinetics manager.

Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 602 of file Boundary1D.cpp.

◆ componentName()

string componentName ( size_t  n) const
overridevirtual

Name of the nth component. May be overloaded.

Reimplemented from Domain1D.

Definition at line 614 of file Boundary1D.cpp.

◆ init()

void init ( )
overridevirtual

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 623 of file Boundary1D.cpp.

◆ resetBadValues()

void resetBadValues ( double *  xg)
overridevirtual

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 637 of file Boundary1D.cpp.

◆ eval()

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

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
jGrid point at which to update the residual
[in]xState vector
[out]rresidual vector
[out]maskBoolean mask indicating whether each solution component has a time derivative (1) or not (0).
[in]rdtReciprocal of the timestep (rdt=0 implies steady- state.)

Reimplemented from Domain1D.

Definition at line 643 of file Boundary1D.cpp.

◆ asArray()

shared_ptr< SolutionArray > asArray ( const double *  soln) const
overridevirtual

Save the state of this domain as a SolutionArray.

Parameters
solnlocal solution vector for this domain
Todo:
Despite the method's name, data are copied; the intent is to access data directly in future revisions, where a non-const version will be implemented.
Since
New in Cantera 3.0.

Reimplemented from Domain1D.

Definition at line 726 of file Boundary1D.cpp.

◆ fromArray()

void fromArray ( SolutionArray arr,
double *  soln 
)
overridevirtual

Restore the solution for this domain from a SolutionArray.

Parameters
[in]arrSolutionArray defining the state of this domain
[out]solnValue of the solution vector, local to this domain
Since
New in Cantera 3.0.

Reimplemented from Boundary1D.

Definition at line 745 of file Boundary1D.cpp.

◆ _getInitialSoln()

void _getInitialSoln ( double *  x)
inlineoverridevirtual

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 361 of file Boundary1D.h.

◆ _finalize()

void _finalize ( const double *  x)
inlineoverridevirtual

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 365 of file Boundary1D.h.

◆ show()

void show ( const double *  x)
overridevirtual

Print the solution.

Reimplemented from Domain1D.

Definition at line 758 of file Boundary1D.cpp.


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