10#ifndef CT_BOUNDARY1D_H
11#define CT_BOUNDARY1D_H
117 void _init(
size_t n);
120 Flow1D* m_flow_right =
nullptr;
163 void show(
const double* x)
override;
174 void init()
override;
175 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
176 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
213 void show(
const double* x)
override {}
215 void init()
override;
217 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
219 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
241 return "symmetry-plane";
244 void init()
override;
246 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
248 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
274 void init()
override;
276 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
278 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
298 return "outlet-reservoir";
301 void show(
const double* x)
override {}
313 void init()
override;
314 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
315 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
348 void init()
override;
350 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
352 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
356 void show(std::ostream& s,
const double* x)
override;
358 void show(
const double* x)
override;
376 return "reacting-surface";
379 void setKinetics(shared_ptr<Kinetics> kin)
override;
394 void init()
override;
397 void eval(
size_t jg,
double* xg,
double* rg, integer* diagg,
double rdt)
override;
399 shared_ptr<SolutionArray>
asArray(
const double* soln)
const override;
410 void show(
const double* x)
override;
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
The base class for boundaries between one-dimensional spatial domains.
ThermoPhase * m_phase_left
Thermo object used by left flow domain.
bool isConnector() override
True if the domain is a connector domain.
double m_mdot
Mass flow rate at the boundary.
double m_temp
Temperature of the boundary.
virtual void setMdot(double mdot)
Set the total mass flow rate [kg/m²/s].
virtual void setMoleFractions(const string &xin)
Set the mole fractions by specifying a string.
virtual double temperature()
Temperature [K].
void _init(size_t n)
Initialize member variables based on the adjacent domains.
Flow1D * m_flow_left
Flow domain to the left of this boundary.
ThermoPhase * m_phase_right
Thermo object used by right flow domain.
size_t m_right_nsp
Number of species in right flow domain.
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.
size_t m_left_nsp
Number of species in left flow domain.
Boundary1D()
Default constructor.
string domainType() const override
Domain type flag.
size_t m_right_nv
Number of state vector components in right flow domain.
size_t m_left_nv
Flow domain to the right of this boundary.
virtual size_t nSpecies()
Get the number of species.
virtual double spreadRate()
Tangential velocity gradient [1/s] at this boundary.
Base class for one-dimensional domains.
shared_ptr< Solution > solution() const
Return thermo/kinetics/transport manager used in the domain.
string id() const
Returns the identifying tag for this domain.
double z(size_t jlocal) const
Get the coordinate [m] of the point with local index jlocal
void setSolution(shared_ptr< Solution > sol)
Set the solution manager.
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.
Empty1D()=default
Default constructor.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
Empty1D(shared_ptr< Solution > solution, const string &id="")
Constructor with contents.
void init() override
Initialize.
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
vector< double > m_yin
inlet mass fractions
int m_ilr
A marker that indicates whether this is a left inlet or a right inlet.
string m_xstr
inlet mass fractions. Parsing deferred to init()
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.
size_t nSpecies() override
Get the number of species.
void setTemperature(double T) override
Set the temperature.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
size_t m_nsp
Number of species in the adjacent flow domain.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
void init() override
Initialize.
Flow1D * m_flow
the adjacent flow domain
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.
double m_V0
The spread rate of the inlet [1/s].
Inlet1D()
Default constructor.
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.
Outlet1D(shared_ptr< Solution > solution, const string &id="")
Constructor with contents.
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.
Outlet1D()=default
Default constructor.
An outlet with specified composition.
void setMoleFractions(const string &xin) override
Set the mole fractions by specifying a string.
OutletRes1D()
Default constructor.
string m_xstr
Mole fractions in the reservoir.
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.
vector< double > m_yres
Mass fractions in the reservoir.
size_t nSpecies() override
Get the number of species.
void eval(size_t jg, double *xg, double *rg, integer *diagg, double rdt) override
Evaluate the residual function at point j.
size_t m_nsp
Number of species in the adjacent flow domain.
void fromArray(SolutionArray &arr, double *soln) override
Restore the solution for this domain from a SolutionArray.
void init() override
Initialize.
Flow1D * m_flow
The adjacent flow domain.
string domainType() const override
Domain type flag.
void show(const double *x) override
Print the solution.
SurfPhase * m_sphase
phase representing the surface species
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...
InterfaceKinetics * m_kin
surface kinetics mechanism
bool m_enabled
True if coverage equations are being solved.
vector< double > m_fixed_cov
Fixed values of the coverages used when coverage equations are not being solved.
ReactingSurf1D()
Default constructor.
vector< double > m_work
temporary vector used to store coverages and production rates.
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.
size_t m_nsp
the number of surface phase species
void enableCoverageEquations(bool docov)
Set whether to solve the equations for the surface species coverages.
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 component n. May be overloaded.
bool coverageEnabled()
Indicates whether the equations for the surface species coverages are being solved.
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.
Surf1D()=default
Default constructor.
Surf1D(shared_ptr< Solution > solution, const string &id="")
Constructor with contents.
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
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
void getCoverages(double *theta) const
Return a vector of surface coverages.
Symm1D(shared_ptr< Solution > solution, const string &id="")
Constructor with contents.
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.
Symm1D()=default
Default constructor.
void init() override
Initialize.
string domainType() const override
Domain type flag.
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.
const int LeftInlet
Unique identifier for the left inlet.
const int RightInlet
Unique identifier for the right inlet.