PanPhaseField SDK
PanPhaseField SDK Manual

Overview of SDK

PanPhaseField SDK is a comprehensive environment for developing PanPhaseField plugins that can easily run in both GUI and console mode, and in mutiple OS. With the PanPhaseField SDK, plugins can directly get the needed thermodynamic input from CALPHAD database and use Pandat GUI to visualize their simulation results.

Features of PanPhaseField SDK include:

  • A comprehensive environment for developing PanPhaseField plugins.
  • A direct coupling between phase-filed models and CALPHAD method in a fast and efficient way. No curve fitting of Gibbs energy is needed and no assumption of pseudo binary or ternary is necessary. Phase-field simulation of multi-component commercial alloys becomes a reality!
  • Two plugin templates (solidification and spinodal decomposition) are provided for a quick start of implementing cutomized phase-field models.
  • Work in both console mode and GUI mode.
  • Convenient inputs and powerful 1D/2D/3D visualization based on the VTK engine are provided. The simulation results in VTK files are also compatible with ParaView. Model parameters are stored in the phase-field database file (.pfdb), which allows users to manage these parameters easily.
  • Plugins can run in different computing environments: Windows/Linux PC, Clusters and Cloud machines.

How to use this SDK in Windows OS

Step 1. Open the console-mode folder

In console mode folder, user can:

  • Run phase-field simulations in console mode.
  • Build user-defined console mode executables (See source/ folder)
  • Build user-defined plugins (See User_Plugin_Examples/ folder)
  • Access resources of PanPhaseField SDK:
    • For console mode executable, see include/ and lib/ folders.
    • For each plugin example, see User_Plugin_Examples/APP_NAME/include/, User_Plugin_Examples/APP_NAME/lib/, User_Plugin_Examples/APP_NAME/PanResult/ and User_Plugin_Examples/APP_NAME/PFM_SDK/ folders.

Step 2. Run a phase-field simulation in console mode

We can run a phase-field simulation in console mode without opening GUI. Results from console mode can be visualized after importing to Pandat's GUI.

See the instruction on importing console-mode results to Pandat's GUI.

To perform a simulation in console mode, we can run a Windows batch file (.bat) or a Linux/Unix shell script (.sh).
Example .bat files and .sh files are in PanPhaseField_ConsoleMode/bin/windows/Examples/ and PanPhaseField_ConsoleMode/bin/linux/Examples/
Pandat batch file (.pbfx) is passed as an argument to the console mode, for example in Windows batch file (.bat):

In this case, Precipitation_AlNi_1D.pbfx must contain the following line

It is important to specify the app name (app="precipitation") for the PanPhaseField_ConsoleMode.exe to perform the simulation by loading the pre-installed application PFM_Precipitation.dll. There is another pre-installed application PFM_Spinodal.dll whose app name is "spinodal":

Besides the pre-installed applications, users can also simulate with user-defined plugins. User-defined plugin (application) must be stored in bin/windows/PanPhaseField_Plugins/ in Windows OS:

or bin/linux/PanPhaseField_Plugins/ in Linux OS

Step 3. Build a new user-defined plugin

Follow instructions on Spinodal decomposition plugin to edit a new plugin.

3.1. Inside User_Plugin_Examples/ folder, copy any of the templates and rename it.

3.2. Inside User_Plugin_Examples/USER_PFM_YOURAPP/, rename the project to a user-defined name.

3.3. Open "PanPhaseField_ConsoleMode/PanPhaseField_ConsoleMode.sln" in Visual Studio 2015 or later.
Add the plugin to the console-mode environment.
Right-click "User_Model_Plugin" in the "Solution Explorer". Select "Add->Existing Project..." and choose the created USER_PFM_YOURAPP project

3.4. Rename the loaded project to a new one that is different from what is copied.

3.5. Follow instructions on Spinodal decomposition plugin to update this plugin.

3.6. The built plugin should be USER_PFM_YOURAPP/bin/USER_PFM_YOURAPP.dll

Visual Studio Configuration must be Release and x64

3.7 Remember to copy this USER_PFM_YOURAPP.dll to PanPhaseField_ConsoleMode/bin/windows/PanPhaseField_Plugins/ so that console mode executable can use it.