PR 7100: FEM WB Elmer viscosity bug fix
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
PR 7100: FEM WB Elmer viscosity bug fix
When a project uses thermal-flow simulation for solid and fluid together then Navier-Stokes equation is applied both for solid and fluid. But solid has not "Viscosity" property so Elmer prints warnings "Requested property: [Viscosity], not found" and calculation has very long time or may not be converged.
This fix disables Stokes-Navier equation for Solid objects.
Example that demonstrated the problem is here:
https://forum.freecadweb.org/viewtopic.php?t=68764
Link to the PR:
https://github.com/FreeCAD/FreeCAD/pull/7100
This fix disables Stokes-Navier equation for Solid objects.
Example that demonstrated the problem is here:
https://forum.freecadweb.org/viewtopic.php?t=68764
Link to the PR:
https://github.com/FreeCAD/FreeCAD/pull/7100
Re: PR 7100: FEM WB Elmer viscosity bug fix
Many thanks for the fix and also for the example file.
I merged your PR now.
For a while I was looking for a proper fluid example file. With this I see that the resulting pressure is wrong. To me it seems that FreeCAD misses in general a constraint to set the initial pressure. What do you think?
Looking at the .sif file written by FreeCAD, I don't see anything regarding pressure. Since you have some experience, what must be written into the .sif file?
I merged your PR now.
For a while I was looking for a proper fluid example file. With this I see that the resulting pressure is wrong. To me it seems that FreeCAD misses in general a constraint to set the initial pressure. What do you think?
Looking at the .sif file written by FreeCAD, I don't see anything regarding pressure. Since you have some experience, what must be written into the .sif file?
Re: PR 7100: FEM WB Elmer viscosity bug fix
Thanks!
I updated the example in PR message:
https://github.com/FreeCAD/FreeCAD/file ... .FCStd.zip
It was velocity 0.1 mm/s but should be 0.1 m/s (I use this value for simple approximation of natural convection) - this is my fault. Now it is seen convective flow temperature.
As for pressure - it may be not used for heat-sink thermal modeling (e.g. in the heat sink example in Comsol Multyphisics). I think this is because calculation of temperature field requires only velocity field without pressure in some simple models.
Also I added Pressure Boundary Condition but now FreeCAD doesn't use it. If manually to add pressure condition on outlet surface then pressure is set throughout the air (it is seen in the paraview, but somehow pressure has negative sign). I think difference between inlet and outlet is not seen because flow has low velocity. sif-file attached.
Also the example needs radiation boundary condition to be more accurate: I check this in other model in Comsol and verified with experimental data. I think it also may be added in FreeCAD (Elmer has this feature in heat transfer model). What do you think?
I updated the example in PR message:
https://github.com/FreeCAD/FreeCAD/file ... .FCStd.zip
It was velocity 0.1 mm/s but should be 0.1 m/s (I use this value for simple approximation of natural convection) - this is my fault. Now it is seen convective flow temperature.
As for pressure - it may be not used for heat-sink thermal modeling (e.g. in the heat sink example in Comsol Multyphisics). I think this is because calculation of temperature field requires only velocity field without pressure in some simple models.
Also I added Pressure Boundary Condition but now FreeCAD doesn't use it. If manually to add pressure condition on outlet surface then pressure is set throughout the air (it is seen in the paraview, but somehow pressure has negative sign). I think difference between inlet and outlet is not seen because flow has low velocity. sif-file attached.
Also the example needs radiation boundary condition to be more accurate: I check this in other model in Comsol and verified with experimental data. I think it also may be added in FreeCAD (Elmer has this feature in heat transfer model). What do you think?
- Attachments
-
- case.zip
- (1.17 KiB) Downloaded 61 times
Re: PR 7100: FEM WB Elmer viscosity bug fix
Do you allow me to use this file as example directly for FreeCAD?
That was my point. FreeCAD misses this. So when I find time, I will add this.
Many thanks for your .sif file!
-------
You example file shows that Elmer is not using all CPU cores. I will have a look at this as well.
However, I cannot predict when I will have time for this.
Re: PR 7100: FEM WB Elmer viscosity bug fix
I did and it was much more work than expected. Here is a PR that adds multi-thread support for Elmer:
https://github.com/FreeCAD/FreeCAD/pull/7159
Re: PR 7100: FEM WB Elmer viscosity bug fix
Re: PR 7100: FEM WB Elmer viscosity bug fix
Thank you!uwestoehr wrote: ↑Mon Jul 11, 2022 2:18 amI did and it was much more work than expected. Here is a PR that adds multi-thread support for Elmer:
https://github.com/FreeCAD/FreeCAD/pull/7159
I can also try to add Pressure Boundary Condition. But I'm new to FreeCAD code.
Re: PR 7100: FEM WB Elmer viscosity bug fix
Many thanks that we can use your example.
If you are on Windows and can't compile, I can also prepare a Windows build for you.
Concerning the pressure, I meant a condition for the bulk pressure. I think one need to specify that the initial pressure of the water is in your example
1.0 bar and due to the heat it will be locally maybe 1.1 bar. However, I haven't had time yet to investigate how this is done that Elmer uses this info.
Can you compile FreeCAD, if yo it would help me if you could test my pull request that adds multithreading of Elmer, especially when you are on Linux or Mac.
If you are on Windows and can't compile, I can also prepare a Windows build for you.
Concerning the pressure, I meant a condition for the bulk pressure. I think one need to specify that the initial pressure of the water is in your example
1.0 bar and due to the heat it will be locally maybe 1.1 bar. However, I haven't had time yet to investigate how this is done that Elmer uses this info.
Re: PR 7100: FEM WB Elmer viscosity bug fix
I merged the support for multi-threading of Elmer now. Please give it a try:
https://forum.freecadweb.org/viewtopic.php?f=18&t=70307
https://forum.freecadweb.org/viewtopic.php?f=18&t=70307
Re: PR 7100: FEM WB Elmer viscosity bug fix
I made some investigation of this problem. I created more difficult model: taper tube with water, inside placed heat sink: In FC with Elmer I got pressure: It turns out that Elmer set ~0 Pa in open side of tube.uwestoehr wrote: ↑Wed Jul 13, 2022 2:16 am Concerning the pressure, I meant a condition for the bulk pressure. I think one need to specify that the initial pressure of the water is in your example
1.0 bar and due to the heat it will be locally maybe 1.1 bar. However, I haven't had time yet to investigate how this is done that Elmer uses this info.
Next I corrected sif-file:
- Set pressure in open side of tube (sign "-" - because Elmer supposes that pressure is directed outside of body):
Code: Select all
Boundary Condition 25
Name = String "Face28"
Velocity 2 = Real 0.0
Velocity 3 = Real 0.0
External Pressure = Real -101000.0
End
Code: Select all
Initial Condition 2
Temperature = Real 300.0
Velocity 1 = Real 0.01
Velocity 2 = Real 0.0
Velocity 3 = Real 0.0
Pressure = Real 101000.0
End
- Attachments
-
- case.sif.zip
- (1.26 KiB) Downloaded 74 times
-
- fem-elmer-tube.FCStd.zip
- (51.52 KiB) Downloaded 69 times