NormalVector

Numerical methods and mathematical models of Elmer
Post Reply
stoykov
Posts: 26
Joined: 11 May 2012, 13:18
Antispam: Yes

NormalVector

Post by stoykov »

Hello,

I am writing a Solver, I have a 2D body with different materials and I need to define the boundary conditions between the materials. For that purpose I need the normal vector.

In "ElmerSolver Manual" is written that the normal vector "is pointing towards the body with lower density". Nevertheless, when I change the density the normal vector always points the same direction and does not change. I am calculating it by using the function NormalVector( Element, Nodes, X, Y, .TRUE.)

I noticed that (in the cases I did) the normal vector is oriented from Right element to Left (I get these elements by: Element % BoundaryInfo % Right and Element % BoundaryInfo % Left) where Right and Left are two elements with different materials and between them I am applying the boundary condition. May I assume that always the normal vector points from Right to Left elements?

Regards,
Stan
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: NormalVector

Post by Juha »

Hi,

The documentation seems badly out of date, sorry 'bout that. The normal orientation
can be set using a BC section keyword
Normal Target Body = Integer n
such that the normal will then point in the direction of body "n". By default the normal
will point towards the lower numbered body.

Hope it helps, Juha
stoykov
Posts: 26
Joined: 11 May 2012, 13:18
Antispam: Yes

Re: NormalVector

Post by stoykov »

Hi Juha,

Thank you for the answer! Yes, one option is to use "Normal Target Body = Integer n", but I wish to do general program which works for complex domains and to avoid specifying the direction of the normal vector manually. Thus, I would prefer to use the default normal, i.e. as it points towards the lower numbered body. In such case, may I assume that the Right element (Element % BoundaryInfo % Right) will always be the element with bigger number and the Left element will be lower numbered body?

Regards,
Stan
Post Reply