Cantera  3.1.0a1
Loading...
Searching...
No Matches
Interface.h
Go to the documentation of this file.
1//! @file Interface.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_INTERFACE_H
7#define CT_INTERFACE_H
8
12
13namespace Cantera
14{
15
16//! A container class for chemically-reacting interfaces.
17/*!
18 * Instances of class Interface represent reacting 2D surfaces between bulk 3D phases,
19 * or 1D edges where multiple surfaces (and bulk phases) meet.
20 * @ingroup solnGroup
21 */
22class Interface : public Solution
23{
24private:
25 Interface() = default;
26
27public:
28 ~Interface() {}
29 Interface(const Interface&) = delete;
30 Interface& operator=(const Interface&) = delete;
31
32 //! Create an empty Interface object
33 static shared_ptr<Interface> create() {
34 return shared_ptr<Interface>(new Interface());
35 }
36
37 //! Set the reacting phase thermo object
38 void setThermo(shared_ptr<ThermoPhase> thermo) override;
39
40 //! Set the Kinetics object
41 void setKinetics(shared_ptr<Kinetics> kinetics) override;
42
43 //! Get the surface phase thermo object
44 shared_ptr<SurfPhase> thermo() {
45 return m_surf;
46 }
47
48 //! Get the surface phase Kinetics object
49 shared_ptr<InterfaceKinetics> kinetics() {
50 return m_surfkin;
51 }
52
53protected:
54 shared_ptr<SurfPhase> m_surf; //!< Surface phase ThermoPhase manager
55 shared_ptr<InterfaceKinetics> m_surfkin; //!< Kinetics manager
56};
57
58//! Create and initialize a new Interface from an input file
59/*!
60 * This constructor wraps newThermo() and newKinetics()
61 *
62 * @param infile name of the input file
63 * @param name name of the surface phase in the file.
64 * If this is blank, the first phase in the file is used.
65 * @param adjacent vector containing names of adjacent phases that participate in this
66 * phases kinetics. If empty, adjacent phases will be instantiated based
67 * on the phase definition.
68 * @returns an initialized Interface object.
69 * @ingroup solnGroup
70 */
71shared_ptr<Interface> newInterface(const string& infile,
72 const string& name="", const vector<string>& adjacent={});
73
74
75//! Create and initialize a new Interface from an input file
76/*!
77 * This constructor wraps newThermo() and newKinetics()
78 *
79 * @param infile name of the input file
80 * @param name name of the phase in the file. If this is the empty string, the first
81 * phase in the file is used.
82 * @param adjacent vector containing adjacent Solution objects. If empty, adjacent
83 * phases will be instantiated based on the phase definition.
84 * @returns an initialized Interface object.
85 * @ingroup solnGroup
86 */
87shared_ptr<Interface> newInterface(const string& infile,
88 const string& name, const vector<shared_ptr<Solution>>& adjacent);
89
90//! Create and initialize a new Interface from AnyMap objects
91/*!
92 * This constructor wraps newThermo() and newKinetics()
93 *
94 * @param phaseNode the node containing the phase definition (that is, thermo model,
95 * list of species, and initial state)
96 * @param rootNode the root node of the tree containing the phase definition, which
97 * will be used as the default location from which to read species definitions.
98 * @param adjacent vector containing adjacent Solution objects. If empty, adjacent
99 * phases will be instantiated based on the phase definition.
100 * @returns an initialized Interface object.
101 * @ingroup solnGroup
102 */
103shared_ptr<Interface> newInterface(AnyMap& phaseNode, const AnyMap& rootNode=AnyMap(),
104 const vector<shared_ptr<Solution>>& adjacent={});
105}
106
107#endif
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
A container class for chemically-reacting interfaces.
Definition Interface.h:23
shared_ptr< InterfaceKinetics > m_surfkin
Kinetics manager.
Definition Interface.h:55
static shared_ptr< Interface > create()
Create an empty Interface object.
Definition Interface.h:33
void setThermo(shared_ptr< ThermoPhase > thermo) override
Set the reacting phase thermo object.
Definition Interface.cpp:13
shared_ptr< InterfaceKinetics > kinetics()
Get the surface phase Kinetics object.
Definition Interface.h:49
shared_ptr< SurfPhase > thermo()
Get the surface phase thermo object.
Definition Interface.h:44
void setKinetics(shared_ptr< Kinetics > kinetics) override
Set the Kinetics object.
Definition Interface.cpp:24
shared_ptr< SurfPhase > m_surf
Surface phase ThermoPhase manager.
Definition Interface.h:54
A container class for chemically-reacting solutions.
Definition Solution.h:44
shared_ptr< Interface > newInterface(const string &infile, const string &name, const vector< string > &adjacent)
Create and initialize a new Interface from an input file.
Definition Interface.cpp:35
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564