Skip to content

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 sin-shaped interface profile of finite width, which is what enables OpenPhase's active parameter tracking optimisation (see phase-field.md → Computational Efficiency).

Key Classes and Concepts ​

  • DoubleObstacle : public OPObject: stateless kernel; owns no storage beyond an initialisation flag. It always takes PhaseField& and InterfaceProperties& (plus optional DrivingForce& and InterfaceRegularization&) as arguments.

Model ​

The interface energy density contributed by the double-obstacle potential is

(1)fGB=∑α≠β4σαβη(−η2π2∇ϕα⋅∇ϕβ+ϕαϕβ),

with η the interface width and σαβ the pairwise interface energy supplied by InterfaceProperties. The corresponding curvature contribution to ϕ˙α is stated in full in 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:

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


API reference ​

Constructors ​

cpp
DoubleObstacle();

Default constructor. Constructs bare object.

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

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

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

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

cpp
void CalculatePhaseFieldIncrements(PhaseField& Phase,
                                   InterfaceProperties& IP);

Calculates interface curvature related contribution to the phase-field evolution.

cpp
  void CalculatePhaseFieldIncrements(PhaseField& Phase,
                                      InterfaceProperties& IP,
                                      DrivingForce& dG);

Calculates interface curvature related contribution to the phase-field evolution. Includes full interface energy anisotropy evaluation.

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

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

cpp
void 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 ​

cpp
double Energy(const PhaseField& Phase,
              const InterfaceProperties& IP) const;

Returns total interface energy in the simulation domain.

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

cpp
double AverageEnergyDensity(const PhaseField& Phase,
                            const InterfaceProperties& IP) const;

Returns average interface energy density in the simulation domain.

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

cpp
double 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 ​

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

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

Released under the GNU GPLv3 License.