CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Unit Normal Vector and Interface Jump ||.||

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2021, 15:24
Default Unit Normal Vector and Interface Jump ||.||
  #1
Member
 
X
Join Date: Jan 2019
Posts: 63
Rep Power: 7
mcfdma is on a distinguished road
Hi.

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
Code:
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
Code:
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

Old   February 18, 2023, 17:01
Default
  #2
gyr
New Member
 
libya
Join Date: Aug 2022
Posts: 25
Rep Power: 4
gyr is on a distinguished road
Did you solve the the problem,i am facing the same
gyr is offline   Reply With Quote

Old   February 20, 2023, 07:24
Default
  #3
Member
 
Join Date: Jan 2022
Location: Germany
Posts: 72
Rep Power: 4
überschwupper is on a distinguished road
I would do the calculation only for cells where the gradient isnt 0. That means, including an for loop where this condition is met
überschwupper is offline   Reply With Quote

Old   February 20, 2023, 10:00
Default
  #4
gyr
New Member
 
libya
Join Date: Aug 2022
Posts: 25
Rep Power: 4
gyr is on a distinguished road
thanks so much
gyr is offline   Reply With Quote

Reply

Tags
interface, interface defining, interface jumping, interfoam


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 14:43.