|
[Sponsors] |
Yesterday, 23:32 |
OpenFOAM correcting the contact angle
|
#1 |
New Member
YJ.Sheng
Join Date: Oct 2023
Posts: 1
Rep Power: 0 |
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); */ } |
|
|
|
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 |