How to rebuild a 1D XPSWMM Model?

Source: Innovyze Support Portal

XPSWMM/XPSTORM database can get corrupted from time to time, for example after a system crash. Corrupted database can lead to strange model errors that are hard to diagnose. If your model meet the following descriptions, you might want to rebuild your model.

  • For a 1D model with less than 100 nodes, the *.xp file should be less than 10M for most models. If your *.xp file is larger than 50M, usually it has a lot of historical information saved, which can make data corruption more likely.
  • Strange errors
  • Model might complain about missing values which are not missing

1D XPSWMM Model Data Structure

  • *.xp: the main database
  • *.sqlite: sewershed geometry, scenarios
  • *.json: ensemble rainfall analysis input and results
  • External files: time series interface file, time series text files, background layers, DTM files etc.

The table below shows a more detailed summary of data items and where they are saved.

*.XP Database

When lots of changes are made to a model, *.xp database tends to grow significantly in size. Due to the complexity of the database format, not all the data added are used by the engine when running the model, and thus can cause unexpected issues. By rebuilding the database, we can purge the “junk” information out and this usually will fix the issues. Even if we get errors, usually they are much easier to fix because the process exposes the corrupted data items in the database.

Scenarios

The main *.xp database stores the base scenario. When a new scenario is created, XPSWMM compares the scenario to the base scenario, and saved the changes to the *.sqlite database. So when rebuilding a model, the old *.sqlite database need to be also renamed to match the new model.

RTC rules works differently than objects, where individual settings can vary in different scenarios. To apply a different RTC setting, a new rule needs to be created and enabled.

Global Storms

Rebuilding Model Procedures

  • Switch to the base scenario
  • Export the base scenario as *.xpx file
  • Start an empty model, and save it
  • Import the *.xpx file and save it
  • Close XPSWMM
  • Copy the old *.sqlite model to the same folder as the new *.xp file
  • Rename the *.sqlite to match the new model name
  • Open the new *.xp file, save the model

Review the new model

Sometimes, this will expose corrupted data items and you should be notified in the warnings about missing values. By comparing with the old model, most of these errors can be fixed.

You can also bring some of the Xptables and styles by saving the existing model as a template and then apply it as the template, refer to the template tutorial.

Empowering Water Experts