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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2016, 12:27
Default how is the interface normal on boundary corrected by "correctContactAngle"
  #1
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
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<alphaContactAngleFvPatchScalarField>(gbf[patchi]))                               
                   {                                   
                     const alphaContactAngleFvPatchScalarField& gcap =  refCast<const alphaContactAngleFvPatchScalarField> (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());
                  }
                }
             }
Saideep is offline   Reply With Quote

Old   November 16, 2016, 16:49
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi Saideep!

Look at page 49 and 50 of the PDF https://pangea.stanford.edu/ERE/pdf/...veleau2016.pdf

Cheers,
Cyp is offline   Reply With Quote

Old   June 16, 2017, 13:27
Default acap.gradient()
  #3
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
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
Saideep is offline   Reply With Quote

Old   December 13, 2018, 09:06
Default
  #4
Member
 
Ashish Vinayak
Join Date: Mar 2015
Location: Wuppertal, Germany
Posts: 50
Rep Power: 11
ashish.vinayak is on a distinguished road
Hi Saideep,

Were you able to figure this out?

Best regards

Quote:
Originally Posted by Saideep View Post
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
ashish.vinayak is offline   Reply With Quote

Reply

Tags
contact angle, 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
Floating point exception: Zero divide liladhar CFX 11 December 16, 2013 04:07
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 17:15
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


All times are GMT -4. The time now is 11:53.