Grand Potential Phase Density
The GrandPotentialPhaseDensity is an abstract base class for grand potential density models of thermodynamic phases. Each grand potential density model
The first and second derivative of the grand potential density with respect to the chemical potential are related to the concentration and susceptibility of the phase by
and the second derivative by
where
Dependencies
Interface
The following functions have to be implemented by each derived class
virtual double PhasePressure (double Temperature, const Tensor<double,1>& ChemicalPotential) const = 0;
virtual double PhaseConcentration (double Temperature, double ChemicalPotential, size_t comp) const = 0
virtual double PhaseSusceptibility (double Temperature, double ChemicalPotential, size_t comp) const = 0;
virtual void ReadInput(std::stringstream& InputFile, int moduleLocation) = 0;Other functions may be implemented as needed.
Usage
Implement derived class e.g.
namespace openphase
{
class Settings;
struct GrandPotentialPhaseDensity_Parabolic: GrandPotentialPhaseDensity
{
GrandPotentialPhaseDensity_Parabolic(size_t PhaseIdxInp): GrandPotentialPhaseDensity(PhaseIdxInp){};
virtual void Initialize (Settings& locSettings) override; ///< Initializes global settings
virtual void ReadInput (std::stringstream& InputFile, int moduleLocation) override; ///< Reads input parameters from a file
double PhasePotential (double Temperature, const Tensor<double,1>& ChemicalPotential) const override
{
double locPotential = 0.0;
for (size_t comp = 0; comp < Ncomp; ++comp)
{
const double& mu = ChemicalPotential({comp});
locPotential -= 0.5*mu*mu/EPS[comp]+C0[comp]*mu;
}
return locPotential;
}
double PhaseConcentration (double Temperature, double ChemicalPotential, size_t comp) const override
{
assert(comp < Ncomp);
return ChemicalPotential/EPS[comp] + C0[comp];
}
double PhaseSusceptibility (double Temperature, double ChemicalPotential, size_t comp) const override
{
assert(comp < Ncomp);
return 1.0/EPS[comp];
}
static constexpr auto thisclassname = "GrandPotentialPhaseDensities_Parabolic";
protected:
std::vector<double> EPS; ///< Energy coefficient for parabolic energy
std::vector<double> C0; ///< Minimum molar concentration of parabolic free energy
};
}// namespace openphase
#endifsee also GrandPotentialPhaseDensity_Parabolic