Skip to main content

Documentation Index

Fetch the complete documentation index at: https://compflowlab.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Inputs

1. Command-Line Arguments

CompFlowLab requires two inputs when executed from the command line:
  • Working directory
    Directory where all simulation outputs will be stored. It is recommended to use the test case folder.
  • Input file (.inp)
    A configuration file that defines the simulation setup, including physical parameters, numerical settings, and ROM options.
Example of Sod Shock Tube:
python -O ./compflowlab.py ./examples/sod_shock_tube ./examples/sod_shock_tube/input_file.inp

2. Input File Structure

The .inp file contains all parameters required to run a simulation. It is organized into logical sections, each controlling a specific part of the simulation. This section provides a complete reference for all parameters available in the CompFlowLab input file. Parameters are grouped by section and include type, allowed values, and descriptions. Solver
ParameterTypeDescriptionAllowed Values
solver_modestrMain solverFOM, PROM, AROM, QROM, NLROM
  • FOM: full order model
  • PROM: linear projection ROM
  • AROM: adaptive ROM
  • QROM: quadratic ROM
  • NLROM: non-linear ROM
Time Integration
ParameterTypeDescriptionAllowed Values
dtfloatPhysical time step>0 (ex: 1e-6)
num_stepsintNumber of time steps>0 (ex: 3000)
time_schemestrTime integration schemeFDF, SSPRK2, SSPRK3, BDF
  • FDF: Forward Difference Euler - Explicit
  • SSPRK2: Strong Stability Preserv. RK2 – Explicit
  • SSPRK3: Strong Stability Preserv. RK3 – Explicit
  • BDF: Backward Difference Euler – Implicit
The BDF method uses finite differences to compute the Jacobian in reacting flow cases, which might make it very stiff and hard to converge if the time step is too large.
Space Discretization
ParameterTypeDescriptionAllowed Values
x_initialfloatStart of Domain>0
x_finalfloatEnd of Domain>x_initial
cell_numberintNumber of uniform computational cells>0
Inlet Boundary Conditions
ParameterTypeDescriptionAllowed Values
rho_inletfloat/strDensity left boundaryconstant/periodic/extrapolate/wall
vel_inletfloat/strVelocity left boundaryconstant/periodic/extrapolate/wall
press_inletfloat/strPressure left boundaryconstant/periodic/extrapolate/wall
temp_inletfloat/strTemperature left boundaryconstant/periodic/extrapolate/wall
mass_frac_inletfloat/strMass fraction left boundaryconstant/periodic/extrapolate/wall
Outlet Boundary Conditions
ParameterTypeDescriptionAllowed Values
rho_outletfloat/strDensity right boundaryconstant/periodic/extrapolate/wall
vel_outletfloat/strVelocity right boundaryconstant/periodic/extrapolate/wall
press_outletfloat/strPressure right boundaryconstant/periodic/extrapolate/wall
temp_outletfloat/strTemperature right boundaryconstant/periodic/extrapolate/wall
mass_frac_outletfloat/strMass fraction right boundaryconstant/periodic/extrapolate/wall
  • constant: specified constant value will be imposed.
  • extrapolate: use the nearest inside value at the boundary.
  • periodic: left boundary = right side, and right boundary = left side.
  • wall: zero net velocity
