WMS:WMLibHydroTree: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 50: Line 50:


{{WMLibMain}}
{{WMLibMain}}
[[Category:WMLib|Hydro]]

Latest revision as of 19:08, 11 January 2017

Description

The public class HydroTree class stores hydrologic tree information and runs operations on the hydrologic tree in the WMLib. Most operations involving adding or managing data in sub-basins or outlet points require a hydrologic tree.

Functions

  • public HydroTree(System.DateTime a_startTime, int a_timeIncrement, int a_numOrdinates)

This function is the constructor function for an instance of a HydroTree class. When creating a HydroTree, pass this function the following information that will be used as job control information for the HEC-1 simulation: the start time (a_startTime), a time step (a_timeIncrement), and the number of hydrograph ordinates (a_numOrdinates). See the example in the introduction as an example of how this function is used.

  • public void ApplyLagTimes()

After HEC-1 has been run, you can apply lag times to each outlet and lag the computed hydrographs at each outlet by the lag time assigned to each OutletPoint. See the example in the introduction as an example of how this function is used.

  • public System.Collections.Generic.List<OutletPoint> GetAllOutletPoints()

This function returns a list of all the outlet points in your hydrologic tree. The outlets are not sorted in any particular order, though they are generally sorted from downstream to upstream in the hydrologic tree, with the most downstream outlet point being first in the list.

  • public System.Collections.Generic.List<SubBasin> GetAllSubBasins()

This function returns a list of all the sub-basins in your hydrologic tree. The sub-basins are not sorted in any particular order, though they are generally sorted from downstream to upstream in the hydrologic tree, with the most downstream sub-basins being first in the list.

  • public WMLib.OutletPoint GetOutletPointFromName(string a_name)

This function returns the first outlet point in the hydrologic tree with the specified name.

  • public WMLib.SubBasin GetSubBasinFromName(string a_name)

This function returns the first sub-basin in the hydrologic tree with the specified name.

  • public double GetPeakFlow()

This function returns the peak flow at the most downstream outlet point in the hydrologic tree. If HEC-1 has not been successfully run, the peak flow cannot be determined. If the hydrographs have been lagged in the simulation, the peak flow is determined from the lagged hydrograph. See the example in the introduction as an example of how this function is used.

  • public System.DateTime GetPeakTime()

This function returns the peak time at the most downstream outlet point in the hydrologic tree. If HEC-1 has not been successfully run, the peak time cannot be determined. If the hydrographs have been lagged in the simulation, the peak time is determined from the lagged hydrograph. See the example in the introduction as an example of how this function is used.

  • public bool RunHec1(string a_fileName, string a_hec1ExeName)

This function runs the HEC-1 model input file a_fileName using the HEC-1 model executable located at a_hec1ExeName. The function returns true if the HEC-1 model was successfully run and false otherwise. All the correct hydrologic information (including sub-basin names, areas, curve numbers, rainfall data, and time of concentration) needs to be setup before running the HEC-1 model. The time of concentration is converted to a lag time using the SCS equation (Tlag = Tc * 0.5988) and the SCS unit hydrograph method is used to compute a hydrograph for the sub-basin based on the area, curve number, total rainfall, and rainfall distribution.

  • public void SetRainfallTimesToJobControl()

This function sets the rainfall distribution times associated with each sub-basin to the start time specified for the job control data in the HydroTree constructor function (it syncs the times in your model to the HydroTree start time). To obtain a hydrograph from HEC-1, you need to call this function before running HEC-1 if you did not derive the sub-basin rainfall data from the job control data.

  • public void WriteTreeToTsFile(string a_fileName, [string a_outletListName = null], [string a_basinListName = null])

This function writes all the hydrographs in your current tree to a file (specified by a_filename) that can be read into the Time Series Editor program, which is shipped with WMS. The optional a_outletListName and a_basinListName arguments specify names for the outlet and basin time series lists.