MIKE+ Adapter¶
The MIKE+ adapter enables use of MIKE+ model setups within the MIKE Workbench.
About MIKE+¶
MIKE+ is a Software developed by DHI Group to model urban networks, river and flood. Please refer to MIKE BY DHI for more information.
Prerequisite¶
The Adaptor requires MIKE+ to be installed on the MIKE Workbench computer (for registration) and the run machine. The execution of models will require a license on the run machine.
Supported Model objects¶
The following model object types are supported by the MIKE+ adapter.
- Catchment
- Catchment input
- Boundary
- Basin
- Cross section
- Calculation point
- Manhole
- Outlet
- Pump
- Sewer junction
- Valve
- Weir
- Link
- ECO Lab output
- ECO Lab source
- Hydro Dynamic Output
- Hydro Dynamic Source
- Mud Transport Output
- Particle Tracking Output
- Sand Transport Output
- Transport Output
- Wind Forcing
Configuration¶
Model preparation¶
The model must have been successfully executed.
Registration¶
The MIKE+ model should be registered from within the Scenario Explorer of the MIKE Workbench. The below screens show how the registration could look like.
When registering a model, a new entry for the MIKE+ model will appear.
When selecting model type MIKE+, the Model register wizard will display a dialog where the necessary MIKE+ model information can be specified.
Table 5 - Model registration wizard (Page 1) - MIKE+ model Information
On the first page of the model registration wizard, the MIKE+ project file should be specified and the Simulation setup selected.
-
MIKE+ project file
Select the MIKE+ project file(*.mupp)
. After selecting a project file, the project file will be parsed, and the available simulation setups will be shown in the Simulation setup dropdown. -
Simulation setup
Select the simulation setup of the MIKE+ project to register.
-
Model name
Specify the name of the model (by default, the name is set to the name of the MIKE+ project).
Click Next to parse the model and continue the model registration.
On the second page of the model registration wizard, an overview of the simulation setup parsed is shown.
Here the content of the model setup parsed can be reviewed and additional initial conditions, model objects and other files can be added.
Once the simulation setup has been reviewed, click Prepare for Registration and Next to Finish to continue.
Click next to display the default Specifications page.
Scroll down to configure saving initial conditions and simulation content to disk.
This dialog allows specifying the location of the model setup in the scenario explorer as well as configuring the scenario.
-
Model Setup Group
Specify the path in the scenario explorer where the model setup should be stored. -
Scenario
Configure the scenario of the model setup. -
Do Not Create Scenario
No scenario will be created. -
Create Default Scenario
A default scenario will be created, with no model object, input or output included. -
Configure New Scenario
Configure a new scenario with using the wizard.
-
Use Template Scenario
Use an existing scenario as a template scenario by selecting the model setup containing the scenario to use as template as well as the scenario to use.
-
Save to disk
- Initial Conditions – Save initial conditions to disk.
- Simulation Content – Save simulation content to disk.
- Folder – Folder to save to.
Specify the necessary information and click Next to continue to register the model.
In case 'Configure New Scenario' or 'Use Template Scenario' has been selected, clicking Next will show a 'Configure Scenario' page.
-
Template Mismatch
List of model objects, input and output not matching the template scenario.
The dialog is empty if no mismatch was found.
-
Boundary Conditions
Configure boundary conditions.
- Category - Table the item was read from (Boundary condition, Load points, 2D boundary conditions, 2D precipitation and evaporation or 2D infiltration).
- ID – The MIKE+ ID
- Type - Boundary Type in MIKE+
- Temporal variation - Can be constant, Cyclic or Time series.
- Use in Scenario - If ticked, a model object is created on the scenario.
-
Configure Inputs
Configure what inputs to include in the scenario and what time series or scripts to use as input.
-
Configure Outputs
Configure what outputs to include in the scenario and where to store the outputs.
-
Hot Start
Configure hot start.
Click Finish to Complete the model registration wizard.
Note
If your model does not use an EPSG coordinate system, please read this faq.
Execution¶
When executing a simulation, the adapator:
1. Exports model data to m1dx file
2. Uses DHI.Mike1D.Mike1DDataAccess.dl
l to update the input data and simulation dates
3. Use DHI.Mike1D.Application.exe
to run 1D simulation or DHI.Couplings.Runner.exe
for coupled models
Alternatively, the use Mike1DController
change engine¶
The launch command can be changed in the MIKEPLUS Adapter.xml
created during model registration.
<?xml version="1.0"?>
<MIKEPLUSAdapter>
<!-- ... -->
<Use1D>False</Use1D>
<UseRiver>True</UseRiver>
<UseCatchment>True</UseCatchment>
<Use2DOverland>False</Use2DOverland>
<UseCoupling>False</UseCoupling>
<CurrentSimulationId>SPC_1</CurrentSimulationId>
<LaunchCmd>
</LaunchCmd>
<LaunchArguments>
</LaunchArguments>
<LaunchSilentArguments>
</LaunchSilentArguments>
<MIKE1DRRFilePath>
</MIKE1DRRFilePath>
<MIKE1DHDFilePath>SPC_m1d.m1dx</MIKE1DHDFilePath>
<AdditionalResultFilePaths />
<MPCCouplingFilePath>
</MPCCouplingFilePath>
<MPCCatchmentDischargeFilePath>
</MPCCatchmentDischargeFilePath>
<MPCMikeUrbanFilePath>
</MPCMikeUrbanFilePath>
<MPCRainfallRunoffFilePath>
</MPCRainfallRunoffFilePath>
<MPCResultFilePredictionDataFilePath>
</MPCResultFilePredictionDataFilePath>
<MPCVolumeFlowRelationsFilePath>
</MPCVolumeFlowRelationsFilePath>
<MPCHotStartFilePath>
</MPCHotStartFilePath>
<Folders />
</MIKEPLUSAdapter>
Updating the launch command requires that the model setup is exported e.g. using the Open in Native Tool or by using an export script, so that that the MIKEPLUS Adapter.xml
can be changed.
After changing the MIKEPLUS Adapter.xml
file, the exported model, should be zipped and imported again, e.g. by using an zip and import script in the script manager.
def ReZipSetup(modelSetupPath, directory):
"""
<Script>
<Author>admin</Author>
<Description>Script to zip a folder and assign the result as content to a modelsetup, ths updating the blob</Description>
<Parameters>
<Parameter name="modelSetupPath" type="string">The full path of the model setup in the database (copy Full Path)</Parameter>
<Parameter name="directory" type="string">The directoy path in windows where the setup has been unpacked</Parameter>
</Parameters>
</Script>
"""
if (System.IO.Directory.Exists(directory) == False):
return;
scm = app.Modules.Get("Scenario Manager");
modelsetup = scm.ModelSetupList.Fetch(modelsetupPath);
zipptr = BaseAdapter.ZipFiles(directory, None, "no Adapter");
modelsetup.Content = zipptr;
scm.ModelSetupList.Update(modelsetup, True);
Warning
Be carefull when editing the model information and importing the changes, as the model information is used as when running simulation.
Limitations¶
The MIKE+ adapter is using the MIKE1D adapter for model execution and is currently limited to working with River, Collection system and overland flow models.