Introduction to Magnetohydrodynamics (MHD)

Magnetohydrodynamics (MHD) is the study of electrically conducting fluids—such as liquid metals, plasmas, and saltwater—subjected to magnetic fields. The fundamental principle is that a moving conductive fluid induces electric currents, which in turn interact with the applied magnetic field to produce Lorentz forces that modify the flow. Conversely, the fluid motion can alter the magnetic field distribution through advection. This two-way coupling makes MHD a rich, multiphysics problem that requires robust simulation tools like COMSOL Multiphysics.

MHD phenomena are central to many engineering and scientific applications, including electromagnetic pumps used in nuclear reactor cooling, magnetic confinement in fusion devices, flow control in metallurgy, and even biomedical techniques like magnetic drug targeting. Accurate simulation of these interactions helps engineers predict performance, optimize designs, and reduce costly prototyping. COMSOL Multiphysics, with its dedicated Magnetohydrodynamics physics interface, provides a comprehensive environment for modeling such problems using computational fluid dynamics (CFD).

This article provides a detailed walkthrough of how to simulate the effect of magnetic fields on conductive fluids using COMSOL CFD. We cover the essential physics, step-by-step setup, key dimensionless parameters, result analysis, and real-world applications. The goal is to give readers a solid foundation for building their own MHD simulations.

Setting Up a COMSOL CFD Simulation for MHD

Before launching COMSOL, it’s critical to define the physical problem clearly. Start by identifying the geometry, the fluid properties, the type and strength of the magnetic field, and the desired boundary conditions. The following subsections outline a systematic approach to constructing an MHD model in COMSOL Multiphysics.

Geometry and Domain Definition

Begin by creating or importing the geometry where the conductive fluid flows. This could be a simple rectangular channel, a pipe, a complex duct, or a three-dimensional vessel. In the Model Builder, use the Geometry node to define the domain. For MHD problems, the entire fluid domain is also the domain where the magnetic field equations (for the induced field) must be solved unless you model the external field separately.

If the applied magnetic field is generated by external coils or permanent magnets, you may need to include an air region around the fluid domain to solve for the magnetic field in the full space. COMSOL’s Magnetic Fields physics interface can be coupled to the fluid flow via the MHD multiphysics coupling.

Selecting the Physics Interfaces

COMSOL offers several physics interfaces relevant to MHD:

  • Laminar Flow (spf): For incompressible or weakly compressible Newtonian fluids. Solves the Navier-Stokes equations with added Lorentz force term.
  • Turbulent Flow (k-epsilon, k-omega, SST): For high Reynolds number flows where turbulence modeling is essential.
  • Magnetic Fields (mf): Solves Maxwell’s equations using the magnetic vector potential. Can be used to compute the applied and induced magnetic fields.
  • Magnetohydrodynamics (mhd) Multiphysics Coupling: Automatically adds the Lorentz force to the fluid flow and includes the induction term in the magnetic field equations. This is the recommended approach for standard MHD simulations.
  • Electric Currents (ec): Used if you need to model the electric field and current density explicitly, e.g., when the fluid is driven by an external electric potential.

For most MHD simulations, simply add the Laminar Flow (or Turbulent Flow) interface and the Magnetic Fields interface, then combine them using the Multiphysics > Magnetohydrodynamics node. COMSOL automatically creates the necessary couplings.

Defining Material Properties

Accurate material properties are essential. Go to the Materials node and add a material for the fluid domain. Key properties include:

  • Density (ρ): affects inertial forces.
  • Dynamic viscosity (μ): governs viscous dissipation.
  • Electrical conductivity (σ): determines how strongly the fluid interacts with the magnetic field. Typical values range from 105 S/m for seawater to 107 S/m for liquid metals like mercury.
  • Relative permeability (μr): for most conductive fluids, μr ≈ 1 (non-magnetic), but for ferrofluids it can be higher.

If thermal effects are included, also specify thermal conductivity, specific heat, and thermal expansion coefficient.

Setting Boundary Conditions

Proper boundary conditions are crucial for a stable and physically meaningful simulation. The following are common conditions in MHD simulations:

  • Flow boundary conditions:
    • Inlet: Specify velocity profile (e.g., parabolic for laminar, uniform for turbulent) or pressure. Use a fully developed flow condition if the inlet is far from the region of interest.
    • Outlet: Set pressure outlet (typically zero gauge pressure) and use a condition that avoids backflow recommendations.
    • Walls: No-slip condition (u=0) is standard. For MHD, walls are usually electrically insulating (zero current normal component).
  • Magnetic field boundary conditions:
    • For external field: Add a Magnetic Flux Conservation condition on the boundaries that defines the applied magnetic field vector (H0 or B0). You can import data from a separate coil model or use a uniform field.
    • For induced field: Default is that the magnetic field satisfies “magnetic insulation” (n × A = 0) on boundaries where the field is expected to be confined.
    • If modeling an open domain, use “Infinite Elements” or appropriate absorbing conditions to avoid artificial reflection.
  • Electric boundary conditions: Often not needed if using the standard MHD coupling with only magnetic fields. If you include an external electric field, define electrodes with fixed electric potential.

