betaFeedback

WorksPhysics and Astronomy

aPriori: a Python package to process direct numerical simulations

Abstract

In the field of computational fluid dynamics, direct numerical simulations generate highly detailed data for the analysis of turbulent flows by resolving all relevant physical scales. Yet their large size, complexity, and heterogeneity make systematic post-processing and data reuse increasingly challenging. Despite the growing availability of high-fidelity simulations through public repositories, extracting meaningful physical insight often requires substantial technical effort, specialized workflows, and access to high-performance computing resources. In this article we introduce aPriori, an open-source Python package developed to address these limitations by providing a dedicated, memory-efficient, and user-oriented framework for the analysis of direct numerical simulation data. The software enables streamlined handling of three-dimensional fields, including filtering, scale separation, gradient evaluation, thermochemical analysis, and visualization, using concise and reproducible scripts. Its pointer-based data management strategy allows very large datasets to be processed on standard workstations without excessive memory usage, significantly lowering the barrier to advanced analysis. Beyond basic post-processing, aPriori supports workflows central to modern turbulence and combustion research, such as a priori model assessment, data-driven closure development, and detailed chemical analyses that include computational singular perturbation. By unifying these capabilities within a coherent and extensible software architecture, aPriori enhances productivity, promotes reproducibility, and facilitates broader and more effective use of high-fidelity simulation data within the computational fluid dynamics community.

Motivation

Direct Numerical Simulation (DNS) has become a widely used tool for researchers studying turbulence and combustion due to its ability to solve the full Navier-Stokes equations without relying on subgrid-scale models [1]. DNS offers a direct resolution of all scales of turbulent fluid motion, from the largest energy-containing eddies down to the smallest scales where kinetic energy is dissipated into heat and, in reactive flows, reactants are mixed at a molecular level and find favourable conditions to react. These details provide insight into complex physical phenomena, such as the statistical properties of turbulence [2] and the interaction between turbulent mixing and chemical reactions in combustion processes [3].

The high level of detail in DNS reflects the substantial computational resources involved, which in turn results in significant CO2CO_2 emissions. Yang et al. [4] analysed the DNS published in the Journal of Fluid Mechanics between 2004 and 2024, and estimated that the largest simulations can emit up to one thousand tons of CO2CO_2—the equivalent of a civil plane flying from New York to Beijing. Details are reported in Figure 1. These authors also estimated that community efforts to share DNS data, such as the Johns Hopkins Turbulence Database (JHTDB) [5], avoided roughly 3.3 million metric tons of carbon emissions, and this estimate underlines the importance of shared repositories that eliminate redundant computations.

Estimated size and CO2 emissions associated with Direct Numerical Simulation studies

Figure 1. Estimated size (a) CO2_2 emissions (b) associated with Direct Numerical Simulation (DNS) studies published in Journal of Fluid Mechanics between 2004 and 2024. Each point represents a simulation reported in the literature, highlighting the rapid growth in computational cost—and therefore carbon footprint—of state-of-the-art DNS. The largest simulations exceed 10310^3 metric tons of CO2_2, comparable to the emissions of a transcontinental commercial flight. Coloured lines show model predictions for channel-flow DNS at fixed friction Reynolds numbers ReτRe_\tau, based on a Reτ4Re_\tau^4 scaling of computational cost and a Moore’s-law-like improvement in hardware efficiency over time. Source: adapted from [4].

Among these repositories, BLASTNet [6, 7, 8, 9] stands out as a publicly accessible database recently released to support research in turbulent combustion. This archive, totaling 2.2 Tera Bytes, comprises 744 samples from 34 distinct high-fidelity DNS cases provided by multiple institutions. These cases encompass diverse flow types, including isotropic turbulence [10, 11], channel flows [12], and different flame configurations [13, 14, 15]. The availability of heterogeneous configurations is instrumental, among other applications, to train better machine learning algorithms, which are being increasingly studied to develop sub-filter closures [16, 17, 18, 19, 20, 21, 22]. Unlike benchmark datasets from the machine learning community (e.g. MNIST [23], CIFAR [24], and ImageNet [25]), which provide ready-to-use configurations, extracting sub-filter quantities from DNS for modeling or retrieving chemical properties can require additional effort, eventually requiring notable computational resources for post-processing.

To tackle this, we propose aPriori, a Python package intended to simplify the workflows commonly involved in DNS data processing. The package adopts the data formatting convention used in the BLASTNet repository, which enforces a standardized structure that facilitates data sharing and reproducibility. This choice also enables the pointer-based data access strategy implemented in the library, while remaining sufficiently general to accommodate datasets that originate from different solvers provided they are converted to the required format. aPriori includes built-in support for operations that are frequently required in turbulence and combustion studies, such as filtering scalar and vector fields for turbulent scales separation, computing gradients, and evaluating dissipation of scalar quantities.

The integration of plotting utilities allows users to readily explore the results of the aforementioned operations, enabling faster interpretation and analysis.

A key advantage of this package is its efficient memory management: instead of loading files into variables, it uses pointers to file locations, reading each file containing scalar variables only when accessed. This prevents memory overloads and facilitates the usability of large datasets. Moreover, it can be coupled with existing advanced chemistry packages to process reactive flows (e.g., Cantera [26] and PyCSP [27]), and with Python-based libraries for machine learning and visualization (e.g., Pytorch [28], Tensorflow [29], Matplotlib [30], and Pyvista [31]). The software is accompanied by a documentation1 and a dedicated GitHub repository2, with access to the source code and to dedicated tutorials.

The manuscript is structured as follows. Section 2 presents the design principles and overall architecture of the aPriori package, describing its modular organization, the role and interaction of the core classes (Scalar, Mesh, and Field), and the adopted data formatting conventions required to interface with large DNS datasets. The section further details the implementation of key functionalities, including pointer-based data access, filtering and downsampling operations, gradient evaluation, data chunking strategies for thermochemical computations, and the integration with external chemistry and visualization libraries. Section 3 illustrates the practical use of the software through a sequence of representative case studies and reproducible code snippets. These examples quantify the performance and memory efficiency of the pointer-based approach, demonstrate data loading and visualization workflows, and showcase typical a priori analysis procedures for turbulence and combustion, including sub-filter quantities evaluation, model assessment, machine-learning–assisted closures, and Computational Singular Perturbation (CSP) analysis. Finally, section 4 summarizes the main contributions of the work, discusses the scope and limitations of the current implementation, and outlines prospective developments aimed at extending the library’s numerical capabilities, data abstractions, and applicability to a broader range of DNS post-processing tasks.

While the library can be installed and operate directly in high-performance computing (HPC) clusters, all tests presented in this work—which include processing of datasets with up to 1 billion grid points—were conducted on a local Unix-based system with an ARM64 architecture (8-core CPU, 16 GB RAM); the goal is to demonstrate the software’s capabilities to extend accessibility of DNS data beyond HPC environments.

Software architecture

The software architecture is modular, built around Python classes that represent key concepts like scalars, meshes, and fields in three-dimensional space. These classes allow users to compute various statistics, manipulate DNS fields, and visualize complex simulation data. The software’s modular architecture adheres to Python’s official packaging guidelines, enabling straightforward distribution through the Python Package Index (PyPI) [32]. The following directory tree illustrates the main folders and the files structure of the software package:

aPriori
├─data/
├─dist/
├─docs/
├─LICENSE
├─pyproject.toml
├─README.md
├─src/
│ └─aPriori/
│   ├─__init__.py
│   ├─_data_struct.py
│   ├─_styles.py
│   ├─_utils.py
│   ├─_variables.py
│   ├─derivatives.py
│   ├─DNS.py
│   ├─NN.py
│   └─plot_utilities.py
├─tests/
└─tutorials/

The data directory houses example datasets employed to run the tutorials, while dist contains the files used for package distribution. The main source code is found under the src/aPrioriDNS directory, which is organized into modules. The __init__.py file contains code to initialize package-level variables and to import frequently used functions and classes. The _data_struct.py module defines the names of the main folders in which the dataset is required to be structured. The _styles.py module controls the layout used in the plot_utilities.py module. variables.py is the database containing all the available variables that can be part of the DNS field. The module DNS.py encompasses the three key classes Scalar, Mesh, and Field, which will be detailed later in this section. The derivatives.py module contains the functions for gradients and Laplacians computations, which are based on the findiff library [33], and the NN.py module provides utilities to prepare the data for machine-learning models, including scaling, feature extraction, and preprocessing. The relationship between these three is graphically depicted in Figure 2. Supporting files like LICENSE, README.md, and pyproject.toml provide high level descriptions of functioning and installation, and straightforward to distribute via PyPI. The documentation is built using Sphinx [34] from the source files contained in the docs folder.

Graphical overview of the software architecture and the relationships between its three core classes

Figure 2. Graphical overview of the software architecture and the relationships between its three core classes. The Mesh class stores the spatial coordinates and grid topology of the DNS domain, providing geometric information required for visualization and differential operations. Individual physical variables (e.g., velocity components, species mass fractions, pressure, temperature) are represented as Scalar objects, each of which handles memory-efficient access to the corresponding binary data files through a pointer-based mechanism. The Field class acts as a high-level container that aggregates all Scalar objects associated with the same mesh, dynamically loading the variables present in the dataset, which are added as attributes of the class. It provides unified methods for filtering, downsampling, gradient computation, thermochemical evaluations, and visualization.

Scalar class

The Scalar class was designed to efficiently manage and manipulate scalar fields defined over three-dimensional domains. Its core functionality is the data handling through file pointers, which enables working with multiple large matrices that, if loaded with commonly employed objects such as numpy arrays, would cause memory overloads. The class provides two operational modes: normal and light mode. The normal mode assigns a numpy array to the object. On the other hand, when a path to a file is specified, the object defaults to light mode, so that every time the object is called, it reads and returns the numerical values of the file located at the assigned path. While this provides better memory efficiency when working with a large number of files (e.g., with multiple timesteps or with many chemical species), as the files are only read when needed, the drawback of this approach is that the data must be reloaded from disk every time the object is accessed. This repeated I/O operation could potentially slow down the operations; however, as demonstrated in section 3.1, the load time remains relatively low—approximately one second for files containing over five hundred million grid points—making the approach suitable for many DNS dataset sizes. Along with this optimized access pattern, the class provides built-in support for extracting and plotting mid-planes slices along the xx, yy, and zz directions, allowing users to quickly inspect cross-sectional features of the field. These plotting utilities are based on Matplotlib [30] and are designed for scientific data visualization. Multiple examples of the plots’ appearance follow in section 3.

