GSoC2020, FEM: extend examples

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 11098
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

GSoC2020, FEM: extend examples

Postby bernd » Sun Mar 29, 2020 7:01 pm

the deadline for Student application is just in a few days ...

As a result of a discussion there came up an idea for a 2020 GSoC. Extend the FEM examples.

- create a example for each available constraint and each available analysis type or equation type
- take some of well known fea examples like the standard calculix ones or the calculix examples from martin kraska or examples from z88 or elmer or other open source fea.
- take some examples which are easy to recalculate by a simple calculator
- get in touch with the FreeCAD FEM community to get ideas for interesting examples
- around 20 new examples in summary, depending on the complexity may be more may be less.

each example:
- code in Python (see https://github.com/FreeCAD/FreeCAD/tree ... emexamples)
- create dokumentation in the Python module of the example (this could be done for the existant examples too)
- create a input writing test for each example. see for example https://github.com/FreeCAD/FreeCAD/blob ... cxtools.py
- create a wiki page for each example (optional, get in contact with the wiki and documentation team first)


Before the GSoC starts the student should himself get familiar with git, how to make a PR and with FreeCAD FEM example code. The best is just to code a new example and make a PR with this example.

But the most important! Make a proposal before March 31th.

cheers bernd


EDIT: more examples:
- pressure on sphere https://forum.freecadweb.org/viewtopic. ... 30#p301067
- tunning fork: https://forum.freecadweb.org/viewtopic.php?t=15820, http://justinablack.com/tuning_fork_freqs/, https://en.wikipedia.org/wiki/Tuning_fo ... _frequency

Elmer:
https://www.nic.funet.fi/pub/sci/physic ... orials.pdf
https://www.nic.funet.fi/index/elmer/do ... nonGUI.pdf
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Mon Mar 30, 2020 2:14 pm

bernd wrote:
Sun Mar 29, 2020 7:01 pm
the deadline for Student application is just in a few days ...

As a result of a discussion there came up an idea for a 2020 GSoC. Extend the FEM examples.

- create a example for each available constraint and each available analysis type or equation type
By all available constraints, I think you mean the constraints available here:
https://wiki.freecadweb.org/FEM_Module# ... onstraints

And while performing FEM analysis in FreeCAD, I could see the available Analysis types as:
  1. Static
  2. Frequency
  3. Thermo mechanical
Are these all the types that FreeCAD has?

bernd wrote:
Sun Mar 29, 2020 7:01 pm
- take some of well known fea examples like the standard calculix ones or the calculix examples from martin kraska or examples from z88 or elmer or other open source fea.
Here are some examples I found:

Martin Kraska's Examples
Calculix turbo-charger turbine
Calculix turbo-charger compressor

The examples of Elmer look complex to me:
https://www.csc.fi/web/elmer/application-examples

Elmer's examples aren't directly available:
https://en.z88.de/examples/

bernd wrote:
Sun Mar 29, 2020 7:01 pm
- take some examples which are easy to recalculate by a simple calculator
Ok, I will search for them.

bernd wrote:
Sun Mar 29, 2020 7:01 pm
- get in touch with the FreeCAD FEM community to get ideas for interesting examples
This looks like a good idea to me.

bernd wrote:
Sun Mar 29, 2020 7:01 pm
Before the GSoC starts the student should himself get familiar with git, how to make a PR and with FreeCAD FEM example code. The best is just to code a new example and make a PR with this example.

But the most important! Make a proposal before March 31th.
Got it!!
I am working on the proposal, will soon share it here for review.
User avatar
bernd
Posts: 11098
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC2020, FEM: extend examples

Postby bernd » Mon Mar 30, 2020 3:33 pm

Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
By all available constraints, I think you mean the constraints available here:
https://wiki.freecadweb.org/FEM_Module# ... onstraints
yes. For all constraints there are examples in this forum somewhere. We will find them :)



Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
And while performing FEM analysis in FreeCAD, I could see the available Analysis types as:
  1. Static
  2. Frequency
  3. Thermo mechanical
