Skip to main content
Ctrl K

Fluidity

Fluidity is an open source, general purpose, multiphase computational fluid dynamics code capable of numerically solving the Navier-Stokes equation and accompanying field equations on arbitrary unstructured finite element meshes in one, two and three dimensions.

160
mentions
2
contributors
Get started
2464 commitsLast commit ≈ 2 weeks ago389 stars118 forks

Description

What it does

Fluidity combines several numerical approaches in one modelling framework:

  • Finite elements and control volumes: choose from continuous Galerkin, discontinuous Galerkin, control-volume, and mixed formulations for the fields and equations in a simulation.
  • Moving meshes: mesh coordinates can move with a time-dependent problem, supporting arbitrary Lagrangian–Eulerian-style workflows and free-surface applications.
  • Adaptive remeshing: error indicators and field derivatives can drive dynamic mesh optimisation. Resolution is concentrated around shocks, fronts, interfaces, boundary layers, and other features that need to be resolved accurately, while less active regions use fewer degrees of freedom.
  • Multiphysics fields: model advection, diffusion, momentum, pressure, temperature, salinity, tracers, species, reactions, buoyancy, and other coupled processes. The manual also describes embedded biology and sediment models.
  • Three-dimensional and ocean-scale modelling: support includes rotating flows, free surfaces, stratification, tides, coastal and ocean configurations, and anisotropic resolution.

The model equations support scalar advection–diffusion with source, reaction, absorption, and anisotropic diffusion terms, together with fluid momentum and pressure equations and a range of boundary conditions. Parameterisations are available for unresolved or sub-grid-scale processes.

Configuration and workflow

Simulations are configured with Fluidity options files, commonly called FLML files. These are XML documents validated against the Fluidity options schema and exposed through an options tree. The Diamond graphical interface can be used to view and edit that tree, while the options format also supports scripted and reproducible configuration.

A typical workflow is:

  1. Define the domain, mesh, fields, material phases, equations, initial conditions, boundary conditions, time integration, adaptivity, and output in an FLML file.
  2. Preprocess meshes and, when needed, decompose them for parallel execution.
  3. Run Fluidity in serial or through MPI.
  4. Inspect VTK output and diagnostic fields in ParaView or Mayavi.
  5. Use the supplied examples to compare discretisations, test conservation and boundedness, and build more involved models.

The source tree includes examples ranging from one-dimensional tracer advection and lock exchange to lid-driven cavities, flow past a sphere, backward-facing steps, water-column collapse, tephra settling, particle Rayleigh–Taylor instability, and Mediterranean tides. Example directories generally provide make preprocess, make run, and make postprocess targets.

Parallel computing

Fluidity is designed as a fully parallel application using the Message Passing Interface (MPI), with support for simulations distributed across large numbers of processes. The flredecomp utility partitions an initial mesh and produces the parallel input required to run a decomposed simulation. Parallel output is written as VTK .vtu partition files together with .pvtu metadata for the complete mesh.

Python and diagnostics

Python and NumPy can be used to prescribe fields and initial conditions, define diagnostics, and customise the current model state without changing the main Fortran source. The Python state interface exposes scalar, vector, and tensor fields so that users can implement coupled or application-specific behaviour.

Fluidity writes simulation snapshots in VTK’s unstructured-grid format. Built-in diagnostics include quantities such as CFL numbers, gradients, divergences, free-surface information, density- and energy-related fields, and indicators useful for assessing numerical behaviour. These outputs can be explored interactively or post-processed in standard scientific-visualisation tools.

Who it is for

Fluidity is intended for researchers and engineers who need a configurable, extensible solver for coupled fluid and transport phenomena, especially where fixed meshes are inefficient or where oceanographic, environmental, multiphase, or free-surface physics matter. Its combination of unstructured meshes, adaptive resolution, multiple discretisation families, embedded models, scripting, and MPI makes it suitable for both focused numerical experiments and large scientific simulations.

The full manual covers installation, model equations, numerical discretisation, mesh formats, adaptive remeshing, parameterisations, configuration, parallel execution, visualisation, diagnostics, Python integration, and worked examples.

Keywords
Programming languages
  • Fortran 43%
  • C 20%
  • C++ 11%
  • Python 10%
  • TeX 6%
  • Shell 4%
  • Makefile 3%
  • GLSL 1%
  • Gnuplot 1%
  • Other 1%
License
</>Source code

Reference papers

Mentions

Contributors

SK
Stephan Kramer
BF

Related software

IC-FERST

IC

IC-FERST is a next generation reservoir simulator based on the Double-Control-Volume Finite Element method, dynamic unstructured mesh optimisation and surface-based modelling for the geological representation.

Updated 1 week ago
128 4