21 : neutralMoleculePhase_(0)
32void PDSS_IonsFromNeutral::setNeutralSpeciesMultiplier(
const std::string& species,
double mult)
34 neutralSpeciesMultipliers_[species] = mult;
38void PDSS_IonsFromNeutral::setSpecialSpecies(
bool special) {
47 throw CanteraError(
"PDSS_IonsFromNeutral::setParametersFromXML",
48 "no 'thermo' Node for species '{}'", speciesNode.
name());
51 throw CanteraError(
"PDSS_IonsFromNeutral::setParametersFromXML",
52 "thermo model for species '{}' isn't 'IonsFromNeutral'",
57 throw CanteraError(
"PDSS_IonsFromNeutral::setParametersFromXML",
58 "no 'Thermo::neutralSpeciesMultipliers' Node for species '{}'",
63 setNeutralSpeciesMultiplier(species_mult.first, species_mult.second);
74 eosNode[
"model"] =
"ions-from-neutral-molecule";
76 eosNode[
"special-species"] =
true;
78 if (!neutralSpeciesMultipliers_.empty()) {
79 eosNode[
"multipliers"] = neutralSpeciesMultipliers_;
90 for (
const auto& item :
m_input[
"multipliers"].asMap<double>()) {
91 setNeutralSpeciesMultiplier(item.first, item.second);
99 for (
auto multiplier : neutralSpeciesMultipliers_) {
108 doublereal val = 0.0;
109 for (
size_t i = 0; i <
numMult_; i++) {
124 doublereal val = 0.0;
125 for (
size_t i = 0; i <
numMult_; i++) {
130 val -= 2.0 * log(2.0);
138 doublereal val = 0.0;
139 for (
size_t i = 0; i <
numMult_; i++) {
144 val += 2.0 * log(2.0);
152 doublereal val = 0.0;
153 for (
size_t i = 0; i <
numMult_; i++) {
163 doublereal val = 0.0;
164 for (
size_t i = 0; i <
numMult_; i++) {
179 doublereal val = 0.0;
180 for (
size_t i = 0; i <
numMult_; i++) {
185 val += 2.0 * log(2.0);
193 doublereal val = 0.0;
194 for (
size_t i = 0; i <
numMult_; i++) {
204 doublereal val = 0.0;
205 for (
size_t i = 0; i <
numMult_; i++) {
210 val -= 2.0 * log(2.0);
218 doublereal val = 0.0;
219 for (
size_t i = 0; i <
numMult_; i++) {
229 doublereal val = 0.0;
230 for (
size_t i = 0; i <
numMult_; i++) {
Header for intermediate ThermoPhase object for phases which consist of ions whose thermodynamics is c...
Declarations for the class PDSS_IonsFromNeutral ( which handles calculations for a single ion in a fl...
A map of string keys to values whose type can vary at runtime.
bool getBool(const std::string &key, bool default_) const
If key exists, return it as a bool, otherwise return default_.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
std::vector< size_t > idNeutralMoleculeVec
Vector of species indices in the neutral molecule ThermoPhase.
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
PDSS_IonsFromNeutral()
Default constructor.
vector_fp factorVec
Stoichiometric coefficient for this species using the Neutral Molecule Species in the vector idNeutra...
size_t numMult_
Number of neutral molecule species that make up the stoichiometric vector for this species,...
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual void initThermo()
Initialization routine.
shared_ptr< ThermoPhase > neutralMoleculePhase_
Pointer to the Neutral Molecule ThermoPhase object.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
void setParent(VPStandardStateTP *phase, size_t k)
Set the parent VPStandardStateTP object of this PDSS object.
virtual doublereal density() const
Return the standard state density at standard state.
vector_fp tmpNM
Vector of length equal to the number of species in the neutral molecule phase.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
bool add2RTln2_
Add 2RTln2 to the entropy and Gibbs free energies for this species.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
double m_h0_RT
Reference state enthalpy divided by RT.
virtual void initThermo()
Initialization routine.
virtual void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
doublereal m_pres
State of the system - pressure.
doublereal m_temp
Current temperature used by the PDSS object.
doublereal m_maxTemp
Maximum temperature.
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.
AnyMap m_input
Input data supplied via setParameters.
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
doublereal m_minTemp
Minimum temperature.
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Class XML_Node is a tree-based representation of the contents of an XML file.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
std::string name() const
Returns the name of the XML node.
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node.
std::string value() const
Return the value of an XML node as a string.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
Namespace for the Cantera kernel.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
const double GasConstant
Universal Gas Constant [J/kmol/K].
compositionMap parseCompString(const std::string &ss, const std::vector< std::string > &names=std::vector< std::string >())
Parse a composition string into a map consisting of individual key:composition pairs.
Contains declarations for string manipulation functions within Cantera.