Skip to content

Commit

Permalink
Use override on ThermoPhase classes
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Aug 15, 2023
1 parent 9a549f8 commit 8ec508a
Show file tree
Hide file tree
Showing 29 changed files with 722 additions and 830 deletions.
18 changes: 9 additions & 9 deletions include/cantera/thermo/BinarySolutionTabulatedThermo.h
Expand Up @@ -173,14 +173,14 @@ class BinarySolutionTabulatedThermo : public IdealSolidSolnPhase
*/
explicit BinarySolutionTabulatedThermo(const string& infile="", const string& id="");

virtual string type() const {
string type() const override {
return "binary-solution-tabulated";
}

virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual bool ready() const;
virtual void getParameters(AnyMap& phaseNode) const;
bool addSpecies(shared_ptr<Species> spec) override;
void initThermo() override;
bool ready() const override;
void getParameters(AnyMap& phaseNode) const override;

/**
* returns an array of partial molar volumes of the species
Expand All @@ -191,7 +191,7 @@ class BinarySolutionTabulatedThermo : public IdealSolidSolnPhase
*
* @param vbar Output vector of partial molar volumes. Length: m_kk.
*/
virtual void getPartialMolarVolumes(double* vbar) const;
void getPartialMolarVolumes(double* vbar) const override;

/**
* Overloads the calcDensity() method of IdealSolidSoln to also consider non-ideal
Expand All @@ -206,11 +206,11 @@ class BinarySolutionTabulatedThermo : public IdealSolidSolnPhase
* where @f$ X_k @f$ are the mole fractions, @f$ W_k @f$ are the molecular weights, and
* @f$ V_\mathrm{m} @f$ is the molar volume interpolated from @f$ V_{\mathrm{m,tab}} @f$.
*/
virtual void calcDensity();
void calcDensity() override;

protected:
//! If the compositions have changed, update the tabulated thermo lookup
virtual void compositionChanged();
void compositionChanged() override;

//! Species thermodynamics linear interpolation function
/*!
Expand Down Expand Up @@ -254,7 +254,7 @@ class BinarySolutionTabulatedThermo : public IdealSolidSolnPhase
vector<double> m_derived_molar_volume_tab;

private:
virtual void _updateThermo() const;
void _updateThermo() const override;
};
}

Expand Down
45 changes: 22 additions & 23 deletions include/cantera/thermo/CoverageDependentSurfPhase.h
Expand Up @@ -220,7 +220,7 @@ class CoverageDependentSurfPhase : public SurfPhase
explicit CoverageDependentSurfPhase(const string& infile="",
const string& id="");

virtual string type() const {
string type() const override {
return "coverage-dependent-surface";
}

Expand All @@ -230,21 +230,20 @@ class CoverageDependentSurfPhase : public SurfPhase
*/
void addInterpolativeDependency(const InterpolativeDependency& int_deps);

virtual void initThermo();
virtual bool addSpecies(shared_ptr<Species> spec);
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name,
AnyMap& speciesNode) const;
void initThermo() override;
bool addSpecies(shared_ptr<Species> spec) override;
void getParameters(AnyMap& phaseNode) const override;
void getSpeciesParameters(const string& name, AnyMap& speciesNode) const override;

//! @name Methods calculating reference state thermodynamic properties
//! Reference state properties are evaluated at @f$ T \text{ and }
//! \theta^{ref} @f$. With coverage fixed at a reference value,
//! reference state properties are effectively only dependent on temperature.
//! @{
virtual void getEnthalpy_RT_ref(double* hrt) const;
virtual void getEntropy_R_ref(double* sr) const;
virtual void getCp_R_ref(double* cpr) const;
virtual void getGibbs_RT_ref(double* grt) const;
void getEnthalpy_RT_ref(double* hrt) const override;
void getEntropy_R_ref(double* sr) const override;
void getCp_R_ref(double* cpr) const override;
void getGibbs_RT_ref(double* grt) const override;
//! @}

//! @name Methods calculating standard state thermodynamic properties
Expand All @@ -260,7 +259,7 @@ class CoverageDependentSurfPhase : public SurfPhase
* + \int_{298}^{T} c^{cov}_{p,k}(T,\theta)dT}{RT}
* @f]
*/
virtual void getEnthalpy_RT(double* hrt) const;
void getEnthalpy_RT(double* hrt) const override;

//! Get the nondimensionalized standard state entropy vector.
/*!
Expand All @@ -271,7 +270,7 @@ class CoverageDependentSurfPhase : public SurfPhase
* - \ln\left(\frac{1}{\theta_{ref}}\right)
* @f]
*/
virtual void getEntropy_R(double* sr) const;
void getEntropy_R(double* sr) const override;