Are these all the types that FreeCAD has?
Yes for CalculiX solver, no for elmer solver. We have examples for each of these types for Calculix, not for elmer. Would be cool to have one for each Equation (they are called equation in elmer solver).



Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
bernd wrote:
Sun Mar 29, 2020 7:01 pm
- take some of well known fea examples like the standard calculix ones or the calculix examples from martin kraska or examples from z88 or elmer or other open source fea.
Here are some examples I found:

Martin Kraska's Examples
Calculix turbo-charger turbine
Calculix turbo-charger compressor

The examples of Elmer look complex to me:
https://www.csc.fi/web/elmer/application-examples

Elmer's examples aren't directly available:
https://en.z88.de/examples/
ok these are a loot. You missed the original CalculiX examples fromm ccx home page http://www.dhondt.de/ and http://www.dhondt.de/cgx_2.16.1.exa.tar.bz2


Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
bernd wrote:
Sun Mar 29, 2020 7:01 pm
- take some examples which are easy to recalculate by a simple calculator
Ok, I will search for them.

bernd wrote:
Sun Mar 29, 2020 7:01 pm
- get in touch with the FreeCAD FEM community to get ideas for interesting examples
This looks like a good idea to me.

bernd wrote:
Sun Mar 29, 2020 7:01 pm
Before the GSoC starts the student should himself get familiar with git, how to make a PR and with FreeCAD FEM example code. The best is just to code a new example and make a PR with this example.

But the most important! Make a proposal before March 31th.
Got it!!
I am working on the proposal, will soon share it here for review.
great
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Mon Mar 30, 2020 5:22 pm

Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm

Got it!!
I am working on the proposal, will soon share it here for review.
Please review my GSoC proposal:
https://docs.google.com/document/d/1cM6 ... sp=sharing
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Mon Mar 30, 2020 6:34 pm

bernd wrote:
Mon Mar 30, 2020 3:33 pm
Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
By all available constraints, I think you mean the constraints available here:
https://wiki.freecadweb.org/FEM_Module# ... onstraints

yes. For all constraints there are examples in this forum somewhere. We will find them :)
We sure will! 8-)

bernd wrote:
Mon Mar 30, 2020 3:33 pm
Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm
And while performing FEM analysis in FreeCAD, I could see the available Analysis types as:
  1. Static
  2. Frequency
  3. Thermo mechanical
Are these all the types that FreeCAD has?
Yes for CalculiX solver, no for elmer solver. We have examples for each of these types for Calculix, not for elmer. Would be cool to have one for each Equation (they are called equation in elmer solver).
Ok.
Then I will try to do some FEM analysis using Elmer to find out.

By the way, how many present examples are there for elmer?
And in the project are we aiming to create examples for al the solvers?

bernd wrote:
Mon Mar 30, 2020 3:33 pm
Sudhanshu wrote:
Mon Mar 30, 2020 2:14 pm

Here are some examples I found:

Martin Kraska's Examples
Calculix turbo-charger turbine
Calculix turbo-charger compressor

The examples of Elmer look complex to me:
https://www.csc.fi/web/elmer/application-examples

Elmer's examples aren't directly available:
https://en.z88.de/examples/
ok these are a loot. You missed the original CalculiX examples fromm ccx home page http://www.dhondt.de/ and http://www.dhondt.de/cgx_2.16.1.exa.tar.bz2
Ok. Thanks.
User avatar
bernd
Posts: 11098
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC2020, FEM: extend examples

Postby bernd » Tue Mar 31, 2020 5:46 am

Sudhanshu wrote:
Mon Mar 30, 2020 5:22 pm
Please review my GSoC proposal:
https://docs.google.com/document/d/1cM6 ... sp=sharing
looks good to me
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Tue Mar 31, 2020 8:53 am

