# how is the interface normal on boundary corrected by "correctContactAngle"

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

 November 16, 2016, 12:27 how is the interface normal on boundary corrected by "correctContactAngle" #1 Senior Member   Saideep Join Date: Apr 2015 Location: INDIA Posts: 203 Rep Power: 11 Hello Foamers; I have a question regarding a library (interfaceProperties.C) used by the interFOAM solver. There is a private member function names "correctContactAngle". Can anyone throw some light on how the interface normal on the boundary is being corrected. I can follow up-to certain portion of the function which I commented and few transformations at the end of the function look confusing. Code: ```void Foam::interfaceProperties::correctContactAngle ( surfaceVectorField::GeometricBoundaryField& nHatb /*we pass the interface normal vector in patches*/ ) const { const fvMesh& mesh = alpha1_.mesh(); const volScalarField::GeometricBoundaryField& gbf = alpha1_.boundaryField(); const fvBoundaryMesh& boundary = mesh.boundary(); forAll(boundary, patchi) { if (isA(gbf[patchi])) { const alphaContactAngleFvPatchScalarField& gcap = refCast (gbf[patchi]); fvsPatchVectorField& nHatp = nHatb[patchi]; scalarField theta = convertToRad*gcap.theta(U_.boundaryField()[patchi], nHatp); vectorField nf = boundary[patchi].nf(); /*is the face normal vector on a patch*/ // Reset nHatp to correspond to the contact angle scalarField a12 = nHatp & nf; /*should be a surface scalar field*/ scalarField b1 = cos(theta); scalarField b2(nHatp.size()); /* how does the following part correct the interface normal vector on the patches?*/ forAll(b2, facei) { b2[facei] = cos(acos(a12[facei]) - theta[facei]); } scalarField det = 1.0 - a12*a12; scalarField a = (b1 - a12*b2)/det; scalarField b = (b2 - a12*b1)/det; nHatp = a*nf + b*nHatp; nHatp /= (mag(nHatp) + deltaN_.value()); } } }```

 November 16, 2016, 16:49 #2 Senior Member   Cyprien Join Date: Feb 2010 Location: Stanford University Posts: 299 Rep Power: 17 Hi Saideep! Look at page 49 and 50 of the PDF https://pangea.stanford.edu/ERE/pdf/...veleau2016.pdf Cheers,

 June 16, 2017, 13:27 acap.gradient() #3 Senior Member   Saideep Join Date: Apr 2015 Location: INDIA Posts: 203 Rep Power: 11 Hi Cyprien and Foamers; In the void correctContactAngle function of interfaceProperties, what does the acap.gradient() do? Code: ``` acap.gradient() = (nf & nHatp)*mag(gradAlphaf[patchi]); acap.evaluate();``` This function call is omitted in the foam-extend part of the correctContantAngle whereas present in the OpenFoam versions? I am not sure how, but it looks like it re-orient the interface normal on the contact angle boundaries further after correcting the interface normal vector. SaiD

December 13, 2018, 09:06
#4
Member

Ashish Vinayak
Join Date: Mar 2015
Location: Wuppertal, Germany
Posts: 50
Rep Power: 10
Hi Saideep,

Were you able to figure this out?

Best regards

Quote:
 Originally Posted by Saideep Hi Cyprien and Foamers; In the void correctContactAngle function of interfaceProperties, what does the acap.gradient() do? Code: ``` acap.gradient() = (nf & nHatp)*mag(gradAlphaf[patchi]); acap.evaluate();``` This function call is omitted in the foam-extend part of the correctContantAngle whereas present in the OpenFoam versions? I am not sure how, but it looks like it re-orient the interface normal on the contact angle boundaries further after correcting the interface normal vector. SaiD

 Tags contact angle, interfoam