Overlapping Boundary Conditions

Discussion about coding and new developments
Post Reply
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Overlapping Boundary Conditions

Post by Takala »

Hello,

I'm thinking about boundary condition definitions and actually this applies for geometry groups in general:

Let us assume I have a model boundary

Code: Select all

Omega = Union(Omega_1, Omega_2),
Now, normally we'd prefere

Code: Select all

Intersection(Omega_1, Omega_2) = Emptyset,
And this is how in Elmer it usually is (if not always), but now we assume to have

Code: Select all

Omega_common = Intersection(Omega_1, Omega_2) != Emptyset.
If one now defines

Code: Select all

Boundary Condition 1
  Target boundaries(1) = $ Omega_1
  Temperature = 1
End

Boundary Condition 2
  Target Boundaries(2) = $ Omega_2
  Temperature = 2
End
would he do something that is currently legal in Elmer? If yes, what would happen (in general, not only in case of Dirichlet condition or Temperature). I would assume that we would have, for this definition, the following

Code: Select all

Temperature(Cut(Omega_1, Omega_2))=1
Temperature(Omega_2)=2
Now to make it more interesting. Should there be a functionality to do this:

Code: Select all

$ Omega_3 = HighestBoundaryID + 1

Construct Group 1
  Group Type = Boundary
  Group Id = $ Omega_3
  Union = $ Omega_1
  Intersection = $ Omega_2
End

Boundary Condition 1
  Target boundaries(1) = $ Omega_3
  Temperature = 1
End
which would make it possible to define groups that are not defined when the geometry is defined. For example here the boundary condition 1 would apply to the intersection of Omega_1 and Omega_2.

The ofcourse it would make sense to enable this feature for Bodies as well.

What do you think about this? And please advise me in case I have missed some feature that already does this.

Cheers,

Eelis
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Overlapping Boundary Conditions

Post by raback »

Hi Eelis

Normally Elmer set BCs in order of the order they appear. This is often more or less arbitrary. Then the desired action is often what you guessed to be the default action. It must be activated with a keyword:

Code: Select all

Set Dirichlet BCs by BC Numbering = Logical True
For Neumann conditions this doesn't really make difference since they are additive.

It should be noted that a each boundary element has only one tag. So you cannot have exactly the same element appearing for two different BCs except as a redundant copy. Of course the union may be non-empty what comes to nodes or degrees of freedom even though it would be empty for elements of the leading degree.

Now there is no feature like you request currently. In ElmerGrid there is some primitive feature (-boundbound and -bulkbound) that try to define new boundary elements from unions of existing ones. This hasn't been too much used and may fail for some elementtypes.

For Dirichlet conditions things are somewhat simpler since the union can be set of nodes rather than set of elements. In ElmerSolver you could quite easily define a mask such that it would be >0 if the node would be shared by more than one bc. Then one could use the conditional BCs in one of these BCs, e.g.

Code: Select all

Potential = 1.23
Potential Condition = Equals Mask
For edges this might be somewhat more difficult. This kind of mask could be created by some auxiliary solver in the start of the simulation eliminating the need for library changes.

What you propose would of course also be possible but might have somewhat larger coding effort. The one tag limit stays but one could of course append new elements to the existing list, or change the tag of those elements that belong to the union. The dofs are associated to nodes, edges or faces and the number of these don't grow even though you introduce new lower dimensional entities. Therefore this should not break any solution related stuff either.

-Peter
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: Overlapping Boundary Conditions

Post by Takala »

Hi Peter,

thanks for the exhaustive answer. So you are saying that in elmer the intersection of two geometry groups (with respect to the elements) is always empty due to the tag limit? And how about the "mesh.elements" structure, does that support "multiple groups" for elements.

If i'd have to guess, this is how it'd go:
If an unv file contained two geometry groups with a non-empty intersection and would be converted with ElmerGrid, this "illegality" would not be checked and thus the topology of the groups would remain in the Elmer mesh format. But when the mesh is read in by ElmerSolver the intersected elements are first tagged with the first group (say Omega_1) and then over written with the second group (Omega_2). Thus we would have:

Code: Select all

Omega_1_{ES} = Cut(Omega_1, Omega_2)
Omega_2_{ES} = Omega_1
where Omega_1 and Omega_2 are the original groups, Omega_1_{ES} and Omega_1_{ES} are the groups seen by ElmerSolver.
Or maybe this overwriting is already happening in ElmerGrid?

Is this guessing correct?

Actually, why I'm so interested about this is because currently I have a really complicated geometry topology with thousands of faces and I need to group them with some algorithms in Salome. I have intersections of boundary geometry groups that are non-empty. The model runs fine and any of the software during my work flow complains about this. So I'm wondering what is happening with my groups? My guessing would explain this.

I think the "one tag limit" is actually a good protection against "bad ideas". Now that you tell me there is a feature to this direction in ElmerGrid, I think it is the correct place to put it: ElmerGrid is about mesh manipulation and ElmerSolver about solving stuff. So If the mesh is not needed to be manipulated during the solving, it should be done in ElmerGrid. You are absolutely right about that.

So maybe we should concentrate on ElmerGrid instead and build upon the idea you already have?

Should there be a feature in ElmerGrid that checks these intersections and prints out something like: "Omega_1 and Omega_2 have common elements!". Then one could say to ElmerGrid to create the intersection and the two originals that are cut with the intersection.

What is your estimation about the coding effort of this kind of feature?

Cheers,

Eelis
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: Overlapping Boundary Conditions

Post by Takala »

raback wrote:Hi Eelis
Now there is no feature like you request currently. In ElmerGrid there is some primitive feature (-boundbound and -bulkbound) that try to define new boundary elements from unions of existing ones. This hasn't been too much used and may fail for some elementtypes.
So you can create a union of two or more existing boundaries?
How about creating a boundary from intersection of two volume groups? This would really be a kickass-feature. For example if one has many complex bodies surrounded by air, then finding the "wall" for a CFD calculation would be easy with this. One can do this in Salome, but it is reaaaally slow!

There seems to be an area where ElmerGrid, which already is a great piece of code, would benefit a bit with some improvements. Of course me, having never looked under the hood of ElmerGrid, is the wrong person to estimate the coding effort of these things...

Is it justified to create such features? Of course these are the kind of stuff that are interesting for people out side the academic world where complex structures are studied. There seems to be more of these peolple every day...

Cheers,

Eelis
Post Reply