A mesh for each body

General discussion about Elmer
Post Reply
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

A mesh for each body

Post by spacedout »

Good evening

Say the domain is divided into 2 contiguous bodies. There would be a Body 1 section and a Body 2 section in the .sif I create the mymesh.msh file from Gmsh

and the .sif contains

Header
Mesh DB "." "mymesh"
End

where the mymesh folder contains the files created from the .msh file with the help of ElmerGrid.

Now it is of course possible to create a .msh file for each body. Call them mymesh1.msh and mymesh2.msh. ElmerGrid would then create two folders

mymesh1 and mymesh2


Would something like

Header
Mesh DB "." "mymesh1" "mymesh2"
End

work ?

In 2D, I assume mymesh1.geo would contain (the .geo script are used by Gmsh to create the .msh file)

Physical Surface(1) = ...

and mymesh2.geo

Physical Surface(2) = ...

and in the .sif section

Body 1
....
End

would refer to mymesh1

and

Body 2
....
End

would refer to mymesh2

Although If it makes any sense there is still the problem of the two meshes not being conforming on the common boundary


Have a nice weekend
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: A mesh for each body

Post by kevinarden »

ElmerGrid can combine 2 meshes, it can even merge coincident nodes. If not coincident mortar boundary conditions can handle the interaction at the boundary. Take for example this test case, the Makefile shows the ElmerGrid commands
https://github.com/ElmerCSC/elmerfem/tr ... actBlunt2D
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: A mesh for each body

Post by raback »

Hi spacedout

What is the underlaying purpose of having different meshes for different bodies?

-Peter
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Re: A mesh for each body

Post by spacedout »

Thank you Kevinarden, I had completely overlooked the -unite option under ElmerGrid. And perhaps one day I can use those mortar conditions for turbomachinery studies where of course rotor-stator meshing involves non-coincident nodes.

And, Peter, to answer your question,

I believe Gmsh can only create meshes according to distance criteria and so does not distinguish between the two sides of a boundary. For example there is a thin boundary layer on the air side of an air/solid interface which obviously does not exist on the solid side. But I still need a mesh inside the solid for my plasma work because electric fields pervade all of space and because there is no air flow inside, that mesh could very well be different from the mesh on the air side. Mind you, as of yet, I don't know how to create a boundary layer for curved edges in Gmsh ( I only get one cell on the boundary running from one vertex of the edge to the other). But I would say that's more a question for the Gmsh code authors.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: A mesh for each body

Post by raback »

Hi

Generally the problem of combining fields numerically using mortar methods results to more challenges in linear system convergence and also convergence of results with mesh density. Hence I would not easily recommend using non-conforming meshes to overcome problems in meshing.

Note also that if you have a multiphysics case it may be a better idea to have a different conforming mesh for the electric potential, and you can have a fluid-only mesh for the air. The electric potential does not need any boundary layer, unless you have some electric double layer at the interface.

-Peter
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Re: A mesh for each body

Post by spacedout »

Thanks for the suggestions but for plasma work, the electric field equations are coupled to the fluid flow equations. With two different meshes over the air region I would have to interpolate between them which would defeat the purpose of using already developed open source software like Elmer , OpenFoam, etc. It thus makes more sense to use only one mesh. To do so, I can execute ElmerGrid on the air and solid separately which will yield two meshes. Next, I would execute ElmerGrid once more but with the -unite option in order to create the final mesh. As long as I ensure that the air and solid meshes have coincident nodes on the interface, I should be fine since this is what you recommend for better convergence.

Best,
Marc
Post Reply