PosterPDF Available

Abstract

Beginners may face many barriers to entry in a Navier-Stokes solver, for instance: The domain decomposition for parallel computation in a distributed-memory system; Coding, compiling, testing, and debugging in programming languages like Fortran or C; The fear of lower anything in the code; Stability of different numerical methods; lack of documentation and others. This work aims to break these barriers by coupling a sandbox environment into the solver. To this end, the high-order Navier-Stokes solver Xcompact3d was modified to accept the entire initial set-up from an external source, including physical and numerical parameters, initial and boundary conditions, and a solid geometry that can be inserted with Immersed Boundary Method (IBM). The initial set-up, in turn, is provided from a Jupyter Notebook, taking advantage of the built-in documentation with markdown cells (easily including figures and Latex equations), visualization and interactivity with widgets and plotting libraries, besides the versatility and readability of Python coding. Additionally, the input parameters can be checked for consistency and compatibility. Previous knowledge of NumPy and Matplotlib is enough to start with the exemplified flow configurations. However, there is no limitation to extend it to more advantaged tools like Pandas, Xarray, Dask, Numba, Holoview, Plotly and many others from the Jupyter ecosystem. In fact, the Jupyter CFD Sandbox was incorporated into the Python package Xcompact3d-toolbox. The outcome of the presented framework benefits users from different levels. For students in computational fluid dynamics, it provides direct hands-on experience and a safe place for practising and learning. For advanced users and code developers, it works as a rapid prototyping tool to test concepts and then compare results to validate any future implementations at the numerical solver. Furthermore, it is a useful advance in terms of research reproducibility and can be ported to any other numerical solver. Tutorials and exemplified flow configurations are available at Xcompact3d-toolbox's Documentation.
A Jupyter Sandbox Environment Coupled Into the
High-Order Navier-Stokes Solver Xcompact3d
Motivation
This work aims to break many of the barriers to entry in an academic
Navier-Stokes solver, for instance:
The domain decomposition in a distributed-memory system;
Coding, compiling, and debugging in programming languages FORTRAN or C;
The fear of lower anything in the code;
Stability of dierent numerical methods;
Lack of documentation and others.
Objective
Build a Python layer above the FORTRAN coded Navier-Stokes solver.
Methodology
The Jupyter CFD Sandbox framework is actuality part of two bigger projects:
The Navier-Stokes solver Xcompact3d [1, 8] was modified to accept the entire
initial set-up from an external source. The main features of the code are:
High order finite-dierence schemes;
Modeling of a solid body inside the computational domain;
Scalar equations for mass and/or heat transport;
Scalability across High-performance Computing platforms;
Support for Direct and Large-Eddy numerical simulations.
The initial set-up, in turn, can be done using the Python package
Xcompact3d-toolbox [10] and a Jupyter Notebook, taking advantage of:
Built-in documentation with markdown cells (including figures, tables, equations and more);
Visualization and interactivity with widgets and ploing libraries;
The versatility and readability of Python coding and the Jupyter Ecosystem.
Parameters
The physical and computational parameters are built on top of traitlets [5], a framework
that lets Python classes have aributes with type checking, dynamically calculated
default values, and “on change” callbacks;
The input parameters can be checked for consistency and compatibility;
In addition to ipywidgets [3] for an user friendly interface;
See the tutorial on the Documentation page [9].
Dataset
Axarray.Dataset [6] is provided (see Why xarray? [7]), initializing the initial and
boundary conditions, and other variables that Xcompact3d expects, all with the proper
size, dimensions, coordinates and aributes;
On top of that, the user can build many dierent flow configurations from a Jupyter
Notebook, with no need to recompile the Navier-Stokes solver every time;
See examples on the documentation page [9].
Solid Body
A solid body can be inserted into the Cartesian domain using a customized Immersed
Boundary Method (IBM) [2];
An accessor for xarray.DataArray with standard geometries is included;
They can be combined for the creation of unique outcomes, like the Ahmed Body.
Simulate / Analyze
0
10
x2
(a) t= 500
0
10
x2
(b) t= 750
0 50 100 150 200 250
x1
0
10
x2
(c) t= 1000
0.0
0.5
1.0
c
Aer the initial set-up, Xcompact3d-toolbox provides methods to write all necessary
variables to the disc with the proper format;
Then, the Navier-Stokes solver Xcompact3d can be executed;
Notice that Xcompact3d-toolbox also supplies support for post-processing;
The figure on the le illustrates the time evolution of the spanwise-averaged
concentration field for the plunging flow in tilted bed [4], simulated by Xcompact3d.
Conclusions
The outcome of this work benefits users from dierent levels:
For students in computational fluid dynamics, it provides direct hands-on experience and a
safe place for practicing and learning;
For advanced users and code developers, it works as a rapid prototyping tool to test concepts
and then compare results to validate any future implementations at the numerical solver.
The presented framework is a useful advance in terms of research reproducibility;
It can be ported to any other numerical solver, let us know if you do so.
Acknowledgments
This study was supported by Petrobras S.A. and financed in part by the
Coordenação de Aperfeiçoamento de Pessoal de Nível Superior - Brazil (CAPES) -
Finance Code 88887.154060/2017-00.
References
[1] P. Bartholomew, G. Deskos, R. A. Frantz, F. N. Schuch, E. Lamballais, and S. Laizet. Xcompact3d:
An open-source framework for solving turbulence problems on a cartesian mesh. SowareX, 2020.
[2] R. Gautier, S. Laizet, and E. Lamballais. A dns study of jet control with microjets using an im-
mersed boundary method. International Journal of Computational Fluid Dynamics, 28, 2014.
[3] ipywidgets. View documentation. https://ipywidgets.readthedocs.io.
[4] F. N. Schuch, J. H. Silvestrini, E. Meiburg, and S. Laizet. The plunging of hyperpycnal plumes on
tilted bed by three-dimensional large-eddy simulations. In 12th Spring School on Transition and
Turbulence, Blumenau, SC, Brazil, 2020. ABCM, 10.5281/zenodo.3968993.
[5] traitlets. View documentation. https://traitlets.readthedocs.io.
[6] xarray. View documentation. http://xarray.pydata.org.
[7] xarray. Why xarray? http://xarray.pydata.org/en/stable/why-xarray.html.
[8] Xcompact3d. View on github. https://github.com/xcompact3d/Incompact3d.
[9] Xcompact3d-toolbox. View documentation. https://xcompact3d-toolbox.readthedocs.io.
[10] Xcompact3d-toolbox. View on github. https://github.com/fschuch/xcompact3d_toolbox.
Felipe N. Schuch, Filipi D. Vianna, André Mombach and Jorge H. Silvestrini
Laboratório de Simulação de Escoamentos Turbulentos - LaSET, the CFD lab at PUCRS
School of Technology, Pontical Catholic University of Rio Grande do Sul, Porto Alegre, Brazil
ResearchGate has not been able to resolve any citations for this publication.
Conference Paper
Full-text available
Theoretical and experimental interest in the transport and deposition of sediments from rivers to oceans has increased rapidly over the last two decades. The marine ecosystem is strongly affected by mixing at river mouths, with for instance anthropogenic actions like pollutant spreading. Particle-laden flows entering a lighter ambient fluid (hyperpycnal flows) can plunge at a sufficient depth, and their deposits might preserve a remarkable record across a variety of climatic and tectonic settings. Numerical simulations play an essential role in this context since they provide information on all flow variables for any point of time and space. This work offers valuable Spatio-temporal information generated by turbulence-resolving 3D simulations of poly-disperse hyperpycnal plumes over a tilted bed. The simulations are performed with the high-order flow solver Xcompact3d, which solves the incompressible Navier-Stokes equations on a Cartesian mesh using high-order finite-difference schemes. Five cases are presented, with different values for flow discharge and sediment concentration at the inlet. A detailed comparison with experimental data and analytical models is already available in the literature. The main objective of this work is to present a new data-set that shows the entire three-dimensional Spatio-temporal evolution of the plunge phenomenon and all the relevant quantities of interest.
Article
Full-text available
Xcompact3D is a Fortran 90–95 open-source framework designed for fast and accurate simulations of turbulent flows, targeting CPU-based supercomputers. It is an evolution of the flow solver Incompact3D which was initially designed in France in the mid-90’s for serial processors to solve the incompressible Navier–Stokes equations. Incompact3D was then ported to parallel High Performance Computing (HPC) systems in the early 2010’s. Very recently the capabilities of Incompact3D have been extended so that it can now tackle more flow regimes (from incompressible flows to compressible flows at low Mach numbers), resulting in the design of a new user-friendly framework called Xcompact3D. The present manuscript presents an overview of Xcompact3D with a particular focus on its functionalities, its ready-to-run simulations and a few case studies to demonstrate its impact.
Article
In this work, a microjet arrangement to control a turbulent jet is studied by means of direct numerical simulation. A customised numerical strategy was developed to investigate the interactions between the microjets and the turbulent jet. This approach is based on an improved immersed boundary method in order to reproduce realistically the control device while being compatible with the accuracy and the parallel strategy of the in-house code Incompact3d. The 16 converging microjets, so-called fluidevrons, lead to an increase of the turbulent kinetic energy in the near-nozzle region through an excitation at small scale caused by the interaction between the fluidevrons and the main jet. As a consequence, very intense unstable ejections are produced from the centre of the jet toward its surrounding. Further downstream, the turbulent kinetic energy levels are lower with a lengthening of the potential core compared to a natural jet, in agreement with experimental results.