[Solved] Concentric Mesh with ElmerGrid

General discussion about Elmer
Post Reply
Cheeco
Posts: 5
Joined: 09 Apr 2021, 19:02
Antispam: Yes

[Solved] Concentric Mesh with ElmerGrid

Post 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 2911 times
Last edited by Cheeco on 18 Apr 2021, 21:24, edited 1 time in total.
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Concentric Mesh with ElmerGrid

Post by Rich_B »

It would help if you posted the .grd files of several examples of your attempts.

Rich.
Cheeco
Posts: 5
Joined: 09 Apr 2021, 19:02
Antispam: Yes

Re: Concentric Mesh with ElmerGrid

Post 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 :-/
Attachments
Bearing1.PNG
Bearing1.PNG (33.51 KiB) Viewed 2885 times
bearing1.grd
(660 Bytes) Downloaded 157 times
Cheeco
Posts: 5
Joined: 09 Apr 2021, 19:02
Antispam: Yes

Re: Concentric Mesh with ElmerGrid

Post by Cheeco »

... and here the second attempt.
Attachments
Bearing2.png
Bearing2.png (35.96 KiB) Viewed 2885 times
bearing2.grd
(668 Bytes) Downloaded 156 times
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Concentric Mesh with ElmerGrid

Post 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 2872 times
Cheeco
Posts: 5
Joined: 09 Apr 2021, 19:02
Antispam: Yes

Re: Concentric Mesh with ElmerGrid

Post 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.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Concentric Mesh with ElmerGrid

Post 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.
Attachments
combined.png
(58.68 KiB) Not downloaded yet
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Concentric Mesh with ElmerGrid

Post 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
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Concentric Mesh with ElmerGrid

Post 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.
Attachments
ring.png
(50.33 KiB) Not downloaded yet
ring.grd
(688 Bytes) Downloaded 165 times
Cheeco
Posts: 5
Joined: 09 Apr 2021, 19:02
Antispam: Yes

Re: Concentric Mesh with ElmerGrid

Post 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
Attachments
flatringsection.grd
(1.02 KiB) Downloaded 149 times
flatringfull.grd
(1.01 KiB) Downloaded 156 times
Post Reply