Natural Convection

General discussion about Elmer
Saint
Posts: 28
Joined: 19 Apr 2023, 08:15
Antispam: Yes

Re: Natural Convection

Post by Saint »

kevinarden wrote: 07 May 2023, 15:42 I try with your mesh, and it diverges right away. You may have a mesh issue. I did it in 3D with brick elements, and it will run with high viscosity models.
3d.PNG
Thank you so much AGAIN ! you are so kind for answering my question. so thanky to you, things are more cleared up, I have to dive more into Gmsh to refine my mesh. I am used to Ansys, Catia and FreeCAD and they have pretty advanced GUI for meshing... when I used Gmsh, I left almost everything to default… (Gmsh is powerful but not for beginners)
Rich_B wrote: 07 May 2023, 22:09 Hello,

The original link to the simulation files doesn't work, it says 'deleted'. You could try compressing the files into archives. The forum allows up to 1 megabyte per attachment and up to three attachments per post. Posting your current simulation as a working example, including geometry and sif file, would be helpful

Thanks, Rich.
Thank you for the report! I also checked the file and it was deleted ! I will never use that upload center again...
Unfortunately, I have overwritten the original files of this post (I believe); I will try to upload the new setup again,with a new mesh to see if that might work or not.
also, I know about the upload capability of this website, but 1Mb was too small for the entire simulation; mainly bec of geometry/mesh file; and i thought sending only pieces of the folder, is not nice (personally, I have trouble following examples in github, since there is no geometry and as a new comer, I don't know my way around them. It would have been nice, if I could run the examples on my computer, and gradually changing them to learn from them, but i don't know how to run them from github)
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural Convection

Post by kevinarden »

If you are a FreeCad user They have integrated Elmer in FreeCad you can look on the FreeCad site.
They have information and tutorials on using Elmer in FreeCad.
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Natural Convection

Post by Rich_B »

Hello,

Feel free to post just the gmsh geo input file, with a brief description of how you create the mesh.

Also, take a look in GetStartedElmer.pdf located here:

https://www.nic.funet.fi/pub/sci/physics/elmer/doc/

Search for 'Download Elmer documentation' and for 'Tutorial files', this will explain how to get the tutorial files without going through github.

Rich.
Saint
Posts: 28
Joined: 19 Apr 2023, 08:15
Antispam: Yes

Re: Natural Convection

Post by Saint »

Rich_B wrote: 08 May 2023, 17:08 Hello,

Feel free to post just the gmsh geo input file, with a brief description of how you create the mesh.

Also, take a look in GetStartedElmer.pdf located here:

https://www.nic.funet.fi/pub/sci/physics/elmer/doc/

Search for 'Download Elmer documentation' and for 'Tutorial files', this will explain how to get the tutorial files without going through github.

