Cantera  2.0
MetalPhase.h
Go to the documentation of this file.
1 /**
2  * @file MetalPhase.h
3  */
4 
5 // Copyright 2003 California Institute of Technology
6 
7 #ifndef CT_METALPHASE_H
8 #define CT_METALPHASE_H
9 
10 #include "mix_defs.h"
11 #include "ThermoPhase.h"
12 #include "SpeciesThermo.h"
13 
14 namespace Cantera
15 {
16 
17 /**
18  * @ingroup thermoprops
19  *
20  * Class MetalPhase represents electrons in a metal.
21  *
22  */
23 class MetalPhase : public ThermoPhase
24 {
25 
26 public:
27 
28  MetalPhase() {}
29 
30  MetalPhase(const MetalPhase& right) {
31  *this = operator=(right);
32  }
33 
34  MetalPhase& operator=(const MetalPhase& right) {
35  if (&right != this) {
37  m_press = right.m_press;
38  }
39  return *this;
40  }
41 
42  virtual ~MetalPhase() {}
43 
44  //! Duplicator
46  MetalPhase* idg = new MetalPhase(*this);
47  return (ThermoPhase*) idg;
48  }
49 
50  // Overloaded methods of class ThermoPhase
51 
52  virtual int eosType() const {
53  return cMetal;
54  }
55 
56  virtual doublereal enthalpy_mole() const {
57  return 0.0;
58  }
59  virtual doublereal intEnergy_mole() const {
60  return 0.0;
61  }
62  virtual doublereal entropy_mole() const {
63  return 0.0;
64  }
65  virtual doublereal gibbs_mole() const {
66  return 0.0;
67  }
68  virtual doublereal cp_mole() const {
69  return 0.0;
70  }
71  virtual doublereal cv_mole() const {
72  return 0.0;
73  }
74 
75  virtual void setPressure(doublereal pres) {
76  m_press = pres;
77  }
78  virtual doublereal pressure() const {
79  return m_press;
80  }
81 
82  virtual void getChemPotentials(doublereal* mu) const {
83  for (size_t n = 0; n < nSpecies(); n++) {
84  mu[n] = 0.0;
85  }
86  }
87 
88  virtual void getEnthalpy_RT(doublereal* hrt) const {
89  for (size_t n = 0; n < nSpecies(); n++) {
90  hrt[n] = 0.0;
91  }
92  }
93 
94  virtual void getEntropy_R(doublereal* sr) const {
95  for (size_t n = 0; n < nSpecies(); n++) {
96  sr[n] = 0.0;
97  }
98  }
99 
100  virtual void getStandardChemPotentials(doublereal* mu0) const {
101  for (size_t n = 0; n < nSpecies(); n++) {
102  mu0[n] = 0.0;
103  }
104  }
105 
106  virtual void getActivityConcentrations(doublereal* c) const {
107  for (size_t n = 0; n < nSpecies(); n++) {
108  c[n] = 1.0;
109  }
110  }
111 
112  virtual doublereal standardConcentration(size_t k=0) const {
113  return 1.0;
114  }
115 
116  virtual doublereal logStandardConc(size_t k=0) const {
117  return 0.0;
118  }
119 
120  virtual void setParametersFromXML(const XML_Node& eosdata) {
121  eosdata._require("model","Metal");
122  doublereal rho = ctml::getFloat(eosdata, "density", "density");
123  setDensity(rho);
124  }
125 
126 protected:
127 
128 private:
129  doublereal m_press;
130 };
131 }
132 
133 #endif
134 
135 
136 
137 
138