CompFlowLab uses ghost cells to apply boundary conditions and does not automatically assign values to them. It completely depends on the user’s CFD knowledge in imposing physically valid boundary conditions.
Initial Condition
Initial conditions can be specified in two different ways:(1) Using a pre-generated profile saved in the same format as a CompFlowLab primitive variable output file (.npy).(2) Defining a few intervals, with the location and primitive variables specified for each interval.
ParameterTypeDescriptionAllowed Values
ic_pathstrInitial condition profile path-
x_interval_icfloatPrimitive variables specified for each domain interval-
If specifying variables using intervals, CompFlowLab always requires values for mass fractions. For non-reacting flows, dummy values can be provided to mass_frac_ic.
Gas Model
ParameterTypeDescriptionAllowed Values
gas_modelstrGas modelAir, path to .yaml or .inp
flux_schemestrFlux scheme2nd Order Roe
limiterboolFlux limiter activationTrue/False
limiter_methodstrLimiter Methodminmod, barth
viscousboolViscous termsTrue/False
numpy_vectorboolUse NumPy vectorizationTrue/False
Visualization
ParameterTypeDescriptionAllowed Values
visualboolPlot visuals while runningTrue/False
save_visualboolSave plotsTrue/False
variable#strVariable to plotsee below
Available variables to plot:
  • Density [kg/m3]
  • Velocity [m/s]
  • Pressure [Pa]
  • Temperature [K]
  • MF: Mass Fraction of first species [-]
  • Heat Release [W/m3]
Saving
ParameterTypeDescriptionAllowed Values
save_intervalintResults save interval>0 (ex:10)
Profiling
ParameterTypeDescriptionAllowed Values
profilingboolProfile performance while runningTrue/False
The profiling results will be saved at the working directory as .prof format. It is recommended to use snakeviz to visualize the profiling results.
Injection
ParameterTypeDescriptionAllowed Values
injectionboolInjection modelTrue/False
injection_state_dirstrPath to premixed injection gas state-
Injection section is only applicable for 1D RDE test case and must be set as False for any other test case.
The injection_state_dir must point to a .npy file which follows the same format as CompFlowLab primitive variable output file.
ROM Setup
These properties will be read if any ROM methods are used.
ParameterTypeDescriptionAllowed Values
rom_methodstrROM projection methodgalerkin, lspg
nl_rom_modelstrNon-linear ROM methodrbf, gpr
arom_methodstrAdaptive ROM methoddirect, svd, isvd, ojas, grouse, past
pod_energyfloatPOD residual energy>0 (ex: 99.9)
hyperboolUse hyper-reductionTrue/False
hyper_methodstrHyper-reduction methodQDEIM, GappyPODE, ECWS, FGS
sampling_ratefloatRate of cells sampled in hyper-reduction in percentage>0 (ex: 2)
init_training_winintAdaptive ROM initial window size>0 (ex:10)
unsampled_update_freqintAdaptive ROM unsampled cells update frequency>0 (ex:10)
training_data_dirstrPath to directory of training snapshots-
training_start_iterintStart index of training snapshots>0 (ex: 0)
training_step_iterintStep index of training snapshots>0 (ex: 10)
training_end_iterintEnd index of training snapshots>0 (ex: 5000)
rom_basis_generateboolGenerate POD basis from scratchTrue/False
rom_basis_dirstrPath to directory of precomputed basis-

ROM Methodology

Further details about Reduced Order Modeling under Methodology section.

Outputs

1. Field Data

Unsteady field data represents the time evolution of an unsteady field at the time step iteration interval specified by save_interval in input file. Each field data is written in a NumPy binary file containing a single NumPy array with two dimensions. The first dimension is the number of variables, the second is the number of cells in the computational mesh. Primitive variable indices are as following:
IndexVariableUnit
0density[kg/m3]
1velocity[m/s]
2pressure[Pa]
3temperature[K]
4:species mass fractions (only in reacting flows)[-]
-1heat release rate (only in reacting flows)[W/m3]
Conservative variable indices are as following:
IndexVariableUnit
0mass[kg/m3]
1momentum[kg*m/s/m3]
2total energy[J/m3]
3:species mass[kg/m3]

2. Visualization

During simulation runtime, plotted visuals will be saved under working_dir/plots if save_visual=True in input file.
This visualization serves only as a basic tool to inspect results during the initial stages. It is recommended that users implement their own customized post-processing scripts to visualize results according to their specific requirements.
When CompFlowLab is run on Linux, interactive plots cannot be displayed during the simulation due to Linux environment limitations. They can only be accessed after the visualizations are saved (i.e., save_visual=True).