Proposal for GSoC: Elmer-Integration

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Proposal for GSoC: Elmer-Integration

Post by m42kus »

Hey, my name is Markus Hovorka and I'm going to apply for the Elmer-Integration GSoC project. I'm a computer science student at the TU Vienna and been involved with FreeCAD personally as well as at work for the past few years.

I was introduced to FreeCAD during a job which involved optimization of an existing product. During that time I used the Part Design and the FEM workbench for post-processing and most of the (structural) simulations I had to do.

After that I quickly got into scripting and programming in/for FreeCAD. Currently I'm being paid to develop a workbench to interface an existing solver for the simulation of the sputtering process.

I already had a look at the FEM source code and think that the goals of the Elmer-Integration are quite reasonable. I'm confident that it can be done in the time span that GSoC provides. Because of my current employment I am already familiar with the challenges and problems of interfacing an external solver as well as presenting/exposing the functionality to the user.

My involvement into the FreeCAD community is still very limited as of today. In part because the project I'm working on right now is closed source. However I maintain the freecad-git package for arch linux since a few months now and plan to contribute much more in the future.

I'm going to submit my proposal before the end of the week and look forward to spending most of my summer coding for FreeCAD ;)
Last edited by m42kus on Tue Mar 21, 2017 6:13 pm, edited 1 time in total.
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Proposal for GSoC: Elmer-Integration

Post by Kunda1 »

AKA drhooves 8-)
https://aur.archlinux.org/packages/freecad-git/
Thanks for all your work on Arch AUR!
Glad you're applying!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Proposal for GSoC: Elmer-Integration

Post by ickby »

Hello Markus,

good to hear that you like to make a proposal for this topic! I can't say much about the topic itself, and suppose you are in direct contact with Bernd and HoWil about the technical details. They will get you suport and review your proposal before final commit. For any organisational topic around GSoC I can provide you with any details you many want to know. Please come back to me if anything is unclear.
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Proposal for GSoC: Elmer-Integration

Post by m42kus »

Thanks for the warm welcome! :)

The first draft of my proposal is finished now. Feedback is very welcome and feel free to point out any spelling or grammatic errors I made (english is not my first language ;)). One area where the my proposal holds back a bit is post-processing. Not sure if a paraview-only abbroach is the best way to go right now, but it's what I had in mind while writing.

I wrote the proposal in google docs. Commenting rights are granted for all in possesion of the following link. I also copied the text into the post below which I will update once the proposal is finished.

https://docs.google.com/document/d/1mX3 ... sp=sharing

Proposal for GSoC 2017

FreeCAD Elmer-Integration

This proposal targets the “Elmer-Integration” project outlined in the “Google Summer of Code” article on the wiki (https://www.freecadweb.org/wiki/Google_Summer_of_Code). The project aims at an extensive integration of the elmer multiphysics solver into the FEM workbench of FreeCAD.

The article separates the task into three phases. The first two phases basically allow elmer to be used as a drop in replacement for calculix. The last (third) phase includes the addition of many new constraint types as well as a few more fundamental changes (e.g. support for multiphysics) to the FEM workbench. Not part of the project is the development of result objects for all types of simulations Elmer supports. Post-processing shall be done in paraview.

The article on the wiki already provides a very detailed description of the project and it’s scope. This proposal tries to present a more concrete description of the task and already provide some hints at possible implementation approaches. It also makes some assumptions about details left out in the wiki article. Following the brief outline of the project is a timeline for the official coding period of GSoC.

Project Outline

The Solver Object
To support the elmer solver a new solver object is required. It will mirror the calculix solver object in it’s basic usage. Both support steady state and transient simulations.

One key difference will be the support for multiphysics simulation. The solver object must allow the specification of multiple “sub” solvers in one analysis. Each of theses “sub” solver will be exposed to the user in the object tree and it’s individual configuration through the property editor and/or a task panel. This feature is not required until phase three of the project but it should be taken into account as soon as possible.

Constraint Objects
A big part of integrating the elmer solver will be the creation of many new constraint objects (especially for new, currently unsupported, types of simulations). This is also not required until phase three because phase one and two reuse constraint objects already used by calculix.

Much inspiration concerning interface design can be drawn from the ElmerGUI application. It already provides Qt-Dialogs for the configuration of all constraints supported by the elmer solver.

The timeline of GSoC won’t allow to support every constraint type elmer supports. It will largely depend on the set of supported types of simulations which is best decided by the FreeCAD community in the first month of GSoC.

Case Generation
An Elmer simulation is defined by one input file and the mesh scene. Those must be available in the folder in which the ElmerSolver program is executed.
  • <name>.sif (Solver Input File): Defines all aspects of the simulation (except mesh).
  • mesh/ (Mesh of the scene): All meshes part of the scene in a special format only used by Elmer.
These will be generated in the same fashion it’s already done for the calculix solver. The Elmer project provides a program called ElmerGrid which is able to convert most mesh formats to the one understood by ElmerSolver. It will be used to export the mesh from FreeCAD.

Post-Processing
Post-Processing presents a very big challenge as there is very little that FreeCAD provides at the moment.
The article on the wiki explicitly states that paraview shall be used for postprocessing. To enable a convenient workflow a command could be added that starts paraview with the results from the active analysis.

To keep all information inside the FreeCAD Document (as opposed to the case directory of Elmer) a results object that holds the VTK data generated by the Elmer program sound be considered.

Timeline
After the accepted students are announced at May 4th the “Community Bonding Period” starts. This time will be used to present a more detailed description of the project to the community and FEM developer, discuss and refine it. Also I will be reading lots of FEM workbench code and contribute a little bit of documentation and probably small changes/fixes mainly to familiarize myself with the codebase and make it easier for other developers new to the FEM codebase.

Coding than officially begins at May 30. The final week in which students are supposed to submit their final work starts with August 21. These dates amount to roughly 12 weeks time to work on the project presented in this document.

Phase 1 outlined in the article on the wiki is already partially implemented in an unofficial fork. This code can be used to jumpstart the development.

Phase 1
Develop the Elmer solver object. Meshes shall be exported and the ElmerSolver executable called in the right manner in a valid Elmer simulation case directory.

Week 01/02: Assess the code that's already available for Elmer-Integration, complete it, write missing documentation and automated tests.

Phase 2
Handle the complete set-up and execution for mechanical problems from within FreeCAD. After completion of Phase 2 the Elmer solver should be fully usable as an replacement of the calculix solver which will probably enable support from the community concerning testing.

Week 03: Generate a valid sif file with global solver settings.
Week 04/05: Add material information and gradually all mechanical constraints to the sif file generator.
Week 06: Provide a results object that holds the VTK post-processing data. Also add a shortcut to display the data in paraview and facilities to export the data to the file system.

Phase 3
Support multiphysics and more types of simulations. This requires modification of the solver object and addition of many constraint types.

Week 07/08: Adapt solver object (and sif file generation) to support multiphysics simulation (container of sub solver).
Week 09-11: Provide wide range of community selected constraints.
Week 12: Write eventually missing documentation, user manuals etc. and much testing.
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Proposal for GSoC: Elmer-Integration

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Proposal for GSoC: Elmer-Integration

Post by m42kus »

Thanks for that, I already uploaded and shared my draft ;)
My GSoC Devlog: ceeli.github.io/gsoc
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Proposal for GSoC: Elmer-Integration