Field class

This class is a container of different Scalar objects, all associated with the same Mesh, which is a class that handles the mesh and related operations. The files are read from a folder that contains all the formatted data, the chemical mechanism used, the mesh, and an info.json file that contains the metadata. An example of a valid structured folder that can be read from the software is the following:

chem_thermo_tran
├── li_h2.yaml
├── data
│   ├── P_Pa_id000.dat
│   ├── RHO_kgm-3_id000.dat
│   ├── T_K_id000.dat
│   ├── UX_ms-1_id000.dat
│   ├── UY_ms-1_id000.dat
│   ├── UZ_ms-1_id000.dat
│   ├── YH2O2_id000.dat
│   ├── YH2O_id000.dat
│   ├── YH2_id000.dat
│   ├── YHO2_id000.dat
│   ├── YH_id000.dat
│   ├── YN2_id000.dat
│   ├── YO2_id000.dat
│   ├── YOH_id000.dat
│   └── YO_id000.dat
├── grid
│   ├── X_m.dat
│   ├── Y_m.dat
│   └── Z_m.dat
└── info.json

where the chem_thermo_tran repository is only necessary for reacting flows DNS. For non-reacting flows, a trigger can be set so that the initialization method does not expect to find the chemical properties file.

The files in the data directory follow a structured naming convention that encodes the physical quantity, units, and a unique identifier. Each filename begins with an abbreviation of the measured quantity (e.g., P for pressure, RHO for density, T for temperature, UX, UY, UZ for velocity components, and YH2O, YH2O2, etc., for chemical species mass fractions). This is followed by the units in concise notation (e.g., Pa for pascals, kgm-3 for kilograms per cubic meter, K for kelvin, ms-1 for meters per second) and ends with _id000 as a unique identifier, used to represent different timeframes. The .dat extension indicates data files, stored in a 32-bit binary floating-point format. This formatting is coherent with the structure proposed in the BLASTNet repository, and ensures clear and organized file identification across simulations.

Initialization and dynamic attributes

The __init__ method initializes the Field object by setting up directory paths, verifying the folder structure, loading configuration files, and building key attributes; the procedure evolves through the following steps:

  1. Folder structure and files check: the instantiation begins by checking that the specified folder follows the expected structure and contains the required data files.

  1. Filter size extraction: the method then identifies whether the field was filtered or not. This operation leverages the containing folder naming imposed by the filtering functions. If the field was previously filtered, the __init__ method extracts the filter size, storing this value in a dedicated object attribute.

  1. Configuration size load: the info.json configuration file within the folder is read to set the dimensions of the 3D data field and assign it to the self.shape attribute.

  1. Mesh attribute creation: a Mesh object for spatial coordinates is constructed by reading the X_m.dat, Y_m.dat, and Z_m.dat grid files. The current implementation supports structured grids only, reflecting the most widely adopted data format used by the reference databases targeted by the library. Support for unstructured or more complex mesh topologies is not precluded by the design and may be incorporated in future releases based on community needs.

  1. Kinetic mechanism and species names extraction: the kinetic mechanism file is loaded and species information is extracted; this step is avoided if the flag reactive is set to False.

  1. Building scalar attributes: finally, two lists of scalar attributes and paths are generated, followed by a call to the update method to initialize these attributes. This creates a dynamic attributes list that includes only the attributes with an associated file in the data directory whose names are formatted following the specifics of the module variables.py.

Throughout the initialization, status updates are printed to the console, providing step-by-step feedback on the setup process.

Filtering, downsampling and cutting

Filtering, downsampling, and cutting operations are very common when DNS data are processed for a priori model validation, and hence they were implemented in the library using one-line commands. These three methods share the general procedure, which consists of reading and processing sequentially all the files in the data and grid folders, saving them in a new container folder with an updated info.json file if the shape of the field changes during the operation.

For filtering operations, the filter kernel (box or Gaussian) must be specified, together with the possibility to perform Favre filtering. When using the Gaussian kernel, the filter is applied as a homogeneous Gaussian function, defined as

G(r)=1σ2πexp⁡(−r22σ2),(1)G(r) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{r^2}{2\sigma^2}\right), \tag*{(1)}

where σ\sigma is chosen such that the Gaussian filter has the same second moment as a box filter of width δ\delta, satisfying

σ2=112δ2.(2)\sigma^2 = \frac{1}{12}\delta^2. \tag*{(2)}

This equivalence in second moments ensures that both the Gaussian and box filters provide comparable

smoothing effects. The filter width Δ\Delta is expressed in terms of multiples of the DNS grid size:

Δ=δδDNS,(3)\Delta= \frac{\delta}{\delta_{\mathrm{DNS}}}, \tag*{(3)}

where δ\delta represents the desired filter width and δDNS\delta_{\mathrm{DNS}} is the DNS grid spacing.

Gradients computation

The computation of gradients is consistent with any filtering operations applied to the field. Specifically, when the field is both filtered and downsampled, gradients can be computed on adjacent cells, as the resulting field resembles a coarse-grained solution typically available in Large Eddy Simulation (LES) software. When the field is filtered but not downsampled, gradient computation is performed on every possible virtually downsampled grid by effectively skipping Δ\Delta adjacent cells, where Δ\Delta is relative to the filter size.

The current implementation employs high-order central difference schemes for spatial derivatives based on [33], which allows arbitrarily high order schemes. A priori defaults to fourth-order accuracy for both the gradient and the Laplacian. When handling filtered fields, the derivative order defaults to second order, as many LES solvers—particularly those operating on unstructured grids—typically rely on lower-order discretizations. The default accuracy can be easily modified using the set_gradients_order function, without requiring changes to the source code.

Nevertheless, in cases where specialized numerical schemes are required for accurate post-processing—for example, to mimic the discretization used by the DNS solver that generated the data—users may modify the gradient schemes directly. This can be achieved by overriding the external gradient and Laplacian functions defined in the derivatives.py module. These functions are invoked by all gradient-related methods within the Field class. Overriding them ensures consistent gradient computation throughout the library, providing both flexibility and numerical consistency in advanced scenarios.

Data Chunking

While handling large variables via pointers can be efficient for operations involving only a small number of scalars—ideally one scalar at a time—chemistry-related computations typically require simultaneous access to the full set of species concentrations and temperature. To address memory constraints in such cases, data chunking is implemented. This approach is particularly important for operations involving the full thermochemical state vector, such as reaction rate computations (which are almost always required during simulations, since source terms are generally not stored to conserve disk space) as well as CSP analyses and local reactor-based evaluations.

In practice, the files representing the thermochemical state vector are read in discrete chunks: only a subset of the data is loaded into memory at a time, processed, and then written to the corresponding output files. These output files remain open throughout the procedure to accommodate results from successive chunks. All utilities that perform such operations include an option to specify the number of chunks to be used; by default, this value is set to 1000.

Usage examples

Scalar class memory usage

This example demonstrates how the Scalar class can be used to efficiently manage large DNS-like datasets while minimizing RAM usage. The benchmark creates a set of 3D scalar fields with increasingly growing sizes, stores them on disk, and then uses the Scalar class in light mode to measure the time required to access each file. The results are plotted as load time versus memory size.

The script begins by importing required libraries for data handling, visualization, and benchmarking.

import aPriori as ap
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import time

The following lines initialize a list of 3D shapes, starting from a base size of 40 × 30 × 15, and iteratively scale each dimension by a factor of 1.1 over 39 steps. This results in a sequence of 40 shapes with increasing total number of grid points, ranging from 1.8 × 10410^{4} up to roughly 5.4 × 10810^{8}. For each shape, a scalar field filled with random floating-point values is generated using NumPy, and saved to disk in binary format using the save_file() utility. This step generates output files which resemble BLASTNet formatting.

s0 = [40, 30, 15]
f = 1.1
n = 39
shapes = [s0]

for _ in range(n):
    next_size = (np.array(shapes[-1]) * f).astype(int).tolist()
    shapes.append(next_size)

elements = [np.prod(shape) for shape in shapes]

data_folder = 'data'
if not os.path.exists(data_folder):
    os.mkdir(data_folder)

filenames = [os.path.join(data_folder, 'f_{}_{}_{}.dat'.format(*shape)) for shape in shapes]
scalars = [np.float32(np.random.rand(*shape))
           for shape in shapes]

for scalar, filename in zip(scalars, filenames):
    ap.save_file(scalar, file_name=filename)

Subsequently we instantiate Scalar objects by pointing to the saved files, without loading them into memory. This allows to measure the overhead associated with delayed loading.

ram_size = [scalar.nbytes / 1024**2 for scalar
            in scalars]
light_scalars = [ap.Scalar(shape=shape, path=
    filename) for shape, filename in zip(
    shapes, filenames)]
disk_sizes = [os.path.getsize(filename) /
    1024**2 for filename in filenames]
ram_size_light = [sys.getsizeof(light_scalar)
                  for light_scalar in light_scalars]

We access each scalar field using the .value property and record the time required to read the data from disk.

t_load = []
for s in light_scalars:
    t0 = time.time()
    array = s.value  # loading the array
    t1 = time.time()
    t_load.append(t1 - t0)

Finally, a logarithmic plot is displayed in Figure 3 to show how the load time scales with the field size, together with a note which underlines the peak memory and associated reading time.

Load time of the Scalar class operating in light mode

Figure 3. Load time of the Scalar class operating in light mode, measured by reading binary DNS-like scalar fields of increasing size from disk. Each point corresponds to a single array whose dimensions were progressively scaled, resulting in memory footprints ranging from a few hundred kilobytes to several gigabytes. The logarithmic axes reveal a near-linear growth of read time with respect to array size, with the largest field tested (approximately 6.46×1086.46 \times10^{8} elements, 2.41 GB) requiring only 1.53 s to load. This benchmark illustrates the efficiency of the pointer-based data access strategy used in the software, enabling manipulation of very large DNS fields without exhausting the system’s memory.

# Create figure and primary axis
fig, ax1 = plt.subplots(figsize=(6.3, 4.4),
                        dpi=500)

# Plot on log-log scale
ax1.set_xscale('log')
ax1.set_yscale('log')
ax1.plot(ram_size, t_load, marker='o',
         linestyle='-', linewidth=2, markersize=6,
         color='C0')
ax1.set_xlabel('Memory usage (MB)', fontsize=16)
ax1.set_ylabel('Load time (s)', fontsize=16)
ax1.tick_params(axis='both', labelsize=14)
# ax1.grid(True, which='both', linestyle='--',
#          alpha=0.2)
ax1.grid(False)

