To run the AlNiPt diffusion simulation example, you must manually gather specific OpenCalphad library files and object files into your local directory before compiling. This example uses OpenMP for parallelization.
Prerequisites
Ensure you have the following files copied into your working directory:
liboceq.a (must be compiled with -fopenmp)liboceqplus.mod (must be compiled with -fopenmp)getkey.o (Required for Linux/Mac users)liboctq.F90 (The version provided in this example directory)
Compilation Steps
- Compile the provided
liboctq.F90 to produce liboctq.o. - Compile and link the main simulation file
sim-alnipt.F90 using gfortran.
Note: On Linux/Mac, you must include getkey.o in the linking command.
Execution
Run the resulting executable using the setup.dat input file. This file defines parameters such as databasefile, elements, and gridpoints.
Output
- The simulation results are written to
ocsim.plt. - Results can be visualized using
GNUPLOT. - The model simulates 1D diffusion where elements move between gridpoints based on a constant mobility value.
# 1. Compile the library
gfortran -c liboctq.F90
# 2. Compile and link the simulation (Linux/Mac example)
gfortran -o sim-alnipt -fopenmp sim-alnipt.F90 liboctq.o getkey.o liboceq.a
# 3. Run the simulation
./sim-alnipt