Using ElmerSolver for Flow

About the development of the FEM module/workbench.

Moderator: bernd

Slughy
Posts: 3
Joined: Tue Dec 29, 2020 10:00 am
Location: Belgium

Using ElmerSolver for Flow

Postby Slughy » Tue Dec 29, 2020 9:02 pm

Hi,

I am fairly new to FC and the integrated FEM workbench.

Structural analysis (simple beams/structures) via CalculiX/CCX is rather straightforward. However, I hit a wall when trying to set up a simple pipe and flow analysis.

When I search the forum I find several examples of Elmer files, all seem to solve fine and produce usable outputs. None of them is however a pure flow case, most are Heat/Flow.

When trying to simulate these examples solely for Flow I cannot achieve the same success (even checking the parameters each at a time).

Steps which I followed:

1. My test setup consists of a tube which reduces in diameter. The tube is split into an inner solid and outer (wall) solid. Both were combined as boolean fragments.

2. The large-diameter face of the inner solid is then given a flow velocity constraint in the X-axis direction.

3. Materials properties are added to outer and inner tubes.

4. Finally Gmesh is run to produce the mesh. For testing, a coarse mesh is used (once I figured how to do it, a refined mesh is to be used).

5. When running the Elmer Solver, I then get either errors or infinite looping.

5a. When I attribute 1 solid (the inner) to the Flow equation, I get an error stating "AttributeError: 'list_iterator' object has no attribute 'next'".
5b. When I attribute none or both solids to the flow equation, I get infinite looping of the Elmer solver, and I get Warning that there is no Viscosity parameter.

There doesn't seem to be a step by step tutorial on how to set up the Elmer solver (lots of references to the Elmer manual, but not really useful for me as I can't even get the solver started).

I must be making a stupid mistake in setting up the shape/solid etc..., so if anyone could give me a hint then that would be greatly appreciated.

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23323 (Git)
Build type: Release
Branch: master
Hash: 512d5c6141aec52b6eecc67370336a28fde862a6
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Dutch/Belgium (nl_BE)
Attachments
Pipe-v3.FCStd
Deleted the mesh to reduce file size. Would generally run Gmsh from Pipe body with 5/1mm mesh size
(25.48 KiB) Downloaded 11 times
User avatar
johnwang
Posts: 637
Joined: Sun Jan 27, 2019 12:41 am

Re: Using ElmerSolver for Flow

Postby johnwang » Tue Dec 29, 2020 9:22 pm

You could try the Elmer examples first.

Switch to FEM workbench, then Choose Menu Utilities/Open FEM examples.
elmer.jpg
elmer.jpg (56.1 KiB) Viewed 560 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Slughy
Posts: 3
Joined: Tue Dec 29, 2020 10:00 am
Location: Belgium

Re: Using ElmerSolver for Flow

Postby Slughy » Wed Dec 30, 2020 3:44 pm

Thanks johnwang,

My solver examples don't have an example of flow equation.

Screenshot_510.png
Screenshot_510.png (11.29 KiB) Viewed 497 times

I figure it has to do with the mesh
User avatar
johnwang
Posts: 637
Joined: Sun Jan 27, 2019 12:41 am

Re: Using ElmerSolver for Flow

Postby johnwang » Thu Dec 31, 2020 3:38 am

Help/About FreeCAD

My Version is 0.19.23500 (Git)

You can download version 23546 at the bottom of this page https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
thschrader
Posts: 2023
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Using ElmerSolver for Flow

Postby thschrader » Thu Dec 31, 2020 4:41 pm

Slughy wrote:
Tue Dec 29, 2020 9:02 pm
...
When trying to simulate these examples solely for Flow I cannot achieve the same success
...
3. Materials properties are added to outer and inner tubes.
...
When running the flow-analysis alone you need only the inner tube as computing domain.
When opening my file you must reset the inlet speed to 10 mm/s (opens with 1000 mm/s)
My mesh is coarse to speed up simulation, see glitches at wall.
I set preconditioner to ILU1 (see datatab of elmer-solver) according to elmer-pipe-tutorial.
I use openfoam, I am not very familiar with elmer.
It is time for a beer :)
Pipe_v3_ts.FCStd
(25.42 KiB) Downloaded 12 times
pipe_flow.JPG
pipe_flow.JPG (67.2 KiB) Viewed 389 times
Slughy
Posts: 3
Joined: Tue Dec 29, 2020 10:00 am
Location: Belgium

Re: Using ElmerSolver for Flow

Postby Slughy » Fri Jan 01, 2021 10:11 pm

Thanks!

It was indeed the solid body throwing the viscosity errors, had already figured that out yesterday evening before seeing your reply :)

Interesting note on the preconditioner setting, do you know of a resource which elaborates on the difference between the settings? I have also come across tutorials which use ILU0 and it even appears from some sources ILU4 is to be prefered.

I will certainly look into openfoam.
RatonLaveur
Posts: 860
Joined: Wed Mar 27, 2019 10:45 am

Re: Using ElmerSolver for Flow

Postby RatonLaveur » Mon Feb 22, 2021 7:04 pm

Hi sorry it took me that much time to get to answer you but I have not been extremely active of late.

I have written a basic wiki page for Elmer which guides to their own documentation. It is very detailed.
Here the link to the page:
https://wiki.freecadweb.org/FEM_SolverElmer

And if you go to the bottom of the page you'll find the resources:
https://www.nic.funet.fi/pub/sci/physics/elmer/doc/

I have barely started scratching the surface and still owe our resident Bernd a proper list describing each parameter in the Elmer data tab..
User avatar
bernd
Posts: 11296
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Using ElmerSolver for Flow

Postby bernd » Tue Feb 23, 2021 4:48 am

@tschrader
is there a bug or why must the inlet speed be changed?
thschrader
Posts: 2023
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Using ElmerSolver for Flow

Postby thschrader » Tue Feb 23, 2021 8:09 am

bernd wrote:
Tue Feb 23, 2021 4:48 am
@tschrader
is there a bug or why must the inlet speed be changed?
Seems to be a bug. When closing the inlet-dialog and reopen,
the decimals change.
RatonLaveur
Posts: 860
Joined: Wed Mar 27, 2019 10:45 am

Re: Using ElmerSolver for Flow

Postby RatonLaveur » Tue Feb 23, 2021 7:00 pm

bernd wrote:
Tue Feb 23, 2021 4:48 am
@tschrader
is there a bug or why must the inlet speed be changed?
Actually, it happens immediately when writing a flow boundary. I remember seeing this discussion in post during the summer of 2020. Can't find the reference.

Tested it today:
Boundary editing task:
2021-02-23 19_56_21-FreeCAD 0.19.png
2021-02-23 19_56_21-FreeCAD 0.19.png (20.82 KiB) Viewed 83 times
Resulting property view:
2021-02-23 19_56_29-.png
2021-02-23 19_56_29-.png (14.13 KiB) Viewed 83 times
Re-editing the boundary and pressing OK does not change the respective values. Everything stays put, just a factor between the two.

OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24219 (Git)
Build type: Release
Branch: master
Hash: 8c26baebab320b8c1c3279bc8eb34a1eb6c7a363
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/Switzerland (en_CH)