PHOENIX¶
PHOENIX: Process-resolved Hybrid Omniphysics Engine for Nonlinear In-situ X-evolution
PHOENIX is a multiphysics simulator for laser-based additive manufacturing that
co-evolves four solvers — thermal-fluid, species transport, residual
stress (FEM), and cellular-automata grain microstructure — in a single
time-stepped run, taking a raw laser toolpath as input and producing
ParaView-ready field outputs covering temperature, melt-pool flow,
dissimilar-metal mixing, residual stress and yield, and as-solidified grain
structure. The thermal-fluid core uses a finite-volume SIMPLE algorithm with a
pool-following adaptive mesh; the species solver lives on its own uniform grid
and feeds composition back into thermal material properties; mechanical and CA
run as cooperating processes coupled through binary frames; the whole stack is
OpenMP-parallel and produces a self-contained per-case result/ tree.
Key Features¶
- Thermal-fluid core: Conjugate heat transfer + incompressible Navier–Stokes on a staggered structured grid, SIMPLE pressure correction, enthalpy-based phase change with Darcy mushy-zone resistance, thermal + solutal Marangoni and Boussinesq buoyancy on the free surface.
- Species transport (dissimilar metals): Convection-diffusion of concentration
on a species-private uniform grid, two-way coupled to thermal through
composition-dependent properties (
mix(prop_primary, prop_secondary, C)everywhere material constants are read). - Residual stress (mechanical FEM): Element-by-element J2 elastoplasticity
with temperature-dependent yield and von Mises output, coarsenable from the
thermal grid by
mech_mesh_ratio. Runs serial in-loop or as a parallel sister process talking to thermal through a binary input queue (~1.6× wall speedup at default settings). - Cellular-automata grain structure: Substrate Voronoi initialisation, octahedral envelope growth, surface + bulk Gaussian nucleation. Reads the thermal field via per-step mushy-zone bbox frames, runs as its own OpenMP process, and writes a zlib-compressed VTI time series of grain IDs + Bunge-Euler orientations.
- Adaptive mesh: Movable structured fine zone in X–Y that follows the laser/melt pool and grows with the pool dimensions; geometric coarse cells fill the rest of the domain. The species grid stays fixed; mechanical FEM is rebuilt per remesh.
- Defect prediction: Post-run lack-of-fusion / keyhole-porosity analysis from the max-temperature field, written as a 3D VTK + summary report.
- Melt-pool tracking: Per-timestep length / depth / width / volume / Tpeak history with auto-generated PNG plots.
- OpenMP parallelism + multi-process scheduling: Hot loops parallel
per-solver, the three heavy solvers run as independent processes spawned
from one
run.shinvocation (thermal foreground + mechanical and CA in background). - Self-contained outputs:
result/<case>/tree split intothermal_fluid_results/,species_results/,mechanical_results/,coupling/,CA_results/{initial_grain,scan_grain}/. Thermal and species use XML.vts+.pvd(zlib-compressed base64) so ParaView opens the time series natively without plugins.
Physics¶
The solver models:
- Heat transfer: Conduction with temperature-dependent properties, volumetric laser heat source (Gaussian distribution)
- Fluid flow: Incompressible Navier–Stokes with SIMPLE algorithm on staggered grid
- Phase change: Enthalpy-based method with Darcy-type resistance in mushy zone
- Surface effects: Thermal Marangoni (∂γ/∂T) and solutal Marangoni (∂γ/∂C) stress on free surface
- Buoyancy: Boussinesq approximation for natural convection
- Species transport: Convection-diffusion of concentration field with molecular diffusivity, two-way coupled to thermal via composition-mixed material properties
- Residual stress: Quasi-static mechanical equilibrium with isotropic elasticity and J2 plasticity (von Mises yield with radial return mapping)
- Powder layer: Distinct thermal properties for unconsolidated powder
- Grain microstructure (cellular automata): Substrate Voronoi tessellation as the initial state; per-cell octahedral envelope growth driven by undercooling-dependent kinetics; surface and bulk Gaussian nucleation with crystallographic capture from neighbour cells. The CA solver consumes per-step mushy-zone bbox frames from the thermal-fluid solver to track exactly the regions that resolidify, and emits zlib-compressed VTI files of grain IDs and Bunge-Euler orientations.
- Defect prediction: Post-simulation detection of lack-of-fusion (\(T_{max} < T_s\), incomplete melting) and keyhole porosity (\(T_{max} > T_b\), excessive vaporization) from peak temperature history within the build layer
How the four solvers fit together¶
┌─────────────────────────────────────────────────────────────────┐
│ thermal-fluid (foreground) │
│ T, u, v, w, ρ, μ, fracl on AMR grid; SIMPLE / enthalpy │
│ │ │ │
│ │ ─── concentration ───► │ ─── temp/sf bbox ───► │
│ │ │ │
│ ▼ ▼ │
│ species (own uniform grid) CA (mushy-zone bbox) │
│ transport eq → C(x,y,z,t) grain growth + nucleation │
│ │ │
│ │ ◄─── C reprojected onto thermal grid │
│ ▼ │
│ thermal mix(prop1, prop2, C) ←── two-way coupling │
│ │
│ │ ─── temp + solidfield (binary frames) ───► │
│ ▼ │
│ mechanical FEM (parallel sister process) │
│ T → thermal strain → displacement → von Mises + yield │
└─────────────────────────────────────────────────────────────────┘
Thermal-fluid is the conductor: it integrates the time loop, drives the AMR
remesher, and emits two binary streams (mushy bbox to CA, full temp/sf to
mechanical). Species reads thermal interpolated onto its own grid and writes
back composition for the next thermal step's mix() calls. Mechanical and CA
each run as their own OpenMP-parallel process, decoupled from thermal's solve
cadence except through their respective binary queues.
Quick Start¶
cd code_base
bash compile.sh # Build (Fortran + CA solver)
bash run.sh mycase 4 0 0 & # Run thermal only (4 threads)
bash run.sh mycase 10 10 0 & # Run thermal + mechanical (10+10)
bash run.sh mycase 10 0 8 & # Run thermal + CA (10 + 8 OpenMP)
Results are written under code_base/result/mycase/{thermal_fluid_results, mechanical_results, CA_results}/.
Project Structure¶
PHOENIX/
├── code_base/ # Active simulation code
│ ├── solver_thermal_fluid/ # Thermal + fluid-flow modules (+ main.f90 entry point)
│ ├── solver_mechanical/ # EBE FEM residual-stress solver (+ inputfile)
│ ├── solver_species/ # Dissimilar-metal species transport (+ inputfile)
│ ├── solver_CA/ # Cellular-automata grain solver (Fortran/OpenMP)
│ ├── compile_files/ # All build artifacts land here
│ ├── compile.sh # Build script
│ ├── run.sh # Run script
│ ├── clean.sh # Clean build artifacts + results
│ ├── install_deps.sh # One-shot dependency installer
│ ├── inputfile/ # Global simulation parameters
│ └── ToolFiles/ # Toolpath files (.crs)
├── legacy/ # Reference code (read-only)
├── projects/ # Task tracking
└── docs/ # This documentation