| Cantera 3.0.0

Loading...
Searching...
No Matches
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 https://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
13 namespace Cantera
14{
15
16/**
17 * @ingroup thermoprops
18 *
19 * Class MetalPhase represents electrons in a metal.
20 */
21 class MetalPhase : public ThermoPhase
22{
23 public:
24 MetalPhase() {}
25
26 // Overloaded methods of class ThermoPhase
27
28 string type() const override {
29 return "electron-cloud";
30 }
31
32 bool isCompressible() const override {
33 return false;
34 }
35
36 double enthalpy_mole() const override {
37 return 0.0;
38 }
39 double intEnergy_mole() const override {
40 return - pressure() * molarVolume();
41 }
42 double entropy_mole() const override {
43 return 0.0;
44 }
45 double gibbs_mole() const override {
46 return 0.0;
47 }
48 double cp_mole() const override {
49 return 0.0;
50 }
51 double cv_mole() const override {
52 return 0.0;
53 }
54
55 void setPressure(double pres) override {
56 m_press = pres;
57 }
58 double pressure() const override {
59 return m_press;
60 }
61
62 void getChemPotentials(double* mu) const override {
63 for (size_t n = 0; n < nSpecies(); n++) {
64 mu[n] = 0.0;
65 }
66 }
67
68 void getEnthalpy_RT(double* hrt) const override {
69 for (size_t n = 0; n < nSpecies(); n++) {
70 hrt[n] = 0.0;
71 }
72 }
73
74 void getEntropy_R(double* sr) const override {
75 for (size_t n = 0; n < nSpecies(); n++) {
76 sr[n] = 0.0;
77 }
78 }
79
80 void getStandardChemPotentials(double* mu0) const override {
81 for (size_t n = 0; n < nSpecies(); n++) {
82 mu0[n] = 0.0;
83 }
84 }
85
86 void getActivityConcentrations(double* c) const override {
87 for (size_t n = 0; n < nSpecies(); n++) {
88 c[n] = 1.0;
89 }
90 }
91 void getPartialMolarEnthalpies(double *h) const override {
92 for (size_t n = 0; n < nSpecies(); n++) {
93 h[n] = 0.0;
94 }
95 }
96
97 Units standardConcentrationUnits() const override {
98 return Units(1.0);
99 }
100
101 double standardConcentration(size_t k=0) const override {
102 return 1.0;
103 }
104
105 double logStandardConc(size_t k=0) const override {
106 return 0.0;
107 }
108
109 void initThermo() override {
110 if (m_input.hasKey("density")) {
111 assignDensity(m_input.convert("density", "kg/m^3"));
112 }
113 }
114
115 void getParameters(AnyMap& phaseNode) const override {
116 ThermoPhase::getParameters(phaseNode);
117 phaseNode["density"].setQuantity(density(), "kg/m^3");
118 }
119
120 private:
121 double m_press;
122};
123}
124
125#endif
ThermoPhase.h
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::AnyMap::hasKey
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
Cantera::AnyMap::convert
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Definition AnyMap.cpp:1535
Cantera::MetalPhase
Class MetalPhase represents electrons in a metal.
Definition MetalPhase.h:22
Cantera::MetalPhase::setPressure
void setPressure(double pres) override
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition MetalPhase.h:55
Cantera::MetalPhase::getStandardChemPotentials
void getStandardChemPotentials(double *mu0) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition MetalPhase.h:80
Cantera::MetalPhase::enthalpy_mole
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
Definition MetalPhase.h:36
Cantera::MetalPhase::logStandardConc
double logStandardConc(size_t k=0) const override
Natural logarithm of the standard concentration of the kth species.
Definition MetalPhase.h:105
Cantera::MetalPhase::getChemPotentials
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
Definition MetalPhase.h:62
Cantera::MetalPhase::pressure
double pressure() const override
Return the thermodynamic pressure (Pa).
Definition MetalPhase.h:58
Cantera::MetalPhase::isCompressible
bool isCompressible() const override
Return whether phase represents a compressible substance.
Definition MetalPhase.h:32
Cantera::MetalPhase::getEntropy_R
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition MetalPhase.h:74
Cantera::MetalPhase::getParameters
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition MetalPhase.h:115
Cantera::MetalPhase::type
string type() const override
String indicating the thermodynamic model implemented.
Definition MetalPhase.h:28
Cantera::MetalPhase::initThermo
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition MetalPhase.h:109
Cantera::MetalPhase::getActivityConcentrations
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition MetalPhase.h:86
Cantera::MetalPhase::cv_mole
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition MetalPhase.h:51
Cantera::MetalPhase::getEnthalpy_RT
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition MetalPhase.h:68
Cantera::MetalPhase::intEnergy_mole
double intEnergy_mole() const override
Molar internal energy. Units: J/kmol.
Definition MetalPhase.h:39
Cantera::MetalPhase::entropy_mole
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
Definition MetalPhase.h:42
Cantera::MetalPhase::cp_mole
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition MetalPhase.h:48
Cantera::MetalPhase::standardConcentrationUnits
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
Definition MetalPhase.h:97
Cantera::MetalPhase::gibbs_mole
double gibbs_mole() const override
Molar Gibbs function. Units: J/kmol.
Definition MetalPhase.h:45
Cantera::MetalPhase::standardConcentration
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
Definition MetalPhase.h:101
Cantera::MetalPhase::getPartialMolarEnthalpies
void getPartialMolarEnthalpies(double *h) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition MetalPhase.h:91
Cantera::Phase::assignDensity
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
Definition Phase.cpp:718
Cantera::Phase::nSpecies
size_t nSpecies() const
Returns the number of species in the phase.
Definition Phase.h:245
Cantera::Phase::density
virtual double density() const
Density (kg/m^3).
Definition Phase.h:687
Cantera::Phase::molarVolume
virtual double molarVolume() const
Molar volume (m^3/kmol).
Definition Phase.cpp:702
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
Cantera::ThermoPhase::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition ThermoPhase.cpp:1176
Cantera::ThermoPhase::m_input
AnyMap m_input
Data supplied via setParameters.
Definition ThermoPhase.h:2130
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564