Cantera 2.6.0
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 holding managers for all pieces defining an interface
17class Interface : public Solution
18{
19private:
20 Interface();
21
22public:
23 ~Interface() {}
24 Interface(const Interface&) = delete;
25 Interface& operator=(const Interface&) = delete;
26
27 //! Create an empty Interface object
28 static shared_ptr<Interface> create() {
29 return shared_ptr<Interface>(new Interface());
30 }
31
32 //! Set the reacting phase thermo object
33 void setThermo(shared_ptr<ThermoPhase> thermo) override;
34
35 //! Set the Kinetics object
36 void setKinetics(shared_ptr<Kinetics> kinetics) override;
37
38 //! Get the surface phase thermo object
39 shared_ptr<SurfPhase> thermo() {
40 return m_surf;
41 }
42
43 //! Get the surface phase Kinetics object
44 shared_ptr<InterfaceKinetics> kinetics() {
45 return m_surfkin;
46 }
47
48protected:
49 shared_ptr<SurfPhase> m_surf; //!< Surface phase ThermoPhase manager
50 shared_ptr<InterfaceKinetics> m_surfkin; //!< Kinetics manager
51};
52
53//! Create and initialize a new Interface from an input file
54/*!
55 * This constructor wraps newPhase() and newKinetics()
56 *
57 * @param infile name of the input file
58 * @param name name of the surface phase in the file.
59 * If this is blank, the first phase in the file is used.
60 * @param adjacent vector containing names of adjacent phases that participate in this
61 * phases kinetics. If empty, adjacent phases will be instantiated based
62 * on the phase definition.
63 * @returns an initialized Interface object.
64 */
65shared_ptr<Interface> newInterface(const std::string& infile,
66 const std::string& name="", const std::vector<std::string>& adjacent={});
67
68
69//! Create and initialize a new Interface from an input file
70/*!
71 * This constructor wraps newPhase() and newKinetics()
72 *
73 * @param infile name of the input file
74 * @param name name of the phase in the file. If this is the empty string, the first
75 * phase in the file is used.
76 * @param adjacent vector containing adjacent Solution objects. If empty, adjacent
77 * phases will be instantiated based on the phase definition.
78 * @returns an initialized Interface object.
79 */
80shared_ptr<Interface> newInterface(const std::string& infile,
81 const std::string& name, const std::vector<shared_ptr<Solution>>& adjacent);
82
83//! Create and initialize a new Interface from AnyMap objects
84/*!
85 * This constructor wraps newPhase() and newKinetics()
86 *
87 * @param phaseNode the node containing the phase definition (that is, thermo model,
88 * list of species, and initial state)
89 * @param rootNode the root node of the tree containing the phase definition, which
90 * will be used as the default location from which to read species definitions.
91 * @param adjacent vector containing adjacent Solution objects. If empty, adjacent
92 * phases will be instantiated based on the phase definition.
93 * @returns an initialized Interface object.
94 */
95shared_ptr<Interface> newInterface(AnyMap& phaseNode, const AnyMap& rootNode=AnyMap(),
96 const std::vector<shared_ptr<Solution>>& adjacent={});
97}
98
99#endif
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
A container class holding managers for all pieces defining an interface.
Definition: Interface.h:18
shared_ptr< InterfaceKinetics > m_surfkin
Kinetics manager.
Definition: Interface.h:50
static shared_ptr< Interface > create()
Create an empty Interface object.
Definition: Interface.h:28
void setThermo(shared_ptr< ThermoPhase > thermo) override
Set the reacting phase thermo object.
Definition: Interface.cpp:18
shared_ptr< InterfaceKinetics > kinetics()
Get the surface phase Kinetics object.
Definition: Interface.h:44
shared_ptr< SurfPhase > thermo()
Get the surface phase thermo object.
Definition: Interface.h:39
void setKinetics(shared_ptr< Kinetics > kinetics) override
Set the Kinetics object.
Definition: Interface.cpp:29
shared_ptr< SurfPhase > m_surf
Surface phase ThermoPhase manager.
Definition: Interface.h:49
A container class holding managers for all pieces defining a phase.
Definition: Solution.h:21
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
shared_ptr< Interface > newInterface(const std::string &infile, const std::string &name="", const std::vector< std::string > &adjacent={})
Create and initialize a new Interface from an input file.
Definition: Interface.cpp:40