Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
scrollbar
Wiki Markup
{Scrollbar}

Spatial Mapping

Hydrological models usually have a schematization or grid that represents the spatial resolution of the model. For groundwater models, regular or non-regular two- or three-dimensional grids may be used, whereas river models typically use a one-dimensional grid. Conceptual catchment models may use a closed polygon to describe the catchment boundary.
When models with different spatial schematizations are linked, the values associated to one schematization in the source model must be transformed to be represented on the schematization of the target model. In order to make such transformations possible for any combination of models a standardized spatial representation was defined. In OpenMI terms this is called the IElementSet interface (see Figure below).

The number of ElementTypes has been reduced in OpenMI 2, e.g. the two-dimensional XYPoint and the three-dimensional XYZPoint have been melted to the ElementType Point with an optional z value.

Spatial mapping only works with geo-referenced ElementTypes, meaning all types apart from IdBased. The type of spatial reference is in OpenMI 2 defined by a string as it is common in the OGC compliant GIS world, s. http://spatialreference.org.

A two-dimensional grid for a groundwater model and a one-dimensional grid for a river model are shown in the figure below.

...

Assume that the river model and the groundwater model illustrated in the figure above are linked for the purpose of transferring information about groundwater leakage from the river model to the groundwater model. When the groundwater model invokes the GetValues method in the river model in order to obtain the leakages, the river model must return a ValueSet, where each value represents the leakage that enters each element in the groundwater model for the requested time. With this in mind it may seem like a huge task to implement the GetValues method in the linkable component. However, since all spatial representations can be accessed generically through the IElementSet interface, a generic element mapper could be developed. Such a mapper is provided in the open source OpenMI SDK with the namespace Oatc.OpenMI.Sdk.Spatial.

The two most essential methods in the ElementMapper class are Initialise and MapValues:

Code Block
public void Initialise(ElementMapperMethod method, IElementSet fromElements, IElementSet toElements)

If Initialise is called at the beginning, a mapping matrix will be calculated for mapping the fromElements to the toElements. The mapping method specified by method is in OpenMI 2 of type ElementMapperMethod.

Code Block
public IValueSet MapValues(IValueSet inputValues)

During computation MapValues uses the mapping matrix calculated in Initialise. When the GetValues method is invoked, the source component uses this matrix to make the spatial conversion, simply by multiplying the vector of values associated to the grid of the source components with the matrix.
For the example shown in the figure above, the mapping matrix will look as shown below:

...

where I is a vector with four components describing the leakage contribution to each grid cell in the groundwater model and L is a vector with three components, each value being the calculated leakage in a river branch.

In OpenMI 2 spatial mapping can be done in a flexible way by plugging a spatial Adapted outputs between Provider and Consumer. A set of simple interpolations will be provided and application developers can integrate their own Adapted outputs with new interpolation methods. Furthermore, a series connection of Adapted outputs is possible. 

The figure above displays a series connection of Adapted outputs mapping the Quantity H for water level from a grid to two single points. In a first step the ElementSet Grid is converted to two ElementSets of type Point. The second step is a further interpolation from these points to the single ElementSets Point1 and Point2.

The user can interactively define the order the Adapted outputs are run, optimizing the mapping performance. Please note that Adapted outputs can also be used for further operations as  e.g. temporal interpolation.