# Mapping functions for secondary x-axis
def ram_to_size(x):
    return np.interp(x, ram_size, elements)

def size_to_ram(x):
    return np.interp(x, elements, ram_size)

# Add log-scale secondary x-axis
ax2 = ax1.secondary_xaxis('top', functions=(
    ram_to_size, size_to_ram))
ax2.set_xscale('log')
ax2.set_xlabel('DNS grid points', fontsize=16,
               labelpad=10)
ax2.tick_params(axis='x', labelsize=14)

# Get max values
max_time = np.max(t_load)
max_ram = ram_size[np.array(t_load).argmax()]
# RAM at max load time
max_elems = elements[-1]

# Create annotation text
annotation_text = (
    f"Peak load time: {max_time:.2f} s\n"
    f"Peak memory usage: {max_ram / 1024:.2f} GB\n"
    f"Array size: {max_elems / 1e6:.1f} M elements"
)

# Add to plot (adjust x and y coordinates as needed)
plt.text(0.06, 1.2, annotation_text,
         fontsize=15, verticalalignment='top',
         #bbox=dict(boxstyle="round,pad=0.4",
         facecolor="white", edgecolor="gray", alpha=0.9)
         )

# Final layout
fig.tight_layout()

plt.savefig('Memory_load.png')
plt.show()

Data reading and visualization

This section demonstrates how the aPriori package can be used to load and visualize DNS datasets from structured folders. Two flame configurations are processed: a slot turbulent lifted hydrogen flame in a hot coflow [35, 15] and a turbulent jet premixed methane/air flame [13].

We begin by importing the required modules and instantiating a Field object that points to the folder containing the DNS data of the hydrogen flame. Scalar fields are accessed via their variable names, and visualized along the zz mid-plane using built-in plotting utilities. Orientation and title control options are provided for publication formatting.

import aPriori as ap
import matplotlib.pyplot as plt

h2_flame = ap.Field('DNS_DATA_2d')

f1, ax1 = h2_flame.plot_z_midplane('T',
    transpose=True, remove_title=True)
f2, ax2 = h2_flame.plot_z_midplane('U_X',
    transpose=True, log=False, remove_title=
    True)

We compute the strain rate tensor using a method of the Field class. The resulting scalar with the strain rate magnitude is automatically added to the object as a dynamic attribute, and is then visualized. Finally, we plot the mass fraction of H2_2O, specifying threshold values to highlight regions of interest.

h2_flame.compute_strain_rate(save_tensor=False
    )

f3, ax3 = h2_flame.plot_z_midplane('S_DNS',
    transpose=True, log=True, remove_title=
    True)
f4, ax4 = h2_flame.plot_z_midplane(
    'YH2O',
    transpose=True,
    vmin=0.03,
    levels=[0.03, 0.10, 0.15],
    remove_title=True)

Each subplot is annotated using the text() function to add panel labels and variable units. Figures are then saved with transparent backgrounds and tight bounding boxes.

ax1.text(0.0, 1.17, 'a', fontsize=55,
    fontweight='bold', fontname='arial',
    transform=ax1.transAxes)
ax1.text(1.15, 1.0, 'T [K]', fontsize=36,
    transform=ax1.transAxes)
f1.savefig('figures/fig_a.png', transparent=
    True, bbox_inches='tight')

ax2.text(0.0, 1.17, 'b', fontsize=55,
    fontweight='bold', transform=ax2.transAxes
    )
ax2.text(1.15, 1.0, r'$U_x$ [m/s]', fontsize
    =36, transform=ax2.transAxes)
f2.savefig('figures/fig_b.png', transparent=
    True, bbox_inches='tight')

ax3.text(0.0, 1.17, 'c', fontsize=55,
    fontweight='bold', transform=ax3.transAxes
    )
ax3.text(1.15, 1.0, r'S [$s^{-1}$]', fontsize
    =36, transform=ax3.transAxes)
f3.savefig('figures/fig_c.png', transparent=
    True, bbox_inches='tight')

ax4.text(0.0, 1.17, 'd', fontsize=55,
    fontweight='bold', transform=ax4.transAxes
    )
ax4.text(1.15, 1.0, r'$Y_{H2O}$ [-]', fontsize
    =36, transform=ax4.transAxes)
f4.savefig('figures/fig_d.png', transparent=
    True, bbox_inches='tight')

Next, we apply the same procedure to a CH4 premixed flame. After loading the cut-domain dataset, we compute a progress variable based on O2_2 and visualize it with a custom colormap.

ch4_flame = ap.Field('CH4_flame_cut')
ch4_flame.compute_progress_variable('O2')

f5, ax5 = ch4_flame.plot_z_midplane('C',
    transpose=True, colormap='inferno',
    vmin=0,
    vmax=1, remove_title=True)

We then compute the velocity magnitude and the gradient of the progress variable, and visualize both on the same mid-plane. The use of reversed colormaps and logarithmic scaling improves visual contrast for fields spanning multiple orders of magnitude.

ch4_flame.compute_velocity_module()
f6, ax6 = ch4_flame.plot_z_midplane('U_DNS',
    transpose=True, colormap='inferno_r',
    remove_title=True)

ch4_flame.compute_gradient_C()
f7, ax7 = ch4_flame.plot_z_midplane('C_grad',
    transpose=True, colormap='inferno_r',
    log=True,
    vmin=1.5, transparent=True,
    remove_title=True)

f8, ax8 = ch4_flame.plot_z_midplane('YCH2O',
    transpose=True, colormap='inferno',
    log=True,
    vmin=-5, remove_title=True)

Filtering and downsampling

In this section an example code illustrates the filtering, downsampling, and subdomain extraction utilities. The dataset used is a non-reacting, forced, homogeneous isotropic turbulence DNS, from a previous work of Gauding et al. [36].

The first step consists of instantiating the field object, using as a reference the data containing folder. As the case is non-reactive, a corresponding flag must be set accordingly to avoid the initialization process looking for the chemical properties folder. The velocity module is then computed and visualized.

import pathlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import aPriori as ap
import os
DNS mid-plane visualisations for two turbulent flame configurations

Figure 4. DNS mid-plane visualisations produced with the aPriori plotting utilities for two turbulent flame configurations. (a)–(d) Lifted hydrogen flame in a heated coflow: temperature, streamwise velocity UxU_x, strain-rate magnitude S=(2SijSij)1/2S = (2S_{ij}S_{ij})^{1/2} on a logarithmic scale, and water vapour mass fraction YH2OY_{\mathrm{H_2O}}. (e)–(h) Premixed methane/air flame: progress variable based on CO2\mathrm{CO_2}, velocity magnitude UU, progress-variable gradient ∣∇C∣|\nabla C| (logarithmic scale), and formaldehyde mass fraction YCH2OY_{\mathrm{CH_2O}}.

