Interface Properties
Interface Properties
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interfaceProperties.H"
#include "alphaContactAngleFvPatchScalarField.H"
#include "unitConversion.H"
#include "surfaceInterpolate.H"
#include "fvcDiv.H"
#include "fvcGrad.H"
#include "fvcSnGrad.H"
void Foam::interfaceProperties::correctContactAngle
(
surfaceVectorField::Boundary& nHatb,
const surfaceVectorField::Boundary& gradAlphaf
) const
{
const fvMesh& mesh = alpha1_.mesh();
const volScalarField::Boundary& abf = alpha1_.boundaryField();
const vectorField nf
(
boundary[patchi].nf()
);
scalarField b2(nHatp.size());
forAll(b2, facei)
{
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
}
void Foam::interfaceProperties::calculateK()
{
const fvMesh& mesh = alpha1_.mesh();
const surfaceVectorField& Sf = mesh.Sf();
correctContactAngle(nHatfv.boundaryFieldRef(), gradAlphaf.boundaryField());
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::interfaceProperties::interfaceProperties
(
const volScalarField& alpha1,
const volVectorField& U,
const IOdictionary& dict
)
:
transportPropertiesDict_(dict),
sigmaPtr_(surfaceTensionModel::New(dict, alpha1.mesh())),
deltaN_
(
"deltaN",
1e-8/pow(average(alpha1.mesh().V()), 1.0/3.0)
),
alpha1_(alpha1),
U_(U),
nHatf_
(
IOobject
(
"nHatf",
alpha1_.time().timeName(),
alpha1_.mesh()
),
alpha1_.mesh(),
dimensionedScalar(dimArea, 0)
),
K_
(
IOobject
(
"interfaceProperties:K",
alpha1_.time().timeName(),
alpha1_.mesh()
),
alpha1_.mesh(),
dimensionedScalar(dimless/dimLength, 0)
)
{
calculateK();
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::interfaceProperties::sigmaK() const
{
return sigmaPtr_->sigma()*K_;
}
Foam::tmp<Foam::surfaceScalarField>
Foam::interfaceProperties::surfaceTensionForce() const
{
return fvc::interpolate(sigmaK())*fvc::snGrad(alpha1_);
}
Foam::tmp<Foam::volScalarField>
Foam::interfaceProperties::nearInterface() const
{
return pos0(alpha1_ - 0.01)*pos0(0.99 - alpha1_);
}
void Foam::interfaceProperties::correct()
{
calculateK();
}
bool Foam::interfaceProperties::read()
{
sigmaPtr_->readDict(transportPropertiesDict_);
return true;
}
// ************************************************************************* //