DHI.Mike1D.CrossSectionModule Namespace

A cross section defines the profile across the reach (perpendicular to the flow direction) at a location. It provides the width, area and other properties of the profile for any water level. From the MIKE 1D engine point of view, a cross section is to provide the functionality defined by the ICrossSection interface.

Cross section database

The CrossSectionData is a database of ICrossSection's. A cross section is indexed by it location (reach id, chainage) and a topography id (topo-id).

The topography id is used to handle different scenarios. Example: A river was measured in 1980 and again in 2000. Both set of data can be entered into the same cross section database, the first set with a topography id of 1980, the other with the topography id of 2000. Whenever searching for cross sections, the topography id must be provided to specify which data set to use. The topography id can be set on each network reach (IReach) individually, using the TopoID property.

The location of a cross section can be specified in two different ways: By their reach id and chainage, or by their reach id only.

  • Reach id and chainage: On a given reach there can be a number of cross sections for different chainages. The bottom level is defined by each cross section individually. This is the traditional MIKE 11 definition.
  • Reach id only: On a given reach you can specify one cross section that is valid for the entire reach. The bottom level is extracted from the network geometry - LocationSpan (digipoints). This is the traditional MIKE URBAN definition.

The cross section database can read and write data to and from the MIKE 11 cross section file, .xns11, using the CrossSectionDataFactory.

Cross section API and classes

The ICrossSection does not necessarily know anything about the geometry of the unerlying cross section, whether it is circular, rectangular open or closed; it can be based on tabulated values or formulas. The ICrossSection can have a BaseCrossSection that it delegates its work to. The BaseCrossSection property returns a XsBase

The XsBase is an implementation of the ICrossSection functionality based on processed data. There are a number of specialized derived base cross sections, implementing each their own geometric version of the XsBase.

  • XsCircular: A circular cross section with a diameter. This is the circular MIKE 11 cross section
  • XsCircularPreprocessed: A circular cross section that can have three different forms: circular, egg-shaped or O-shaped. this is the MIKE URBAN circular cross sections. Processed data can not be modified.
  • XsRectangular: A cross section with width and a height. This is the rectangular MIKE 11 cross section
  • XsRectangularPreprocessed: A cross section with a widt and a height, and a small depression at the bottom to handle low flow situations. This is the rectangular MIKE URBAN cross section. Processed data can not be modified.
  • XsBaseRaw: Cross section with raw data, a set of X-Z cross section points, defining the geometry of the cross section. It comes in two variations: XsOpen, which is the standard open cross section. XsPolygon, a closed cross section, the last cross section point is connected to the first cross section point, thereby closing the cross section.

Classes

AbstractBottomSlot Base functionality for the BottomSlotClassic and BottomSlotAreaPreserving.
CrossSectionData A class representing a collection of cross sections, spanning multiple reaches.

The collection orders the cross sections in two ways: If a reach only has one global cross-section, it is indexed by reachID and topoID. Other cross sections which have a location including a chainage, are ordered by locationID (reachID), topoID and chainage.

If a cross section gets its location updated after insertion into the collection, it needs to be removed and reinserted into the collection in order to be indexed correctly.

Events are not supported for COM interop, even though they appear in the type lib.

All physical quantities are in SI units.

CrossSectionDataCrossSectionEnumerator Enumerator class thats enumerates the list of crossSections sorted by branch, topoid and chainage
CrossSectionDataFactory A factory class for reading and writing CrossSectionCollections.
CrossSectionExtensions Static class containing extension methods related to cross sections
CrossSectionFactory A factory builder for creating cross sections.

To create a new cross section, first create a CrossSectionFactory. Then build the base of the cross section by calling one of the BuildXXX functions. Use the SetXXX functions to customize the cross section. Get the finished cross section from GetCrossSection

CrossSectionLocated

A cross section with a location (ZLocation). Has a pointer to an BaseCrossSection. The BaseCrossSection can be reused by many CrossSectionLocated.

Contains ZLocation, Coordinates, Info, MinWaterDepth, DHI_ID. Rest is extracted from the BaseCrossSection.

Buffering of previous water level is handled here.

Also does translation from water level to depth (BaseCrossSection can be depth based.). The levels in the BaseCrossSection uses Location.Z as zero level.

CrossSectionMiddling A Cross Section middling is a cross sections that is placed between two other cross sections and uses those to calculate its own values using interpolation.
CrossSectionPoint A class representing a point on the cross section
CrossSectionPointList The points contained in a cross section. The points need not be sorted by the x value.
CrossSectionSlotDecorator Adds slot funtionality to an ICrossSection. It handles as well topslot as bottom slot.
FlowResistance Holds information about cross section resistance.

