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

OpenFOAM correcting the contact angle

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   Yesterday, 23:32
Post OpenFOAM correcting the contact angle
  #1
New Member
 
YJ.Sheng
Join Date: Oct 2023
Posts: 1
Rep Power: 0
Amadeus is on a distinguished road
Hello everyone!

I am studying the source code of the interFoam solver in OpenFOAM. When calculating surface tension, interFoam needs to compute the interface curvature. My question is about the calculateK() function and the correctContactAngle() function in the interfaceProperties.C file. These functions do not seem to consider the case where the interface normal vector and the boundary normal vector are collinear. How is the curvature calculated in such cases?

Additionally, after calculating the curvature at the boundary, how can the curvature of other interface cells be corrected to ensure that the interface curvature is consistent?

Code:
void Foam::interfaceProperties::calculateK()
{
    const fvMesh& mesh = alpha1_.mesh();
    const surfaceVectorField& Sf = mesh.Sf();

    // Cell gradient of alpha
    const volVectorField gradAlpha(fvc::grad(alpha1_, "nHat"));

    // Interpolated face-gradient of alpha
    surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha));

    //gradAlphaf -=
    //    (mesh.Sf()/mesh.magSf())
    //   *(fvc::snGrad(alpha1_) - (mesh.Sf() & gradAlphaf)/mesh.magSf());

    // Face unit interface normal
    surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_));
    // surfaceVectorField nHatfv
    // (
    //     (gradAlphaf + deltaN_*vector(0, 0, 1)
    //    *sign(gradAlphaf.component(vector::Z)))/(mag(gradAlphaf) + deltaN_)
    // );
    correctContactAngle(nHatfv.boundaryFieldRef(), gradAlphaf.boundaryField());

    // Face unit interface normal flux
    nHatf_ = nHatfv & Sf;

    // Simple expression for curvature
    K_ = -fvc::div(nHatf_);

    // Complex expression for curvature.
    // Correction is formally zero but numerically non-zero.
    /*
    volVectorField nHat(gradAlpha/(mag(gradAlpha) + deltaN_));
    forAll(nHat.boundaryField(), patchi)
    {
        nHat.boundaryFieldRef()[patchi] = nHatfv.boundaryField()[patchi];
    }

    K_ = -fvc::div(nHatf_) + (nHat & fvc::grad(nHatfv) & nHat);
    */
}
I noticed that some code in the calculateK() function is commented out. In the commented code, it appears that OpenFOAM handles these situations. Why did OpenFOAM comment out this code?
Amadeus is offline   Reply With Quote

Reply


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
Contact angle in OpenFoam with fixedfluxpressure Eller_OF OpenFOAM 11 July 30, 2024 02:10
can anyone help me about the udf of dynamic contact angle in FLUENT? Albert Lee FLUENT 0 July 1, 2018 08:21
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 14:24
Dynamic contact angle raj kumar saini Fluent UDF and Scheme Programming 0 October 13, 2014 02:18


All times are GMT -4. The time now is 23:25.