3D numerical simulation of liquid metal flow under RMF. Features a comparative study between a custom analytical Lorentz force UDF and ANSYS Fluent's built-in MHD module.
Comparison of Analytical UDF and Full MHD Models
ESA-funded project – University of Miskolc
Author: Burak Yorukcu | Supervisors: Prof. Zsolt Veres, Prof. Haijie Zhang
This repository contains the complete setup, simulation files, and post-processing results for the 3D numerical simulation of a Ga75In25 liquid metal flow subjected to a Rotating Magnetic Field (RMF). Two distinct modeling approaches are compared:
- Analytical UDF (Lorentz Force) – custom C-based user-defined function implementing the azimuthal Lorentz force.
- Full MHD Module – native ANSYS Fluent MHD model solving coupled Maxwell-Navier-Stokes equations.
Key outcomes include validation of spin-up characteristics, quantification of energy dissipation due to 3D Taylor-Görtler vortices, and identification of electrical end-effects near insulating boundaries.
- Domain: 90° sector of a cylinder (radius = 12.5 mm, length = 100 mm)
- Mesh: Structured hexahedral, ~250,000 cells, wall refinement for Hartmann layer
- Periodic Boundary: Rotational periodicity with -90° offset
| Geometry | Mesh | Periodic Interface |
|---|---|---|
![]() |
![]() |
![]() |
| Property | Value |
|---|---|
| Electrical conductivity (σ) | 3.58×10⁶ S/m |
| Magnetic permeability (μ) | 1.2566×10⁻⁶ H/m |
| Magnetic induction (B₀) | 0.09 T (90 mT) |
| RMF frequency (f) | 50 Hz |
- MHD module disabled
- Azimuthal Lorentz force implemented via
DEFINE_SOURCEin C UDF (file:final_udf_B90_3D.c) - Force projected to Cartesian X/Z momentum equations
- Output data:
avgweqvel-rfilelorentz.out,swirlsonuc3d_udf.csv
- Maxwell’s equations coupled with Navier-Stokes
- Magnetic induction / electric potential approach
- Complex phase shifts: B_x = 0.09 T, B_z = 0.09 T with 90° phase shift
- All walls electrically insulating
- Output data:
avgweqvel-rfile_mhd.out,swirl.mhd.csv
| Parameter | UDF Method | MHD Module | Difference |
|---|---|---|---|
| Max Velocity Magnitude (m/s) | 1.74 | 1.77 | < 2% |
| Max Turbulent Kinetic Energy (m²/s²) | 0.0501 | 0.0487 | ~2.8% |
| Max Turbulent Intensity (%) | 18.3 | 18.0 | ~1.6% |
| Max Vorticity Magnitude (s⁻¹) | 3.53×10⁴ | 3.42×10⁴ | ~3.1% |
Note: The reduction from the 2D theoretical value (~1.88 m/s) confirms energy dissipation by 3D secondary flows (Taylor-Görtler vortices).
| UDF – Velocity Magnitude | MHD – Velocity Magnitude | Swirl Comparison |
|---|---|---|
![]() |
![]() |
![]() |
| Pathlines (UDF) | Pathlines (MHD) | Taylor-Görtler (UDF) |
|---|---|---|
![]() |
![]() |
![]() |
| Taylor-Görtler (MHD) | End-Effects (MHD) | Turbine half (UDF) |
|---|---|---|
![]() |
(see MHD pathlines) | ![]() |
The MHD model captures electrical end-effects (Hartmann braking) near insulating caps, leading to more regularized flow compared to the UDF model.
- ANSYS Fluent 2023R1 or later (with MHD add-on module)
- C compiler (for UDF compilation)
UDF Model:
# Compile UDF in Fluent
/define/user-defined/compiled-functions compile
# Load final_udf_B90_3D.c
# Enable source terms in cell zone conditions
MHD Model:
# Enable MHD module
/define/models/mhd? yes
# Set magnetic boundary conditions (insulating walls)
# Apply phase-shifted B-field (0.09 T, 90° shift)
Use provided .csv and .out files to regenerate velocity/turbulence plots.
For pathlines and vector fields, load the corresponding .cas and .dat files (not included due to size; contact author).
Mesh independence study performed (250k cells optimal)
Spin-up curves show stable acceleration to steady-state
Residuals indicate convergence below 1e-5
Integrate solidification models with validated MHD settings
Extend thermal analysis for continuous casting applications
Quantify Hartmann braking effect on global flow efficiency
Burak Yorukcu – Graduate Researcher, Space Engineering University of Miskolc Email: burak.yorukcu@student.uni-miskolc.hu , burakyorukcu@outlook.com
Supervisors: Prof. Zsolt Veres, Prof. Haijie Zhang













