Moving a QUAL2K / QUAL2Kw Excel Model to the Web Engine

QUAL2K and QUAL2Kw ship as Microsoft Excel workbooks with VBA macros and a Fortran executable. That setup needs Windows and Excel with macros enabled, and large models can be slow or crash inside VBA. The Hydrolitica engine is an independent Python port of the QUAL2Kw 5.1 solver that runs in the browser: you can open an existing workbook directly, with no manual re-entry.

Import in One Step

  1. Open the engine with the import dialog (or use Import QUAL2Kw workbook in the engine toolbar) and pick your .xls, .xlsx or .xlsm file. The workbook is read in your browser; only the cell values of the input sheets are sent to the engine, so large workbooks (tens of MB) are fine.
  2. Read the import report. It lists what was carried over and warns about anything that was not (see the table below).
  3. Review the wizard cards, then Run. Compare the results with the workbook's own WQ Output, WQ Min, WQ Max and Temperature Output sheets if you want to check the port yourself.

Supported layouts: classic QUAL2Kw 5.1 and the newer HTS/STS layout. Dendritic (multi-branch) xQUAL2Kw workbooks cannot be imported directly yet. In our September 2026 validation run the engine reproduced the output sheets of 15 calibrated models within 5% (or a small absolute band), and the daily means held after passing each workbook through this importer. See Validation results.

Excel/VBA vs the Web Engine

QUAL2Kw workbook vs Hydrolitica engine

TopicQUAL2Kw workbookHydrolitica engine
PlatformWindows with Excel and macros enabledAny modern browser (Windows, macOS, Linux, Chromebook)
Getting a model inCell editing across many sheetsImport the workbook, or the 14-step guided wizard, or JSON / CSV
SolverVBA and the Fortran qual2kw5.exePython port of the QUAL2Kw 5.1 solver (explicit Euler), run in the cloud
Run timeDepends on the PC and the modelFrom seconds to a few minutes; the limit is 300 seconds per run
CalibrationManual, or the workbook genetic algorithmAuto-calibration of 18 kinetic rates against observed data (free account)
State variables17 water-quality states plus temperatureThe same 17 plus temperature, pH computed at every step
OutputsOutput sheets and chartsDaily mean, minimum and maximum per reach; charts, CSV and PDF report
SavingThe .xlsm fileCloud save with an account, plus JSON / CSV export

What the Importer Maps

Workbook sheet to wizard card

Workbook sheetWizard cardNotes
QUAL2K1. Project SetupName, date, time zone, time step and simulation options (read by label, so both layouts work)
Reach2. Reach DefinitionGeometry, Manning's n or rating curves, weirs, elevations, coordinates
Headwater3. HeadwaterFlow, temperature and water quality
Point Sources4. Point SourcesLocation, inflow or abstraction, concentrations
Diffuse Sources5. Diffuse SourcesLocation range, flow, concentrations
Rates6. Kinetic RatesRead by section and label, as the VBA reads them
Reach Rates7. Reach RatesPer-reach overrides, every column
Light and Heat8. Light & HeatSolar, long-wave and wind options
Meteorology sheets9. MeteorologyAir and dew-point temperature, wind, cloud, shade
Initial conditions12. Initial ConditionsStarting values, bottom algae

Common Issues

IssueCauseSolution
Run stops at 300 secondsLarge model with a small time step, especially with sediment diagenesisUse a larger calculation step or split the river
Solar warning after importNo latitude / longitude on the reachesAdd coordinates in Project Setup or on the reaches
DO saturation too highElevation left at 0 mEnter the reach elevations
Import report lists diel point sourcesThe workbook varies loads through the dayCheck whether the daily mean is acceptable for your study

If the problem is the Excel workbook itself (Error 53, a stop at ChDir ThisWorkbook.Path, "is aborted!" or blocked macros), see QUAL2K and QUAL2Kw errors and how to fix them.

Model the whole river in the prediction engine

Import your QUAL2Kw workbook or open the example project. Results reproduce 15 calibrated QUAL2Kw models within 5% or a small absolute band.

See the prediction engine