CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Unit Normal Vector and Interface Jump ||.||

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2021, 14:24
Default Unit Normal Vector and Interface Jump ||.||
Join Date: Jan 2019
Posts: 63
Rep Power: 5
mcfdma is on a distinguished road

Rather than creating two threads, I am going to ask both my questions here since they are related.

I am using interFoam solver for my fluid flow simulation.

I am interested in acquiring the unit normal vector at the interface. I know the equation for normal vector is \overrightarrow{n} = \nabla\alpha which in OF can be written as
normV = fvc::grad(alpha1);
which compiles properly.

But when I try to compute the unit normal vector given by \hat n = \frac{\nabla \alpha}{|\nabla \alpha|} which I have written using
unormV = fvc::grad(alpha1)/mag(fvc::grad(alpha1));
that also compiles properly. However, when running a case, my simulation crashes as the unit normal vector divides by 0 in the outer region where \alpha = 0.

I am interested in acquiring unit normal vector to compute a variable which brings me to my second part of the question. The parameter I am measuring qs requires interface knowledge and is given by: \hat n. || \varepsilon E ||=qs.

My questions
1. How can I calculate unit normal vector \hat n at the interface?

2. How can I write the interface jump represented by ||.|| within my solver?

Any help is appreciated.
mcfdma is offline   Reply With Quote


interface, interface defining, interface jumping, interfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 05:28.