bernd wrote:
Tue Mar 31, 2020 8:05 am
Sudhanshu wrote:
Tue Mar 31, 2020 8:01 am
For meshers, since FreeCAD (mostly) comes with Netgen in it and Gmsh needs to be externally installed in the system I will use Netgen by default. Maybe if time permits and if it feels necessary, some examples using Gmsh will also be created.
the meshes uses manually by Python created meses ATM. These meshes where exported from a either with Netgen or Gmsh generated mesh. The code to export is not yet in master. I will merge this as soon as some dev starts in this regard. BTW there is a topic on FEM ...
https://forum.freecadweb.org/viewtopic. ... 70#p382470
Can you share the link of the code you are talking about?

Also, I was reading the Calculix cantilever example from here. The code isn't that difficult after all. Very similar to how a macros work in FreeCAD. So to generate the examples, apart from knowing the FEM theory of the example I only need to know the functions that should be called to setup it's various parts and constraints. Not that difficult.

By the way, in that example you set various parameters if the solver is calculix or ccxtools, but for z88 and elmer you don't do any such thing. Why?
Also, I am not able to do analysis using elmer and I couldn't find any tutorial in the user documentation. So can you share some relevant documentation.

And, I have always wondered what is the difference between Calculix and CCXTools? :?:
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Tue Mar 31, 2020 8:56 am

bernd wrote:
Tue Mar 31, 2020 5:46 am
Sudhanshu wrote:
Mon Mar 30, 2020 5:22 pm
Please review my GSoC proposal:
https://docs.google.com/document/d/1cM6 ... sp=sharing
looks good to me
Thanks for reviewing! :D
Should I mention anything about creating examples for Elmer and/or Z88 or not?

And, is the "Current Scenario" good enough? Would you like to add anything in it?
User avatar
bernd
Posts: 11098
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GSoC2020, FEM: extend examples

Postby bernd » Tue Mar 31, 2020 10:42 am

the only difference between the different solver z88, Calculix and Elmer is the solver object and the equation object for elmer. Thus it is easy to set up examples for multiple solvers. See https://github.com/FreeCAD/FreeCAD/blob ... py#L70-L90

means you should extend the proposal as follows. At leas one example for each constraint which is supported by each solver. Means z88 only supports fixed constraint and force constraint. The example we have has these two constraints means it is fine. But for elmer there are a few more supported constraints. See https://github.com/FreeCAD/FreeCAD/blob ... /writer.py
User avatar
Sudhanshu
Posts: 355
Joined: Mon Oct 15, 2018 5:22 am

Re: GSoC2020, FEM: extend examples

Postby Sudhanshu » Tue Mar 31, 2020 2:22 pm

bernd wrote:
Tue Mar 31, 2020 10:42 am
the only difference between the different solver z88, Calculix and Elmer is the solver object and the equation object for elmer. Thus it is easy to set up examples for multiple solvers. See https://github.com/FreeCAD/FreeCAD/blob ... py#L70-L90
Ok nice.
Thanks.

bernd wrote:
Tue Mar 31, 2020 10:42 am
means you should extend the proposal as follows. At leas one example for each constraint which is supported by each solver. Means z88 only supports fixed constraint and force constraint. The example we have has these two constraints means it is fine. But for elmer there are a few more supported constraints. See https://github.com/FreeCAD/FreeCAD/blob ... /writer.py
From what I could infer from the writer module, the constraints supported by Elmer are as follow:
  1. InitialTemperature
  2. BodyHeatSource
  3. Heatflux
  4. Temperature
  5. ElectrostaticPotential
  6. Pressure
  7. Force
  8. Fixed
  9. Displacement
  10. SelfWeight
  11. InitialFlowVelocity
  12. FlowVelocity
Also, the type of equations supported by Elmer are:
  1. Heat Equation
  2. Electrostatic Equation
  3. Fluxsolver ( :?: )
  4. Elasticity
  5. Flow
Is that all?