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
[Solved] Concentric Mesh with ElmerGrid
[Solved] Concentric Mesh with ElmerGrid
Last edited by Cheeco on 18 Apr 2021, 21:24, edited 1 time in total.
Re: Concentric Mesh with ElmerGrid
It would help if you posted the .grd files of several examples of your attempts.
Rich.
Rich.
Re: Concentric Mesh with ElmerGrid
Dear Rich,
I attached 2 examples as files and a corresponding picture.
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.
- Attachments
-
- Bearing1.PNG (33.51 KiB) Viewed 2951 times
-
- bearing1.grd
- (660 Bytes) Downloaded 159 times
Re: Concentric Mesh with ElmerGrid
... and here the second attempt.
- Attachments
-
- Bearing2.png (35.96 KiB) Viewed 2951 times
-
- bearing2.grd
- (668 Bytes) Downloaded 158 times
Re: Concentric Mesh with ElmerGrid
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.
Rich.
Re: Concentric Mesh with ElmerGrid
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.
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.
-
- Posts: 2312
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: Concentric Mesh with ElmerGrid
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.
My coding style and logic is not the best, but it is working. Have not robustly tested it.
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.
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
-
- Site Admin
- Posts: 4832
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Concentric Mesh with ElmerGrid
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:
-Peter
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
Re: Concentric Mesh with ElmerGrid
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.
I like the approaches by Kevin and Peter much better!
Rich.
Re: Concentric Mesh with ElmerGrid
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
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 151 times
-
- flatringfull.grd
- (1.01 KiB) Downloaded 159 times