Skip to content

Testing Infrastructure

FLINT includes a suite of standalone Fortran programs used for:

  • Numerical verification
  • Cross-validation against Cantera
  • Performance benchmarking
  • Regression testing during development

These programs are compiled as part of the standard build process and are located in the bin/test directory.


Testing Philosophy

FLINT testing follows three principles:

  1. Numerical consistency
    Native routines and Cantera-interface ones must reproduce reference solutions within defined tolerances.

  2. Backend consistency
    Dedicated chemistry kernels, general routines, and optional Cantera interfaces must produce equivalent physical results.

  3. Regression stability
    Changes to the codebase must not alter validated results unexpectedly.


Categories of Tests

1. Thermodynamic Verification

  • Compares specific heat and thermodynamic properties
  • Native implementation vs Cantera
  • Checks relative error and execution time

Executable:

test-thermo


2. Chemical Source Terms

  • Validates species production rates
  • Explicit kernel vs Cantera net production rates

Executable:

test-wdot


3. Reactor Integration

  • Constant-volume batch reactor
  • Compares temperature evolution across:
  • General chemistry routines
  • Dedicated chemistry kernels
  • Cantera backend (if enabled)

Executable:

test-batchF


4. Chemical Equilibrium

  • Validates CEA-based equilibrium solver
  • Compares equilibrium temperature and selected species

Executable:

test-CEA


Running the Test Suite

From the test directory:

./../bin/test/<test-name>

Each test reports:

  • Key computed quantities
  • Reference values (if applicable)
  • Success/failure verdict

Regression Strategy

Reference ("blessed") values are embedded in the test drivers. A test fails if:

  • The solution is not finite
  • Relative error exceeds defined tolerance
  • Unexpected numerical behavior is detected

This ensures that modifications to:

  • Thermodynamic routines
  • Chemistry kernels
  • Solver infrastructure

do not silently alter validated behavior.


Adding a New Test

To add a new regression test:

  1. Create a standalone Fortran driver.
  2. Load the required mechanism and data.
  3. Define reference values or comparison logic.
  4. Add success/failure criteria.
  5. Register the executable in the CMake configuration.

Tests should:

  • Be deterministic
  • Avoid unnecessary I/O
  • Use clear tolerances
  • Focus on a single capability

Continuous Integration (Optional)

When integrated into CI workflows, test executables can be run automatically after each build to ensure numerical stability across commits.