Skip to content

Model Adapters

The MIKE Workbench comes equipped with adapters for a couple for the DHI modeling tools. They are very similar but still different, so this chapter describes the specialties for each adapter as well as some best practices for preparing a model setup for registration with the MIKE WORKBENCH.

The modeling concept

A standard model setup

A model is a black box. It contains some proprietary configuration information describing the model setup. A model takes input time series and, in some cases, initial conditions as input to a new run. After a run we usually get Output time series, Logs, some other outputs (e.g. images, grids,...) and in some cases output states which can be reused as initial conditions.

A MIKE Workbench model setup

All the files in the above description are proprietary and specific to the model tool. The way the model setup files describe the physical (or conceptual) problem depends on the implementation done by the model tool developer - as well as the type of modeling tool.

For instance, MIKE HYDRO BASIN uses a node concept where different calculation entities in the model are expressed as nodes. The entire model is then constructed by connecting a set of different nodes, adhering to certain rules defined by MIKE HYDRO BASIN. Another tool like MIKE 11 describes a different problem and does not use the same clear convention to describe the physics of the problem the node concept is not as clear. A 2D model like MIKE 21 or 3D model like MIKE 3 is probably not possible to describe by nodes - like MIKE HYDRO BASIN.

This makes it a challenge to construct a common system which shall work across model types. It calls for some generalization - which has the benefit of handling all types of models - and possibly the draw-back of not being specific in some areas for all models.

So, the MIKE Workbench uses an adapter concept which enables a common representation of any model setup and hides proprietary formatted files from the MIKE Workbench. The adapter is responsible for conversion between the MIKE Workbench data and the model data (see The adapter concept). I.e. the original model setup becomes a black box in its entirety.

The common representation used by the MIKE Workbench is similar to the one used by MIKE HYDRO BASIN, i.e. a set of nodes each having different parameters and each having input and output time series. But as opposed to the model tool the MIKE Workbench cannot handle links between nodes (this lies with the proprietary modeling tool).

The data model for a model setup in the MIKE Workbench looks like shown below. It illustrates that a model setup consists of a number of model objects (or nodes). Each node can have a number of input time series, may produce a number of output time series and/or a number of other outputs (e.g. images, text files). The entire setup may also have mode-wide outputs and may use initial conditions.

A model object may, in addition to the associated data types as shown, contain properties reflecting model settings or so-called model parameters. A model object may also reflect a geographic position.

The adapter concept

In order for the MIKE Workbench to communicate in a standard way with different types of modeling tools the adapter concept is used. This means that a model can be registered in and controlled from the MIKE WORKBENCH if a piece of software is added to the MIKE Workbench - the adapter - between the MIKE Workbench business logic and the model setup/model tool specifics.

Each model tool has its own adapter.

The adapter shall shield the model setup and proprietary files from the MIKE Workbench, making the model setup appear like any other model setup to the MIKE Workbench. The responsibilities of the adapter are in short:

  • Configuration
    • Describe the setup in MIKE Workbench context (model objects, input/output time series, outputs, initial conditions).
    • Provide model setup data enabling the MIKE Workbench to run the same model setup.
  • Runtime
    • Convert the input data provided by the MIKE Workbench to proprietary formats (initial conditions, input time series).
  • Execute the model
    • Assess success/failure of the model run.
    • Extract outputs to MIKE Workbench format (new initial states, output time series, output data).

How to prepare a setup

The adapter shall 'just' parse the model setup pick up files and data and prepare the configuration input for the MIKE Workbench. However, modelers tend to organize files and data differently which may give problems to some adapters.

The below bullets highlight a couple of recommendations which will reduce the number of problems which may be experience when registering a model:

  • Put the main model file (mdb, mxd, sim11, she, ...) in the root folder of the setup and have all other setup files and input time series in the same folder or in sub-directories.
    It should be possible to copy the setup from the root folder to another location and still be able to run the model.

  • Empty the directory structure for any unnecessary files - maybe the adapter will zip all files from the root and down...

  • The setup to be registered only needs enough input data to run for a short period, i.e. reduce the size of input files and result files (initial conditions) before registration.
  • If possible, avoid strange characters (special language characters) in file names, station names, item names etc.
  • Consider the projection of the setup. It should be one of the projections supported by the MIKE Workbench. A good test is to try first to import shape files or similar directly into the MIKE WORKBENCH via GIS Manager to verify if they are supported
  • Make single item time series files if possible. The MIKE Workbench will provide data series data one by one. If the input time series files contain multiple items per (dfs0-) file, the adapter is then responsible for synchronizing the data series before writing the items in the file in the right order. This potential interpolation is avoided if files have only one item each.
  • Register a model setup WITH result files. i.e. run the model prior to registration. Only then can the adapter validate the potential outputs.