Post by ian.rees »

M42kus, this sounds awesome! I'm looking forward to modelling electrical stuff (and maybe even electrical+thermal) in FreeCAD with Elmer. Drop me a line if there's anything I can do to help. -Ian-
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Proposal for GSoC: Elmer-Integration

Post by bernd »

Hi Markus,

welcome to the FreeCAD community, and welcome to the GSoC! Thank you very much for your proposal. I have been reading your proposal. Your proposal is quite detailed and addresses what we have proposed. This looks great.

What I have been missing in phase2 is the FEM-Mesh. This needs to be transfered to Elmer too, in order to make a analysis.

It would be cool to include the CalculiX cantilever beam as the first analysis to make with Elmer from within FreeCAD. Means: load the 3D FEM example from Start workbench --> add an ElmerSolver object --> select the ElmerSolver object --> run the analysis (can be tested with Z88 solver at the moment) --> an result object should be created.

Furthermore an ElmerFEM unit test for an simple mechanical analysis would be needed too.

bernd
m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Proposal for GSoC: Elmer-Integration

Post by m42kus »

Hey bernd,
Thanks for mentoring students at GSoC and especially for taking the time to review my proposal!
bernd wrote: What I have been missing in phase2 is the FEM-Mesh. This needs to be transfered to Elmer too, in order to make a analysis.
Your right, missed that during my analysis of the FEM code, thanks for pointing it out. Will have a quick look at the source and adapt the proposal.
bernd wrote: It would be cool to include the CalculiX cantilever beam as the first analysis to make with Elmer from within FreeCAD. Means: load the 3D FEM example from Start workbench --> add an ElmerSolver object --> select the ElmerSolver object --> run the analysis (can be tested with Z88 solver at the moment) --> an result object should be created.
Yes good idea. I suppose that this example should yield a machanical result-object, meaning machanical result-objects for mechanical simulations and a new VTK result-object for the rest? Or would a VTK only approach be prefered? The reason for this question I guess is that I don't know what direction the FEM workbench is going in that regard. Is there a direction? ;)
bernd wrote: Furthermore an ElmerFEM unit test for an simple mechanical analysis would be needed too.
Of course. I didn't mention testing in the proposal except for phase 1. However I intend to write tests at every stage of development. Should I include that in the timeline?
Last edited by m42kus on Wed Mar 29, 2017 4:26 pm, edited 1 time in total.
My GSoC Devlog: ceeli.github.io/gsoc
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Proposal for GSoC: Elmer-Integration

Post by Jee-Bee »

bernd wrote:It would be cool to include the CalculiX cantilever beam as the first analysis to make with Elmer from within FreeCAD. Means: load the 3D FEM example from Start workbench --> add an ElmerSolver object --> select the ElmerSolver object --> run the analysis (can be tested with Z88 solver at the moment) --> an result object should be created.
I can imagine it is outside the scope of this project. What i think it would be nice if a analysis is done with multiple solvers to compare them (and post on wiki).
Post Reply