Skip to content

Grand Potential Phase Density

The GrandPotentialPhaseDensity is an abstract base class for grand potential density models of thermodynamic phases. Each grand potential density model ωα is represented by a class that inherits from this base class. It therefore has to implement the calculation of the grand potential density and its first and second derivative with respect to the chemical potential. Note that in absence of shear stresses, the grand potential density is equal to the negative pressure

(1)ωα=pα

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

(2)ωαμ=cα

and the second derivative by

(3)2ωαμ2=χα

where χα the susceptibility of phase α.

Dependencies

Interface

The following functions have to be implemented by each derived class

cpp
    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.

cpp
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
#endif

see also GrandPotentialPhaseDensity_Parabolic

Released under the GNU GPLv3 License.