feflowlib - feflow2ogs#

Section author: Julian Heinze (Helmholtz Centre for Environmental Research GmbH - UFZ)

Introduction#

The converter is used to convert data stored in FEFLOW binary format to VTK format (.vtu). This converter was developed in the Python language and interacts with the Python API of FEFLOW. It allows the use of pyvista especially for the creation of unstructured grids. But it can also be used as a library to easily access FEFLOW data in Python. With the usage of ogs6py it is possible to create a prj-file from the converted model to enable simulations with OGS. At the moment only steady state diffusion and liquid flow processes are supported to set up the prj-file.

Features#

All in all, the converter can be used to convert steady state diffusion and liquid flow processes from FEFLOW. This includes the conversion of the bulk mesh together with the boundary conditions, as well as the creation of the corresponding mesh vtk-files. In addition, (in)complete prj files can be created automatically. The prj file is set up of a model-specific part and a part that is read from a template and defines the solver and process configuration. The current status enables:

Main features:#

  • conversion of FEFLOW meshes

  • extraction of boundary condition

  • creation of OGS-models for steady state diffusion and liquid flow processes

  • usage via command line interface or as Python library

specific features:#

  • get point, cells and celltypes to array according to pyvista convention for pyvista.UnstructuredGrid

  • write MaterialIDs to a dictionary

  • write point and cell data with MaterialIDs to dictionaries that match the points and cells of the input data

  • convert only the geometry of input data

  • update the geometry with point and cell data

  • convert the geometry with point and cell data

  • extraction and writing of material specific meshes that represent inhomogeneous material properties

  • prepare FEFLOW data for ogs simulation with tools that allow:

    • creation of (in)complete prj-files for OGS

      • model specific elements refer to mesh, material properties, parameter, boundary conditions

      • templates define the solver, time loop, process, output

    • writing of boundary conditions to separate .vtu-files

Requirements#

OR:

  • FEFLOW

  • ogstools with feflow (pip install ogstools[feflow])

Installation#

The converter requires FEFLOW to be installed. There are different ways to fulfill this requirement, either one installs FEFLOW or works with a container that has FEFLOW installed.

Depending on the Linux distribution used, different steps are possible to install FEFLOW. The DHI supports the installation of FEFLOW on Ubuntu. Instructions for installing from an apt repository can be found on their website. Additionally, the environment variables must be set correctly to find the FEFLOW installation in Python. The following three variables need to be set:

export PYTHONPATH=/opt/feflow/8.0/python
export LD_LIBRARY_PATH=/opt/feflow/8.0/lib64:/opt/feflow/common/qt/lib64:/opt/feflow/common/lib64
export FEFLOW80_ROOT=/opt/feflow/8.0

DHI, the developer of FEFLOW, do not support macOS. So, it is needed to use the Docker container or a virtual machine.

FEFLOW is fully supported on Windows. The installation is according to the official website.

The installation of the FEFLOW converter with ogstools is optional. The option can be selected with the following pip-command.

pip install ogstools[feflow]

Command line usage#

feflow2ogs is a command line interface of the converter that summarizes the main functions to provide the user with an accessible application.

This tool converts FEFLOW binary files to VTK format.

usage: feflow2ogs [-h] [-i INPUT] [-o OUTPUT]
                  [{geo_surface,geometry,properties,properties_surface,OGS_steady_state_diffusion,OGS_liquid_flow}]
                  [{BC,no_BC}]

Positional Arguments#

case

Possible choices: geo_surface, geometry, properties, properties_surface, OGS_steady_state_diffusion, OGS_liquid_flow

Different cases can be chosen for the conversion: 1. “geometry” to convert only the geometries of the mesh. 2. “properties” to convert all the mesh properties to nodes and cells. 3. “surface” to convert only the surface of the mesh. 4. “properties_surface” to convert the surface with properties. 5. “OGS_steady_state_diffusion” to prepare a OGS-project according to a steady state diffusion process. 6. “OGS_liquid_flow” to prepare a OGS-project according to a liquid flow process.

Default: “OGS_steady_state_diffusion”

BC

Possible choices: BC, no_BC

This argument specifies whether the boundary conditions is written. It should only be used if the input data is 3D. The boundary condition need to be extracted, when a OGS simulation wants to be setup.

Default: “BC”

Named Arguments#

-i, --input

The path to the input FEFLOW file.

-o, --output

The path to the output VTK file.

API usage#

In addition, it may be used as Python module. Further information can be found at: ogstools.feflowlib package.

Example#

An example of how the API can be used is given at: How to use feflowlib.