Page 1 of 1

[Solved] Concentric Mesh with ElmerGrid

Posted: 09 Apr 2021, 19:16
by Cheeco
Dear Forum,

I want to run a study for a Gas Bearings using the Reynolds solver. Therefore, I would like to have a regular, concentric 2D grid as sketched in the picture. I understand that ElmerGrid is not very good with circular shapes, but the simplicity of the geometry tells me that there is probably a simple way to do it. After 2 hours of testing, I unfortunately have not found out how.

I would like to keep it simple because I want to adapt the inner and outer radius for parameter optimization later.

Do you have an ideas or an example?

Greetings,

Stefan
Simplemesh.png
Simplemesh.png (13.78 KiB) Viewed 2917 times

Re: Concentric Mesh with ElmerGrid

Posted: 11 Apr 2021, 00:35
by Rich_B
It would help if you posted the .grd files of several examples of your attempts.

Rich.

Re: Concentric Mesh with ElmerGrid

Posted: 11 Apr 2021, 17:13
by Cheeco
Dear Rich,

I attached 2 examples as files and a corresponding picture.
  • In the first example, I tried to use polar coordinates. Unfortunately, it seems probably only suited for 3D structures such as tubes, but not flat ones
  • In the second example, I tried to use the transform feature "4". But I do not understand what is transformed around which axis.
It might not be reflected in the results, but I seriously tried :-/

Re: Concentric Mesh with ElmerGrid

Posted: 11 Apr 2021, 17:14
by Cheeco
... and here the second attempt.

Re: Concentric Mesh with ElmerGrid

Posted: 11 Apr 2021, 18:18
by Rich_B
If you download the github repository, there is a folder 'elmerfem\ElmerGUI\samples\grd' that contains samples of elmergrid input files. Take a look at container.grd, it may help you although it's a 3D example. Instead of using mapping, try using revolve block.

Rich.
container.png
container.png (18.12 KiB) Viewed 2878 times

Re: Concentric Mesh with ElmerGrid

Posted: 13 Apr 2021, 23:11
by Cheeco
Hey Rich,

thanks for your advice. The Container example looks indeed extremely promising, but despite many attempts, I could not create anything similar in 2D. I understood from the ElmerGrid documentation that using the Revolve command automatically extrudes the Mesh in a 3rd dimension. For the time being, I did not find a way around it.

For the time being I "solved" the problem by just approximating a piece of a circle with a rectangle. This is of course not ideal, but will probably not make a big difference for the engineering application I have in mind.

Re: Concentric Mesh with ElmerGrid

Posted: 13 Apr 2021, 23:49
by kevinarden
Could not find a way as you say revolve does 2D to 3D but not 1D to 2D. Polar use Z, theta not r, theta.
So I wrote a fortran module to generate angular 2D elmer meshes with an inner and outer radius. The number of elements in each direction can be specified, as well as the start/finish angle. by keeping the number of radial elements consistent ElmerGrid can be used to unite and merge segments into 1 mesh. Code, directions, and example attached. Will put all files on github later.
angular2d.f90
(2.06 KiB) Downloaded 167 times
angular2d_directions.pdf
(51.11 KiB) Downloaded 176 times
My coding style and logic is not the best, but it is working. Have not robustly tested it.

Re: Concentric Mesh with ElmerGrid

Posted: 14 Apr 2021, 00:25
by raback
Hi

This is little confucing. I wonder who wrote the code... Well, these were intended for limited use before Elmer was open source. Usually I recommend not to use the capabilities of ElmerGrid for geometry generation. I mainly see the role of ElmerGrid in mesh conversion and partitioning.

It turns out that if you have a 2D mesh it seems difficult to make this within ElmerGrid format. However, if you do the cartesian meshing and tell ElmerGrid that it created a mesh in cylindrical coordinates (phi,r,z) then it will make you the coordinate transformation to (x,y,z). This works as well for 2D and 3D.

So just take the "bearing1.grd" case, change its coordinate system to "cartesian 2d" and call it with:

Code: Select all

ElmerGrid 1 5 bearing1.grd -cylinder -merge 1.0e-8
-Peter

Re: Concentric Mesh with ElmerGrid

Posted: 14 Apr 2021, 01:17
by Rich_B
Trying to fool Elmergrid by changing the Subcell Limits 2 to '0 0', and then revolving the simulated 1D x-direction line around the y-axis gave a nice picture showing a 2D ring, but with volume elements with zero volumes. The boundaries are surfaces not lines, rendering this approach useless.

I like the approaches by Kevin and Peter much better!

Rich.

Re: Concentric Mesh with ElmerGrid

Posted: 17 Apr 2021, 22:27
by Cheeco
Dear Kevin, Peter and Rich,

thanks for all of your efforts, with your help I could solve the problem. I actually used Peter's solution, as it was more straightforward to implement. But also here thanks for the excellent documentation, Kevin. I also added two minimal examples, one for a full circle and one for a section, based on Peters solution.

This forum here is really awesome!

Stefan