data_folder = os.path.join(
    'DNS_turbulent_transport', '
    Filtering_example')
# Initialize the field, with the option '
    reactive' set to false
DNS_field = ap.Field(data_folder, reactive=
    False)

DNS_field.compute_velocity_module()
f, ax = DNS_field.plot_z_midplane(
    'U_DNS',
    scale='m',
    colormap='Blues',
    vmin=0,
    vmax=11,
    cbar_title=r'U [m/s]',
    y_ticks=[2, 4, 6],
    remove_title=True
)

Every time a field is filtered, cut, or downsampled, the resulting output is saved in a replicated folder, which has the same structure of the original one. This allows the library to read the resulting output field as a different object. At this stage the pointer-based structure of the code comes in useful, as it allows to store all these objects in a dictionary and work with them simultaneously.

In the following, three different filter sizes (Δ=8\Delta= 8, 16, and 32) are selected. The filter() method of the class performs the filtering operations, creates the filtered field folder, and returns the folder’s name as a string. The folder name contains information regarding the filter size, the filter kernel, and whether Favre filtering was employed. This string is then used to instantiate the object as a new instance of the class Field, which is then added to the dictionary with a proper key representing the filter size.

filter_sizes = [8, 16, 32]
filtered_fields = dict()

for delta in filter_sizes:
    f_name = DNS_field.filter(delta)
    f = ap.Field(f_name, reactive=False)
    filtered_fields[f'{delta}'] = f
    del f

The dictionary is then browsed and the velocity magnitude values are accessed to be plotted for all the filter sizes.

figures_dir = os.path.join(data_folder, '
    Figures')
os.mkdir(figures_dir)
for i, delta in enumerate(filter_sizes):
    # apply different figure properties
    depending on the position
    if i == 0:
remove_y = False
else:
    remove_y = True
if i == len(filter_sizes)-1:
    remove_cbar = False
    cbar_title = r’U [m/s]’
else:
    remove_cbar = True
    cbar_title = None

# Plot and save figure and axis objects
f, ax = filtered_fields[f’{delta}’].plot_z_midplane(’U_DNS’, scale=’m’,
colormap=’Blues’, title=r’$\Delta$’+f’ = {delta}’, vmin=0, vmax=11, cbar_title=
cbar_title, y_ticks=[2, 4, 6], remove_x=
True, remove_y=remove_y, remove_cbar=
remove_cbar)

# Save figure
f.savefig(os.path.join(figures_dir,f’delta
{delta}.png’),
    transparent=True,
    bbox_inches=’tight’
)

The same procedure is here applied to downsample and plot the filtered fields.

downsampled_fields = dict() # initialize an empty dictionary
for delta in filter_sizes:
    # Downsample the filtered field and initialize a new one using the new directory
    ds = ap.Field(filtered_fields[f’{delta}’].downsample(ds_size=delta), reactive=False)
    downsampled_fields[f"{delta}"] = ds
    del ds

for i, delta in enumerate(filter_sizes):
    if i == 0:
        remove_y = False
    else:
        remove_y = True
    if i == len(filter_sizes)-1:
        remove_cbar = False
        cbar_title = r’U [m/s]’
    else:
        remove_cbar = True
        cbar_title = None

    f, ax = downsampled_fields[f"{delta}"].plot_z_midplane(’U_DNS’, scale=’m’,
    colormap=’Blues’, title=r’$\Delta$’+f’ = {delta}’, vmin=0, vmax=11, cbar_title=
    cbar_title, remove_title=True, y_ticks=[2,
    4, 6], remove_x=False, remove_y=remove_y,
    remove_cbar=remove_cbar)

    f.savefig(os.path.join(figures_dir,f’delta
    {delta}DS.png’),
        transparent=True,
        bbox_inches=’tight’
    )

Figure 5 shows the outputs of the code presented in this section.

Mid-plane visualization of the velocity field

Figure 5. Mid-plane visualization of the velocity field from the homogeneous isotropic turbulence DNS of Gauding et al. [36]. Each column corresponds to a different filter size. The top row shows the filtered velocity magnitude, while the bottom row presents the same filtered fields after downsampling.

Turbulence model assessment

Model validation is one of the key functionalities that the library was designed for. In § 4.1 we first define the general framework used for a priori model validation, as it was fundamental in defining various aspects of the software architecture, and in section 3.4.2 we show an example application.

General framework for a priori validation

The framework to perform a priori validation of subfilter models with the library consists roughly in the following steps:

  1. The derived quantities of interest are computed from the original DNS field, relying on the variables which constitute the solution of the partial differential equations.

  1. The DNS field is filtered. As shown in the previous example, the filtering operation will create an additional folder that contains the filtered data. The main variables (e.g., velocity, density, etc...) constitute the LES-like 33 filtered field, meaning that

those quantities resemble what is ideally accessible in a LES simulation4. The non-linear quantities computed on the DNS at step one, such as the kinetic energy, or the strain rate, are filtered as well from this operation, and they represent variables containing sub-filter information, which is typically not accessible in LES.

  1. The derived quantities of interest are computed from the filtered field. For example, the x-component of velocity, in the software, is referred to as U_X both in the unfiltered and in the filtered field. In the unfiltered field it represents the DNS velocity UxU_x, in the filtered one it represents U‾x\overline{U}_x. These two quantities can be accessed with the following commands, respectively:

1 DNS_field.U_X
2 filtered_field.U_X

given that DNS_field and the object containing the DNS data and filtered_field is the object containing the field filtered from the aforementioned one.

To give an example with the kinetic energy, the procedure would look as follows:

  1. Compute the kinetic energy kDNSk_{DNS}:

kDNS=12U⋅U;(4)k_{DNS} = \frac{1}{2}\mathbf{U}\cdot\mathbf{U}; \tag*{(4)}
  1. Filter the DNS field: additionally to the main variables, one obtains the filtered kinetic energy, which reads

k‾DNS=12U⋅U‾;(5)\overline{k}_{DNS} = \frac{1}{2}\overline{\mathbf{U}\cdot\mathbf{U}}; \tag*{(5)}
  1. From the LES-like field, compute again the resolved kinetic energy:

k‾LES=12U‾⋅U‾;(6)\overline{k}_{LES} = \frac{1}{2}\overline{\mathbf{U}}\cdot\overline{\mathbf{U}}; \tag*{(6)}

now the residual kinetic energy can be computed as

kr=12U⋅U‾−12U‾⋅U‾≡k‾DNS−k‾LES(7)k_r = \frac{1}{2}\overline{\mathbf{U}\cdot\mathbf{U}}-\frac{1}{2}\overline{\mathbf{U}}\cdot\overline{\mathbf{U}} \equiv\overline{k}_{DNS}-\overline{k}_{LES} \tag*{(7)}

with krk_r, k‾DNS\overline{k}_{DNS} and k‾LES\overline{k}_{LES} being attributes of the filtered field object.

Smagorinsky model

The following example shows how to compute sub-filter quantities related to turbulence, specifically the residual dissipation rate and the residual stresses.

The code starts by importing the libraries and declaring the input variables:

1 import numpy as np
2 import aPriori as ap
3 import os

5 #============ Input variables ============#
6 data_folder = ’DNS_turbulent_transport’
7 filter_size = 8
8 Cs = 0.16
9 figures_folder = ’figures_subgrid_turbulence’
10 #=========================================#

The following steps consist in creating a folder to save the figures, initializing the unfiltered DNS field object, and leveraging the built-in methods to compute the rate-of-strain tensor, which is defined as

SijDNS=12(∂Ui∂xj+∂Uj∂xi),(8)S^{DNS}_{ij} = \frac{1}{2}\left(\frac{\partial U_i}{\partial x_j}+\frac{\partial U_j}{\partial x_i}\right), \tag*{(8)}

with SS representing its module:

SDNS=(2SijSij)1/2(9)S_{DNS} = \left(2S_{ij}S_{ij}\right)^{1/2} \tag*{(9)}
1 # Create the folder for the output figures
2 if not os.path.exists(figures_folder):
3     os.mkdir(figures_folder)

5 # Initialize the field, with the option ’
      reactive’ set to false
6 DNS_field = ap.Field(os.path.join(data_folder,
      ’DNS_data_cut’), reactive=False)

8 # DNS Strain rate computation
9 DNS_field.compute_strain_rate(save_derivatives
      =False, save_tensor=True)

11 # Strain rate module plot
12 fl,ax1 = DNS_field.plot_z_midplane(
13     ’S_DNS’,
      log=True,
      vmax=2.6,
      vmin=.5,
      colormap=’Blues’,
      scale=’m’,
      title=r’$\\mathcal{S}=2S_{ij}S_{ij}$’,
      remove_cbar=True,
      transparent=False,
      )

23 fl.savefig(
      os.path.join(figures_folder, ’f1’),
      transparent=True,
      bbox_inches=’tight’)

The DNS field is then filtered with a filter size Δ\Delta, specified in the code inputs. The filtering function returns a string that is used to initialize the filtered field object, which contains the filtered rate of strain

S‾ijDNS≡12(∂Ui∂xj+∂Uj∂xi).(10)\overline{S}_{ij}^{DNS} \equiv\frac{1}{2}\left(\frac{\partial U_i}{\partial x_j}+\frac{\partial U_j}{\partial x_i}\right). \tag*{(10)}
# Filtering field.
# The function will return the relative path
  of the filtered field folder
f_name = DNS_field.filter(filter_size=
  filter_size, filter_type='Gauss')
# The filtered field can now be initialized
filtered_field = ap.Field(f_name, reactive=
  False)

# DNS filtered dissipation rate plot
f2, ax2 = filtered_field.plot_z_midplane(
  'S_DNS',
  log=True,
  vmax=2.6,
  vmin=.5,
  colormap='Blues',
  scale='m',
  title=r'$\overline{\mathcal{S}}_{DNS} \
  equiv \overline{2S_{ij}{S}_{ij}}$',
  remove_y=True,
  remove_cbar=True,
  transparent=False,
)
f2.savefig(
  os.path.join(figures_folder, 'f2'),
  transparent=True,
  bbox_inches='tight')

The strain rate can then be computed from the LES-like field, leading to the following expression:

S‾ijLES≡12(∂U‾i∂xj+∂U‾j∂xi).(11)\overline{S}_{ij}^{LES} \equiv\frac{1}{2}\left(\frac{\partial\overline{U}_i}{\partial x_j}+\frac{\partial\overline{U}_j}{\partial x_i}\right). \tag*{(11)}

The expressions in eq. 10 and eq. 11 are then compared in a parity plot.

# LES Strain rate plot
filtered_field.compute_strain_rate(
  save_derivatives=False, save_tensor=True)
f3, ax3 = filtered_field.plot_z_midplane(
  'S_LES',
  log=True,
  vmax=2.6,
  vmin=.5,
  colormap='Blues',
  scale='m',
  title=r'$\overline{\mathcal{S}}_{LES} \
  equiv 2\overline{S}_{ij}\overline{S}_{ij}$'
  remove_y=True,
  transparent=False,
)
f3.savefig(os.path.join(figures_folder, 'f3'),
  transparent=True,
  bbox_inches='tight')
f4, ax4 = ap.parity_plot(
  filtered_field.S_DNS.value,
  filtered_field.S_LES.value,
  density=True,
  cmin=1e-9,
  ticks=[100, 200, 300, 400],
  rel_error=None,
  x_name=r'$\overline{\mathcal{S}}_{DNS}$',
  y_name=r'$\bar{\mathcal{S}}_{LES}$',
)
f4.savefig(
  os.path.join(figures_folder, 'f4'),
  transparent=True,
  bbox_inches='tight')

The results obtained with the code provided in the first part of this section are displayed in Figure 6.a.

Assessment of subgrid-scale quantities relevant to turbulence modelling

Figure 6. Assessment of subgrid-scale quantities relevant to turbulence modelling using the aPriori framework. Data from [36]. (a) Strain–rate magnitude SS from DNS, its filtered counterpart S‾DNS\overline{S}_{\mathrm{DNS}}, and the strain–rate magnitude computed from the filtered velocity field SLESS_{\mathrm{LES}}, together with the corresponding parity plot. (b) Residual dissipation rate ϵrDNS\epsilon_{r}^{\mathrm{DNS}} obtained from DNS, the Smagorinsky prediction ϵrLES\epsilon_{r}^{\mathrm{LES}}, the absolute error field, and the associated parity plot. (c) Deviatoric residual stress module τrDNS\tau_{r}^{\mathrm{DNS}}, its Smagorinsky estimate τrLES\tau_{r}^{\mathrm{LES}}, the absolute error field, and the corresponding parity plot. All results refer to a homogeneous isotropic turbulence DNS filtered with Δ=8\Delta= 8, illustrating the workflow for a priori evaluation of subgrid-scale closures.

We proceed computing quantities of interest for modeling, introducing Smagorinsky model and validating it against the DNS benchmark values. This constitutes an example of how the library can be used to validate existing closure models. The transfer of energy from the residual scales to the filtered ones appears in the filtered energy equation and according to [2] reads

ϵr≡−τijRS‾ijLES,(12)\epsilon_r \equiv-\tau_{ij}^{R}\overline{S}_{ij}^{LES}, \tag*{(12)}

with τijr\tau_{ij}^{r} being the deviatoric part of the residual stress

τijr=τijR−13δijτkkR,(13)\tau_{ij}^{r}=\tau_{ij}^{R}-\frac{1}{3}\delta_{ij}\tau_{kk}^{R}, \tag*{(13)}

and τrDNS\tau_{r}^{DNS} the magnitude of such tensor:

τrDNS=(2τijrτijr)1/2.(14)\tau_{r}^{DNS}=\left(2\tau_{ij}^{r}\tau_{ij}^{r}\right)^{1/2}. \tag*{(14)}
# Compute residual dissipation rate
filtered_field.DNS_folder_path = DNS_field.
  folder_path
filtered_field.
  compute_residual_dissipation_rate(mode=
  'DNS')
filtered_field.Cs=Cs # set the Smagorinsky
  constant
filtered_field.
  compute_residual_dissipation_rate(mode=
  'Smag')

# Compute absolute error, save it to file, and
  add it as a variable
absolute_error = np.abs(filtered_field.
  Epsilon_r_DNS.value - filtered_field.
  Epsilon_r_Smag.value)
error_file_name = 'Epsilon_r_AE_id000.dat'
error_file_path = os.path.join(filtered_field.
  data_path, error_file_name)
ap.save_file(absolute_error, error_file_path)
ap.add_variable('Epsilon_r_AE', 'Epsilon_r_AE_
  {}.dat')
filtered_field.update(verbose=True)
# Residual dissipation rate plot
f5, ax5 = filtered_field.plot_z_midplane(
    ’Epsilon_r_DNS’,
    vmin=-150,
    vmax=150,
    transparent=False,
    title=r’$\epsilon_r^{DNS}$’,
    scale=’m’,
    remove_cbar=True,
    colormap=’Blues’
)
f5.savefig(
    os.path.join(figures_folder, ’f5’),
    transparent=True,
    bbox_inches=’tight’)

# Smagorinsky modeled residual dissipation
rate
f6, ax6 = filtered_field.plot_z_midplane(
    ’Epsilon_r_Smag’,
    vmin=-150,
    vmax=150,
    title=r’$\epsilon_r^{LES}$’,
    transparent=False,
    scale=’m’,
    remove_y=True,
    remove_cbar=True,
    colormap=’Blues’
)
f6.savefig(
    os.path.join(figures_folder, ’f6’),
    transparent=True,
    bbox_inches=’tight’)

f7,ax7 = filtered_field.plot_z_midplane(
    ’Epsilon_r_AE’,
    scale=’m’,
    colormap=’Blues’,
    title=r’$|\epsilon_r^{DNS} - \epsilon_r^{LES}|$’,
    vmin=-150,
    vmax=150,
    transparent=False,
    remove_y=True
)
f7.savefig(
    os.path.join(figures_folder, ’f7’),
    transparent=True,
    bbox_inches=’tight’)

# Residual dissipation rate parity plot
f8, ax8 = ap.parity_plot(
    filtered_field.Epsilon_r_DNS.value,
    filtered_field.Epsilon_r_Smag.value,
    density=True,
    cmin=1e-9,
    limits=[-800, 800],
    ticks=[-500, 0, 500],
    rel_error=None,
    x_name=r’$\epsilon_r^{DNS}$’,
    y_name=r’$\epsilon_r^{LES}$’,
)
f8.savefig(
    os.path.join(figures_folder, ’f8’),
transparent=True,
bbox_inches=’tight’)

The code above computes the residual dissipation rate obtained from the filtered DNS field and the corresponding prediction with the Smagorinsky model. The DNS-based value is evaluated directly from the definition of Eq. (12), while the modelled contribution is obtained using the eddy-viscosity formulation with the prescribed Smagorinsky constant. The absolute error between the two fields is then computed and stored as an additional variable. Figure 6.b displays the mid-plane distributions of ϵrDNS\epsilon_r^{DNS}, the Smagorinsky prediction ϵrLES\epsilon_r^{LES}, and their absolute difference, together with the associated parity plot. Finally, the same procedure is applied to model the magnitude of the deviatoric residual stress.

# Residual stress computation, reference and
    modeled
filtered_field.compute_tau_r(mode=’DNS’)
filtered_field.compute_tau_r(mode=’Smag’)

# Compute absolute error, save it to file, and
    add it as a variable
absolute_error = np.abs(filtered_field.
    TAU_r_DNS.value - filtered_field.
    TAU_r_Smag.value)
error_file_name = ’TAU_r_AE_id000.dat’
error_file_path = os.path.join(filtered_field.
    data_path, error_file_name)
ap.save_file(absolute_error, error_file_path)
ap.add_variable(’TAU_r_AE’, ’TAU_r_AE_{}.dat’)
filtered_field.update(verbose=True)

# Residual sub-filter stress plot
f9, ax9 = filtered_field.plot_z_midplane(
    ’TAU_r_DNS’,
    vmin=0,
    vmax=10,
    title=r’$\tau_r^{DNS}$’,
    transparent=False,
    scale=’m’,
    remove_cbar=True,
    colormap=’Blues’,
)
f9.savefig(
    os.path.join(figures_folder, ’f9’),
    transparent=True,
    bbox_inches=’tight’)

# Residual stress Smagorinsky plot
f10, ax10 = filtered_field.plot_z_midplane(
    ’TAU_r_Smag’,
    vmin=0,
    vmax=10,
    title=r’$\tau_r^{LES}$’,
    transparent=False,
    scale=’m’,
    remove_y=True,
    remove_cbar=True,
    colormap=’Blues’
)
f10.savefig(
    os.path.join(figures_folder, ’f10’),
    transparent=True,
    bbox_inches=’tight’)

# Absolute error plot
f11, ax11 = filtered_field.plot_z_midplane(
    ’TAU_r_AE’,
    scale=’m’,
    colormap=’Blues’,
    title=r’$|\tau_r^{DNS} - \tau_r^{LES}|$’,
    vmin=0,
    vmax=10,
    remove_y=True
)
f11.savefig(
    os.path.join(figures_folder, ’f11’),
    transparent=True,
    bbox_inches=’tight’)
# Parity plot
f12, ax12 = ap.parity_plot(
    filtered_field.TAU_r_DNS.value,
    filtered_field.TAU_r_Smag.value,
    density=True,
    cmin=1e-8,
    # limits=[-500, 500],
    # ticks=[-400, 400],
    rel_error=None,
    x_name=r’$\tau_r^{DNS}$’,
    y_name=r’$\tau_r^{LES}$’,
    limits=[0, 30],
    ticks=[0, 10, 20, 30]
)
f12.savefig(
    os.path.join(figures_folder, ’f12’),
    transparent=True,
    bbox_inches=’tight’)

The DNS reference and the Smagorinsky prediction are computed, and the absolute error between the two is stored as an additional variable. Figure 6.c shows the mid-plane distributions of τrDNS\tau_r^{DNS}, the modeled value τrLES\tau_r^{LES}, and the corresponding absolute error, together with the associated parity plot. This final comparison demonstrates how the library enables a priori assessment of sub-filter stress closures in addition to energy-transfer quantities, providing a comprehensive evaluation of turbulence models against DNS data.

Machine-learning enhanced turbulent combustion closure

In the present example we illustrate how to use the library to train a machine learning-based closure model for turbulent combustion. A multi-layer perceptron is trained on the filtered LES-like data to regress the cell-reacting fraction parameter in the Partially-Stirred Reactor (PaSR) model. Specifically, the input parameters chosen are the Favre-filtered progress variable c~\widetilde{c}, its gradient module ∣∇c~∣|\nabla\widetilde{c}| and Laplacian ∇2c~\nabla^2\widetilde{c}, the chemical timescale τc\tau_c, and the mixing timescale τm\tau_m. The Favre-filtering operation is defined for a generic scalar ff as

f~=ρf‾ρ‾.(15)\widetilde{f} = \frac{\overline{\rho f}}{\overline{\rho}} . \tag*{(15)}

The selection of input parameters, baseline model, and the foundational idea of this tutorial is further detailed in previous research, where a similar approach was used to correct the PaSR model for methane premixed flames [22]. The NN module of the library is used to build the training data tensor and generate a data scaler which can be fitted and used to extract the input data when testing the network on different cases. Finally, the results of the physics-based PaSR model and the deep-learning model are compared, and the effect of a sparsity regularisation term in the loss function is assessed both qualitatively and quantitatively.

The first part consists in importing the modules, creating the necessary folders, downloading the DNS data and initializing the field object. The simulation data are a subset of the hydrogen/air premixed turbulent flame described in [38] at equivalence ratio ϕ=0.5\phi= 0.5, whose size was here reduced for reproducibility purposes.

import numpy as np
import aPriori as ap
import os
import shutil

tmp_data_folder = ’tmp’
dns_data_folder = os.path.join(tmp_data_folder
                              , ’DNS_data’)

os.makedirs(tmp_data_folder, exist_ok=True)
os.makedirs(dns_data_folder, exist_ok=True)
if not os.path.exists(os.path.join(
        dns_data_folder, ’data’)):
    ap.download(dataset=’h2_premixed’,
        dest_folder=dns_data_folder)

dns_field = ap.Field(dns_data_folder)

Subsequently, the reaction rates are computed on the DNS field, the field is then filtered, and the reaction rates are computed again on the filtered field. The reaction rates thus computed are referred to as Laminar Finite Rates, and the effect of filtering and computing the reaction rates is illustrated in Figure 7.a and Figure 7.b. The plotting function is available in the full tutorial and is omitted for simplicity.

Machine-learning–assisted modelling of the cell-reacting fraction in a premixed hydrogen flame

Figure 7. Machine-learning–assisted modelling of the cell-reacting fraction in a premixed hydrogen flame. (a) DNS mass fraction of H2_2 and its Favre-filtered counterpart, illustrating the effect of filtering on the thermochemical state. (b) DNS reaction rate ω˙H2DNS\dot{\omega}_{\mathrm{H}_2}^{\mathrm{DNS}}, the corresponding filtered value ω˙‾H2DNS\overline{\dot{\omega}}_{\mathrm{H}_2}^{\mathrm{DNS}}, and the laminar finite-rate (LFR) estimate ω˙‾H2LFR\overline{\dot{\omega}}_{\mathrm{H}_2}^{\mathrm{LFR}}. (c) Training and test losses during optimisation of the neural-network model, showing rapid convergence and stable generalisation. (d) Parity plots comparing DNS heat-release rate Q˙DNS\dot{Q}_{\mathrm{DNS}} with (i) the LFR model, (ii) the PaSR closure, (iii) the neural network without regularisation (α=0\alpha= 0), and (iv) the neural network with weak sparsity regularisation (α=10−7\alpha= 10^{-7}). (e) Influence of increasing sparsity regularisation on the predicted reacting-fraction field γNN\gamma_{\mathrm{NN}} (top) and on the contributions of total, NMSE, and sparsity losses (bottom).

# Compute reaction rates on the DNS
dns_field.compute_reaction_rates(exist_ok=True
                                )

# Filter
filter_size = 6
filtered_field = ap.Field(dns_field,
    filter_favre(filter_size, exist_ok=True))
# Compute reaction rates on the filtered field
filtered_field.compute_reaction_rates(exist_ok=True)

plot_filtering_effect()

The variables of interest are then computed on the LES-like filtered field, with different methods that are identifiable by the root "compute". In order, we are computing the strain rate, the residual dissipation rate, the residual kinetic energy (necessary for the mixing timescale), the chemical and mixing timescale, the progress variable, its gradient and Laplacian.

# compute the strain rate on the filtered field
filtered_field.compute_strain_rate(save_tensor=True)

# compute the residual dissipation rate with
# Smagorinsky model
filtered_field.compute_residual_dissipation_rate(mode='Smag')

# compute residual kinetic energy
filtered_field.compute_residual_kinetic_energy()
# compute chemical timescale with SFR, FFR and
# Chomiak model
filtered_field.compute_chemical_timescale(mode
    ='SFR', replace_nonreacting='max')
filtered_field.fuel = 'H2'
filtered_field.ox = 'O2'
filtered_field.compute_chemical_timescale(mode
    ='Ch')
filtered_field.compute_mixing_timescale(mode='
    Kolmo')

# compute progress variable, its gradient, and
# the Laplacian
filtered_field.compute_progress_variable('H2O'
    )
filtered_field.compute_gradient_C()
filtered_field.compute_laplacian_C()

Once the derived variables are computed, the Field object can identify them as attributes, and they can be accessed by secondary classes. In the following script, we leverage the TrainingBuilder class, part of the NN module, which takes as input an object of the Field class and builds the tensor containing the input data for the neural network. This script extracts the mid-plane to speedup the training process for reproducibility purposes, then initializes a TrainingBuilder object to extract and scale the requested variables, and finally transfers the training data in a pytorch-compatible format. The script can also be run using the entire dataset (not only the mid-plane) by setting the flag use_midplane to False.

use_midplane = True
train_size = 0.5
seed = 42
use_gpu = True

# Extract only the field midplane if requested
if use_midplane:
    filtered_field = ap.Field(filtered_field.
        cut([0, 0, 100],exist_ok=True))

# Process the data for the neural network
from aPriori.NN import TrainingBuilder
from architectures import select_device,
    prepare_training_data

# Initialize the scaler
scaler = TrainingBuilder()
scaler.add('C')
scaler.add('C_grad', mode='minmax')
scaler.add('C_laplacian', mode='minmax')
scaler.add('Tau_c_SFR', modulus=True, vmax=1
    e10, vmin=0, log=True)
scaler.add('Tau_m_Kolmo', modulus=True, log=
    True, vmin=1e-6)
scaler.fit(filtered_field)

# Build the training vector X and the reaction
# rates to use in the loss function
X = scaler.build_x(filtered_field)
HRR_LFR = filtered_field.HRR_LFR.
    reshape_column()
HRR_DNS = filtered_field.HRR_DNS.
    reshape_column()

# Save Scaler. This option is useful when
# testing on different datasets
scaler.save(os.path.join(tmp_data_folder, '
    scaler.json'))

# Select the device to use (GPU)
device = select_device(cuda_device_id=0)
# Split the data between training and test,
# transfer in pytorch format
data = prepare_training_data(
    X, HRR_DNS, HRR_LFR,
    train_size=train_size,
    random_state=seed,
    device=device)

The data processing done in the previous sections allows to use the data dictionary to train a neural network model using pytorch. The following section instantiates the network and uses a separately defined method for training. The loss function behaviour during the training epochs is plotted in Figure 7.c.

from architectures import FCNN,
    plot_training_loss
import torch

# Define hyperparameters
input_dim = X.shape[1]
n_layers = 5    # number of inner layers
tr_layers = 2  # transition layers
n_neurons = 64  # neurons in the inner layers
output_dim = 1
alpha = 0.0    # sparsity-promoting
    regularization
epochs = 500
lr = 1e-3       # learning rate
batch_size = 500000

model = FCNN(
    input_dim,
    n_layers,
    n_neurons,
    output_dim,
    tr_layers=tr_layers)

# Initialize model for reproducibility
model._initialize_weights(seed)

model.fit(data,
    epochs=epochs,
    alpha=alpha,
    batch_size=batch_size
    )

plot_training_loss(
    model,
    log_scale=True,
    save_path=os.path.join(tmp_data_folder, '
        loss.png'))

Finally, the model can be tested on the whole dataset. The model outputs are saved as files, and added as dynamic attributes with the add_attribute function. This operation can be repeated considering different values of the regularization term α\alpha. The results in Figure 7.d illustrate with parity plots the neural network model calibration, comparing with the physics-based approach. Figure 7.e highlights the effect of the sparsity regularization, which for small values is able to reduce the activation of the deep-learning model limiting its effectiveness to the flame region, while for higher values of α\alpha the regularization term tends to overcome the NMSE loss, leading to an over-regularization of the model.

# Test on the whole dataset
model = model.to('cpu')
with torch.no_grad():
    gamma = model.forward(torch.tensor(X,dtype
    =torch.float32)).numpy()
HRR_FCNN = gamma*HRR_LFR

# Save output to read them as variables
gamma_path = 'gamma_fcnn_a{}_id000.dat'
gamma_attr = 'gamma_fcnn_a{}'
ap.save_file(gamma, os.path.join(
    filtered_field.data_path, gamma_path.
    format(0)))

# Update field to read
ap.add_variable(gamma_attr.format(0),
    gamma_path.format(0))
filtered_field.update()

torch.save(model, os.path.join(tmp_data_folder
    , f'model_a0.pth'))

Computational Singular Perturbation (CSP) analysis

The present section shows two main functionalities resulting from the coupling between the aPriori and the PyCSP [27] packages. The main functionalities included in the current version of the library are the computation of the Tangential Stretching Rate (TSR), and the Amplitude Participation Indexes (APIs). The section is divided in three sub-sections, which briefly describe the theory behind the TSR, APIs, and a code example to compute these values with aPriori, respectively. The PyCSP software is described more in detail in [27], and for a deeper discussion of the CSP, TSR, and APIs theory, the reader is referred to previous research work [39, 40, 41].

Tangential stretching rate (TSR)

The tangential stretching rate provides a quantitative measure of the rate at which neighbouring trajectories of the dynamical system stretch or contract along the direction of the vector field. Given the homogeneous system

dzdt=g(z),(16)\frac{d z}{d t} = g(z), \tag*{(16)}

the evolution of an infinitesimal line element v(t)\mathbf{v}(t) joining two nearby trajectories is governed by the linear variational equation

dvdt=Jg(z) v,(17)\frac{d \mathbf{v}}{d t} = J_g(z)\,\mathbf{v}, \tag*{(17)}

where JgJ_g is the Jacobian of the vector field. The instantaneous stretching rate along the direction of a unit vector u~=v/∥v∥\tilde{\mathbf{u}} = \mathbf{v}/\lVert\mathbf{v}\rVert is given by the quadratic form

ωu~=u~⋅Jg⋅u~.(18)\omega_{\tilde{u}} = \tilde{\mathbf{u}}\cdot J_g\cdot\tilde{\mathbf{u}}. \tag*{(18)}

To characterize the stretching induced by the dynamics itself, the direction u~\tilde{\mathbf{u}} is chosen to be tangent to the vector field,

τ~=g(z)∥g(z)∥,(19)\tilde{\boldsymbol{\tau}} = \frac{g(z)}{\lVert g(z)\rVert}, \tag*{(19)}

leading to the definition of the tangential stretching rate:

ωτ~=τ~⋅Jg⋅τ~.(20)\omega_{\tilde{\tau}} = \tilde{\boldsymbol{\tau}}\cdot J_g\cdot\tilde{\boldsymbol{\tau}}. \tag*{(20)}

Expanding the vector field in the CSP eigenbasis,

g=∑i=1Naifi,(21)g = \sum_{i=1}^{N} a_i f_i, \tag*{(21)}

and recalling that Jg=AΛBJ_g = A\Lambda B in this basis, the TSR admits the modal representation

ωτ~=∑i=1NWiλi,(22)\omega_{\tilde{\tau}} = \sum_{i=1}^{N} W_i\lambda_i, \tag*{(22)}

where λi\lambda_i is the eigenvalue associated with the iith mode and

Wi=fi∥g∥(τ~⋅ai)(23)W_i = \frac{f_i}{\lVert g\rVert}\left(\tilde{\boldsymbol{\tau}}\cdot a_i\right) \tag*{(23)}

is a weight that quantifies the contribution of that mode. The TSR is thus a weighted average of the eigenvalues of JgJ_g, combining three ingredients: (i) the magnitude and sign of λi\lambda_i, (ii) the amplitude fi=bi⋅gf_i = b_i\cdot g of each mode, (iii) its degree of alignment with the tangent vector field. The TSR identifies the characteristic chemical time scale as

τchem=∣1ωτ~∣,(24)\tau_{\mathrm{chem}} = \left|\frac{1}{\omega_{\tilde{\tau}}}\right|, \tag*{(24)}

which may be used to define Damköhler numbers or to detect explosive (ωτ~>0\omega_{\tilde{\tau}} > 0) versus dissipative (ωτ~<0\omega_{\tilde{\tau}} < 0) regions of the flow. The TSR also induces a natural decomposition of the tangent space into fast, active, and slow subspaces, reflecting which modes contribute most strongly to the stretching dynamics [40].

Amplitude Participation Indexes (APIs)

The Amplitude Participation Index (API) quantifies the contribution of each physical process (reaction or transport term) to the amplitude of a CSP mode. For systems with transport and chemistry, the modal amplitudes are defined as

hi=bi⋅(L(z)+g(z)),(25)h_i = b_i \cdot\left(L(z) + g(z)\right), \tag*{(25)}

where L(z)L(z) contains convective and diffusive operators and g(z)g(z) the chemical source term. Expanding hih_i into contributions from individual processes,

hi=∑l=1Nprocβi(l),(26)h_i = \sum_{l=1}^{N_{\mathrm{proc}}} \beta_i^{(l)}, \tag*{(26)}

where each βi(l)\beta_i^{(l)} corresponds to either a specific transport term or a specific chemical reaction, the API is defined as

Pi(l)=βi(l)∑j=1Nproc∣βi(j)∣.(27)P_i^{(l)} = \frac{\beta_i^{(l)}}{\sum_{j=1}^{N_{\mathrm{proc}}} \left|\beta_i^{(j)}\right|}. \tag*{(27)}

By construction,

∑l=1Nproc∣Pi(l)∣=1.\sum_{l=1}^{N_{\mathrm{proc}}} \left|P_i^{(l)}\right| = 1.

The API identifies which processes dominate the behaviour of each mode. For exhausted fast modes (hr≈0h_r \approx0), large values of Pr(l)P_r^{(l)} reveal the processes that enforce the local equilibrium condition expressed by hr=0h_r = 0. For slow active modes, the APIs provide insight into which reactions or transport mechanisms govern the slow evolution of the state vector.

APIs form the basis for cause–effect analysis within CSP: they allow one to associate specific physical processes with specific modal functions, enabling identification of the mechanisms responsible for slow dynamics, equilibration, ignition, extinction, or transport–kinetics balance. They also serve as building blocks for higher-level participation indices, such as TSR-PIs or entropy-based indicators [41].

CSP example

The following example illustrates how the aPriori package can be used to perform a local CSP analysis on a three–dimensional DNS dataset of a lifted H2_2 jet flame. The script below loads the DNS field, computes CSP quantities including the Tangential Stretching Rate (TSR) and the Amplitude Participation Indexes (APIs), and produces a set of post–processing visualizations.

import aPriori as ap
import os

figures_folder = ’figures_csp’

# Load DNS dataset (PyCSP-compatible HDF5
  structure)
dns_field = ap.Field(’
  DNS_H2_lifted_csp_subdomain’)

# Compute CSP quantities on the full 3D field
dns_field.compute_csp(
    API_species=[’H2O’, ’OH’],
    n_chunks=100,
)

os.makedirs(figures_folder, exist_ok=True)

# Plot modal participation in the TSR
dns_field.plot_api(
    api_type=’TSR’,
    n=10,
    n_cols=5,
    cmap=’RdGy_r’,
    vmin=-1, vmax=1,
    save_path=os.path.join(figures_folder, ’
    api_tsr.png’)
)

# Plot API for OH production/consumption
dns_field.plot_api(
    api_type=’OH’,
    n=10,
    n_cols=5,
    cmap=’RdGy_r’,
    vmin=-1, vmax=1,
    save_path=os.path.join(figures_folder, ’
    api_oh.png’)
)

# Mid-plane map of the TSR field
dns_field.plot_z_midplane(
    ’TSR_DNS’,
    colormap=’gist_heat’,
    transpose=True,
    remove_text=True,
    cbar_title=’TSR [$s^{-1}$]’,
    vmax=0,
    transparent=False,
    save_path=os.path.join(figures_folder, ’
    TSR.png’)
)

# Mid-plane map of the OH mass fraction
dns_field.plot_z_midplane(
    ’YOH’,
    colormap=’gist_heat_r’,
    transpose=True,
    remove_text=True,
    cbar_title=r’$Y_{OH}$ [$-$]’,
    save_path=os.path.join(figures_folder, ’
    YOH.png’)
)

Figure 8 summarizes the outcome of the CSP analysis applied to the lifted H2_2 jet flame. Figure 8a reports the spatial distribution of the negative Tangential Stretching Rate (TSR) values, while Figure 8b highlights only its positive values, which identify regions where the local chemical dynamics is explosive. These regions are spatially confined and closely aligned with the flame front, indicating that positive TSR values only arise where chain-branching chemistry overcomes dissipative relaxation.

Illustration of CSP post-processing applied to the lifted H$_2$ jet flame

Figure 8. Illustration of CSP post-processing applied to the lifted H2_2 jet flame: (a) TSR field on the mid-plane, clipped on the negative values; (b) TSR field on the mid-plane, clipped on the positive values; (c) TSR amplitude participation indexes for ten dominant reactions; (d) OH mass fraction; (e) temperature; (f) OH-related amplitude participation indexes.

The APIs contributing to the TSR are shown in Figure 8c for the ten most relevant reactions, which relative importance is selected based on the ℓ1\ell^{1} norm of its associated API computed on the whole domain. The dominant contribution in regions of high positive TSR is associated with the chain-branching step

H+O2⇌O+OH\mathrm{H} + \mathrm{O}_2 \rightleftharpoons\mathrm{O} + \mathrm{OH}

which is known to control the explosive growth of radical pools in hydrogen oxidation. This reaction exhibits strong positive participation precisely in the regions where TSR is positive, confirming its leading role in setting the most energetic chemical timescale.

A second set of reactions involves pathways associated with the HO2_2 chemistry, but their roles are markedly different. The reaction

H+O2(+M)⇌HO2(+M)\mathrm{H} + \mathrm{O}_2 (+\mathrm{M}) \rightleftharpoons\mathrm{HO}_2 (+\mathrm{M})

exhibits significant participation in regions adjacent to the flame front, where H radicals and molecular oxygen coexist. Its activity extends into the preheat layer, reflecting its role in regulating radical pool formation under conditions where chain branching is not yet dominant. In contrast, the reverse reaction

H+HO2⇌H2+O2\mathrm{H} + \mathrm{HO}_2 \rightleftharpoons\mathrm{H}_2 + \mathrm{O}_2

is found to contribute primarily in regions characterized by weak or absent heat release, upstream of the main reaction zone. There, it acts as a radical recombination pathway in partially mixed or chemically frozen regions, where H2_2 and O2_2 are not well mixed yet and radicals are almost absent. Accordingly, while (Rb-10) displays a large amplitude participation index, its contribution is largely decoupled from the explosive dynamics identified by positive TSR values.

We can identify a third group of chain-propagation and termination reactions, such as (Rf-3) H2+OH⇌H+H2O\mathrm{H}_2 + \mathrm{OH} \rightleftharpoons\mathrm{H} + \mathrm{H}_2\mathrm{O}, and (Rf-8) H+OH+M⇌H2O+M\mathrm{H} + \mathrm{OH} + \mathrm{M} \rightleftharpoons\mathrm{H}_2\mathrm{O} + \mathrm{M}, which show weaker and more diffuse participation. Their role is primarily dissipative, contributing to the relaxation toward the slow manifold once the radical pool has been established. Notably, (Rf-8) exhibits a clear correlation with the high temperature region (Figure 8.e), consistent with its role as a three-body recombination process that becomes active during thermal relaxation and radical quenching.

Figure 8.d reports the OH mass fraction, while Figure 8.e shows the temperature field. Both quantities peak in the same region where the TSR exhibits its largest magnitude, confirming the strong coupling between radical production, heat release, and the emergence of fast chemical time scales.

Finally, Figure 8.f shows the APIs associated with the OH source term. In this case, the dominant contributions arise from reactions directly producing or consuming OH, most notably the chain-branching step (Rf-1) and the propagation reaction (Rf-3) assume slightly higher APIs in the preheating zone compared to the TSR-based APIs. Notably, also the relative importance of (Rf-11) increases. Compared to the TSR-based APIs, the OH APIs are more spatially localized and closely follow the thin reaction layer, highlighting the distinction between reactions governing a determined species evolution and those controlling in general the fast modes of the system.

Overall, this example demonstrates how CSP-based indicators provided by aPriori allow one to (i) identify explosive versus dissipative regions via the TSR, (ii) isolate the chemical pathways responsible for the most energetic time scales, and (iii) distinguish between reactions controlling a selected species production and those governing thermochemical relaxation. While this example used a relatively simple and well known system, this functionality can be leveraged in various scenarios, including detailed analysis of pollutants or greenhouse gases formation pathways in complex combustion simulations. These results stem from the interaction between two community-driven, open-source software projects, illustrating how coordinated and openly shared development efforts can facilitate the practical adoption of advanced analysis techniques while reducing implementation overhead.

Conclusions and future development

The aPriori package addresses a critical gap in the post-processing of direct numerical simulation data by offering a lightweight, memory-efficient, and modular Python-based solution. By leveraging a pointer-based data access strategy, the software reduces memory consumption at the cost of reading the file each time its content is accessed; the reading time is shown to be in the order of seconds for hundred millions of grid points. This trade-off enables the processing of large-scale simulations without the need for high-performance computing infrastructure, thus significantly broadening access to DNS data.

This initiative bridges a longstanding gap between traditional CFD solvers—typically written in low-level languages such as C++ or Fortran—and modern data-driven workflows that rely heavily on Python-based machine learning and statistics libraries. By doing so, aPriori facilitates a smoother transition from raw simulation data to advanced modeling and analysis pipelines, enabling new synergies between high-fidelity physics and data-driven approaches. Additionally, the implementation of data chunking enables memory-safe evaluations of complex thermochemical expressions, a crucial feature for combustion applications involving detailed chemistry, such as source term reconstruction and Computational Singular Perturbation (CSP) analyses.

aPriori also contributes to the broader research ecosystem. By providing a standardized, open-source toolkit to process complex and heterogeneous DNS datasets, the package encourages data reuse and reproducibility, facilitating data sharing across institutions. In particular, its compatibility with the BLASTNet platform enhances the usability of publicly available datasets and reduces the need for redundant, resource-intensive simulations. Additionally, the Python interface ensures seamless integration with a wide variety of scientific libraries—including Cantera, Matplotlib, and PyVista—promoting interoperability and ease of adoption.

Several development paths can further enhance the capabilities of the library. These include the implementation of more diverse and flexible gradient computation schemes, the addition of 3D visualization utilities, and support for more abstract data types such as vectors and tensors to enhance the software’s modularity. Finally, the authors would like to stress that, as an open-source project, aPriori is designed to evolve with the needs of the community. Its design invites contributions and encourages a user-driven roadmap, aiming, with cooperation within the community, to become a reference tool for the post-processing of direct numerical simulations.

References

  1. [1]P. Moin, K. Mahesh, Direct numerical simulation: a tool in turbulence research, Annual review of fluid mechanics 30 (1) (1998) 539–578.DOI
  2. [2]S. B. Pope, Turbulent Flows, Cambridge University Press, Cambridge, England, 2012.
  3. [3]T. Poinsot, D. Veynante, Theoretical and Numerical Combustion, Vol. 28, R.T. Edwards, Inc., Philadelphia, PA, USA, 2005.
  4. [4]X. Yang, W. Zhang, M. Abkar, W. Anderson, Computational fluid dynamics: Its carbon foot-print and role in carbon reduction, Journal of Renewable and Sustainable Energy 16 (5) (Sep. 2024). doi:10.1063/5.0217320. URL http://dx.doi.org/10.1063/5.0217320
  5. [5]Y. Li, E. Perlman, M. Wan, Y. Yang, C. Meneveau, R. Burns, S. Chen, A. Szalay, G. Eyink, A public turbulence database cluster and applications to study lagrangian evolution of velocity increments in turbulence, Journal of Turbulence 9 (2008) N31. doi:10.1080/14685240802376389. URL http://dx.doi.org/10.1080/14685240802376389
  6. [6]W. T. Chung, M. Ihme, K. S. Jung, J. H. Chen, J. Guo, D. Brouzet, M. Talei, B. Jiang, B. Savard, A. Y. Poludnenko, B. Akoush, P. Sharma, A. Tamkin, Blastnet simulation dataset, uRL: https://blastnet.github.io/ (Jun. 2023). doi:10.5281/zenodo.8034232. URL https://doi.org/10.5281/zenodo.8034232
  7. [7]W. T. Chung, K. S. Jung, J. Chen, M. Ihme, The bearable lightness of big data: Towards massive public datasets in scientific machine learning, in: ICML 2022 2nd AI for Science Workshop, 2022. URL https://openreview.net/forum?id=LxGZtM7L6qnarxiv.org/abs/2207.12546
  8. [8]W. T. Chung, B. Akoush, P. Sharma, A. Tamkin, K. S. Jung, J. H. Chen, J. Guo, D. Brouzet, M. Talei, B. Savard, A. Y. Poludnenko, M. Ihme, Turbulence in focus: Benchmarking scaling behavior of 3D volumetric super-resolution with BLASTNet 2.0 data, Advances in Neural Information Processing Systems (NeurIPS) 36 (2023).arxiv.org/abs/2309.13457
  9. [9]W. T. Chung, K. S. Jung, J. H. Chen, M. Ihme, Blastnet: A call for community-involved big data in combustion machine learning, Applications in Energy and Combustion Science 12 (2022) 100087. doi:https://doi.org/10.1016/j.jaecs.2022.100087. URL https://www.sciencedirect.com/science/article/pii/S2666352X22000309
  10. [10]W. T. Chung, A. A. Mishra, M. Ihme, Interpretable data-driven methods for subgrid-scale closure in les for transcritical lox/gch4 combustion, Combustion and Flame 239 (2022) 111758. doi:10.1016/j.combustflame.2021.111758. URL http://dx.doi.org/10.1016/j.combustflame.2021.111758
  11. [11]D. Donzis, P. Yeung, Resolution effects and scaling in numerical simulations of passive scalar mixing in turbulence, Physica D: Non-linear Phenomena 239 (14) (2010) 1278–1287. doi:10.1016/j.physd.2009.09.024. URL http://dx.doi.org/10.1016/j.physd.2009.09.024
  12. [12]R. J. Samuel, M. Bode, J. D. Scheel, K. R. Sreenivasan, J. Schumacher, No sustained mean velocity in the boundary region of plane thermal convection, Journal of Fluid Mechanics 996 (Oct. 2024). doi:10.1017/jfm.2024.853. URL http://dx.doi.org/10.1017/jfm.2024.853
  13. [13]D. Brouzet, M. Talei, M. Brear, B. Cuenot, The impact of chemical modelling on turbulent premixed flame acoustics, Journal of Fluid Mechanics 915 (2021). doi:10.1017/jfm.2020.1184.DOI
  14. [14]V. Coulon, J. Gaucherand, V. Xing, D. Laera, C. Lapeyre, T. Poiṅsot, Direct numerical simulations of methane, ammonia-hydrogen and hydrogen turbulent premixed flames, Combustion and Flame 256 (2023) 112933. doi:10.1016/j.combustflame.2023.112933. URL http://dx.doi.org/10.1016/j.combustflame.2023.112933
  15. [15]K. S. Jung, S. O. Kim, T. Lu, J. H. Chen, C. S. Yoo, On the flame stabilization of turbulent lifted hydrogen jet flames in heated coflows near the autoignition limit: A comparative dns study, Combustion and Flame 233 (2021) 111584. doi:10.1016/j.combustflame.2021.111584. URL http://dx.doi.org/10.1016/j. combustflame.2021.111584
  16. [16]N. Swaminathan, A. Parente, Machine Learning and Its Application to Reacting Flows: ML and Combustion, Springer Nature, 2023.DOI
  17. [17]M. Ihme, W. T. Chung, A. A. Mishra, Combustion machine learning: Principles, progress and prospects, Prog. Energy Combust. Sci. 91 (101010) (2022) 101010.DOI
  18. [18]M. Bode, M. Gauding, Z. Lian, D. Denker, M. Davidovic, K. Kleinheinz, J. Jitsev, H. Pitsch, Using physics-informed super-resolution generative adversarial networks for subgrid modeling in turbulent reactive flows (2019).arxiv.org/abs/1911.11380
  19. [19]M. Bode, M. Gauding, Z. Lian, D. Denker, M. Davidovic, K. Kleinheinz, J. Jitsev, H. Pitsch, Using physics-informed enhanced super-resolution generative adversarial networks for subfilter modeling in turbulent reactive flows, Proc. Combust. Inst. 38 (2) (2021) 2617–2625.DOI
  20. [20]L. Nista, C. D. K. Schumann, T. Grenga, A. Attili, H. Pitsch, Investigation of the generalization capability of a generative adversarial network for large eddy simulation of turbulent premixed reacting flows, Proc. Combust. Inst. 39 (4) (2023) 5279–5288.
  21. [21]M. T. Henry de Frahan, S. Yellapantula, R. King, M. S. Day, R. W. Grout, Deep learning for presumed probability density function models, Combust. Flame 208 (2019) 436–450. doi:10.1016/j.combustflame.2019.07.015.DOI
  22. [22]L. Piu, A. Péquin, R. S. M. Freitas, S. Iavarone, H. Pitsch, A. Parente, A data-driven approach to refine the partially stirred reactor closure for turbulent premixed flames, Flow, Turbulence and Combustion (Jan. 2025). doi:10.1007/s10494-024-00626-3. URL http://dx.doi.org/10.1007/ s10494-024-00626-3
  23. [23]L. Deng, The mnist database of handwritten digit images for machine learning research [best of the web], IEEE Signal Processing Magazine 29 (6) (2012) 141–142. doi:10.1109/msp.2012.2211477. URL http://dx.doi.org/10.1109/ MSP.2012.2211477
  24. [24]A. Krizhevsky, Learning multiple layers of features from tiny images, 2009. URL https://api.semanticscholar. org/CorpusID:18268744
  25. [25]J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, L. Fei-Fei, Imagenet: A large-scale hierarchical image database, in: 2009 IEEE Conference on Computer Vision and Pattern Recognition, 2009, pp. 248–255. doi:10.1109/CVPR.2009.5206848.DOI
  26. [26]D. G. Goodwin, H. K. Moffat, L. Schoegl, R. L. Speth, B. W. Weber, Cantera: An object-oriented software toolkit for chemical kinetics, thermodynamics, and transport processes, https://www.cantera.org, version 3.0.0 (2023). doi:10.5281/zenodo.8137090.
  27. [27]R. Malpica Galassi, Pycsp: A python package for the analysis and simplification of chemically reacting systems based on computational singular perturbation, Computer Physics Communications 276 (2022) 108364. doi:https://doi.org/10.1016/j.cpc.2022.108364. URL https://www.sciencedirect. com/science/article/pii/ S0010465522000832
  28. [28]A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, S. Chintala, Pytorch: An imperative style, high-performance deep learning library, in: H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. Fox, R. Garnett (Eds.), Advances in Neural Information Processing Systems, Vol. 32, Curran Associates, Inc., 2019. URL https://proceedings.neurips. cc/paper_files/paper/2019/file/ bdcca28ffe7f92fbfa9f7012727740-Paper. pdfarxiv.org/abs/1912.01703
  29. [29]M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. M., R. M. S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, X. Zheng, TensorFlow: Large-scale machine learning on heterogeneous systems, software available from tensorflow.org (2015). URL https://www.tensorflow.org/arxiv.org/abs/1603.04467
  30. [30]J. D. Hunter, Matplotlib: A 2d graphics environment, Computing in Science & Engineering 9 (3) (2007) 90–95. doi:10.1109/MCSE.2007.55.DOI
  31. [31]C. B. Sullivan, A. A. Kaszynski, Pyvista: 3d plotting and mesh analysis through a streamlined interface for the visualization toolkit (vtk), Journal of Open Source Software 4 (37) (2019) 1450. doi:10.21105/joss.01450. URL https://doi.org/10.21105/joss.01450
  32. [32]Python package index - pypi. URL https://pypi.org/
  33. [33]M. Baer, findiff software package, https://github.com/maroba/findiff (2018). URL https://github.com/maroba/findiff
  34. [34]Sphinx Development Team, Sphinx 4.0.0+ documentation (Jun. 2020). URL https://www.sphinx-doc.org/en/master/
  35. [35]C. S. Yoo, R. Sankaran, J. H. Chen, Three-dimensional direct numerical simulation of a turbulent lifted hydrogen jet flame in heated coflow: flame stabilization and structure, Journal of Fluid Mechanics 640 (2009) 453–481. doi:10.1017/S0022112009991388.DOI
  36. [36]M. Gauding, F. Thiesset, E. Varea, L. Danaila, Structure of iso-scalar sets, Journal of Fluid Mechanics 942 (2022) A14. doi:10.1017/jfm.2022.367.DOI
  37. [37]S. B. Pope, Ten questions concerning the large-eddy simulation of turbulent flows, New J. Phys. 6 (2004) 35–35.DOI
  38. [38]Q. Malé, C. J. Lapeyre, N. Noiray, Hydrogen reaction rate modeling based on convolutional neural network for large eddy simulation, Data-Centric Engineering 6 (2025) e11. doi:10.1017/dce.2025.1.DOI
  39. [39]S. Lam, D. Goussis, Understanding complex chemical kinetics with computational singular perturbation, Symposium (International) on Combustion 22 (1) (1989) 931–941. doi:https://doi.org/10.1016/S0082-0784(89)80102-X. URL https://www.sciencedirect.com/science/article/pii/S008207848980102X
  40. [40]M. Valorani, S. Paolucci, E. Martelli, T. Grenga, P. P. Ciottioli, Dynamical system analysis of ignition phenomena using the tangential stretching rate concept, Combustion and Flame 162 (8) (2015) 2963–2990. doi:https://doi.org/10.1016/j.combustflame.2015.05.015. URL https://www.sciencedirect.com/science/article/pii/S0010218015001534
  41. [41]M. Valorani, F. Creta, P. P. Ciottioli, R. Malpica Galassi, D. A. Goussis, H. N. Najm, S. Paolucci, H. G. Im, E.-A. Tingas, D. M. Manias, A. Parente, Z. Li, T. Grenga, Computational Singular Perturbation Method and Tangential Stretching Rate Analysis of Large Scale Simulations of Reactive Flows: Feature Tracking, Time Scale Characterization, and Cause/Effect Identification. Part 1, Basic Concepts, Springer International Publishing, Cham, 2020, pp. 43–64.DOI

Paper details

vlnc:W_2vw7xtta
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents