10#ifndef CT_BOUNDARY1D_H
11#define CT_BOUNDARY1D_H
21const int LeftInlet = 1;
22const int RightInlet = -1;
66 virtual size_t nSpecies() {
110 void _init(
size_t n);
112 StFlow* m_flow_left =
nullptr;
113 StFlow* m_flow_right =
nullptr;
115 size_t m_left_nv = 0;
116 size_t m_right_nv = 0;
117 size_t m_left_loc = 0;
118 size_t m_right_loc = 0;
119 size_t m_left_points = 0;
120 size_t m_left_nsp = 0;
121 size_t m_right_nsp = 0;
122 size_t m_sp_left = 0;
123 size_t m_sp_right = 0;
124 size_t m_start_left = 0;
125 size_t m_start_right = 0;
155 void show(
const double* x)
override;
157 size_t nSpecies()
override {
166 void init()
override;
167 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
168 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
175 vector<double> m_yin;
197 void show(
const double* x)
override {}
199 void init()
override;
201 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
203 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
221 return "symmetry-plane";
224 void init()
override;
226 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
228 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
250 void init()
override;
252 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
254 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
270 return "outlet-reservoir";
273 void show(
const double* x)
override {}
275 size_t nSpecies()
override {
285 void init()
override;
286 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
287 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
292 vector<double> m_yres;
316 void init()
override;
318 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
320 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
323 void show(std::ostream& s,
const double* x)
override;
325 void show(
const double* x)
override;
338 return "reacting-surface";
341 void setKinetics(shared_ptr<Kinetics> kin)
override;
343 void enableCoverageEquations(
bool docov) {
347 bool coverageEnabled() {
353 void init()
override;
356 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
358 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
359 void fromArray(SolutionArray& arr,
double* soln)
override;
366 std::copy(x, x+m_nsp, m_fixed_cov.begin());
369 void show(
const double* x)
override;
375 bool m_enabled =
false;
376 vector<double> m_work;
377 vector<double> m_fixed_cov;
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
The base class for boundaries between one-dimensional spatial domains.
bool isConnector() override
True if the domain is a connector domain.
virtual void setMdot(double mdot)
Set the total mass flow rate.
virtual void setMoleFractions(const string &xin)
Set the mole fractions by specifying a string.
virtual double temperature()
Temperature [K].
virtual void setTemperature(double t)
Set the temperature.
virtual void setMoleFractions(const double *xin)
Set the mole fractions by specifying an array.
void setupGrid(size_t n, const double *z) override
called to set up initial grid, and after grid refinement
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
virtual void setSpreadRate(double V0)
Set tangential velocity gradient [1/s] at this boundary.
virtual double mdot()
The total mass flow rate [kg/m2/s].
virtual double massFraction(size_t k)
Mass fraction of species k.
void init() override
Initialize.
string domainType() const override
Domain type flag.
virtual double spreadRate()
Tangential velocity gradient [1/s] at this boundary.
Base class for one-dimensional domains.
shared_ptr< Solution > m_solution
Composite thermo/kinetics/transport handler.
shared_ptr< Solution > solution() const
Return thermo/kinetics/transport manager used in the domain.
string m_id
Identity tag for the domain.
A terminator that does nothing.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void init() override
Initialize.
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
double massFraction(size_t k) override
Mass fraction of species k.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
void init() override
Initialize.
double spreadRate() override
Tangential velocity gradient [1/s] at this boundary.
void setSpreadRate(double V0) override
set spreading rate
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
A kinetics manager for heterogeneous reaction mechanisms.
An error indicating that an unimplemented function has been called.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void init() override
Initialize.
string domainType() const override
Domain type flag.
An outlet with specified composition.
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
double massFraction(size_t k) override
Mass fraction of species k.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
void init() override
Initialize.
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
void setKinetics(shared_ptr< Kinetics > kin) override
Set the kinetics manager.
void resetBadValues(double *xg) override
When called, this function should reset "bad" values in the state vector such as negative species con...
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void _finalize(const double *x) override
In some cases, a domain may need to set parameters that depend on the initial solution estimate.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
string componentName(size_t n) const override
Name of the nth component. May be overloaded.
void init() override
Initialize.
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
void _getInitialSoln(double *x) override
Writes some or all initial solution values into the global solution array, beginning at the location ...
A container class holding arrays of state information.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
void init() override
Initialize.
string domainType() const override
Domain type flag.
void show(std::ostream &s, const double *x) override
Print the solution.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
void getCoverages(double *theta) const
Return a vector of surface coverages.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
void init() override
Initialize.
string domainType() const override
Domain type flag.
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.