10#ifndef CT_BOUNDARY1D_H
11#define CT_BOUNDARY1D_H
21const int LeftInlet = 1;
22const int RightInlet = -1;
48 string type()
const override {
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;
199 void show(
const double* x)
override {}
201 void init()
override;
203 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
205 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
225 return "symmetry-plane";
228 void init()
override;
230 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
232 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
256 void init()
override;
258 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
260 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
276 return "outlet-reservoir";
279 void show(
const double* x)
override {}
281 size_t nSpecies()
override {
291 void init()
override;
292 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
293 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
298 vector<double> m_yres;
324 void init()
override;
326 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
328 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
331 void show(std::ostream& s,
const double* x)
override;
333 void show(
const double* x)
override;
346 return "reacting-surface";
349 void setKinetics(shared_ptr<Kinetics> kin)
override;
354 void enableCoverageEquations(
bool docov) {
358 bool coverageEnabled() {
364 void init()
override;
367 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
369 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
370 void fromArray(SolutionArray& arr,
double* soln)
override;
377 std::copy(x, x+m_nsp, m_fixed_cov.begin());
380 void show(
const double* x)
override;
385 size_t m_surfindex = 0;
387 bool m_enabled =
false;
388 vector<double> m_work;
389 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.
string type() const override
String indicating the domain implemented.
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.
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.
string type() const override
String indicating the domain implemented.
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.
void show(const double *x) override
Print the solution.
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
string type() const override
String indicating the domain implemented.
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
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.
string type() const override
String indicating the domain implemented.
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.
An outlet with specified composition.
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
string type() const override
String indicating the domain implemented.
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.
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...
string type() const override
String indicating the domain implemented.
shared_ptr< SolutionArray > asArray(const double *soln) const override
Save the state of this domain as a SolutionArray.
void setKineticsMgr(InterfaceKinetics *kin)
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.
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...
string type() const override
String indicating the domain implemented.
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.
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.
string type() const override
String indicating the domain implemented.
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.
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.