//! Get the nondimensionalized standard state heat capacity vector.
/*!
Expand All @@ -280,7 +279,7 @@ class CoverageDependentSurfPhase : public SurfPhase
* = \frac{c^{ref}_{p,k}(T) + c^{cov}_{p,k}(T,\theta)}{RT}
* @f]
*/
virtual void getCp_R(double* cpr) const;
void getCp_R(double* cpr) const override;

//! Get the nondimensionalized standard state gibbs free energy vector.
/*!
Expand All @@ -289,23 +288,23 @@ class CoverageDependentSurfPhase : public SurfPhase
* = \frac{h^o_k(T,\theta)}{RT} + \frac{s^o_k(T,\theta)}{R}
* @f]
*/
virtual void getGibbs_RT(double* grt) const;
void getGibbs_RT(double* grt) const override;

//! Get the standard state gibbs free energy vector. Units: J/kmol.
/*!
* @f[
* g^o_k(T,\theta) = h^o_k(T,\theta) + Ts^o_k(T,\theta)
* @f]
*/
virtual void getPureGibbs(double* g) const;
void getPureGibbs(double* g) const override;

//! Get the standard state chemical potential vector. Units: J/kmol.
/*!
* @f[
* \mu^o_k(T,\theta) = h^o_k(T,\theta) + Ts^o_k(T,\theta)
* @f]
*/
virtual void getStandardChemPotentials(double* mu0) const;
void getStandardChemPotentials(double* mu0) const override;
//! @}

//! @name Methods calculating partial molar thermodynamic properties
Expand All @@ -319,31 +318,31 @@ class CoverageDependentSurfPhase : public SurfPhase
* \tilde{h}_k(T,\theta) = h^o_k(T,\theta)
* @f]
*/
virtual void getPartialMolarEnthalpies(double* hbar) const;
void getPartialMolarEnthalpies(double* hbar) const override;

//! Get the partial molar entropy vector. Units: J/kmol/K.
/*!
* @f[
* \tilde{s}_k(T,\theta) = s^o_k(T,\theta) - R\ln(\theta_k)
* @f]
*/
virtual void getPartialMolarEntropies(double* sbar) const;
void getPartialMolarEntropies(double* sbar) const override;

//! Get the partial molar heat capacity vector. Units: J/kmol/K.
/*!
* @f[
* \tilde{c}_{p,k}(T,\theta) = c^o_{p,k}(T,\theta)
* @f]
*/
virtual void getPartialMolarCp(double* cpbar) const;
void getPartialMolarCp(double* cpbar) const override;

//! Get the chemical potential vector. Units: J/kmol.
/*!
* @f[
* \mu_k(T,\theta) = \mu^o_k(T,\theta) + RT\ln(\theta_k)
* @f]
*/
virtual void getChemPotentials(double* mu) const;
void getChemPotentials(double* mu) const override;
//! @}

//! @name Methods calculating Phase thermodynamic properties
Expand All @@ -358,23 +357,23 @@ class CoverageDependentSurfPhase : public SurfPhase
* \hat h(T,\theta) = \sum_k \theta_k \tilde{h}_k(T,\theta)
* @f]
*/
virtual double enthalpy_mole() const;
double enthalpy_mole() const override;

//! Return the solution's molar entropy. Units: J/kmol/K
/*!
* @f[
* \hat s(T,\theta) = \sum_k \theta_k \tilde{s}_k(T,\theta)
* @f]
*/
virtual double entropy_mole() const;
double entropy_mole() const override;

//! Return the solution's molar heat capacity. Units: J/kmol/K
/*!
* @f[
* \hat{c_p}(T,\theta) = \sum_k \theta_k \tilde{c_p}_k(T,\theta)
* @f]
*/
virtual double cp_mole() const;
double cp_mole() const override;
//! @}

