# how to calculate the interface normal between mulitphase

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

 October 19, 2018, 23:31 how to calculate the interface normal between mulitphase #1 New Member   Lei Zhou Join Date: Sep 2018 Posts: 2 Rep Power: 0 Hello everyone: I feel confused about the calculation of interface normal between mulitphase. It's the source code in line 1150-1171 at https://www.openfoam.com/documentati...8C_source.html /************************************************** *******************/ Foam::tmp Foam:haseSystem::nHatfv ( const volScalarField& alpha1, const volScalarField& alpha2 ) const { surfaceVectorField gradAlphaf ( fvc::interpolate(alpha2)*fvc::interpolate(fvc::gra d(alpha1)) - fvc::interpolate(alpha1)*fvc::interpolate(fvc::gra d(alpha2)) ); const dimensionedScalar deltaN ( "deltaN", 1e-8/pow(average(mesh_.V()), 1.0/3.0) ); // Face unit interface normal return gradAlphaf/(mag(gradAlphaf) + deltaN); } /************************************************** **/ What's the meaning behind the code? My understanding is that the grad(alpha1) and -grad(alpha2) both are approximation of interface normal from phase1 to phase2. Then, the linear combination of grad(alpha1) and -grad(alpha2) is still a approximation of interface normal from phase1 to phase2. So the premultiply factors( alpha2, alpha1) are weighted factor. Is my understanding right? Is there any other explanation? Last edited by joe1949; October 20, 2018 at 10:21.

 December 9, 2018, 08:13 #2 New Member   Lei Zhou Join Date: Sep 2018 Posts: 2 Rep Power: 0 Self answering : Both grad(alpha1)/alpha1 and -grad(alpha2)/alpha2 are the normal from alpha1 to alpha2. Then their sum grad(alpha1)/alpha1 + ( -grad(alpha2)/alpha2 ) are the interface normal. considering that the division operation is time-comsuming. So we can use alpha1*alpha2 to times ( grad(alpha1)/alpha1 + ( -grad(alpha2)/alpha2 ) ) to eliminate the denominator, because the magnitude of the normal can be uniformization. The result is alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2)

October 29, 2021, 05:09
#3
New Member

JungHoon Lee
Join Date: Apr 2019
Posts: 8
Rep Power: 6
Quote:
 Originally Posted by joe1949 Self answering : Both grad(alpha1)/alpha1 and -grad(alpha2)/alpha2 are the normal from alpha1 to alpha2. Then their sum grad(alpha1)/alpha1 + ( -grad(alpha2)/alpha2 ) are the interface normal. considering that the division operation is time-comsuming. So we can use alpha1*alpha2 to times ( grad(alpha1)/alpha1 + ( -grad(alpha2)/alpha2 ) ) to eliminate the denominator, because the magnitude of the normal can be uniformization. The result is alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2)

Dear Lei Zhou,

thank you so much for great information. I know this post seem quite old but I would like to ask you wehre did you get this equation? Could you please refer a literature for this?

JungHoon

 Tags openfoam 1806, program development