Grand Potential Density
The GrandPotentialDensity class manages the grand potential density
which is the sum of the grand potential densities
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
// ....
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
@GrandPotentialDensity
$OMEGA_0 Vapor phase model : Parabolic
$OMEGA_1 Solid phase model : ParabolicEach grand potential density model
Interface
GrandPotentialDensity (Settings& locSettings, std::string InputFileName); ///< Allocates and initializes memoryRead 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.
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
GrandPotentialPhaseDensity& operator() (size_t PhaseIdx) constReturns grand potential density
double operator() (int i, int j, int k, const PhaseField& Phase) constReturns grand potential density