Cantera  2.4.0
MetalPhase.h
Go to the documentation of this file.
1 /**
2  * @file MetalPhase.h
3  */
4 
5 // This file is part of Cantera. See License.txt in the top-level directory or
6 // at http://www.cantera.org/license.txt for license and copyright information.
7 
8 #ifndef CT_METALPHASE_H
9 #define CT_METALPHASE_H
10 
11 #include "ThermoPhase.h"
12 #include "cantera/base/ctml.h"
13 
14 namespace Cantera
15 {
16 
17 /**
18  * @ingroup thermoprops
19  *
20  * Class MetalPhase represents electrons in a metal.
21  */
22 class MetalPhase : public ThermoPhase
23 {
24 public:
25  MetalPhase() {}
26 
27  // Overloaded methods of class ThermoPhase
28 
29  virtual std::string type() const {
30  return "Metal";
31  }
32 
33  virtual doublereal enthalpy_mole() const {
34  return 0.0;
35  }
36  virtual doublereal intEnergy_mole() const {
37  return 0.0;
38  }
39  virtual doublereal entropy_mole() const {
40  return 0.0;
41  }
42  virtual doublereal gibbs_mole() const {
43  return 0.0;
44  }
45  virtual doublereal cp_mole() const {
46  return 0.0;
47  }
48  virtual doublereal cv_mole() const {
49  return 0.0;
50  }
51 
52  virtual void setPressure(doublereal pres) {
53  m_press = pres;
54  }
55  virtual doublereal pressure() const {
56  return m_press;
57  }
58 
59  virtual void getChemPotentials(doublereal* mu) const {
60  for (size_t n = 0; n < nSpecies(); n++) {
61  mu[n] = 0.0;
62  }
63  }
64 
65  virtual void getEnthalpy_RT(doublereal* hrt) const {
66  for (size_t n = 0; n < nSpecies(); n++) {
67  hrt[n] = 0.0;
68  }
69  }
70 
71  virtual void getEntropy_R(doublereal* sr) const {
72  for (size_t n = 0; n < nSpecies(); n++) {
73  sr[n] = 0.0;
74  }
75  }
76 
77  virtual void getStandardChemPotentials(doublereal* mu0) const {
78  for (size_t n = 0; n < nSpecies(); n++) {
79  mu0[n] = 0.0;
80  }
81  }
82 
83  virtual void getActivityConcentrations(doublereal* c) const {
84  for (size_t n = 0; n < nSpecies(); n++) {
85  c[n] = 1.0;
86  }
87  }
88 
89  virtual doublereal standardConcentration(size_t k=0) const {
90  return 1.0;
91  }
92 
93  virtual doublereal logStandardConc(size_t k=0) const {
94  return 0.0;
95  }
96 
97  virtual void setParametersFromXML(const XML_Node& eosdata) {
98  eosdata._require("model","Metal");
99  doublereal rho = getFloat(eosdata, "density", "density");
100  setDensity(rho);
101  }
102 
103 private:
104  doublereal m_press;
105 };
106 }
107 
108 #endif
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: MetalPhase.h:55
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
Definition: MetalPhase.h:97
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
Definition: MetalPhase.h:42
Class MetalPhase represents electrons in a metal.
Definition: MetalPhase.h:22
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
size_t nSpecies() const
Returns the number of species in the phase.
Definition: Phase.h:266
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition: MetalPhase.h:48
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition: MetalPhase.h:59
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
Definition: MetalPhase.h:83
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Definition: MetalPhase.h:39
void _require(const std::string &a, const std::string &v) const
Require that the current XML node have an attribute named by the first argument, a, and that this attribute have the the string value listed in the second argument, v.
Definition: xml.cpp:576
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition: MetalPhase.h:65
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition: MetalPhase.h:89
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: MetalPhase.h:29
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Definition: MetalPhase.h:33
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition: MetalPhase.h:45
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition: MetalPhase.h:71
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition: MetalPhase.h:77
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Definition: MetalPhase.h:93
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Definition: ctml.cpp:164
virtual doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
Definition: MetalPhase.h:36
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
virtual void setPressure(doublereal pres)
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition: MetalPhase.h:52
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase.
Definition: Phase.h:622