It contains information on the formulation used, ResistanceFormulation, and also the resistance values unless they are tabulated.

If resistance values are tabulated, DepthDependence == Tabulated, they should be looked up in the processed data of the cross sections.

If the DepthDependence == Exponent the following formula is used: r(d,h) = r_b + (r_t - r_b) * Math.Pow(d / h, c); with depth derivative r'(d,h) = (c/h)(r_t - r_b) * Math.Pow(d / h, c-1); where r_b is ResistanceValue r_t is ResistanceTopValue and c is ExpDepExponent

During simulation the engine works on Mannings M or Chezy, and converts the other resistance formulations to one of those. The converted/modified values and formulations are stored in the XSBase.

InterpolateXSRaw Interpolates in the raw data using the M11CrossSectionAlg.dll. It is the same interpolation as in the Cross Section Editor (crossectionedit.dll)
Processing Class containing various methods that can be utilized when processing data.
ProcessingLevelsSpecs level-related specifications for pre-processing of cross section data
ProcessingSimple Small class that does the storage width and flow area processing (total area) in the most simple way.
ReachCrossSections Class containing all crossSections for one reach/topo-id combination. It can either contain one global cross section (the MikeUrban way, ID based), or a set of crosssections, sorted on chainage (the Mike11 way, ID+chainage based). In case of a set of cross-sections, each cross section must have a valid Location.
StandardCrossSectionFilter basic filter for cross sections, e.g., for partial loading or display. allows filtering by branch name(s), TopoId(s), and area. TODO: If use, reimplement using dictionary instead of arrays, for performance.
TopSlotAngle Top slot that returns value corresponding to adding vertical walls approaching infinity
XSBase Base class for crossSections. Holds processed data.

The most common case is that BottomLevel is zero, meaning that the ProcessedLevels are depth based. However, this is not a requirement.

Can hold equidistant as well as non-equidistant processed data, _equidistantLevels. In case of equidistant, the processed levels always start at zero, i.e., the BottomLevel is always zero (depth based).

XSBaseProcessedData Internal helper class for storing a complete set of processed data
XSBaseRaw A class representing a cross section with raw data attached. TODO: Should deserializer call
XSCircular Closed circular cross section. Circular cross sections are defined by their diameter. Processed data is calculated by CalculateProcessedData(XSBase)
XSCircularPreprocessed Closed Circular Cross Section with preprocessed data. There are several different types of circular cross sections: - Circular. - Egg-shaped circular. - O-shaped circular. For the O-shaped cross section the Height is 9/8*diameter The preprocessed data contains a slot up to a height of 1.5 times the diameter. Hence, the TopLevel does not equal BottomLevel plus the diameter/height.
XSOpen Open cross section. Open cross sections are defined by a list of points. Remember to call CalculateProcessedData() before use.
Obsolete
XSPolygon Closed polygon cross section. Polygon cross sections are defined by a list of points. Remember to call CalculateProcessedData() before use.
Obsolete
XSProcessedInterp A class representing a cross section that is interpolated from the processed data of two other cross sections.
XSRectangular An open rectangular cross section. Processed data is calculated by the Mike11 processing code CalculateProcessedData(XSBase)
XSRectangularPreprocessed An open rectangular cross section with preprocessed data. The preprocessed data contains a slot up to a height of 1.5 times the diameter. Hence, the TopLevel does not equal BottomLevel plus the Height.

Structures

CrossSectionBufferLevel Buffer level, when looking up values in cross section

Interfaces

IBottomSlot Interface to a top slot. A slot is not responsible for checking whether the water level argument is valid for the slot. Such a check should be done before using the slot.
ICrossSection This is the interface that all cross sections should implement. The methods are mainly defined by what is needed by the engine.
ICrossSectionBridge interface definition for a bridge for loading and, optionally, saving a cross section collection.
ICrossSectionFilter simple interface definition for a filter for cross section, used, e.g., in partial loading of a cross section collection. A particular implementation will have additional members. Note: there is a CrossSectionFilter class that implements this interface.
ICrossSectionPoint Point on a cross section.
ISlot Interface to slots. A slot is not responsible for checking whether the water level argument is valid for the slot. Such a check should be done before using the slot.
ITopSlot Interface to a top slot. A slot is not responsible for checking whether the water level argument is valid for the slot. Such a check should be done before using the slot.

Delegates

CrossSectionEventHandler event handler delegate

Enumerations

CrossSectionBufferType Which type of value is stored in the buffer
XSInterpolationTypes Defines how an interpolated cross section are interpolated