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
9#include "cantera/base/Solution.h"
10#include "cantera/thermo/SurfPhase.h"
11#include "cantera/kinetics/InterfaceKinetics.h"
12
13 namespace Cantera
14{
15
16//! A container class holding managers for all pieces defining an interface
17 class Interface : public Solution
18{
19 private:
20 Interface();
21
22 public:
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
48 protected:
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
InterfaceKinetics.h
Solution.h
SurfPhase.h
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Cantera::Interface
A container class holding managers for all pieces defining an interface.
Definition: Interface.h:18
Cantera::Interface::m_surfkin
shared_ptr< InterfaceKinetics > m_surfkin
Kinetics manager.
Definition: Interface.h:50
Cantera::Interface::create
static shared_ptr< Interface > create()
Create an empty Interface object.
Definition: Interface.h:28
Cantera::Interface::setThermo
void setThermo(shared_ptr< ThermoPhase > thermo) override
Set the reacting phase thermo object.
Definition: Interface.cpp:18
Cantera::Interface::kinetics
shared_ptr< InterfaceKinetics > kinetics()
Get the surface phase Kinetics object.
Definition: Interface.h:44
Cantera::Interface::thermo
shared_ptr< SurfPhase > thermo()
Get the surface phase thermo object.
Definition: Interface.h:39
Cantera::Interface::setKinetics
void setKinetics(shared_ptr< Kinetics > kinetics) override
Set the Kinetics object.
Definition: Interface.cpp:29
Cantera::Interface::m_surf
shared_ptr< SurfPhase > m_surf
Surface phase ThermoPhase manager.
Definition: Interface.h:49
Cantera::Solution
A container class holding managers for all pieces defining a phase.
Definition: Solution.h:21
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::newInterface
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