Initial Conditions

For steady-state simulations, initial guesses for velocity, pressure, and magnetic potential can help convergence. Start with zero velocity and a uniform magnetic field. For time-dependent simulations, initial conditions should represent the physical state at t=0, e.g., fluid at rest and linear magnetic field distribution.

Meshing Strategy

A high-quality mesh is essential for accurate MHD simulations because the Lorentz force adds a body force that can be highly localized, especially near walls where large velocity gradients occur (Hartmann layers). Recommendations:

  • Use boundary layer mesh (prism layers) near walls to resolve the thin Hartmann boundary layers. The Hartmann layer thickness is approximately δH = L / Ha, where Ha is the Hartmann number (defined later).
  • For turbulent flows, ensure y+ values are appropriate for the turbulence model (e.g., y+ ~1 for low-Reynolds number models).
  • Use a free triangular or quadrilateral mesh in the cross-section and sweep along the flow direction if the geometry is extruded.
  • Perform a mesh refinement study to ensure results are mesh-independent.

Solver Configuration

COMSOL typically uses a fully coupled solver for MHD problems because of the strong bidirectional coupling. In the Study node, choose “Stationary” for steady-state or “Time Dependent” for transient problems. Under Solver Configurations, enable the fully coupled approach and, if necessary, adjust the damping factor for nonlinear iterations. For highly coupled problems (high Hartmann numbers), a segregated solver may be more efficient, using one group for flow variables and another for magnetic variables.

Monitor residuals during the solve. Convergence criteria of 1e-5 or 1e-6 for relative tolerance are typical. If the solver fails to converge, try reducing the initial step (for time-dependent) or increasing the damping factor.

Key Dimensionless Parameters in MHD Simulations

Understanding dimensionless numbers helps predict flow regimes and interpret results. The most important in MHD are:

Magnetic Reynolds Number (Rem)

Rem = μ0 σ U L, where μ0 is the permeability of free space, σ is electrical conductivity, U is a characteristic velocity, and L a characteristic length. Rem indicates whether magnetic advection is significant. For Rem ≪ 1 (most liquid metal flows), the induced magnetic field is negligible compared to the applied field, simplifying the equations. For Rem ∼ 1 or larger (common in astrophysical and fusion plasmas), the magnetic field is strongly distorted by the flow, requiring a fully coupled solution. In COMSOL, ensure the physics interface is set to include induced fields if Rem is not negligible.

Hartmann Number (Ha)

Ha = B L √(σ / μ), where B is the applied magnetic flux density, L the characteristic length, σ conductivity, μ dynamic viscosity. Ha compares electromagnetic forces to viscous forces. High Ha values (≫1) lead to strong suppression of turbulence and the formation of thin Hartmann layers along walls perpendicular to the magnetic field. The flow becomes nearly one-dimensional in the core region with a characteristic “M-shaped” velocity profile. In COMSOL, simulating high Ha requires very fine mesh near walls to capture the Hartmann layer; otherwise, the solution may be inaccurate.

Interaction Parameter (N)

Also known as the Stuart number: N = Ha² / Re = σ B² L / (ρ U). N measures the ratio of electromagnetic to inertial forces. For N > 1, magnetic forces dominate, and the flow tends to align with the magnetic field lines. MHD simulations with high N often exhibit strong flow laminarization even if Re would indicate turbulence.

Other Relevant Numbers

  • Reynolds Number (Re): ρ U L / μ, critical for turbulence transition.
  • Prandtl Number (Pr) and Grashof Number (Gr): if thermal effects are included for buoyancy-driven MHD flows.

Analyzing Simulation Results

Once the simulation converges, post-processing in COMSOL reveals how the magnetic field alters the fluid behavior. Use the Results node to create plots and extract data. Key aspects to examine:

Velocity and Flow Patterns

Plot the velocity magnitude and streamlines. In MHD flows, you may observe:

  • Laminarization: Turbulent fluctuations are damped by the Lorentz force, making the flow more ordered. Compare with a case without a magnetic field.
  • M-shaped profiles: In a square duct with a transverse magnetic field, the core velocity becomes flat with peaks near the side walls parallel to the field.
  • Suppression of secondary flows: In bends or expansions, magnetic fields can reduce recirculation zones.

Create a Velocity Slice or Surface plot and also plot profiles along lines to quantify changes. Use the Line Graph feature to extract velocity profiles across the channel at different axial positions.

Magnetic Flux Density and Induced Fields

Plot the magnetic flux density norm (B) and the magnetic field lines. High Rem flows will show field line distortion (the “frozen-in” effect). For low Rem, the induced field is small; you can visualize the deviation from the applied field.

Also compute the induced current density (J = σ (u × B + E, if electric field exists)) using Derived Values. The Lorentz force is J × B.

Pressure Drop

Under a strong magnetic field, the additional Lorentz force acts like an anisotropic resistance, increasing the pressure drop for a given flow rate. Plot the pressure along the channel axis and compare with analytic solutions (e.g., in a Hartmann flow, the pressure gradient is proportional to Ha²). Use the Integration operator to compute total pressure drop across the domain.

