Getting Started with R-THYM

What is R-THYM?

First published: May 2026
Last updated: August 16, 2026

[!NOTE] I am always updating sections of this manual as features are added to R-THYM. There is some lag before new features appear in the published documentation.

Welcome to R-THYM (Real-Time Hydraulic Model), a next-generation Digital Twin designed to simulate water infrastructure and energy management within a single, unified environment.

R-THYM is an interactive and realistic design aid built on the principle that power and hydraulics are inextricably interlinked.

While it is entirely possible to model hydraulics in isolation, understanding the true cost implications of a design is what ultimately drives engineering and operational decisions. Power consumption is often the largest operational cost driver in water infrastructure. R-THYM models this interaction in detail so that designers of systems of all sizes can analyze energy expenditures, evaluate renewable integration, and make informed financial decisions using the tool's components.

By bringing these traditionally isolated worlds together, R-THYM allows you to optimize your system's energy footprint, track water quality as it moves through the network, and then instantly pressure-test those operations against high-fidelity hydraulic transients.

To understand how R-THYM achieves this, it is helpful to look at its three fundamental modeling pillars:

  • Water-Energy Nexus
  • Extended Period Simulation (EPS)
  • Method of Characteristics (MOC)

The Water-Energy Nexus

Water distribution is incredibly energy-intensive. R-THYM goes beyond simple pump efficiency curves by integrating a full-scale energy microgrid into your hydraulic model.

R-THYM allows you to drag-and-drop power generation and storage nodes directly onto your canvas, including:

  • Utility Grids with dynamic, time-of-use (diurnal) pricing patterns
  • Renewable Energy sources like Solar Arrays and Wind Turbines
  • Hydropower Turbines that generate electricity from excess system head
  • Battery Storage with configurable capacity, charge/discharge limits, and CC/CV taper
  • Fuel Generators (Diesel, Natural Gas, Propane, Biogas) linked to Fuel Tank nodes
  • Power Switches that interrupt downstream electrical supply, instantly simulating grid failures or rolling blackouts

By pulling live weather forecasts for your site location, R-THYM predicts solar irradiance and wind speeds to forecast renewable generation. You can use these insights to shift heavy pumping operations to times when renewable energy is peaking or when utility grid prices are at their lowest—reducing operational costs and carbon emissions.

Energy results feed directly into the model's economic analysis. In addition to time-of-use electricity and fuel costs, R-THYM can account for carbon intensity, water production and treatment costs, and customer sales revenue. The Cash Flow Optimizer can then search those coupled hydraulic and energy results for lower-cost operating strategies.

Extended Period Simulation (EPS)

Extended Period Simulation (EPS) is the industry standard for modeling the continuous operations of a water distribution network. In R-THYM, the EPS engine is built for high-resolution operational cycles, allowing you to analyze diurnal demand patterns, tank cycling, energy pricing, and water quality over a run measured in hours or days.

Powered by the robust, time-tested EPANET calculation engine, EPS assumes that water is an incompressible fluid, calculating a stable, steady state at each sequential time step. Unlike traditional EPS software that often limits you to rigid 1-hour intervals, R-THYM lets you set a custom hydraulic time step (from 5 minutes to 24 hours) and then drive the run with a dynamic simulation speed slider. You can slow the simulation down to an exact real-time pace (1 sec/s) to carefully monitor filling operations, accelerate it to watch a full daily cycle unfold in seconds, or fast-forward through the entire duration.

When to use EPS:

  • Operational Planning: Tracking reservoir levels, energy usage, and fuel consumption over a continuous operating cycle.
  • Economic Optimization: Running simulations to find the most cost-effective times to fill tanks based on dynamic utility pricing and renewable energy availability.
  • Water Quality: Tracking a chemical or constituent, water age, source contribution, or multi-species (MSX) reactions as water travels from sources to every junction, tank, and outflow.
  • General Hydraulics: Verifying that pipe diameters and pump curves can safely meet peak consumer demands under normal conditions.
  • Interactive System Design: Uniquely in R-THYM, the EPS environment acts as a live, interactive design aid. While the simulation is running, you can manually toggle pumps and turbines, open and close valves, switch power sources, or smoothly ramp variable speed drives. This real-time interaction lets you "fly" your system and visualize the direct impact of operational decisions, revealing insights that static, traditional modeling often misses.

EPS is computationally lightweight and perfect for understanding the operational "big picture" of how your system behaves throughout the day. It excels at modeling the steady, macro-level movement of water—and the quality of that water—to help you optimize standard operations. However, to analyze the rapid, split-second pressure waves that occur the exact moment you interact with the system, such as tripping a pump or rapidly closing a valve, R-THYM shifts from this steady-state view into the high-speed physics of our third pillar: the Method of Characteristics (MOC).

Method of Characteristics (MOC)

When a valve slams shut or a pump suddenly loses power, the water in the pipe compresses. The kinetic energy of the moving water is converted into a high-pressure shockwave (water hammer) that travels through the pipe at the speed of sound.

To simulate these extreme events, R-THYM engages its custom, browser-native Method of Characteristics (MOC) transient engine, compiled to WebAssembly so the physics run at native speed in your browser.

Because transparency and scientific accuracy are critical in hydraulic modeling, our core MOC solver is open-source. This ensures that the engine is never a "black box," allowing engineers, researchers, and students to review the underlying physics, verify the numerical methods, and independently validate their surge results.

MOC is a numerical method that treats water as a compressible fluid and accounts for the elasticity of the pipe walls. Instead of advancing the simulation in hours or minutes, the MOC engine tracks physics frame-by-frame, calculating the changing pressures and velocities every 10 milliseconds by default.

Features of the R-THYM MOC Engine:

  • Real-Time Execution: The MOC engine solves the characteristic equations in a dedicated background worker using compiled WebAssembly. Your interface remains smooth and responsive, even during heavy physics calculations.
  • Acoustic Tracking: Accurately models the propagation, reflection, and super-positioning of acoustic pressure waves.
  • Unsteady Friction (USF): Uses Brunone unsteady friction with an Infinite Impulse Response (IIR) filter to model frequency-dependent boundary layer shear stress, so wave decay and physical damping match real-world transducer data.
  • Cavitation and Column Separation: Tracks pressure drops to vapor pressure and the formation and collapse of vapor cavities.
  • Surge Protection Design: Allows you to test standpipes, hydropneumatic tanks, air/vacuum valves, check valves, relief and control valves, and PID control schemes under emergency scenarios.

Water quality and cost accounting pause during MOC. Those analyses belong to the EPS view of the system; MOC is reserved for the split-second hydraulic physics.

The Best of All Worlds

The true power of R-THYM lies in its interconnected nature. You don't need to rebuild your model in a separate software package to test for transients, nor do you need to export your pump flows to a spreadsheet to calculate your power bill.

You can run an EPS simulation to optimize your pumping schedule around weather forecasts and diurnal energy rates, and to watch water quality evolve through the same operating cycle. Then, at the exact moment a critical flow state is reached, you can engage the dynamic MOC mode. R-THYM automatically passes the steady-state velocities and pressures directly into the MOC engine, allowing you to instantly trigger a valve closure or a catastrophic grid-power failure and watch the transient physics unfold in real time.

R-THYM gives you the macro-level insight to plan your operations economically, the water-quality view to understand what the system is delivering, and the micro-level physics to protect your infrastructure.