Question
How can I extract depth-averaged values from a 3D dfsu file?Answer
MIKE Zero Release 2025 includes a new tool in the MIKE Zero Toolbox called DFSU Vertical Statistics.
With this tool you can extract depth averaged values in a number of ways.
For older MIKE Zero releases it is possible to use the tool engine from the bin directory and execute it via the Launch Simulation Engine.
The tool engine is called ‘DataVerticalAveragingFM.exe’.You have to create an input ascii file to define the data. You may extract more than one item at a time and you can choose the layer interval to use for the averaged values. The output will be a 2D dfsu file. An example with the first two items is shown below.
Note: item numbering starts from 2
[DataVerticalAveragingFM]
[INPUT]
file_name = |volume.dfsu|
EndSect // INPUT[OUTPUT]
file_name = |velocity_depth_average.dfsu|
title = 'my title'
number_of_items = 2
item_numbers = 2, 3
maximum = 0
minimum = 0
mean = 1
mode = 1
first_layer = 1
last_layer = 18
EndSect // OUTPUTEndSect // DataVerticalAveragingFM
The parameter 'mode' defines how you count the number of layers:
mode = 0: from maximum bottom
mode = 1: from surfaceThis tool can also be used to extract a single layer from a 3D dfsu file to a 2D dfsu file by defining first_layer = last_layer. E.g. to extract the top layer of a 3D dfsu file to a 2D dfsu file use the following setup:
[DataVerticalAveragingFM]
[INPUT]
file_name = |volume.dfsu|
EndSect // INPUT[OUTPUT]
file_name = |velocity_top_layer.dfsu|
title = 'my title'
number_of_items = 2
item_numbers = 2, 3
mode = 1
first_layer = 1
last_layer = 1
EndSect // OUTPUTEndSect // DataVerticalAveragingFM
Alternatively you can download a compiled version of the tool DHI.MikeCore.Util from GitHub at https://github.com/DHI/MIKECore-Examples/releases.
This tool can, amongst other things, extract a layer from a 3D dfsu file.
Note: these tools are not part of the official release and as such have not be subjected to extensive testing.
In MIKE Zero Release 2024 Update 1 and later you can use the official tool Data Extraction FM to extract a single layer from a 3D dfsu file to a 2D dfsu file.
Views:
Keywords: 3D, dfsu, average, depth, layer
Related Products:
MIKE 21/3