ENH: dynamicContactAngleForce: new finite-area contact-angle force model

DEFEATURE: merge fa-perturbedTemperatureDependent into dynamicContactAngle
This commit is contained in:
Kutalmis Bercin
2022-12-06 11:43:56 +00:00
committed by Andrew Heather
parent 8f63fd5230
commit 885456f9a4
6 changed files with 131 additions and 70 deletions

View File

@ -30,7 +30,7 @@ liquidFilm/subModels/kinematic/force/forceList/forceList.C
liquidFilm/subModels/kinematic/force/force/force.C
liquidFilm/subModels/kinematic/force/force/forceNew.C
liquidFilm/subModels/kinematic/force/contactAngleForces/contactAngleForce/contactAngleForce.C
liquidFilm/subModels/kinematic/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C
liquidFilm/subModels/kinematic/force/contactAngleForces/dynamicContactAngleForce/dynamicContactAngleForce.C
liquidFilm/subModels/filmSubModelBase.C

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "perturbedTemperatureDependentContactAngleForce.H"
#include "dynamicContactAngleForce.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,26 +39,44 @@ namespace areaSurfaceFilmModels
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(perturbedTemperatureDependentContactAngleForce, 0);
defineTypeNameAndDebug(dynamicContactAngleForce, 0);
addToRunTimeSelectionTable
(
force,
perturbedTemperatureDependentContactAngleForce,
dynamicContactAngleForce,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
perturbedTemperatureDependentContactAngleForce::
perturbedTemperatureDependentContactAngleForce
dynamicContactAngleForce::dynamicContactAngleForce
(
liquidFilmBase& film,
const dictionary& dict
)
:
contactAngleForce(typeName, film, dict),
thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.primaryMesh())),
U_vs_thetaPtr_
(
Function1<scalar>::NewIfPresent
(
"Utheta",
coeffDict_,
word::null,
&film.primaryMesh()
)
),
T_vs_thetaPtr_
(
Function1<scalar>::NewIfPresent
(
"Ttheta",
coeffDict_,
word::null,
&film.primaryMesh()
)
),
rndGen_(label(0)),
distribution_
(
@ -68,43 +86,53 @@ perturbedTemperatureDependentContactAngleForce
rndGen_
)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
perturbedTemperatureDependentContactAngleForce::
~perturbedTemperatureDependentContactAngleForce()
{}
{
if (U_vs_thetaPtr_ && T_vs_thetaPtr_)
{
FatalIOErrorInFunction(dict)
<< "Entries Utheta and Ttheta could not be used together"
<< abort(FatalIOError);
}
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
tmp<areaScalarField> perturbedTemperatureDependentContactAngleForce::
theta() const
tmp<areaScalarField> dynamicContactAngleForce::theta() const
{
tmp<areaScalarField> ttheta
auto ttheta = tmp<areaScalarField>::New
(
new areaScalarField
IOobject
(
IOobject
(
typeName + ":theta",
film().primaryMesh().time().timeName(),
film().primaryMesh()
),
film().regionMesh(),
dimensionedScalar(dimless, Zero)
)
IOobject::scopedName(typeName, "theta"),
film().primaryMesh().time().timeName(),
film().primaryMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
film().regionMesh(),
dimensionedScalar(dimless, Zero)
);
areaScalarField& theta = ttheta.ref();
scalarField& thetai = theta.ref();
const areaScalarField& T = film().Tf();
// Initialize with the function of temperature
thetai = thetaPtr_->value(T());
if (U_vs_thetaPtr_)
{
// Initialize with the function of film speed
const areaVectorField& U = film().Uf();
thetai = U_vs_thetaPtr_->value(mag(U()));
}
if (T_vs_thetaPtr_)
{
// Initialize with the function of film temperature
const areaScalarField& T = film().Tf();
thetai = T_vs_thetaPtr_->value(T());
}
// Add the stochastic perturbation
forAll(thetai, facei)
@ -115,6 +143,7 @@ theta() const
return ttheta;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,31 +24,66 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::regionModels::areaSurfaceFilmModels::
perturbedTemperatureDependentContactAngleForce
Foam::regionModels::areaSurfaceFilmModels::dynamicContactAngleForce
Description
Temperature dependent contact angle force with a stochastic perturbation.
Film-speed or film-temperature dependent
contact-angle force with a stochastic perturbation.
The contact angle in degrees is specified as a \c Foam::Function1 type,
to enable the use of, e.g. \c constant, \c polynomial, \c table values
and the stochastic perturbation obtained from a
\c Foam::distributionModels::distributionModel.
See also
- Foam::regionModels::areaSurfaceFilmModels::contactAngleForce
- areaSurfaceFilmModels::temperatureDependentContactAngleForce
- Foam::regionModels::areaSurfaceFilmModels::distributionContactAngleForce
- Foam::Function1Types
- Foam::distributionModel
Usage
Minimal example:
\verbatim
forces
(
dynamicContactAngle
);
dynamicContactAngleForceCoeffs
{
// Mandatory entries
distribution <subDict>;
// Conditional entries
// Option-1
Utheta <Function1<scalar>>;
// Option-2
Ttheta <Function1<scalar>>;
// Inherited entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
dynamicContactAngle | Type name | word | yes | -
Utheta | Contact angle as a function of film speed <!--
--> | \<Function1\<scalar\> | choice | -
Ttheta | Contact angle as a function of film temperature <!--
--> | \<Function1\<scalar\> | choice | -
distribution | Probability distribution model | subDict | yes | -
\endtable
The inherited entries are elaborated in:
- \link contactAngleForce.H \endlink
- \link Function1.H \endlink
- \link distributionModel.H \endlink
SourceFiles
perturbedTemperatureDependentContactAngleForce.C
dynamicContactAngleForce.C
\*---------------------------------------------------------------------------*/
#ifndef perturbedTemperatureDependentContactAngleForce_H
#define perturbedTemperatureDependentContactAngleForce_H
#ifndef areaSurfaceFilmModels_dynamicContactAngleForce_H
#define areaSurfaceFilmModels_dynamicContactAngleForce_H
#include "contactAngleForce.H"
#include "Function1.H"
@ -65,17 +100,20 @@ namespace areaSurfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class perturbedTemperatureDependentContactAngleForce Declaration
Class dynamicContactAngleForce Declaration
\*---------------------------------------------------------------------------*/
class perturbedTemperatureDependentContactAngleForce
class dynamicContactAngleForce
:
public contactAngleForce
{
// Private Data
//- Contact angle function
autoPtr<Function1<scalar>> thetaPtr_;
//- Contact angle as a function of film speed
autoPtr<Function1<scalar>> U_vs_thetaPtr_;
//- Contact angle as a function of film temperature
autoPtr<Function1<scalar>> T_vs_thetaPtr_;
//- Random number generator
Random rndGen_;
@ -87,16 +125,10 @@ class perturbedTemperatureDependentContactAngleForce
// Private Member Functions
//- No copy construct
perturbedTemperatureDependentContactAngleForce
(
const perturbedTemperatureDependentContactAngleForce&
) = delete;
dynamicContactAngleForce(const dynamicContactAngleForce&) = delete;
//- No copy assignment
void operator=
(
const perturbedTemperatureDependentContactAngleForce&
) = delete;
void operator=(const dynamicContactAngleForce&) = delete;
protected:
@ -108,13 +140,13 @@ protected:
public:
//- Runtime type information
TypeName("perturbedTemperatureDependentContactAngle");
TypeName("dynamicContactAngle");
// Constructors
//- Construct from surface film model
perturbedTemperatureDependentContactAngleForce
dynamicContactAngleForce
(
liquidFilmBase& film,
const dictionary& dict
@ -122,7 +154,7 @@ public:
//- Destructor
virtual ~perturbedTemperatureDependentContactAngleForce();
virtual ~dynamicContactAngleForce() = default;
};