Neko: a Portable Framework for High-Order Spectral Element Flow Simulations

Technical Description

Neko is a portable framework for high-order spectral element based simulations, focusing on the incompressible regime. The framework is written in modern Fortran and adopts an object-oriented approach, allowing for multi-tier abstractions of the solver stack and facilitating various hardware backends, ranging from general-purpose processors, accelerators, and vector processors, to limited support of FPGA. Neko focuses on single core/single accelerator efficiency via fast tensor-product operator evaluations. The primary consideration in Neko is how to efficiently utilize different computer hard- ware without re-implementing the entire framework for each supported backend. We solve this problem by hiding the implementation of backend-dependent low-level kernels behind a common interface realized as an abstract Fortran type. This way, types implementing higher-level concepts, for example, the fluid solver, can remain completely backend-agnostic.

Neko Explainer

If the above technical description was not what you’re looking for, check out the explainer answers to some common questions below.

What can Neko simulate?

Neko has its roots in the Nek codes so it will come as no surprise that Neko can run similar types of incompressible flow simulations. It can also simulate convection and flettner rotors for propelling ships. Overall, though, Neko is particularly suited to fundamental turbulence research, helping us understand what happens to fluids when they come in contact with a wall.

What are the trade-offs of using Neko?

One of the biggest advantages to using Neko is that the user doesn’t need to do anything to make Neko run on different hardware architectures. The code is written in a way that users simply set up the simulation and under the hood the code assesses what hardware is available and chooses the correct kernel for running on that hardware. This is what we mean when calling Neko portable and back-end agnostic. The user and the CFD solver do not need to care what hardware they’re running on.

Furthermore, Neko can to extremely fast direct numerical simulation (DNS) of fluid flows. DNS means that for every geometric point in the simulated flow, the code directly calculates solutions to the Navier-Stokes equations instead of using a turbulence model that approximates what should be happening in a given geometric point of the flow. Part of why Neko can run these DNS calculations so quickly is that it uses hexahedral elements (building blocks) to create a geometric grid, also called the mesh, for simulating the fluid flow.

A trade off of the hexahedral elements, though, is that they aren’t good at describing the space around complex objects like an entire car or airplane. Imagine having a box full of hexahedral blocks and a model airplane and trying to pack the model in the blocks in a way that you have no empty space between the model and the blocks. If any empty spaces are left between the model and the blocks, that’s missing data in the simulation. For now, it means that the simulation is best at simpler objects like only part of the airplane or car.

What could Neko do better?

Neko needs to support complex geometries. It is currently a great tool for understanding the nature of turbulence but could be useful to industrial problems if it could simulate turbulence around complex geometries like an entire car or plane.

What will CEEC aim to improve about Neko?

CEEC work will focus on increasing the complexity of geometries that Neko can simulate as well as increasing its scalability. This work is driven by the merchant ship hull lighthouse case. A ship hull is a less geometrically complex object than a car but still more complex than Neko’s current capacity. It’s also simulation on an entirely different scale. As an example, a ten-centimeter patch of a merchant ship hull already needs one hundred million elements (building blocks) to simulate. Hence, the scale of the entire ship hull will be an enormous test of Neko scalability; it’s ability to efficiently use up to an entire Exascale HPC system.

The other work CEEC will do is adding the ability to simulate topology optimization in Neko. This will be driven by the static mixer lighthouse case.

Why are these improvements a challenge?

Making the improvements that will allow Neko to run the merchant ship hull simulation is challenging for two reasons. First, it may be necessary to write new numerical methods to make the hexahedral elements work with the more complex geometry of the ship hull. Second, it will take time, iterative code tweaking, and test runs on both small and large portions of HPC systems to ensure that Neko can run a simulation of complex geometries while maintaining its performance efficiency on the largest European HPC systems. Any small problem introduced by more complex geometries could be crippling at Exascale.

In terms of the topology optimization simulation, giving Neko the ability to run flow simulations while also iteratively evaluating and optimizing the results of the simulation for maximum mixture and minimum turbulence has the potential to make the code less stable. During the optimization process, Neko has to look back in time at previous simulations while preparing future simulations in ways that it currently doesn’t know how to do.

What real-world benefits will an improved Neko help achieve?

Being able to directly numerically simulate fluid flow and turbulence around complex geometries will make it possible to simulate more real-world applicable use cases.  If industrial users are able to benefit from the accuracy and level of detail provided by Neko, their simulations could lead to direct societal benefits like more energy efficient transportation or production of food and medications, in the case of topology optimization. Meanwhile, all the data generated by these simulations will deepen our understanding of how turbulence works, which will lead to improved turbulence models that can be implemented in other codes and types of simulations.

Important Links

Related Lighthouse Cases

Related Posts

  • CEEC at ISC High-Performance 2024

    CEEC at ISC High-Performance 2024 It’s time again for the international gathering of HPC stakeholders at this year’s ISC High-Performance 2024 conference, once again in Hamburg, Germany. Like last year, […]


  • Knowledge Shared is Knowledge Gained: The 1st CEEC Community Workshop

    Knowledge Shared is Knowledge Gained: The 1st CEEC Community Workshop

    Knowledge Shared is Knowledge Gained: the 1st CEEC Community Workshop This past December 13th, CEEC held its first annual community workshop at our consortium partner Friedrich-Alexander-Universität in Erlangen, Germany and […]


  • Introducing Tim Felle Olsen

    Introducing Tim Felle Olsen

    My name is Tim Felle Olsen, and I recently joined the CEEC project as a Post.Doc. researcher at the Technical University of Denmark. I have a background in computational mathematics […]


Related Upcoming Events