Tutorial 4: Time-Varying Data
Task
Convert the boundary conditions and gate operations from constants to time-varying input data.
Skills Gained
- Learn about HEC-DSS as a time series data storage system.
- Learn how HEC-DSS path names are used to reference time series in DSM2 input files.
The purpose of this tutorial is to incorporate time-varying information into the model. In the previous sections, all boundary conditions and gate timings were set as constant, and no input files were needed. In this section, the model is set to read time-varying information stored in HEC-DSS files.
The U.S. Army Corps of Engineers' Hydrologic Engineering Center Data Storage System, or HEC-DSS, is a database system designed to efficiently store and retrieve scientific data that is typically sequential. Such data types include, but are not limited to, time series data, curve data, spatial-oriented gridded data, and others. The system was designed to make it easy for users and application programs to retrieve and store data.
Data in HEC-DSS format can be viewed using special software including VISTA (DWR) or HEC-DSSVue. Each time series is described in the database using DSS Pathnames. For DSM2, the pathnames are typically used as follows:
- A-Part: Data Source
- B-Part: Location
- C-Part: Variable
- D-Part: Date range
- E-Part: Data frequency
- F-Part: Description (e.g., CalSim run identifier).
For more information, see the HEC-DSS website.
Steps to Incorporate Time-Varying Data
1. Change the Transfer Flows to HEC-DSS Input
- Create a new file called
input_hydro_ts_tutorial.inp
. - In the new file, create the
INPUT_TRANSFER_FLOW
table:
INPUT_TRANSFER_FLOW
TRANSFER_NAME FILLIN FILE PATH
transfer_1 linear ${TUTORIALINPUT} /TUTORIAL/TRANSFER/FLOW//15MIN/CONSTANT/
END
Note: HEC-DSS pathnames use forward slashes:
/A-Part/B-Part/C-Part/D-Part/E-Part/F-Part/
. In the example above, the A-Part isTUTORIAL
, the B-Part isTRANSFER
, etc.
- Open
hydro.inp
and add the followingENVVAR
definition:
ENVVAR
NAME VALUE
HYDROOUTDSSFILE output.dss
DSM2MODIFIER timevar_1
TUTORIALINPUT ../timeseries/tutorial.dss
END
- Update the
HYDRO_TIME_SERIES
block inhydro.inp
to include the new file:
HYDRO_TIME_SERIES
input_boundary_hydro_tutorial.inp
input_transfer_flow_tutorial.inp
input_hydro_ts_tutorial.inp
END
- Save the files.
- Open
qual.inp
and setDSM2MODIFIER
totimevar_1
to matchhydro.inp
.
2. Running HYDRO and QUAL
- Navigate to the directory:
${DSM2_home}\tutorial\simple\t4_timevar
. - Open a command window in the directory.
- Run the following commands:
hydro hydro.inp
qual qual.inp
- Open the
output.dss
file in thet4_timevar
directory and verify the results.
3. Adjust DSM2MODIFIER for a Variant Scenario
- Open
hydro.inp
and changeDSM2MODIFIER
totimevar_2
in theENVVAR
section. - Open
qual.inp
and make the same change toDSM2MODIFIER
.
4. Add Source Information into HYDRO
- In
input_hydro_ts_tutorial.inp
, add theSOURCE_FLOW
table:
SOURCE_FLOW
NAME NODE SIGN FILLIN FILE PATH
source1 5 1 linear ${TUTORIALINPUT} /TUTORIAL/SOURCE/FLOW//15MIN/CONSTANT/
END
- Save the file.
5. Add Corresponding Source Information into QUAL
- Create a new file called
input_qual_ts_tutorial.inp
. - Add the
NODE_CONCENTRATION
table:
NODE_CONCENTRATION
NAME NODE_NO VARIABLE FILLIN FILE PATH
source1 5 ec last ${TUTORIALINPUT} /TUTORIAL/SOURCE/EC//15MIN/CONSTANT/
END
- Add the
TUTORIALINPUT
definition toqual.inp
:
ENVVAR
NAME VALUE
TUTORIALINPUT ../timeseries/tutorial.dss
END
- Update the
QUAL_TIME_SERIES
block inqual.inp
:
QUAL_TIME_SERIES
input_node_conc_tutorial.inp
input_qual_ts_tutorial.inp
END
- Save the files.
6. Add Time-Varying Tide Information for Downstream Boundary in HYDRO
- In
input_hydro_ts_tutorial.inp
, add theBOUNDARY_STAGE
table:
BOUNDARY_STAGE
NAME NODE FILLIN FILE PATH
downstream_stage 7 linear ${TUTORIALINPUT} /TUTORIAL/DOWNSTREAM/STAGE//15MIN/REALISTIC/
END
7. Add Downstream Boundary in QUAL
- In
input_qual_ts_tutorial.inp
, add the following to theNODE_CONCENTRATION
table:
NODE_CONCENTRATION
NAME NODE_NO VARIABLE FILLIN FILE PATH
downstream_stage 7 ec last ${TUTORIALINPUT} /TUTORIAL/DOWNSTREAM/EC//15MIN/REALISTIC/
END
8. Add a Gate Time Series to HYDRO
- Create a new file called
input_gate_tutorial.inp
. - Add the
INPUT_GATE
table:
INPUT_GATE
GATE DEVICE VARIABLE FILLIN FILE PATH
gate_1 weir op_from_node none ${TUTORIALINPUT} /TUTORIAL/GATE/FLAP_OP//IR-YEAR/TIMEVAR/
END
- Update the
HYDRO_TIME_SERIES
block inhydro.inp
:
HYDRO_TIME_SERIES
input_boundary_hydro_tutorial.inp
input_transfer_flow_tutorial.inp
input_hydro_ts_tutorial.inp
input_gate_tutorial.inp
END
- Save the files.
9. Running HYDRO and QUAL
- Navigate to the directory:
${DSM2_home}\tutorial\simple\t4_timevar
. - Open a command window in the directory.
- Run the following commands:
hydro hydro.inp
qual qual.inp
- Open the
output.dss
file in thet4_timevar
directory and examine the results.