DOI: 10.18419/darus-5519
title: Replication Data for: Super-resolution reconstruction of scalar fields from the pyrolysis of pulverised biomass using deep learning

description: &lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
 &lt;meta charset="utf-8"/&gt;
 &lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;
 &lt;title&gt;README&lt;/title&gt;
 &lt;style&gt;
 body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; padding: 1rem; max-width: 900px; margin: auto; }
 code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
 pre { background: #f6f8fa; padding: 0.75rem; overflow: auto; border-radius: 6px; }
 table { border-collapse: collapse; margin: 1rem 0; width: 100%; }
 th, td { border: 1px solid #ddd; padding: 0.5rem; text-align: left; }
 thead th { background: #fafbfc; }
 h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
 &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Repository for publication: A. Shamooni et al., Super-resolution reconstruction of scalar fields from the pyrolysis of pulverised biomass using deep learning, Proc. Combust. Inst. (2025)&lt;/h1&gt;
&lt;h1&gt;Containing&lt;/h1&gt;
&lt;h2&gt;torch_code&lt;/h2&gt;
&lt;p&gt;
The main Pytorch source code used for training/testing is provided in &lt;em&gt;torch_code.tar.gz&lt;/em&gt; file. &lt;br/&gt;
&lt;/p&gt;
&lt;h2&gt;torch_code_tradGAN&lt;/h2&gt;
&lt;p&gt;
To compare with traditional GAN, we use the code in torch_code_tradGAN with similar particle-laden datasets. The source code is &lt;em&gt;torch_code_tradGAN.tar.gz&lt;/em&gt; file.&lt;br/&gt;
&lt;/p&gt;
&lt;h2&gt;datasets&lt;/h2&gt;
&lt;p&gt;
The training/validation/testing datasets have been provided in lmdb format which is ready to use in the code. The datasets in &lt;em&gt;datasets.tar.gz&lt;/em&gt; contain:&lt;br/&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Training dataset:&lt;/p&gt;
&lt;p&gt;data_train_OF-mass_kinematics_mk0x_1x_2x_FHIT_particle_128_Re52-2D_20736_lmdb.lmdb &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test dataset:&lt;/p&gt;
&lt;p&gt;data_valid_inSample_OF-mass_kinematics_mk0x_1x_2x_FHIT_particle_128_Re52-2D_3456_lmdb.lmdb &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that the samples from 9 DNS cases are collected in order (each case 2304 samples for training and 384 samples for testing) which can be recognized using the provided metadata file in each folder. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Out of distribution test datasets: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Out of distribution test dataset (used in Fig 10 of the paper):&lt;/p&gt;
&lt;p&gt;data_valid_inSample_OF-mass_kinematics_mk3x_FHIT_particle_128_Re52-2D_nonUniform_1024_lmdb.lmdb |&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We have two separate OOD DNS cases and from each we select 512 samples. &lt;/p&gt;
&lt;h2 id="experiments"&gt;experiments&lt;/h2&gt;
&lt;p&gt;The main trained models are provided in &lt;em&gt;experiments.tar.gz&lt;/em&gt; file. Each experiment contains the log file of the training, the last training state (for restart) and the model wights used in the publication. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Trained model using the main dataset (used in Figs 2-10 of the paper):&lt;/p&gt;
&lt;p&gt;h_oldOrder_mk_700-11-c_PFT_Inp4TrZk_outTrZ_RRDBNetCBAM-4Prt_DcondPrtWav_f128g64b16_BS16x4_LrG45D5_DS-mk012-20k_LStandLog&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To compare with traditional GAN, we use the code in torch_code_tradGAN with similar particle-laden datasets as above. The training consists of one pre-training step and two separate fine-tuning. One fine-tuning with the loss weights from the litreature and one fine-tuning with tuned loss weights. The final results are in experiments/trad_GAN/experiments/&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pre-trained traditional GAN model (used in Figs 8-9 of the paper):&lt;/p&gt;
&lt;p&gt;train_RRDB_SRx4_particle_PSNR &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fine-tuned traditional GAN model with loss weights from lit. (used in Figs 8-9 of the paper) &lt;/p&gt;
&lt;p&gt;train_ESRGAN_SRx4_particle_Nista_oneBlock &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fine-tuned traditional GAN model with optimized loss weights (used in Figs 8-9 of the paper) &lt;/p&gt;
&lt;p&gt;train_ESRGAN_SRx4_particle_oneBlock_betaA &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="inference_notebooks"&gt;inference_notebooks&lt;/h2&gt;
&lt;p&gt;The inference_notebooks folder contains example notebooks to do inference. The folder contains &quot;torch_code_inference&quot; and &quot;torch_code_tradGAN_inference&quot;. The &quot;torch_code_inference&quot; is the inference of main trained model. The &quot;torch_code_tradGAN_inference&quot; is the inference for traditional GAN approach. 
Move the inference folders in each of these folders into the corresponding torch_code roots. Also create softlinks of datasets and experiments in the main torch_code roots. Note that in each notebook you must double check the required paths to make sure they are set correctly. &lt;/p&gt;
&lt;/p&gt;
&lt;h1&gt;How to&lt;/h1&gt;
&lt;h2&gt;Build the environment&lt;/h2&gt;
&lt;p&gt;
To build the environment required for the training and inference you need Anaconda. Go to the torch_code folder and &lt;br/&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;
conda env create -f environment.yml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Then create ipython kernel for post processing, &lt;br/&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;
conda activate torch_22_2025_Shamooni_PCI

python -m ipykernel install --user --name ipyk_torch_22_2025_Shamooni_PCI --display-name &quot;ipython kernel for post processing of PCI2025&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Perform training&lt;/h2&gt;
&lt;p&gt;
It is suggested to create softlinks to the dataset folder directly in the torch_code folder:&lt;br/&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;
cd torch_code 
ln -s &lt;path to the dataset folder&gt; datasets 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
You can also simply move the datasets and inference forlders in the torch_code folder beside the cfd_sr folder and other files. &lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
In general, we prefer to have a root structure as below:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
root files and directories:&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
cfd_sr&lt;br/&gt;
datasets&lt;br/&gt;
experiments&lt;br/&gt;
inference&lt;br/&gt;
options&lt;br/&gt;
__init__.py&lt;br/&gt;
test.py&lt;br/&gt;
train.py &lt;br/&gt;
version.py&lt;br/&gt;
&lt;/p&gt;
&lt;p&gt;
Then activate the conda environment &lt;br/&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;
conda activate torch_22_2025_Shamooni_PCI
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
An example script to run on single node with 2 GPUs:&lt;br/&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;
torchrun --standalone --nnodes=1 --nproc_per_node=2 train.py -opt options/train/condSRGAN/use_h_mk_700-011_PFT.yml --launcher pytorch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;em&gt;Make sure that the paths to datasets &quot;dataroot_gt&quot; and &quot;meta_info_file&quot; for both training and validation data in option files are set correctly.&lt;/em&gt; &lt;br/&gt;
&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;