Double Obstacle
The DoubleObstacle class implements the capillarity part of the phase-field equation. It evaluates the energy penalty associated with the diffuse interface using a double-obstacle potential and pushes the resulting contribution to the phase-field increment through the CalculatePhaseFieldIncrements family of methods. Unlike the double-well potential, the double-obstacle potential yields a phase-field.md → Computational Efficiency).
Key Classes and Concepts
DoubleObstacle : public OPObject: stateless kernel; owns no storage beyond an initialisation flag. It always takesPhaseField&andInterfaceProperties&(plus optionalDrivingForce&andInterfaceRegularization&) as arguments.
Model
The interface energy density contributed by the double-obstacle potential is
with InterfaceProperties. The corresponding curvature contribution to phase-field.md and is what CalculatePhaseFieldIncrements computes.
Usage
Input
DoubleObstacle has no dedicated .opi block. Its behaviour is controlled entirely through its constructor arguments and the objects it receives at method call time (InterfaceProperties, DrivingForce, optionally InterfaceRegularization).
Output
WriteEnergyVTK(tStep, locSettings, Phase, IP)— writes the spatial interface-energy field in VTS format.WriteEnergyVTK(tStep, locSettings, Phase, IP, EP)— same, with the elastic volume change accounted for.
Statistics helpers (Energy, AverageEnergyDensity, PointEnergy) return scalar diagnostics suitable for console reports.
Example
From the grain-growth walkthrough on phase-field.md:
DoubleObstacle DO(OPSettings, InputFile);
for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
IP.Set(Phi, BC);
DO.CalculatePhaseFieldIncrements(Phi, IP);
Phi.NormalizeIncrements(BC, RTC.dt);
Phi.MergeIncrements(BC, RTC.dt);
}Dependencies
- PhaseField — fields and increments.
- InterfaceProperties — interface energy
and mobility . - DrivingForce — optional shared accumulator of chemical/mechanical contributions.
- InterfaceRegularization — optional stabiliser for strongly driven interfaces.
API reference
Constructors
cppDoubleObstacle();Default constructor. Constructs bare object.
cppDoubleObstacle(Settings& locSettings, std::string ObjectNameSuffix = "");Constructor. Constructs and initializes the DoubleObstacle object. Since DoubleObstacle has no internal state parameters and no storages of its own, the method mostly reports successful initialization.
cppvoid Initialize(Settings& locSettings, std::string ObjectNameSuffix = "");Initializes the DoubleObstacle object. Since DoubleObstacle has no internal state parameters and no storages of its own, the method mostly reports successful initialization.
Methods related to phase-field equation evaluation
cppvoid CalculateCurvatureDrivingForce(PhaseField& Phase, InterfaceProperties& IP, DrivingForce& dG);Calculates generalized curvature contribution to the driving force. The method is not used in the standard implementation of the phase-field equation but can be useful if the interface contribution curvature is needed as a separate quantity.
cppvoid CalculatePhaseFieldIncrementsSharp(PhaseField& Phase, InterfaceProperties& IP);Calculates interface curvature related contribution to the phase-field evolution using sharp interface formalism of A.Final et.al (DOI: https://doi.org/10.1103/PhysRevLett.121.025501) adapted for the double obstacle potential.
cppvoid CalculatePhaseFieldIncrements(PhaseField& Phase, InterfaceProperties& IP);Calculates interface curvature related contribution to the phase-field evolution.
cppvoid CalculatePhaseFieldIncrements(PhaseField& Phase, InterfaceProperties& IP, DrivingForce& dG);Calculates interface curvature related contribution to the phase-field evolution. Includes full interface energy anisotropy evaluation.
cppvoid CalculatePhaseFieldIncrements(PhaseField& Phase, InterfaceProperties& IP, InterfaceRegularization& Kappa);Calculates interface curvature related contribution to the phase-field evolution. Considers interface regularization to accommodate large driving forces.
cppvoid CalculatePhaseFieldIncrements(PhaseField& Phase, InterfaceProperties& IP, DrivingForce& dG, InterfaceRegularization& Kappa);Calculates interface curvature related contribution to the phase-field evolution. Considers full interface energy anisotropy evaluation and interface regularization to accommodate large driving forces.
cppvoid StabilizeThinChannels(PhaseField& Phase, InterfaceProperties& IP, double penalty);Experimental method, which stabilizes thin channels between two interfaces with the same phase-field index on both sides of the channel. It is meant to prevent thin channels collapsing due to diffuse interfaces overlap.
Run time statistics output methods
cppdouble Energy(const PhaseField& Phase, const InterfaceProperties& IP) const;Returns total interface energy in the simulation domain.
cppdouble Energy(const PhaseField& Phase, const InterfaceProperties& IP, const ElasticProperties& EP) const;Returns total interface energy in the simulation domain accounting for the elastic volume change.
cppdouble AverageEnergyDensity(const PhaseField& Phase, const InterfaceProperties& IP) const;Returns average interface energy density in the simulation domain.
cppdouble PointEnergy(const PhaseField& Phase, const InterfaceProperties& IP, const int i, const int j, const int k) const;Returns interface energy in a given grid point (i,j,k).
cppdouble PointEnergy( const PhaseField& Phase, const InterfaceProperties& IP, const ElasticProperties& EP, const int i, const int j, const int k) const;Returns interface energy in a given grid point (i,j,k) accounting for the elastic volume change.
Visualization data output
cppvoid WriteEnergyVTK(const int tStep, const Settings& locSettings, const PhaseField& Phase, const InterfaceProperties& IP) const;Writes interface energy in VTS format for visualization for a given time step tStep.
cppvoid WriteEnergyVTK(const int tStep, const Settings& locSettings, const PhaseField& Phase, const InterfaceProperties& IP, const ElasticProperties& EP) const;Writes interface energy in VTS format for visualization for a given time step tStep considering the elastic volume change.