Rich.
Thank you so much for your reply and for the guidances, I will try to send the mesh and brief description tonight, but right now, I am desperately trying to figure out the symmetry function; I think maybe my mesh is too rough, 0.5 mm mesh max h for a cube/simulation about 2*3*2 cm, and it expected about 62 hours to simulate.
:?: I am trying to apply two symmetry planes, and apply a rough mesh but with regional refinement, to both improve the accuracy and reduce the computation time. Please let me know how to apply it !? (i was expecting to cut the mesh with two planes, like ansys, but I think i have to do it from the cad file, before meshing, and then select some boundaries to apply the symmetry ???

kevinarden wrote: 08 May 2023, 11:24 If you are a FreeCad user They have integrated Elmer in FreeCad you can look on the FreeCad site.
They have information and tutorials on using Elmer in FreeCad.
Thank you so much for your reply and for the guidances, I already know about the engine, but I had trouble conducting multiphysic simulation with the Elmer engine in freecad. Maybe I am not skilled enough, or maybe it is not supported.
I will visit it again, after I got some basic results in Elmer itself, it is better to use the Elmer itseld, rather than a transfered version (I even prefered the linux code, but I don't have time and energy to learn it from that far basic)

:?: I am trying to apply two symmetry planes, and apply a rough mesh but with regional refinement, to both improve the accuracy and reduce the computation time. Please let me know how to apply it !? (i was expecting to cut the mesh with planes, like ansys, but I think i have to do it from the cad file, before meshing, and then select some boundaries to apply the symmetry ???
Saint
Posts: 28
Joined: 19 Apr 2023, 08:15
Antispam: Yes

Re: Natural Convection

Post by Saint »

As for meshing, I am using hybrid meshing, with refined regions:
box geometry: 2*3*2
global mesh, max h: 1mm
refined region: 0.25mm
thickness of transient layer: 5mm
transient layer max h: 0.5mm
I'm not sure if this mesh is fine enough or not... i haven't tried it yet (reason below :arrow: )

Image

I am trying to use the symmetry, to reduce the cost; and as far as I understood:
I have to set a boundary condition at my symmetry plane, and set the velocity to 0, the vector which is parallel to the plane ( :?: )

But I wonder about other physical parameters, like heat; how can I define the symmetry in those scenarios :?:

:arrow: as for the symmetry, at first I tried to cut my geometry with FC (FreeCAD) first, and then mesh the small pieces, but I noticed: Gmsh, is creating bigger cells at the surface and edges, which would have introduced noise to the simulation.
Then I tried to mesh the entire geometry, and then cut the mesh in FC, which was a painful process to find the right formats to: convert, switching between environments for different command, cutting it and finding the right format to export, and finally realizing that only the surface of the mesh has been translated :mrgreen: :lol:

(Let me know if you know what was wrong over there; this is a summary of the process. Gmsh (meshing) > Export (.BDF) > import in FC > changing the format of mesh, from FEM mesh to Mesh, in FEM environment > cutting the mesh in Meshing environment > export in different format and finding out there is only the surface available)

Anyway, after that I tried to cut the mesh with Gmsh, but after creating a different plane, shape and volume; and trying to use the boolean operation; there was an error "could not apply boolean operation"....
I believe Gmsh recognizes the mesh and the geometry that I have created as separate entities, and therefore it cannot perform a task between them.


These are my file. let me know if you have trouble openning them.
~30Mb mesh (latest version, before cutting in half for symmetry)
https://uploadly.me/MuoBq

entire file, for one of my simulations, the mesh in this folder is rougher than my latest mesh and without refinement; and the simulation has been terminated after few itterations (~60Mb):
https://uploadly.me/4YZAo

this is its convergence diagram:
Image

don't laugh too hard at it :D
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural Convection

Post by kevinarden »

I will check the meshing, but in gmsh you have to cut the block prior to meshing. You can create a large cutting block then use Boolean cut and then delete the cutting tool.

The heat symmetry boundary conditions is the "do nothing", if you do nothing the boundary will be symmetric.
kevinarden
Posts: 2315
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural Convection

Post by kevinarden »

Here is a gmsh file that reads the step, creates the two blocks and cuts the step file down to 1/4. Then you can mesh from there.
F9.geo
(265 Bytes) Downloaded 58 times
cuts.PNG
cuts.PNG (29.08 KiB) Viewed 691 times
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Natural Convection

Post by annier »

For obtaining converged simulations with Navier-Stokes equations, it is generally recommended to start the test cases with the following settings:
1. large value of dynamic viscosity
2. very small time step size (e.g. if coordinate scaling = 1.0E-03 , time step can be 1.0E-4 or less)
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Saint
Posts: 28
Joined: 19 Apr 2023, 08:15
Antispam: Yes

Re: Natural Convection

Post by Saint »

annier wrote: 10 May 2023, 20:28 For obtaining converged simulations with Navier-Stokes equations, it is generally recommended to start the test cases with the following settings:
1. large value of dynamic viscosity
2. very small time step size (e.g. if coordinate scaling = 1.0E-03 , time step can be 1.0E-4 or less)
Thank you for your guidance.
My previous simulations were basic static FEM modeling, and consequently, time step and rough mesh was not that critical.
But now I am "converging :D :lol: " toward new understanding that my mesh was and maybe is way too rough, and my steps were way too big !
I wanted to simulate many try and errors, so I tried to pick rough mesh and large steps, just to run something and learn from it, but apparently...

Please let me know more about such tips !
Especially, about viscosity models, compressibility, convection and parallel simulating :!: :idea: :?:
(I guess i will face more difficulties with K-epsilon, omega and spalart-allmaras)


:?: :arrow: Recent update, right now, I am running the simulation on 2D, with 80k nodes for 1 by 3 cm surface, my time step is 0.00001 and I am still getting fluctuations in my navier-stokes results !! WHY ? Should I reduce the mesh or steps even more ?

Image
kevinarden wrote: 10 May 2023, 11:17 Here is a gmsh file that reads the step, creates the two blocks and cuts the step file down to 1/4. Then you can mesh from there.
F9.geo
cuts.PNG
Thank you so much, again; Mr Arden.
It was not needed, but I really appreciate your kindness; I wish to thank you in person, you are a nice person.
I already had the 1/4 of my shape; but I know realize the stupid mistake that I made :P
When I made my quarter, and meshed it with Gmsh. With the first sight, I saw irregularities along the surface toward the center, and under the mental stress and rush; I assumed: Gmsh, is using bigger element size along the surface and edges, compared to center.
But after I saw your post: I said you are unlikely to make a mistake, and there is something that I am missing.... Now I realize that during meshing my part, I had refined the region/zone in my shape but i forgot and I have mistaken my own creation with some possible pitfall that might cause inaccuracy.
I am so embarrassed :X

And about Gmsh, you are correct. After a few hours, trying different techniques, I've found out that Gmsh cannot cut the mesh similar to boolean operation, and editing the mesh with third software, was a pain and deadend with my knowledge.

:?: Can you please confirm if I am in the right window for applying the symmetry?
If my symmetry plane is XZ, I will clip (fix to zero) the velocity of Y direction, meaning the orientation of 2 (v), in boundary condition under navier-stokes tab, as the image below:

Image
Saint
Posts: 28
Joined: 19 Apr 2023, 08:15
Antispam: Yes

Re: Natural Convection

Post by Saint »

I wonder, maybe I should force a certain priority on solvers. giving higher priority to heat eq and even setting the number of times that navier-stokes will be solved with way much higher than heat eq.

maybe by fixing the number of times that NS eq is being solved to a high number, it might help with fluctuations ? (if it is an option)
Post Reply