Skip to content

Grand Potential Density

The GrandPotentialDensity class manages the grand potential density

(1)ω=αϕαωα(μi,T)

which is the sum of the grand potential densities ωα(μi,T) of each thermodynamic phase α weighted by the phase-field ϕα.

Dependencies

Usage

The grand potential class is required as input for the solve functions of the GrandPotentialSolver class. Below a minimalistic usage example is given

cpp
// ....
Settings              OPSettings (InputFileName);
GrandPotentialDensity omega      (OPSettings, InputFileName);
// ....
omega.Set(Temp.Tx,GPS.ChemicalPotential);
// ....

for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
    // ....
    GPS.Solve(Phase,omega,BC,IP,Tx,RTC.dt);
    // ....
}

Input Parameters

The GrandPotentialDensity class has only one required input parameter for each thermodynamic phase. Currently, only the Parabolic is supported. Below an example is given for two thermodynamic phases is given

opi
@GrandPotentialDensity

$OMEGA_0    Vapor phase model    : Parabolic
$OMEGA_1    Solid phase model    : Parabolic

Each grand potential density model

Interface

cpp
GrandPotentialDensity (Settings& locSettings, std::string InputFileName);   ///< Allocates and initializes memory

Read requested grand potential density model for each thermodynamic phase form class form .opi file. Each grand potential density model is a class hat inherits from GrandPotentialPhaseDensity. An object of each requested class is created. For each object GrandPotentialPhaseDensity::Initialize and GrandPotentialPhaseDensity::ReadInput are called.

cpp
void Set(const Storage3D<double,0>& Temperature, const Storage3D<double,1>& ChemicalPotential)

Sets and stores reference to Temperature and chemical potential class. The Set method needs to be called explicitly only once but will it be implicitly invoked by the compiler on each function call when the external external memory is accessed during that function call! This allow to abstract the definition ωα(μi,T) independent of (i,j,k).

cpp
GrandPotentialPhaseDensity& operator() (size_t PhaseIdx) const

Returns grand potential density ωα(μi) of phase α

cpp
double operator() (int i, int j, int k, const PhaseField& Phase) const

Returns grand potential density ω at (i,j,k).

Released under the GNU GPLv3 License.