Temperature Distribution (If Thermal Effects Included)

If heat transfer is coupled, the Joule heating term (J²/σ) appears as a source term in the energy equation. Contour plots of temperature show hot spots caused by concentrated current paths. Ensure the Prandtl number and Joule heating are correctly included.

Advanced Considerations and Multiphysics Coupling

COMSOL allows extending the basic MHD model with additional physics. Some examples:

Turbulence Modeling in MHD

High Re flows in MHD often involve a complex interaction: the magnetic field suppresses some turbulent scales while others may be modified. COMSOL includes turbulence models adapted for MHD (k-epsilon, SST, etc.) where additional damping terms account for the Lorentz force. For moderate Ha, these models perform well; for very high Ha, the flow can become fully laminar, and using a laminar flow model may suffice. Always validate against experimental data or DNS.

Two-Phase MHD Flows

In metallurgy or nuclear engineering, you may have bubbles or droplets in a conductive fluid. Use the Level Set or Phase Field method coupled with MHD. The magnetic field can affect bubble shape and rise velocity due to the Lorentz force on the continuous phase.

Fluid-Structure Interaction (FSI) with MHD

For elastic walls or flexible structures in contact with MHD flows (e.g., in magnetic liquid metal pumps), combine the Laminar Flow, Magnetic Fields, and Solid Mechanics interfaces. The Lorentz force on the fluid is transmitted to the solid through the FSI coupling.

Open Boundary and External Magnetic Fields

When the magnetic field is generated by coils outside the fluid domain, COMSOL can import coil currents from the AC/DC module. Use the Magnetic Fields, No Currents interface in the air region and couple to the fluid MHD domain via continuity conditions. Alternatively, you can precompute the applied field and import it as a function.

Applications of Magnetic Fluid Simulations

The ability to simulate MHD with COMSOL has wide-ranging practical uses. Here are several industries and research areas that benefit:

Electromagnetic Pumps for Liquid Metal Cooling

In fusion reactors and fast-neutron reactors, liquid metals (e.g., lithium-lead, sodium) are used as coolants. Electromagnetic pumps use a magnetic field and an electric current to drive the metal without moving parts. COMSOL simulations optimize pump geometry, electrode placement, and magnetic field strength to achieve high efficiency while minimizing pressure drop and avoiding cavitation. Efficiency gains of 10–20% have been demonstrated through simulation-guided designs.

Magnetic Drug Targeting in Biomedicine

In targeted therapies, magnetic nanoparticles are injected into the bloodstream and guided to a tumor site using external magnetic fields. CFD-MHD simulations help predict the trajectories of these particles in realistic vasculature geometry, accounting for blood rheology and particle magnetic properties. Researchers at the University of California have used COMSOL to optimize magnetic field gradients for deeper tissue penetration.

Magnetic Damping Systems in Machinery

Damping vibrations using MHD is common in high-precision equipment: a conductive fluid (e.g., mercury) in a channel under a magnetic field provides a damping force proportional to velocity. COMSOL helps design the channel geometry and field strength to achieve desired damping coefficients without mechanical contacts.

Fusion Reactor Plasma Control

In tokamaks and stellarators, MHD stability is critical. While COMSOL is not designed for full plasma kinetics, it is used for modeling liquid metal blankets (divertors, first walls) where the coolant flow is affected by strong magnetic fields. Simulations guide the design of flow paths to handle heat fluxes exceeding 10 MW/m² while maintaining MHD stability.

Metallurgy: Continuous Casting and Stirring

In steel and aluminum production, electromagnetic stirring improves mixing and controls solidification. COMSOL simulations model the flow of molten metal under rotating magnetic fields, predicting flow patterns that influence grain structure and inclusion distribution.

Conclusion

Simulating the effect of magnetic fields on conductive fluids using COMSOL CFD allows engineers and researchers to predict complex multiphysics behavior without expensive experiments. By carefully defining geometry, selecting the appropriate physics interfaces, setting accurate material properties and boundary conditions, and employing a well-resolved mesh, one can obtain reliable results that reveal how magnetic forces alter velocity profiles, pressure drops, and thermal distributions.

The key dimensionless numbers—Magnetic Reynolds number, Hartmann number, and Interaction parameter—provide a framework for understanding the regime of the simulation and interpreting the output. Post-processing tools in COMSOL enable detailed analysis of flow patterns, induced currents, and magnetic field distortion.

With applications ranging from electromagnetic pumps and fusion cooling to biomedical drug targeting and metallurgy, mastering MHD simulation with COMSOL offers substantial value. The integrated multiphysics environment makes it straightforward to extend the model with turbulence, heat transfer, or even fluid-structure interaction. As computational resources continue to improve and solvers become more robust, COMSOL will remain an indispensable tool for anyone working at the intersection of fluid dynamics and electromagnetism.

For further reading, consult the COMSOL MHD pipe example, the MHD Module User Guide, and the seminal work by Davidson on MHD.