protected:
Expand Down
40 changes: 20 additions & 20 deletions include/cantera/thermo/DebyeHuckel.h
Expand Up @@ -414,7 +414,7 @@ class PDSS_Water;
class DebyeHuckel : public MolalityVPSSTP
{
public:
virtual ~DebyeHuckel();
~DebyeHuckel() override;

//! Full constructor for creating the phase.
/*!
Expand All @@ -427,15 +427,15 @@ class DebyeHuckel : public MolalityVPSSTP
//! @name Utilities
//! @{

virtual string type() const {
string type() const override {
return "Debye-Huckel";
}

//! @}
//! @name Molar Thermodynamic Properties of the Solution
//! @{

virtual double enthalpy_mole() const;
double enthalpy_mole() const override;

//! Molar entropy. Units: J/kmol/K.
/**
Expand All @@ -452,10 +452,10 @@ class DebyeHuckel : public MolalityVPSSTP
* temperature since the volume expansivities are equal to zero.
* @see MultiSpeciesThermo
*/
virtual double entropy_mole() const;
double entropy_mole() const override;

virtual double gibbs_mole() const;
virtual double cp_mole() const;
double gibbs_mole() const override;
double cp_mole() const override;

//! @}
//! @name Mechanical Equation of State Properties
Expand All @@ -468,7 +468,7 @@ class DebyeHuckel : public MolalityVPSSTP
//! @{

protected:
virtual void calcDensity();
void calcDensity() override;

public:
//! @}
Expand All @@ -481,7 +481,7 @@ class DebyeHuckel : public MolalityVPSSTP
//! to be molality-based here.
//! @{

virtual void getActivityConcentrations(double* c) const;
void getActivityConcentrations(double* c) const override;

//! Return the standard concentration for the kth species
/*!
Expand All @@ -497,7 +497,7 @@ class DebyeHuckel : public MolalityVPSSTP
* assume this refers to species 0.
* @return the standard Concentration in units of m^3/kmol
*/
virtual double standardConcentration(size_t k=0) const;
double standardConcentration(size_t k=0) const override;

//! Get the array of non-dimensional activities at the current solution
//! temperature, pressure, and solution concentration.
Expand All @@ -506,7 +506,7 @@ class DebyeHuckel : public MolalityVPSSTP
*
* @param ac Output vector of activities. Length: m_kk.
*/
virtual void getActivities(double* ac) const;
void getActivities(double* ac) const override;

//! Get the array of non-dimensional molality-based activity coefficients at
//! the current solution temperature, pressure, and solution concentration.
Expand All @@ -519,7 +519,7 @@ class DebyeHuckel : public MolalityVPSSTP
* @param acMolality Vector of Molality-based activity coefficients
* Length: m_kk
*/
virtual void getMolalityActivityCoefficients(double* acMolality) const;
void getMolalityActivityCoefficients(double* acMolality) const override;

//! @}
//! @name Partial Molar Properties of the Solution
Expand All @@ -538,7 +538,7 @@ class DebyeHuckel : public MolalityVPSSTP
* @param mu Output vector of species chemical
* potentials. Length: m_kk. Units: J/kmol
*/
virtual void getChemPotentials(double* mu) const;
void getChemPotentials(double* mu) const override;

//! Returns an array of partial molar enthalpies for the species
//! in the mixture. Units (J/kmol)
Expand All @@ -561,7 +561,7 @@ class DebyeHuckel : public MolalityVPSSTP
* @param hbar Output vector of species partial molar enthalpies.
* Length: m_kk. units are J/kmol.
*/
virtual void getPartialMolarEnthalpies(double* hbar) const;
void getPartialMolarEnthalpies(double* hbar) const override;

//! Returns an array of partial molar entropies of the species in the
//! solution. Units: J/kmol/K.
Expand Down Expand Up @@ -591,9 +591,9 @@ class DebyeHuckel : public MolalityVPSSTP
* @param sbar Output vector of species partial molar entropies.
* Length = m_kk. units are J/kmol/K.
*/
virtual void getPartialMolarEntropies(double* sbar) const;
void getPartialMolarEntropies(double* sbar) const override;

virtual void getPartialMolarCp(double* cpbar) const;
void getPartialMolarCp(double* cpbar) const override;

//! Return an array of partial molar volumes for the species in the mixture.
//! Units: m^3/kmol.
Expand All @@ -611,18 +611,18 @@ class DebyeHuckel : public MolalityVPSSTP
* @param vbar Output vector of species partial molar volumes.
* Length = m_kk. units are m^3/kmol.
*/
virtual void getPartialMolarVolumes(double* vbar) const;
void getPartialMolarVolumes(double* vbar) const override;

//! @}

/*
* -------------- Utilities -------------------------------
*/

virtual bool addSpecies(shared_ptr<Species> spec);
virtual void initThermo();
virtual void getParameters(AnyMap& phaseNode) const;
virtual void getSpeciesParameters(const string& name, AnyMap& speciesNode) const;
bool addSpecies(shared_ptr<Species> spec) override;
void initThermo() override;
void getParameters(AnyMap& phaseNode) const override;
void getSpeciesParameters(const string& name, AnyMap& speciesNode) const override;

//! Return the Debye Huckel constant as a function of temperature
//! and pressure (Units = sqrt(kg/gmol))
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/EdgePhase.h
Expand Up @@ -38,7 +38,7 @@ class EdgePhase : public SurfPhase
*/
explicit EdgePhase(const string& infile="", const string& id="");

virtual string type() const {
string type() const override {
return "edge";
}
};
Expand Down

0 comments on commit 8ec508a

Please sign in to comment.