contactAngleModels: New contact angle models library
used in the alphaContactAngleFvPatchScalarField boundary condition to replace the need to derive specialised versions for different contact angle evaluation methods. This simplifies the code and provides a reusable system which could be applied to other multiphase contact angle boundary conditions.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,7 +33,6 @@ License
|
|||||||
#include "fvcSnGrad.H"
|
#include "fvcSnGrad.H"
|
||||||
#include "CorrectPhi.H"
|
#include "CorrectPhi.H"
|
||||||
#include "fvcMeshPhi.H"
|
#include "fvcMeshPhi.H"
|
||||||
#include "alphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "correctContactAngle.H"
|
#include "correctContactAngle.H"
|
||||||
#include "dragModel.H"
|
#include "dragModel.H"
|
||||||
#include "movingWallVelocityFvPatchVectorField.H"
|
#include "movingWallVelocityFvPatchVectorField.H"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -140,7 +140,7 @@ void Foam::Function1<Type>::operator=(const Function1<Type>& f)
|
|||||||
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::writeEntry(Ostream& os, const Function1<Type>& f1)
|
void Foam::writeEntry(Ostream& os, const Function1<Type>& f1)
|
||||||
{
|
{
|
||||||
writeKeyword(os, f1.name())
|
writeKeyword(os, f1.name())
|
||||||
<< nl << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
<< nl << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,19 +39,6 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const Field<Type>& fld
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchField<Type>(p, iF, fld),
|
|
||||||
uniformValue_()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -96,14 +96,6 @@ public:
|
|||||||
const DimensionedField<Type, volMesh>&
|
const DimensionedField<Type, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from patch and internal field and patch field
|
|
||||||
uniformFixedValueFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const Field<Type>& fld
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
//- Construct from patch, internal field and dictionary
|
||||||
uniformFixedValueFvPatchField
|
uniformFixedValueFvPatchField
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::fv::gaussDivScheme
|
Foam::fv::gaussDivScheme
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Basic second-order div using face-gradients and Gauss' theorem.
|
Basic second-order div using face interpolated values and Gauss' theorem.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
gaussDivScheme.C
|
gaussDivScheme.C
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -77,14 +77,12 @@ Foam::fv::gaussGrad<Type>::gradf
|
|||||||
|
|
||||||
forAll(mesh.boundary(), patchi)
|
forAll(mesh.boundary(), patchi)
|
||||||
{
|
{
|
||||||
const labelUList& pFaceCells =
|
const fvPatch& p = mesh.boundary()[patchi];
|
||||||
mesh.boundary()[patchi].faceCells();
|
const labelUList& pFaceCells = p.faceCells();
|
||||||
|
|
||||||
const vectorField& pSf = mesh.Sf().boundaryField()[patchi];
|
const vectorField& pSf = mesh.Sf().boundaryField()[patchi];
|
||||||
|
|
||||||
const fvsPatchField<Type>& pssf = ssf.boundaryField()[patchi];
|
const fvsPatchField<Type>& pssf = ssf.boundaryField()[patchi];
|
||||||
|
|
||||||
forAll(mesh.boundary()[patchi], facei)
|
forAll(p, facei)
|
||||||
{
|
{
|
||||||
igGrad[pFaceCells[facei]] += pSf[facei]*pssf[facei];
|
igGrad[pFaceCells[facei]] += pSf[facei]*pssf[facei];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,7 +59,10 @@ class gaussGrad
|
|||||||
:
|
:
|
||||||
public fv::gradScheme<Type>
|
public fv::gradScheme<Type>
|
||||||
{
|
{
|
||||||
// Private Data
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Data
|
||||||
|
|
||||||
tmp<surfaceInterpolationScheme<Type>> tinterpScheme_;
|
tmp<surfaceInterpolationScheme<Type>> tinterpScheme_;
|
||||||
|
|
||||||
|
|||||||
@ -5,4 +5,13 @@ surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C
|
|||||||
surfaceTensionModels/constant/constantSurfaceTension.C
|
surfaceTensionModels/constant/constantSurfaceTension.C
|
||||||
surfaceTensionModels/temperatureDependent/temperatureDependentSurfaceTension.C
|
surfaceTensionModels/temperatureDependent/temperatureDependentSurfaceTension.C
|
||||||
|
|
||||||
|
contactAngleModels/contactAngleModel/contactAngleModel.C
|
||||||
|
contactAngleModels/contactAngleModel/contactAngleModelNew.C
|
||||||
|
contactAngleModels/constant/constantContactAngle.C
|
||||||
|
contactAngleModels/temperatureDependent/temperatureDependentContactAngle.C
|
||||||
|
contactAngleModels/dynamic/dynamicContactAngle.C
|
||||||
|
contactAngleModels/gravitational/gravitationalContactAngle.C
|
||||||
|
|
||||||
|
alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libinterfaceProperties
|
LIB = $(FOAM_LIBBIN)/libinterfaceProperties
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-ltwoPhaseProperties \
|
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,8 +32,6 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(alphaContactAngleFvPatchScalarField, 0);
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum
|
const char* Foam::NamedEnum
|
||||||
<
|
<
|
||||||
@ -65,6 +63,7 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
|
contactAngle_(),
|
||||||
limit_(lcZeroGradient)
|
limit_(lcZeroGradient)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -77,6 +76,7 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
|
contactAngle_(contactAngleModel::New(dict)),
|
||||||
limit_(limitControlNames_.read(dict.lookup("limit")))
|
limit_(limitControlNames_.read(dict.lookup("limit")))
|
||||||
{
|
{
|
||||||
if (dict.found("gradient"))
|
if (dict.found("gradient"))
|
||||||
@ -102,6 +102,7 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(acpsf, p, iF, mapper),
|
fixedGradientFvPatchScalarField(acpsf, p, iF, mapper),
|
||||||
|
contactAngle_(acpsf.contactAngle_, false),
|
||||||
limit_(acpsf.limit_)
|
limit_(acpsf.limit_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -113,12 +114,23 @@ Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(acpsf, iF),
|
fixedGradientFvPatchScalarField(acpsf, iF),
|
||||||
|
contactAngle_(acpsf.contactAngle_, false),
|
||||||
limit_(acpsf.limit_)
|
limit_(acpsf.limit_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::alphaContactAngleFvPatchScalarField::cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return contactAngle_->cosTheta(Up, nHat);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::alphaContactAngleFvPatchScalarField::evaluate
|
void Foam::alphaContactAngleFvPatchScalarField::evaluate
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes
|
const Pstream::commsTypes
|
||||||
@ -156,8 +168,21 @@ void Foam::alphaContactAngleFvPatchScalarField::write
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
fixedGradientFvPatchScalarField::write(os);
|
fixedGradientFvPatchScalarField::write(os);
|
||||||
|
writeEntry(os, contactAngle_());
|
||||||
writeEntry(os, "limit", limitControlNames_[limit_]);
|
writeEntry(os, "limit", limitControlNames_[limit_]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchScalarField,
|
||||||
|
alphaContactAngleFvPatchScalarField
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,10 +25,7 @@ Class
|
|||||||
Foam::alphaContactAngleFvPatchScalarField
|
Foam::alphaContactAngleFvPatchScalarField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Abstract base class for alphaContactAngle boundary conditions.
|
General alpha contact angle boundary condition.
|
||||||
|
|
||||||
Derived classes must implement the theta() function which returns the
|
|
||||||
wall contact angle field.
|
|
||||||
|
|
||||||
The essential entry "limit" controls the gradient of alpha1 on the wall:
|
The essential entry "limit" controls the gradient of alpha1 on the wall:
|
||||||
- none - Calculate the gradient from the contact-angle without limiter
|
- none - Calculate the gradient from the contact-angle without limiter
|
||||||
@ -47,9 +44,15 @@ Description
|
|||||||
{
|
{
|
||||||
type alphaContactAngle;
|
type alphaContactAngle;
|
||||||
limit none;
|
limit none;
|
||||||
|
theta0 70;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::contactAngleModel
|
||||||
|
Foam::contactAngleModels::constant
|
||||||
|
Foam::contactAngleModels::dynamic
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
alphaContactAngleFvPatchScalarField.C
|
alphaContactAngleFvPatchScalarField.C
|
||||||
|
|
||||||
@ -59,7 +62,7 @@ SourceFiles
|
|||||||
#define alphaContactAngleFvPatchScalarField_H
|
#define alphaContactAngleFvPatchScalarField_H
|
||||||
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
#include "fixedGradientFvPatchFields.H"
|
||||||
#include "fvsPatchFields.H"
|
#include "contactAngleModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -74,6 +77,11 @@ class alphaContactAngleFvPatchScalarField
|
|||||||
:
|
:
|
||||||
public fixedGradientFvPatchScalarField
|
public fixedGradientFvPatchScalarField
|
||||||
{
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Equilibrium contact angle function
|
||||||
|
autoPtr<contactAngleModel> contactAngle_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -135,12 +143,12 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the contact angle
|
//- Return the cosine of the contact angle
|
||||||
virtual tmp<scalarField> theta
|
tmp<scalarField> cosTheta
|
||||||
(
|
(
|
||||||
const fvPatchVectorField& Up,
|
const fvPatchVectorField& Up,
|
||||||
const fvsPatchVectorField& nHat
|
const vectorField& nHat
|
||||||
) const = 0;
|
) const;
|
||||||
|
|
||||||
//- Evaluate the patch field
|
//- Evaluate the patch field
|
||||||
virtual void evaluate
|
virtual void evaluate
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constantContactAngle.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(constant, 0);
|
||||||
|
addToRunTimeSelectionTable(contactAngleModel, constant, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::constant::constant(const dictionary& dict)
|
||||||
|
:
|
||||||
|
theta0_(dict.lookup<scalar>("theta0"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::constant::~constant()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::contactAngleModels::constant::cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField(Up.size(), cos(degToRad(theta0_)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::contactAngleModels::constant::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
writeEntry(os, "theta0", theta0_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::contactAngleModels::constant
|
||||||
|
|
||||||
|
Description
|
||||||
|
Uniform constant contact angle model.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example of the contact angle specification:
|
||||||
|
\verbatim
|
||||||
|
contactAngle
|
||||||
|
{
|
||||||
|
type constant;
|
||||||
|
theta0 70;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::contactAngleModel
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
constantContactAngle.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef constantContactAngle_H
|
||||||
|
#define constantContactAngle_H
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class constant Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class constant
|
||||||
|
:
|
||||||
|
public contactAngleModel
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Equilibrium contact angle
|
||||||
|
scalar theta0_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("constant");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
constant(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<contactAngleModel> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<contactAngleModel>(new constant(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~constant();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Cosine of the contact angle
|
||||||
|
virtual tmp<scalarField> cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Write data in dictionary format
|
||||||
|
virtual void write(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace contactAngleModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(contactAngleModel, 0);
|
||||||
|
defineRunTimeSelectionTable(contactAngleModel, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModel::contactAngleModel()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModel::~contactAngleModel()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::writeEntry(Ostream& os, const contactAngleModel& ca)
|
||||||
|
{
|
||||||
|
writeKeyword(os, "contactAngle")
|
||||||
|
<< nl << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
||||||
|
|
||||||
|
writeEntry(os, "type", ca.type());
|
||||||
|
|
||||||
|
ca.write(os);
|
||||||
|
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,143 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::contactAngleModel
|
||||||
|
|
||||||
|
Description
|
||||||
|
Abstract base-class for contact-angle models
|
||||||
|
which return the cosine contact angle field.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example of the surface tension specification:
|
||||||
|
\verbatim
|
||||||
|
contactAngle
|
||||||
|
{
|
||||||
|
type <contact angle model type>;
|
||||||
|
<coefficient name> <coefficient value>;
|
||||||
|
.
|
||||||
|
.
|
||||||
|
.
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
contactAngleModel.C
|
||||||
|
contactAngleModelNew.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef contactAngleModel_H
|
||||||
|
#define contactAngleModel_H
|
||||||
|
|
||||||
|
#include "fvPatchFields.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class contactAngleModel Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class contactAngleModel
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected member functions
|
||||||
|
|
||||||
|
static const dictionary& contactAngleDict(const dictionary& dict)
|
||||||
|
{
|
||||||
|
return dict.subDict("contactAngle");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("contactAngleModel");
|
||||||
|
|
||||||
|
|
||||||
|
// Declare runtime construction
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
contactAngleModel,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
),
|
||||||
|
(dict)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
// Construct
|
||||||
|
contactAngleModel();
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<contactAngleModel> clone() const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~contactAngleModel();
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
static autoPtr<contactAngleModel> New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Cosine of the contact angle
|
||||||
|
virtual tmp<scalarField> cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
//- Write data in dictionary format
|
||||||
|
virtual void write(Ostream& os) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void writeEntry(Ostream& os, const contactAngleModel& ca);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
#include "constantContactAngle.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::contactAngleModel> Foam::contactAngleModel::New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (dict.isDict("contactAngle"))
|
||||||
|
{
|
||||||
|
const dictionary& contactAngleDict =
|
||||||
|
contactAngleModel::contactAngleDict(dict);
|
||||||
|
|
||||||
|
word contactAngleModelType(contactAngleDict.lookup("type"));
|
||||||
|
|
||||||
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(contactAngleModelType);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown contactAngleModelType type "
|
||||||
|
<< contactAngleModelType << endl << endl
|
||||||
|
<< "Valid contactAngleModel types are : " << endl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cstrIter()(contactAngleDict);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return autoPtr<contactAngleModel>
|
||||||
|
(
|
||||||
|
new contactAngleModels::constant(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "dynamicContactAngle.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(dynamic, 0);
|
||||||
|
addToRunTimeSelectionTable(contactAngleModel, dynamic, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::dynamic::dynamic(const dictionary& dict)
|
||||||
|
:
|
||||||
|
theta0_(dict.lookup<scalar>("theta0")),
|
||||||
|
uTheta_(dict.lookup<scalar>("uTheta")),
|
||||||
|
thetaAdv_(dict.lookup<scalar>("thetaAdv")),
|
||||||
|
thetaRec_(dict.lookup<scalar>("thetaRec"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::dynamic::~dynamic()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::contactAngleModels::dynamic::cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const vectorField nf(Up.patch().nf());
|
||||||
|
|
||||||
|
// Calculated the component of the velocity parallel to the wall
|
||||||
|
vectorField U(Up.patchInternalField() - Up);
|
||||||
|
U -= (nf & U)*nf;
|
||||||
|
|
||||||
|
// Find the direction of the interface parallel to the wall and normalise
|
||||||
|
vectorField n(nHat - (nf & nHat)*nf);
|
||||||
|
n /= (mag(n) + small);
|
||||||
|
|
||||||
|
// Calculate the velocity coefficient
|
||||||
|
// from the component of U normal to the interface
|
||||||
|
const scalarField uCoeff(tanh((n & U)/uTheta_));
|
||||||
|
|
||||||
|
return cos
|
||||||
|
(
|
||||||
|
degToRad(theta0_)
|
||||||
|
+ degToRad(thetaRec_ - theta0_)*max(uCoeff, 0.0)
|
||||||
|
- degToRad(thetaAdv_ - theta0_)*min(uCoeff, 0.0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::contactAngleModels::dynamic::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
writeEntry(os, "theta0", theta0_);
|
||||||
|
writeEntry(os, "uTheta", uTheta_);
|
||||||
|
writeEntry(os, "thetaAdv", thetaAdv_);
|
||||||
|
writeEntry(os, "thetaRec", thetaRec_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::contactAngleModels::dynamic
|
||||||
|
|
||||||
|
Description
|
||||||
|
Dynamic contact angle model.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
theta0 | Equilibrium contact angle | yes |
|
||||||
|
uTheta | Velocity scale | yes |
|
||||||
|
thetaAdv | Limiting advancing contact angle | yes |
|
||||||
|
thetaRec | Limiting receding contact angle | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example:
|
||||||
|
\verbatim
|
||||||
|
contactAngle
|
||||||
|
{
|
||||||
|
type dynamic;
|
||||||
|
uTheta 1;
|
||||||
|
theta0 70;
|
||||||
|
thetaAdv 100;
|
||||||
|
thetaRec 50;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::contactAngleModel
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
dynamicContactAngle.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef dynamicContactAngle_H
|
||||||
|
#define dynamicContactAngle_H
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class dynamic Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class dynamic
|
||||||
|
:
|
||||||
|
public contactAngleModel
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Equilibrium contact angle
|
||||||
|
scalar theta0_;
|
||||||
|
|
||||||
|
//- Dynamic contact angle velocity scale
|
||||||
|
scalar uTheta_;
|
||||||
|
|
||||||
|
//- Limiting advancing contact angle
|
||||||
|
scalar thetaAdv_;
|
||||||
|
|
||||||
|
//- Limiting receding contact angle
|
||||||
|
scalar thetaRec_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("dynamic");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
dynamic(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<contactAngleModel> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<contactAngleModel>(new dynamic(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~dynamic();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Cosine of the contact angle
|
||||||
|
virtual tmp<scalarField> cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Write data in dictionary format
|
||||||
|
virtual void write(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace contactAngleModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "gravitationalContactAngle.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
#include "uniformDimensionedFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(gravitational, 0);
|
||||||
|
addToRunTimeSelectionTable(contactAngleModel, gravitational, dictionary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::gravitational::gravitational(const dictionary& dict)
|
||||||
|
:
|
||||||
|
theta0_(dict.lookup<scalar>("theta0")),
|
||||||
|
gTheta_(dict.lookup<scalar>("gTheta")),
|
||||||
|
thetaAdv_(dict.lookup<scalar>("thetaAdv")),
|
||||||
|
thetaRec_(dict.lookup<scalar>("thetaRec"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::gravitational::~gravitational()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::contactAngleModels::gravitational::cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const uniformDimensionedVectorField& g =
|
||||||
|
Up.db().lookupObject<uniformDimensionedVectorField>("g");
|
||||||
|
|
||||||
|
const scalarField uCoeff(tanh((nHat & g.value())/gTheta_));
|
||||||
|
|
||||||
|
return cos
|
||||||
|
(
|
||||||
|
degToRad(theta0_)
|
||||||
|
+ degToRad(thetaRec_ - theta0_)*max(uCoeff, 0.0)
|
||||||
|
- degToRad(thetaAdv_ - theta0_)*min(uCoeff, 0.0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::contactAngleModels::gravitational::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
writeEntry(os, "theta0", theta0_);
|
||||||
|
writeEntry(os, "gTheta", gTheta_);
|
||||||
|
writeEntry(os, "thetaAdv", thetaAdv_);
|
||||||
|
writeEntry(os, "thetaRec", thetaRec_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::contactAngleModels::gravitational
|
||||||
|
|
||||||
|
Description
|
||||||
|
Gravitational acceleration based contact angle model.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
theta0 | Equilibrium contact angle | yes |
|
||||||
|
gTheta | Gravitational acceleration scale | yes |
|
||||||
|
thetaAdv | Limiting advancing contact angle | yes |
|
||||||
|
thetaRec | Limiting receding contact angle | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example:
|
||||||
|
\verbatim
|
||||||
|
contactAngle
|
||||||
|
{
|
||||||
|
type gravitational;
|
||||||
|
gTheta 0.1;
|
||||||
|
theta0 70;
|
||||||
|
thetaAdv 100;
|
||||||
|
thetaRec 50;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::contactAngleModel
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
gravitationalContactAngle.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef gravitationalContactAngle_H
|
||||||
|
#define gravitationalContactAngle_H
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class gravitational Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class gravitational
|
||||||
|
:
|
||||||
|
public contactAngleModel
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Equilibrium contact angle
|
||||||
|
scalar theta0_;
|
||||||
|
|
||||||
|
//- Gavitational acceleration scale
|
||||||
|
scalar gTheta_;
|
||||||
|
|
||||||
|
//- Limiting advancing contact angle
|
||||||
|
scalar thetaAdv_;
|
||||||
|
|
||||||
|
//- Limiting receding contact angle
|
||||||
|
scalar thetaRec_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("gravitational");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
gravitational(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<contactAngleModel> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<contactAngleModel>(new gravitational(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~gravitational();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Cosine of the contact angle
|
||||||
|
virtual tmp<scalarField> cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Write data in dictionary format
|
||||||
|
virtual void write(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace contactAngleModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "temperatureDependentContactAngle.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(temperatureDependent, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
contactAngleModel,
|
||||||
|
temperatureDependent,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::temperatureDependent::temperatureDependent
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
TName_(dict.lookupOrDefault<word>("T", "T")),
|
||||||
|
theta0_(Function1<scalar>::New("theta0", dict))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::contactAngleModels::temperatureDependent::~temperatureDependent()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::contactAngleModels::temperatureDependent::cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return cos
|
||||||
|
(
|
||||||
|
degToRad
|
||||||
|
(
|
||||||
|
theta0_->value
|
||||||
|
(
|
||||||
|
Up.patch().lookupPatchField<volScalarField, scalar>(TName_)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::contactAngleModels::temperatureDependent::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
writeEntry(os, theta0_());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::contactAngleModels::temperatureDependent
|
||||||
|
|
||||||
|
Description
|
||||||
|
Temperature-dependent contact angle model.
|
||||||
|
|
||||||
|
The contact angle is evaluated from the specified Foam::Function1 for the
|
||||||
|
temperature field looked-up from the mesh database the name of which
|
||||||
|
may optionally be provided.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
T | Temperature field name | no | T
|
||||||
|
contactAngle | contact angle function | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example of the contact angle specification:
|
||||||
|
\verbatim
|
||||||
|
contactAngle
|
||||||
|
{
|
||||||
|
type temperatureDependent;
|
||||||
|
contactAngle constant 0.07;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::contactAngleModel
|
||||||
|
Foam::Function1
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
temperatureDependentContactAngle.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef temperatureDependentContactAngle_H
|
||||||
|
#define temperatureDependentContactAngle_H
|
||||||
|
|
||||||
|
#include "contactAngleModel.H"
|
||||||
|
#include "Function1.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace contactAngleModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class temperatureDependent Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class temperatureDependent
|
||||||
|
:
|
||||||
|
public contactAngleModel
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
//- Name of temperature field, default = "T"
|
||||||
|
word TName_;
|
||||||
|
|
||||||
|
//- Equilibrium contact angle function
|
||||||
|
autoPtr<Function1<scalar>> theta0_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("temperatureDependent");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
temperatureDependent(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<contactAngleModel> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<contactAngleModel>(new temperatureDependent(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~temperatureDependent();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Cosine of the contact angle
|
||||||
|
virtual tmp<scalarField> cosTheta
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& Up,
|
||||||
|
const vectorField& nHat
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Write data in dictionary format
|
||||||
|
virtual void write(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace contactAngleModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -62,9 +62,9 @@ void Foam::interfaceProperties::correctContactAngle
|
|||||||
);
|
);
|
||||||
|
|
||||||
fvsPatchVectorField& nHatp = nHatb[patchi];
|
fvsPatchVectorField& nHatp = nHatb[patchi];
|
||||||
const scalarField theta
|
const scalarField cosTheta
|
||||||
(
|
(
|
||||||
degToRad(a1cap.theta(U_.boundaryField()[patchi], nHatp))
|
a1cap.cosTheta(U_.boundaryField()[patchi], nHatp)
|
||||||
);
|
);
|
||||||
|
|
||||||
const vectorField nf
|
const vectorField nf
|
||||||
@ -75,12 +75,12 @@ void Foam::interfaceProperties::correctContactAngle
|
|||||||
// Reset nHatp to correspond to the contact angle
|
// Reset nHatp to correspond to the contact angle
|
||||||
|
|
||||||
const scalarField a12(nHatp & nf);
|
const scalarField a12(nHatp & nf);
|
||||||
const scalarField b1(cos(theta));
|
const scalarField b1(cosTheta);
|
||||||
|
|
||||||
scalarField b2(nHatp.size());
|
scalarField b2(nHatp.size());
|
||||||
forAll(b2, facei)
|
forAll(b2, facei)
|
||||||
{
|
{
|
||||||
b2[facei] = cos(acos(a12[facei]) - theta[facei]);
|
b2[facei] = cos(acos(a12[facei]) - acos(cosTheta[facei]));
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalarField det(1.0 - a12*a12);
|
const scalarField det(1.0 - a12*a12);
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
|
||||||
alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
|
|
||||||
alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C
|
|
||||||
alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
|
|
||||||
alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
|
|
||||||
alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
|
alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libtwoPhaseProperties
|
LIB = $(FOAM_LIBBIN)/libtwoPhaseProperties
|
||||||
|
|||||||
@ -1,121 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / 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.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "constantAlphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "volMesh.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField::
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF),
|
|
||||||
theta0_(0.0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField::
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF, dict),
|
|
||||||
theta0_(dict.lookup<scalar>("theta0"))
|
|
||||||
{
|
|
||||||
evaluate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField::
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const constantAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper),
|
|
||||||
theta0_(gcpsf.theta0_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField::
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const constantAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, iF),
|
|
||||||
theta0_(gcpsf.theta0_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField::theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField&,
|
|
||||||
const fvsPatchVectorField&
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<scalarField>(new scalarField(size(), theta0_));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::constantAlphaContactAngleFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
alphaContactAngleFvPatchScalarField::write(os);
|
|
||||||
writeEntry(os, "theta0", theta0_);
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,145 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / 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.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
A constant alphaContactAngle scalar boundary condition.
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::alphaContactAngleFvPatchScalarField
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
constantAlphaContactAngleFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef constantAlphaContactAngleFvPatchScalarField_H
|
|
||||||
#define constantAlphaContactAngleFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "alphaContactAngleFvPatchScalarField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class constantAlphaContactAngleFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class constantAlphaContactAngleFvPatchScalarField
|
|
||||||
:
|
|
||||||
public alphaContactAngleFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Equilibrium contact angle
|
|
||||||
scalar theta0_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("constantAlphaContactAngle");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// constantAlphaContactAngleFvPatchScalarField
|
|
||||||
// onto a new patch
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const constantAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow copy without setting internal field reference
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const constantAlphaContactAngleFvPatchScalarField&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
//- Copy constructor setting internal field reference
|
|
||||||
constantAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const constantAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new constantAlphaContactAngleFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the equilibrium contact-angle
|
|
||||||
virtual tmp<scalarField> theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField& Up,
|
|
||||||
const fvsPatchVectorField& nHat
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "dynamicAlphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField::
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF),
|
|
||||||
theta0_(0.0),
|
|
||||||
uTheta_(0.0),
|
|
||||||
thetaA_(0.0),
|
|
||||||
thetaR_(0.0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField::
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF, dict),
|
|
||||||
theta0_(dict.lookup<scalar>("theta0")),
|
|
||||||
uTheta_(dict.lookup<scalar>("uTheta")),
|
|
||||||
thetaA_(dict.lookupBackwardsCompatible<scalar>({"thetaA", "thetaRec"})),
|
|
||||||
thetaR_(dict.lookupBackwardsCompatible<scalar>({"thetaR", "thetaAdv"}))
|
|
||||||
{
|
|
||||||
evaluate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField::
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const dynamicAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper),
|
|
||||||
theta0_(gcpsf.theta0_),
|
|
||||||
uTheta_(gcpsf.uTheta_),
|
|
||||||
thetaA_(gcpsf.thetaA_),
|
|
||||||
thetaR_(gcpsf.thetaR_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField::
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const dynamicAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, iF),
|
|
||||||
theta0_(gcpsf.theta0_),
|
|
||||||
uTheta_(gcpsf.uTheta_),
|
|
||||||
thetaA_(gcpsf.thetaA_),
|
|
||||||
thetaR_(gcpsf.thetaR_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField::theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField& Up,
|
|
||||||
const fvsPatchVectorField& nHat
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (uTheta_ < small)
|
|
||||||
{
|
|
||||||
return tmp<scalarField>(new scalarField(size(), theta0_));
|
|
||||||
}
|
|
||||||
|
|
||||||
const vectorField nf(patch().nf());
|
|
||||||
|
|
||||||
// Calculated the component of the velocity parallel to the wall
|
|
||||||
vectorField Uwall(Up.patchInternalField() - Up);
|
|
||||||
Uwall -= (nf & Uwall)*nf;
|
|
||||||
|
|
||||||
// Find the direction of the interface parallel to the wall
|
|
||||||
vectorField nWall(nHat - (nf & nHat)*nf);
|
|
||||||
|
|
||||||
// Normalise nWall
|
|
||||||
nWall /= (mag(nWall) + small);
|
|
||||||
|
|
||||||
// Calculate Uwall resolved normal to the interface parallel to
|
|
||||||
// the interface
|
|
||||||
scalarField uwall(nWall & Uwall);
|
|
||||||
|
|
||||||
return theta0_ + (thetaA_ - thetaR_)*tanh(uwall/uTheta_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
alphaContactAngleFvPatchScalarField::write(os);
|
|
||||||
writeEntry(os, "theta0", theta0_);
|
|
||||||
writeEntry(os, "uTheta", uTheta_);
|
|
||||||
writeEntry(os, "thetaA", thetaA_);
|
|
||||||
writeEntry(os, "thetaR", thetaR_);
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,207 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / 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.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
A dynamic alphaContactAngle scalar boundary condition
|
|
||||||
|
|
||||||
Usage
|
|
||||||
Standard properties:
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
theta0 | Equilibrium contact angle | yes |
|
|
||||||
uTheta | Velocity scale | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
The advancing and receding contact angles can be either specified with
|
|
||||||
respect to the interface normal direction:
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
thetaA | Limiting advancing contact angle | yes |
|
|
||||||
thetaR | Limiting receding contact angle | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
or with respect to the phase outward direction:
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
thetaAdv | Limiting advancing contact angle | yes |
|
|
||||||
thetaRec | Limiting receding contact angle | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
Example of the boundary condition specification using the interface
|
|
||||||
normal direction convention:
|
|
||||||
\verbatim
|
|
||||||
<patchName>
|
|
||||||
{
|
|
||||||
type dynamicAlphaContactAngle;
|
|
||||||
uTheta 1;
|
|
||||||
theta0 90;
|
|
||||||
thetaA 70;
|
|
||||||
thetaR 110;
|
|
||||||
limit gradient;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
Example of the boundary condition specification using the phase outward
|
|
||||||
direction convention (opposite to the normal direction):
|
|
||||||
\verbatim
|
|
||||||
<patchName>
|
|
||||||
{
|
|
||||||
type dynamicAlphaContactAngle;
|
|
||||||
uTheta 1;
|
|
||||||
theta0 90;
|
|
||||||
thetaAdv 110;
|
|
||||||
thetaRec 70;
|
|
||||||
limit gradient;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::alphaContactAngleFvPatchScalarField
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef dynamicAlphaContactAngleFvPatchScalarField_H
|
|
||||||
#define dynamicAlphaContactAngleFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "alphaContactAngleFvPatchScalarField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class dynamicAlphaContactAngleFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
:
|
|
||||||
public alphaContactAngleFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Equilibrium contact angle
|
|
||||||
scalar theta0_;
|
|
||||||
|
|
||||||
//- Dynamic contact angle velocity scale
|
|
||||||
scalar uTheta_;
|
|
||||||
|
|
||||||
//- Limiting advancing contact angle
|
|
||||||
scalar thetaA_;
|
|
||||||
|
|
||||||
//- Limiting receding contact angle
|
|
||||||
scalar thetaR_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("dynamicAlphaContactAngle");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
// onto a new patch
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const dynamicAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow copy without setting internal field reference
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const dynamicAlphaContactAngleFvPatchScalarField&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
//- Copy constructor setting internal field reference
|
|
||||||
dynamicAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const dynamicAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new dynamicAlphaContactAngleFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Evaluate and return dynamic contact-angle
|
|
||||||
virtual tmp<scalarField> theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField& Up,
|
|
||||||
const fvsPatchVectorField& nHat
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "temperatureDependentAlphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF),
|
|
||||||
TName_("T"),
|
|
||||||
theta0_()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF, dict),
|
|
||||||
TName_(dict.lookupOrDefault<word>("T", "T")),
|
|
||||||
theta0_(Function1<scalar>::New("theta0", dict))
|
|
||||||
{
|
|
||||||
evaluate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const temperatureDependentAlphaContactAngleFvPatchScalarField& psf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(psf, p, iF, mapper),
|
|
||||||
TName_(psf.TName_),
|
|
||||||
theta0_(psf.theta0_, false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const temperatureDependentAlphaContactAngleFvPatchScalarField& psf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(psf, iF),
|
|
||||||
TName_(psf.TName_),
|
|
||||||
theta0_(psf.theta0_, false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField&,
|
|
||||||
const fvsPatchVectorField&
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return theta0_->value
|
|
||||||
(
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(TName_)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
alphaContactAngleFvPatchScalarField::write(os);
|
|
||||||
writeEntryIfDifferent<word>(os, "T", "T", TName_);
|
|
||||||
writeEntry(os, theta0_());
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,174 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Temperature-dependent alphaContactAngle scalar boundary condition.
|
|
||||||
|
|
||||||
The contact angle is evaluated from the specified Foam::Function1 for the
|
|
||||||
temperature field looked-up from the mesh database the name of which
|
|
||||||
may optionally be provided.
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
T | Temperature field name | no | T
|
|
||||||
theta0 | Contact angle function | yes |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
|
||||||
\verbatim
|
|
||||||
<patchName>
|
|
||||||
{
|
|
||||||
type temperatureDependentAlphaContactAngle;
|
|
||||||
theta0 constant 60;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::alphaContactAngleFvPatchScalarField
|
|
||||||
Foam::constantAlphaContactAngleFvPatchScalarField
|
|
||||||
Foam::Function1
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef temperatureDependentAlphaContactAngleFvPatchScalarField_H
|
|
||||||
#define temperatureDependentAlphaContactAngleFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "alphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "Function1.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class temperatureDependentAlphaContactAngleFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
:
|
|
||||||
public alphaContactAngleFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
//- Name of temperature field, default = "T"
|
|
||||||
word TName_;
|
|
||||||
|
|
||||||
//- Equilibrium contact angle function
|
|
||||||
autoPtr<Function1<scalar>> theta0_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("temperatureDependentAlphaContactAngle");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
// onto a new patch
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const temperatureDependentAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Disallow copy without setting internal field reference
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const temperatureDependentAlphaContactAngleFvPatchScalarField&
|
|
||||||
) = delete;
|
|
||||||
|
|
||||||
//- Copy constructor setting internal field reference
|
|
||||||
temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const temperatureDependentAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new temperatureDependentAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the equilibrium contact-angle
|
|
||||||
virtual tmp<scalarField> theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField& Up,
|
|
||||||
const fvsPatchVectorField& nHat
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,153 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration | Website: https://openfoam.org
|
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "timeVaryingAlphaContactAngleFvPatchScalarField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volMesh.H"
|
|
||||||
#include "Time.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF),
|
|
||||||
t0_(0.0),
|
|
||||||
thetaT0_(0.0),
|
|
||||||
te_(0.0),
|
|
||||||
thetaTe_(0.0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(p, iF, dict),
|
|
||||||
t0_(dict.lookup<scalar>("t0")),
|
|
||||||
thetaT0_(dict.lookup<scalar>("thetaT0")),
|
|
||||||
te_(dict.lookup<scalar>("te")),
|
|
||||||
thetaTe_(dict.lookup<scalar>("thetaTe"))
|
|
||||||
{
|
|
||||||
evaluate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper),
|
|
||||||
t0_(gcpsf.t0_),
|
|
||||||
thetaT0_(gcpsf.thetaT0_),
|
|
||||||
te_(gcpsf.te_),
|
|
||||||
thetaTe_(gcpsf.te_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
alphaContactAngleFvPatchScalarField(gcpsf, iF),
|
|
||||||
t0_(gcpsf.t0_),
|
|
||||||
thetaT0_(gcpsf.thetaT0_),
|
|
||||||
te_(gcpsf.te_),
|
|
||||||
thetaTe_(gcpsf.thetaTe_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField>
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField&,
|
|
||||||
const fvsPatchVectorField&
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar t = patch().boundaryMesh().mesh().time().userTimeValue();
|
|
||||||
scalar theta0 = thetaT0_;
|
|
||||||
|
|
||||||
if (t < t0_)
|
|
||||||
{
|
|
||||||
theta0 = thetaT0_;
|
|
||||||
}
|
|
||||||
else if (t > te_)
|
|
||||||
{
|
|
||||||
theta0 = thetaTe_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tmp<scalarField>(new scalarField(size(), theta0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
alphaContactAngleFvPatchScalarField::write(os);
|
|
||||||
writeEntry(os, "t0", t0_);
|
|
||||||
writeEntry(os, "thetaT0", thetaT0_);
|
|
||||||
writeEntry(os, "te", te_);
|
|
||||||
writeEntry(os, "thetaTe", thetaTe_);
|
|
||||||
writeEntry(os, "value", *this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / 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.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
A time-varying alphaContactAngle scalar boundary condition
|
|
||||||
(alphaContactAngleFvPatchScalarField)
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef timeVaryingAlphaContactAngleFvPatchScalarField_H
|
|
||||||
#define timeVaryingAlphaContactAngleFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "alphaContactAngleFvPatchScalarField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class timeVaryingAlphaContactAngleFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
:
|
|
||||||
public alphaContactAngleFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private Data
|
|
||||||
|
|
||||||
// Equilibrium contact angle control parameters
|
|
||||||
scalar t0_;
|
|
||||||
scalar thetaT0_;
|
|
||||||
scalar te_;
|
|
||||||
scalar thetaTe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("timeVaryingAlphaContactAngle");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// timeVaryingAlphaContactAngleFvPatchScalarField onto a new patch
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const timeVaryingAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
timeVaryingAlphaContactAngleFvPatchScalarField
|
|
||||||
(
|
|
||||||
const timeVaryingAlphaContactAngleFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new timeVaryingAlphaContactAngleFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Evaluate and return the time-varying equilibrium contact-angle
|
|
||||||
virtual tmp<scalarField> theta
|
|
||||||
(
|
|
||||||
const fvPatchVectorField& Up,
|
|
||||||
const fvsPatchVectorField& nHat
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user