threePhaseInterfaceProperties: Update constructor to be consistent with the two-phase interfaceProperties

Avoids problem of duplicate registration of K
This commit is contained in:
Henry 2015-02-10 17:44:18 +00:00
parent 4b3c77cadb
commit 7c4e3a0761
2 changed files with 17 additions and 26 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,14 +21,6 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
threePhaseInterfaceProperties
Description
Properties to aid interFoam :
1. Correct the alpha boundary condition for dynamic contact angle.
2. Calculate interface curvature.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "threePhaseInterfaceProperties.H" #include "threePhaseInterfaceProperties.H"
@ -47,12 +39,6 @@ const Foam::scalar Foam::threePhaseInterfaceProperties::convertToRad =
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Correction for the boundary condition on the unit normal nHat on
// walls to produce the correct contact angle.
// The dynamic contact angle is calculated from the component of the
// velocity on the direction of the interface, parallel to the wall.
void Foam::threePhaseInterfaceProperties::correctContactAngle void Foam::threePhaseInterfaceProperties::correctContactAngle
( (
surfaceVectorField::GeometricBoundaryField& nHatb surfaceVectorField::GeometricBoundaryField& nHatb
@ -147,6 +133,7 @@ void Foam::threePhaseInterfaceProperties::calculateK()
// Face unit interface normal // Face unit interface normal
surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_));
correctContactAngle(nHatfv.boundaryField()); correctContactAngle(nHatfv.boundaryField());
// Face unit interface normal flux // Face unit interface normal flux
@ -157,9 +144,9 @@ void Foam::threePhaseInterfaceProperties::calculateK()
// Complex expression for curvature. // Complex expression for curvature.
// Correction is formally zero but numerically non-zero. // Correction is formally zero but numerically non-zero.
//volVectorField nHat = gradAlpha/(mag(gradAlpha) + deltaN_); // volVectorField nHat = gradAlpha/(mag(gradAlpha) + deltaN_);
//nHat.boundaryField() = nHatfv.boundaryField(); // nHat.boundaryField() = nHatfv.boundaryField();
//K_ = -fvc::div(nHatf_) + (nHat & fvc::grad(nHatfv) & nHat); // K_ = -fvc::div(nHatf_) + (nHat & fvc::grad(nHatfv) & nHat);
} }
@ -192,21 +179,26 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
nHatf_ nHatf_
( (
IOobject
( (
fvc::interpolate(fvc::grad(mixture.alpha1())) "nHatf",
/(mag(fvc::interpolate(fvc::grad(mixture.alpha1()))) + deltaN_) mixture.alpha1().time().timeName(),
) & mixture.alpha1().mesh().Sf() mixture.alpha1().mesh()
),
mixture.alpha1().mesh(),
dimensionedScalar("nHatf", dimArea, 0.0)
), ),
K_ K_
( (
IOobject IOobject
( (
"K", "interfaceProperties:K",
mixture.alpha1().time().timeName(), mixture.alpha1().time().timeName(),
mixture.alpha1().mesh() mixture.alpha1().mesh()
), ),
-fvc::div(nHatf_) mixture.alpha1().mesh(),
dimensionedScalar("K", dimless/dimLength, 0.0)
) )
{ {
calculateK(); calculateK();
@ -233,5 +225,4 @@ Foam::threePhaseInterfaceProperties::nearInterface() const
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -78,8 +78,8 @@ class threePhaseInterfaceProperties
void operator=(const threePhaseInterfaceProperties&); void operator=(const threePhaseInterfaceProperties&);
//- Correction for the boundary condition on the unit normal nHat on //- Correction for the boundary condition on the unit normal nHat on
// walls to produce the correct contact dynamic angle // walls to produce the correct contact dynamic angle.
// calculated from the component of U parallel to the wall // Calculated from the component of U parallel to the wall
void correctContactAngle void correctContactAngle
( (
surfaceVectorField::GeometricBoundaryField& nHat surfaceVectorField::GeometricBoundaryField& nHat