Skip to content

OpenSEMBA/step2gmsh

Repository files navigation

step2gmsh

Tests

step2gmsh is a collection of python scripts to generate MFEM compatible meshes from step files using calls to gmsh mesher.

The main usage is to generate 2D finite element method (FEM) meshes which can be used to solve electrostatic/magnetostatic problems.

Installation

Install requirements with

    python -m pip install -r requirements.txt

Usage

Step2gmsh requires two diferent files:

  • A json file where material properties are described for each geometry
  • A step file with all the geometry info

Both files must have the same label and share folder path. An example of those files can be found in Five wires case

Launch from command line as

    python src/step2gmsh.py <-i path_to_step_file>

The tested input step files have been generated with FreeCAD. The geometrical entities within the step file must be separated in layers. The operations performed on the different layers depend on their material asignment registered in the json file.

  • A layer with a PEC material, represent a perfect conductor. In case one of the layers surrounds the rest of elements, it will be asigned as ground and defines the global domain for the rest of conductors. Internally, this will be represented as Conductor_0. The areas of the rest of conductors different to zero will be substracted from the computational domain and removed. In open cases, Conductor_0 is just another conductor and the domain is defined using the bounding box of the layers.
  • Layers registered as Dielectric are used to identify regions which will have a material assigned.
  • Open and semi-open problems can be defined using a single layer called OpenBoundary.

Below is shown an example of a closed case with 6 conductors and 5 dielectrics, the external boundary corresponds to Conductor_0. The case is modeled with FreeCAD and can be found in the testData/five_wires folder together with the exported as a step file. The resulting mesh after applying step2gmsh is shown below.

Five wires example as modeled with FreeCAD Five wires example meshed with gmsh

License and copyright

step2gmsh is licensed under GNU GENERAL PUBLIC LICENSE Version 2, its copyright belongs to the University of Granada.

Acknowledgments

This project is funded by the following grants:

  • HECATE - Hybrid ElectriC regional Aircraft distribution TEchnologies. HE-HORIZON-JU-Clean-Aviation-2022-01. European Union.
  • ESAMA - Métodos numéricos avanzados para el análisis de materiales eléctricos y magnéticos en aplicaciones aerospaciales. PID2022-137495OB-C31. Spain.

About

Generates MFEM compatible meshes from step files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages