-
Notifications
You must be signed in to change notification settings - Fork 50
Channel Routing
T-Route has currently implemented two channel routing methods: the Muskingum Cunge (MC) and a diffusive wave. The MC is applied to only a synthetic channel cross section that is a compound channel cross section with a trapezoidal main and rectangular floodplain. The flow in each segment at each time step is updated using a finite difference equation that is derived using a continuity equation and a storage equation (The NCAR WRF-Hydro Modeling System Technical Description).
, where
The wave celerity for a trapezoidal main channel is
, where
Assuming
, where
For overbank flow, the MC algorithm implemented within T-Route computes an weighted wave celerity by considering the celerities of the main channel and floodplain according to their relative areas. The weighting is based on the ratio of the main channel flow area to the total flow area and the ratio of the floodplain flow area to the total flow area.
Applying the aforementioned equations, the Muskingum-Cunge (MC) algorithm searches for the water depth that minimizes the difference between
The Fortran compute kernel of the MC is MCsingeSegStime_f2py_NOLOOP.f90. Integration of the Fortran kernel with Python using Cython involves several steps:
pyMCsingleSegStime_NoLoop.f90 is the Fortran code that is used to create a C-compatible wrapper for the kernel. This wrapper helps to interface the Fortran code with Cython by providing C-callable functions.
Use compiler.sh to run makefile to compile the kernel and Fortran wrapper into shared libraries.
Write a Cython wrapper file to interface with the compiled Fortran codes. reach.pyx is written in Python using Cython syntax.
fortran_wrappers.pxd integrates the Fortran codes with C/C++ or Cython by providing the declarations for the Fortran functions that will be used in the C/C++ or Cython code.
setup.py compiles the Cython module and link it with the Fortran object files.
mc_reach.pyx can now import and use the compiled Fortran compute kernel for the MC method in Cython.
In mc_reach.pyx, the MC extension module troute.routing.fast_reach.reach
is executed within the compute_reach_kernel
Cython function. To facilitate parallel computing, T-Route originally made the assumption that
becomes
, allowing, in theory, each stream segment within a given sub-network domain to simultaneously perform the MC computation without waiting for the completions of
The governing equation of the diffusive wave routing within T-Route is
, where
with
The partial differential equation is solved using the Crank-Nicolson scheme to non-uniform space grids, combined with an adapted Talyor series and Hermite Interpolation method. This approach is referred to as Crank-Nicolson over Space (CNS).
- Overview
- Hydrofabric Integration
- Input Forcing
- Domain Data
- Data Formats
- CLI
- BMI Tutorial
- Lower Colorado, TX example
- Larger Domains (e.g. CONUS)