ENH: kinematicParcelFoam: new solver and tutorial

The original thermoSurfaceFilm sub-models were divided between kinematicSurfaceFilm and thermoSurfaceFilm in order to use the surfaceFilm model in a kinematicCloud.

The film interaction models are now in a kinematicSurface class which can be used in a kinematic cloud adding constant thermal properties (p and T) for some sub-models, e.g. drySplashInteraction/wetSplashInteraction.

pRef and Tref were added to the kinematicSurfaceFilm as entry to the regionFilm when used with a kinematic cloud.

In the finite area surface film model Tref, pRef are stored in filmSubModelBase.

TUT: kinematicParcelFoam: new tutorial pitzDailySprinkles
This commit is contained in:
sergio
2021-05-06 11:47:12 -07:00
committed by Sergio Ferraris
parent 4476863907
commit a9aa6cb0db
43 changed files with 2878 additions and 974 deletions

View File

@ -0,0 +1,3 @@
kinematicParcelFoam.C
EXE = $(FOAM_APPBIN)/kinematicParcelFoam

View File

@ -0,0 +1,42 @@
EXE_INC = \
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/faOptions/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-latmosphericModels \
-lregionModels \
-lsurfaceFilmModels \
-lsurfaceFilmDerivedFvPatchFields \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lregionFaModels \
-lfiniteArea \
-lfaOptions

View File

@ -0,0 +1,22 @@
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
fvm::ddt(U) + fvm::div(phi, U)
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
parcels.SU(U, true)
+ fvOptions(U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);
}

View File

@ -0,0 +1,16 @@
const word kinematicCloudName
(
args.getOrDefault<word>("cloud", "kinematicCloud")
);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCloud parcels
(
kinematicCloudName,
rhoInf,
U,
muc,
g
);

View File

@ -0,0 +1 @@
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();

View File

@ -0,0 +1,85 @@
#include "readGravitationalAcceleration.H"
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
dimensionedScalar rhoInfValue
(
"rhoInf",
dimDensity,
laminarTransport
);
volScalarField rhoInf
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
rhoInfValue
);
volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
rhoInf*laminarTransport.nu()
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
#include "createMRF.H"
#include "createClouds.H"
#include "createSurfaceFilmModel.H"
#include "createFvOptions.H"

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Application
kinematicParcelFoam
Group
grpLagrangianSolvers
Description
Transient solver for incompressible, turbulent flow with kinematic,
particle cloud, and surface film modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "surfaceFilmModel.H"
#include "basicKinematicCloud.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "CorrectPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for incompressible, turbulent flow"
" with kinematic particle clouds"
" and surface film modelling."
);
#define CREATE_MESH createMeshesPostProcess.H
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createRegionControls.H"
#include "createUfIfPresent.H"
turbulence->validate();
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readDyMControls.H"
#include "CourantNo.H"
#include "setMultiRegionDeltaT.H"
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store the particle positions
parcels.storeGlobalPositions();
// Do any mesh changes
mesh.update();
if (solvePrimaryRegion && mesh.changing())
{
MRF.update();
if (correctPhi)
{
// Calculate absolute flux
// from the mapped surface velocity
phi = mesh.Sf() & Uf();
#include "../../incompressible/pimpleFoam/correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
parcels.evolve();
surfaceFilm.evolve();
if (solvePrimaryRegion)
{
// --- PIMPLE loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
laminarTransport.correct();
turbulence->correct();
}
}
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
if (pimple.ddtCorr())
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf));
}
else
{
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU));
}
MRF.makeRelative(phiHbyA);
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAU, MRF);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p)
==
fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
p.relax();
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
// Correct rhoUf if the mesh is moving
fvc::correctUf(Uf, U, phi);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);

View File

@ -534,8 +534,12 @@ public:
inline const volScalarField::Internal&
UCoeff() const;
//- Return tmp momentum source term
inline tmp<fvVectorMatrix> SU(volVectorField& U) const;
//- Return tmp momentum source term (compressible)
inline tmp<fvVectorMatrix> SU
(
volVectorField& U,
bool incompressible = false
) const;
// Check

View File

@ -468,7 +468,8 @@ Foam::KinematicCloud<CloudType>::UCoeff() const
template<class CloudType>
inline Foam::tmp<Foam::fvVectorMatrix>
Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
Foam::KinematicCloud<CloudType>::SU(volVectorField& U, bool incompressible)
const
{
if (debug)
{
@ -478,18 +479,29 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
<< max(UCoeff()).value() << endl;
}
dimensionSet dim(dimForce);
if (incompressible)
{
dim.reset(dimForce/dimDensity);
}
if (solution_.coupled())
{
if (solution_.semiImplicit("U"))
{
const volScalarField::Internal
volScalarField::Internal
Vdt(mesh_.V()*this->db().time().deltaT());
if (incompressible)
{
Vdt.dimensions() *= dimDensity;
}
return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
}
else
{
tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dimForce));
tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dim));
fvVectorMatrix& fvm = tfvm.ref();
fvm.source() = -UTrans()/(this->db().time().deltaT());
@ -498,7 +510,7 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
}
}
return tmp<fvVectorMatrix>::New(U, dimForce);
return tmp<fvVectorMatrix>::New(U, dim);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -31,14 +32,15 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NoSurfaceFilm.H"
#include "KinematicSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelSurfaceFilmModels(CloudType) \
\
makeSurfaceFilmModel(CloudType); \
makeSurfaceFilmModelType(NoSurfaceFilm, CloudType);
makeSurfaceFilmModelType(NoSurfaceFilm, CloudType); \
makeSurfaceFilmModelType(KinematicSurfaceFilm, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,6 +33,7 @@ License
#include "NoSurfaceFilm.H"
#include "ThermoSurfaceFilm.H"
#include "KinematicSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,7 +41,8 @@ License
\
makeSurfaceFilmModel(CloudType); \
makeSurfaceFilmModelType(NoSurfaceFilm, CloudType); \
makeSurfaceFilmModelType(ThermoSurfaceFilm, CloudType);
makeSurfaceFilmModelType(ThermoSurfaceFilm, CloudType); \
makeSurfaceFilmModelType(KinematicSurfaceFilm, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,6 +33,7 @@ License
#include "NoSurfaceFilm.H"
#include "ThermoSurfaceFilm.H"
#include "KinematicSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,7 +42,8 @@ License
makeSurfaceFilmModel(CloudType); \
\
makeSurfaceFilmModelType(NoSurfaceFilm, CloudType); \
makeSurfaceFilmModelType(ThermoSurfaceFilm, CloudType);
makeSurfaceFilmModelType(ThermoSurfaceFilm, CloudType); \
makeSurfaceFilmModelType(KinematicSurfaceFilm, CloudType);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,807 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "KinematicSurfaceFilm.H"
#include "surfaceFilmRegionModel.H"
#include "liquidFilmModel.H"
#include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
#include "Pstream.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class CloudType>
Foam::wordList Foam::KinematicSurfaceFilm<CloudType>::interactionTypeNames_
{
"absorb", "bounce", "splashBai"
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class CloudType>
typename Foam::KinematicSurfaceFilm<CloudType>::interactionType
Foam::KinematicSurfaceFilm<CloudType>::interactionTypeEnum(const word& it) const
{
forAll(interactionTypeNames_, i)
{
if (interactionTypeNames_[i] == it)
{
return interactionType(i);
}
}
FatalErrorInFunction
<< "Unknown interaction type " << it
<< ". Valid interaction types include: " << interactionTypeNames_
<< abort(FatalError);
return interactionType(0);
}
template<class CloudType>
Foam::word Foam::KinematicSurfaceFilm<CloudType>::interactionTypeStr
(
const interactionType& it
) const
{
if (it >= interactionTypeNames_.size())
{
FatalErrorInFunction
<< "Unknown interaction type enumeration" << abort(FatalError);
}
return interactionTypeNames_[it];
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
Foam::vector Foam::KinematicSurfaceFilm<CloudType>::tangentVector
(
const vector& v
) const
{
vector tangent(Zero);
scalar magTangent = 0.0;
while (magTangent < SMALL)
{
const vector vTest(rndGen_.sample01<vector>());
tangent = vTest - (vTest & v)*v;
magTangent = mag(tangent);
}
return tangent/magTangent;
}
template<class CloudType>
Foam::vector Foam::KinematicSurfaceFilm<CloudType>::splashDirection
(
const vector& tanVec1,
const vector& tanVec2,
const vector& nf
) const
{
// Azimuthal angle [rad]
const scalar phiSi = twoPi*rndGen_.sample01<scalar>();
// Ejection angle [rad]
const scalar thetaSi = degToRad(rndGen_.sample01<scalar>()*(50 - 5) + 5);
// Direction vector of new parcel
const scalar alpha = sin(thetaSi);
const scalar dcorr = cos(thetaSi);
const vector normal(alpha*(tanVec1*cos(phiSi) + tanVec2*sin(phiSi)));
vector dirVec(dcorr*nf);
dirVec += normal;
return dirVec/mag(dirVec);
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
{
const fvMesh& mesh = this->owner().mesh();
// set up filmModel pointer
filmModel_ =
const_cast<regionFilm*>
(
mesh.time().objectRegistry::template findObject
<
regionFilm
>
(
"surfaceFilmProperties"
)
);
// set up areaFilms
const wordList names =
mesh.time().objectRegistry::template
sortedNames<regionModels::regionFaModel>();
forAll(names, i)
{
const regionModels::regionFaModel* regionFa =
mesh.time().objectRegistry::template findObject
<
regionModels::regionFaModel
>(names[i]);
if (regionFa && isA<areaFilm>(*regionFa))
{
areaFilm& film =
const_cast<areaFilm&>(refCast<const areaFilm>(*regionFa));
areaFilms_.append(&film);
}
}
// Initiate thermo ref for filmModel
if (filmModel_ && binitThermo)
{
this->coeffDict().readEntry("pRef", pRef_);
this->coeffDict().readEntry("TRef", TRef_);
thermo_ = new liquidMixtureProperties(this->coeffDict().subDict("thermo"));
}
}
template<class CloudType>
template<class filmType>
void Foam::KinematicSurfaceFilm<CloudType>::absorbInteraction
(
filmType& film,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mass,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " absorbInteraction" << endl;
}
// Patch face normal
const vector& nf = pp.faceNormals()[facei];
// Patch velocity
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
// Relative parcel velocity
const vector Urel(p.U() - Up);
// Parcel normal velocity
const vector Un(nf*(Urel & nf));
// Parcel tangential velocity
const vector Ut(Urel - Un);
film.addSources
(
pp.index(),
facei,
mass, // mass
mass*Ut, // tangential momentum
mass*mag(Un), // impingement pressure
0 // energy
);
this->nParcelsTransferred()++;
this->totalMassTransferred() += mass;
keepParticle = false;
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::bounceInteraction
(
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
) const
{
if (debug)
{
Info<< "Parcel " << p.origId() << " bounceInteraction" << endl;
}
// Patch face normal
const vector& nf = pp.faceNormals()[facei];
// Patch velocity
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
// Relative parcel velocity
const vector Urel(p.U() - Up);
// Flip parcel normal velocity component
p.U() -= 2.0*nf*(Urel & nf);
keepParticle = true;
}
template<class CloudType>
template<class filmType>
void Foam::KinematicSurfaceFilm<CloudType>::drySplashInteraction
(
filmType& filmModel,
const scalar sigma,
const scalar mu,
const parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl;
}
// Patch face velocity and normal
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Local pressure
//const scalar pc = thermo_.thermo().p()[p.cell()];
// Retrieve parcel properties
const scalar m = p.mass()*p.nParticle();
const scalar rho = p.rho();
const scalar d = p.d();
const vector Urel(p.U() - Up);
const vector Un(nf*(Urel & nf));
// Laplace number
const scalar La = rho*sigma*d/sqr(mu);
// Weber number
const scalar We = rho*magSqr(Un)*d/sigma;
// Critical Weber number
const scalar Wec = Adry_*pow(La, -0.183);
if (We < Wec) // Adhesion - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else // Splash
{
// Ratio of incident mass to splashing mass
const scalar mRatio = 0.2 + 0.6*rndGen_.sample01<scalar>();
splashInteraction<filmType>
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
}
}
template<class CloudType>
template<class filmType>
void Foam::KinematicSurfaceFilm<CloudType>::wetSplashInteraction
(
filmType& filmModel,
const scalar sigma,
const scalar mu,
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl;
}
// Patch face velocity and normal
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Retrieve parcel properties
const scalar m = p.mass()*p.nParticle();
const scalar rho = p.rho();
const scalar d = p.d();
vector& U = p.U();
const vector Urel(p.U() - Up);
const vector Un(nf*(Urel & nf));
const vector Ut(Urel - Un);
// Laplace number
const scalar La = rho*sigma*d/sqr(mu);
// Weber number
const scalar We = rho*magSqr(Un)*d/sigma;
// Critical Weber number
const scalar Wec = Awet_*pow(La, -0.183);
if (We < 2) // Adhesion - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else if ((We >= 2) && (We < 20)) // Bounce
{
// Incident angle of impingement
const scalar theta = piByTwo - acos(U/mag(U) & nf);
// Restitution coefficient
const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
// Update parcel velocity
U = -epsilon*(Un) + 5.0/7.0*(Ut);
keepParticle = true;
return;
}
else if ((We >= 20) && (We < Wec)) // Spread - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else // Splash
{
// Ratio of incident mass to splashing mass
// splash mass can be > incident mass due to film entrainment
const scalar mRatio = 0.2 + 0.9*rndGen_.sample01<scalar>();
splashInteraction<filmType>
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
}
}
template<class CloudType>
template<class filmType>
void Foam::KinematicSurfaceFilm<CloudType>::splashInteraction
(
filmType& filmModel,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mRatio,
const scalar We,
const scalar Wec,
const scalar sigma,
bool& keepParticle
)
{
// Patch face velocity and normal
const fvMesh& mesh = this->owner().mesh();
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Determine direction vectors tangential to patch normal
const vector tanVec1(tangentVector(nf));
const vector tanVec2(nf^tanVec1);
// Retrieve parcel properties
const scalar np = p.nParticle();
const scalar m = p.mass()*np;
const scalar d = p.d();
const vector Urel(p.U() - Up);
const vector Un(nf*(Urel & nf));
const vector Ut(Urel - Un);
const vector& posC = mesh.C()[p.cell()];
const vector& posCf = mesh.Cf().boundaryField()[pp.index()][facei];
// Total mass of (all) splashed parcels
const scalar mSplash = m*mRatio;
// Number of splashed particles per incoming particle
const scalar Ns = 5.0*(We/Wec - 1.0);
// Average diameter of splashed particles
const scalar dBarSplash = 1/cbrt(6.0)*cbrt(mRatio/Ns)*d + ROOTVSMALL;
// Cumulative diameter splash distribution
const scalar dMax = 0.9*cbrt(mRatio)*d;
const scalar dMin = 0.1*dMax;
const scalar K = exp(-dMin/dBarSplash) - exp(-dMax/dBarSplash);
// Surface energy of secondary parcels [J]
scalar ESigmaSec = 0;
// Sample splash distribution to determine secondary parcel diameters
scalarList dNew(parcelsPerSplash_);
scalarList npNew(parcelsPerSplash_);
forAll(dNew, i)
{
const scalar y = rndGen_.sample01<scalar>();
dNew[i] = -dBarSplash*log(exp(-dMin/dBarSplash) - y*K);
npNew[i] = mRatio*np*pow3(d)/pow3(dNew[i])/parcelsPerSplash_;
ESigmaSec += npNew[i]*sigma*p.areaS(dNew[i]);
}
// Incident kinetic energy [J]
const scalar EKIn = 0.5*m*magSqr(Un);
// Incident surface energy [J]
const scalar ESigmaIn = np*sigma*p.areaS(d);
// Dissipative energy
const scalar Ed = max(0.8*EKIn, np*Wec/12*pi*sigma*sqr(d));
// Total energy [J]
const scalar EKs = EKIn + ESigmaIn - ESigmaSec - Ed;
// Switch to absorb if insufficient energy for splash
if (EKs <= 0)
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
return;
}
// Helper variables to calculate magUns0
const scalar logD = log(d);
const scalar coeff2 = log(dNew[0]) - logD + ROOTVSMALL;
scalar coeff1 = 0.0;
forAll(dNew, i)
{
coeff1 += sqr(log(dNew[i]) - logD);
}
// Magnitude of the normal velocity of the first splashed parcel
const scalar magUns0 =
sqrt(2.0*parcelsPerSplash_*EKs/mSplash/(1.0 + coeff1/sqr(coeff2)));
// Set splashed parcel properties
forAll(dNew, i)
{
const vector dirVec = splashDirection(tanVec1, tanVec2, -nf);
// Create a new parcel by copying source parcel
parcelType* pPtr = new parcelType(p);
pPtr->origId() = pPtr->getNewParticleID();
pPtr->origProc() = Pstream::myProcNo();
if (splashParcelType_ >= 0)
{
pPtr->typeId() = splashParcelType_;
}
// Perturb new parcels towards the owner cell centre
pPtr->track(0.5*rndGen_.sample01<scalar>()*(posC - posCf), 0);
pPtr->nParticle() = npNew[i];
pPtr->d() = dNew[i];
pPtr->U() = dirVec*(mag(Cf_*Ut) + magUns0*(log(dNew[i]) - logD)/coeff2);
// Apply correction to velocity for 2-D cases
meshTools::constrainDirection(mesh, mesh.solutionD(), pPtr->U());
// Add the new parcel
this->owner().addParticle(pPtr);
nParcelsSplashed_++;
}
// Transfer remaining part of parcel to film 0 - splashMass can be -ve
// if entraining from the film
const scalar mDash = m - mSplash;
absorbInteraction<filmType>
(filmModel, p, pp, facei, mDash, keepParticle);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
(
const dictionary& dict,
CloudType& owner,
const word& type,
bool initThermo
)
:
SurfaceFilmModel<CloudType>(dict, owner, type),
rndGen_(owner.rndGen()),
thermo_(nullptr),
filmModel_(nullptr),
areaFilms_(0),
interactionType_
(
interactionTypeEnum(this->coeffDict().getWord("interactionType"))
),
deltaWet_(0.0),
splashParcelType_(0),
parcelsPerSplash_(0),
Adry_(0.0),
Awet_(0.0),
Cf_(0.0),
nParcelsSplashed_(0)
{
Info<< " Applying " << interactionTypeStr(interactionType_)
<< " interaction model" << endl;
if (interactionType_ == itSplashBai)
{
this->coeffDict().readEntry("deltaWet", deltaWet_);
splashParcelType_ =
this->coeffDict().getOrDefault("splashParcelType", -1);
parcelsPerSplash_ =
this->coeffDict().getOrDefault("parcelsPerSplash", 2);
this->coeffDict().readEntry("Adry", Adry_);
this->coeffDict().readEntry("Awet", Awet_);
this->coeffDict().readEntry("Cf", Cf_);
}
init(initThermo);
}
template<class CloudType>
Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
(
const KinematicSurfaceFilm<CloudType>& sfm,
bool initThermo
)
:
SurfaceFilmModel<CloudType>(sfm),
rndGen_(sfm.rndGen_),
thermo_(nullptr),
filmModel_(nullptr),
areaFilms_(0),
interactionType_(sfm.interactionType_),
deltaWet_(sfm.deltaWet_),
splashParcelType_(sfm.splashParcelType_),
parcelsPerSplash_(sfm.parcelsPerSplash_),
Adry_(sfm.Adry_),
Awet_(sfm.Awet_),
Cf_(sfm.Cf_),
nParcelsSplashed_(sfm.nParcelsSplashed_)
{
init(initThermo);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::KinematicSurfaceFilm<CloudType>::transferParcel
(
parcelType& p,
const polyPatch& pp,
bool& keepParticle
)
{
const label patchi = pp.index();
bool bInteraction(false);
// Check the singleLayer film models
if (filmModel_ && filmModel_->isRegionPatch(patchi))
{
const label facei = pp.whichFace(p.face());
switch (interactionType_)
{
case itBounce:
{
bounceInteraction(p, pp, facei, keepParticle);
break;
}
case itAbsorb:
{
const scalar m = p.nParticle()*p.mass();
absorbInteraction<regionFilm>
(*filmModel_, p, pp, facei, m, keepParticle);
break;
}
case itSplashBai:
{
bool dry = this->deltaFilmPatch_[patchi][facei] < deltaWet_;
const scalarField X(thermo_->size(), 1);
const scalar mu = thermo_->mu(pRef_, TRef_, X);
const scalar sigma = thermo_->sigma(pRef_, TRef_, X);
if (dry)
{
drySplashInteraction<regionFilm>
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
}
else
{
wetSplashInteraction<regionFilm>
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
}
break;
}
default:
{
FatalErrorInFunction
<< "Unknown interaction type enumeration"
<< abort(FatalError);
}
}
// Transfer parcel/parcel interactions complete
bInteraction = true;
}
for (areaFilm& film : areaFilms_)
{
if (patchi == film.patchID())
{
const label facei = pp.whichFace(p.face());
switch (interactionType_)
{
// It only supports absorp model
case itAbsorb:
{
const scalar m = p.nParticle()*p.mass();
absorbInteraction<areaFilm>
(
film, p, pp, facei, m, keepParticle
);
break;
}
case itBounce:
{
bounceInteraction(p, pp, facei, keepParticle);
break;
}
case itSplashBai:
{
bool dry = film.h()[facei] < deltaWet_;
regionModels::areaSurfaceFilmModels::liquidFilmModel& liqFilm =
refCast
< regionModels::areaSurfaceFilmModels::liquidFilmModel
>(film);
const scalarField X(liqFilm.thermo().size(), 1);
const scalar pRef = film.pRef();
const scalar TRef = liqFilm.Tref();
const scalar mu = liqFilm.thermo().mu(pRef, TRef, X);
const scalar sigma =
liqFilm.thermo().sigma(pRef, TRef, X);
if (dry)
{
drySplashInteraction<areaFilm>
(film, sigma, mu, p, pp, facei, keepParticle);
}
else
{
wetSplashInteraction<areaFilm>
(film, sigma, mu, p, pp, facei, keepParticle);
}
break;
}
default:
{
FatalErrorInFunction
<< "Unknown interaction type enumeration"
<< abort(FatalError);
}
}
// Transfer parcel/parcel interactions complete
bInteraction = true;
}
}
// Parcel not interacting with film
return bInteraction;
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::cacheFilmFields
(
const label filmPatchi,
const label primaryPatchi,
const regionModels::surfaceFilmModels::surfaceFilmRegionModel& filmModel
)
{
SurfaceFilmModel<CloudType>::cacheFilmFields
(
filmPatchi,
primaryPatchi,
filmModel
);
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::cacheFilmFields
(
const label filmPatchi,
const areaFilm& filmModel
)
{
SurfaceFilmModel<CloudType>::cacheFilmFields
(
filmPatchi,
filmModel
);
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::setParcelProperties
(
parcelType& p,
const label filmFacei
) const
{
SurfaceFilmModel<CloudType>::setParcelProperties(p, filmFacei);
}
template<class CloudType>
void Foam::KinematicSurfaceFilm<CloudType>::info(Ostream& os)
{
SurfaceFilmModel<CloudType>::info(os);
label nSplash0 = this->template getModelProperty<label>("nParcelsSplashed");
label nSplashTotal =
nSplash0 + returnReduce(nParcelsSplashed_, sumOp<label>());
os << " - new splash parcels = " << nSplashTotal << endl;
if (this->writeTime())
{
this->setModelProperty("nParcelsSplashed", nSplashTotal);
nParcelsSplashed_ = 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,362 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::KinematicSurfaceFilm
Group
grpLagrangianIntermediateSurfaceFilmSubModels
Description
Kinematic parcel surface film model.
Responsible for:
- injecting parcelss from the film model into the cloud, e.g. for dripping
- parcel interaction with the film, e.g absorb, bounce, splash
SourceFiles
KinematicSurfaceFilm.C
KinematicSurfaceFilmI.H
\*---------------------------------------------------------------------------*/
#ifndef KinematicSurfaceFilm_H
#define KinematicSurfaceFilm_H
#include "SurfaceFilmModel.H"
#include "UPtrList.H"
#include "liquidMixtureProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
//Forward declaration of classes
namespace regionModels
{
namespace surfaceFilmModels
{
class surfaceFilmRegionModel;
}
}
namespace regionModels
{
namespace areaSurfaceFilmModels
{
class liquidFilmBase;
}
}
/*---------------------------------------------------------------------------*\
Class KinematicSurfaceFilm Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class KinematicSurfaceFilm
:
public SurfaceFilmModel<CloudType>
{
public:
// Public Data
//- Options for the interaction types
enum interactionType
{
itAbsorb,
itBounce,
itSplashBai
};
//- Names for interactionType
static wordList interactionTypeNames_;
// Public Member Functions
//- Return interaction type enum from word
interactionType interactionTypeEnum(const word& it) const;
//- Return word from interaction type enum
word interactionTypeStr(const interactionType& it) const;
protected:
// Protected Data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
typedef typename
regionModels::areaSurfaceFilmModels::liquidFilmBase areaFilm;
typedef typename
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm;
//- Reference to the cloud random number generator
Random& rndGen_;
// Region Film thermo
//- Region Film liquid thermo
liquidMixtureProperties* thermo_;
//- Region Film reference pressure
scalar pRef_;
//- Region Film reference temperature
scalar TRef_;
//- Pointer to filmModel
regionFilm* filmModel_;
// Area Films
//- UPointers to area films
UPtrList<areaFilm> areaFilms_;
// Interaction model data
//- Interaction type enumeration
interactionType interactionType_;
//- Film thickness beyond which patch is assumed to be wet
scalar deltaWet_;
//- Splash parcel type label - id assigned to identify parcel for
// post-processing. If not specified, defaults to originating cloud
// type
label splashParcelType_;
//- Number of new parcels resulting from splash event
label parcelsPerSplash_;
// Surface roughness coefficient typically in the range 1300 - 5200
// and decreases with increasing surface roughness
//- Dry surface roughness coefficient
// = 2630 for dry interaction (ref. Bai)
scalar Adry_;
//- Wet surface roughness coefficient
// = 1320 for wet interaction (ref. Bai)
scalar Awet_;
//- Skin friction typically in the range 0.6 < Cf < 0.8
scalar Cf_;
//- Counter for number of new splash parcels
label nParcelsSplashed_;
// Protected Member Functions
//- Return a vector tangential to input vector, v
vector tangentVector(const vector& v) const;
//- Return splashed parcel direction
vector splashDirection
(
const vector& tanVec1,
const vector& tanVec2,
const vector& nf
) const;
//- Initialise pointers of films
void init(bool binitThermo);
// Injection from sheet (ejection) helper functions
//- Cache the film fields in preparation for injection
virtual void cacheFilmFields
(
const label primaryPatchi,
const areaFilm&
);
//- Cache the film fields in preparation for injection
virtual void cacheFilmFields
(
const label filmPatchi,
const label primaryPatchi,
const regionModels::surfaceFilmModels::surfaceFilmRegionModel&
);
//- Set the individual parcel properties
virtual void setParcelProperties
(
parcelType& p,
const label filmFacei
) const;
public:
//- Runtime type information
TypeName("kinematicSurfaceFilm");
// Constructors
//- Construct from components
KinematicSurfaceFilm
(
const dictionary& dict,
CloudType& owner,
const word& type = typeName,
bool initThermo = true
);
//- Construct copy
KinematicSurfaceFilm
(
const KinematicSurfaceFilm<CloudType>& sfm,
bool initThermo = true
);
//- Construct and return a clone using supplied owner cloud
virtual autoPtr<SurfaceFilmModel<CloudType>> clone() const
{
return autoPtr<SurfaceFilmModel<CloudType>>
(
new KinematicSurfaceFilm<CloudType>(*this)
);
}
//- Destructor
virtual ~KinematicSurfaceFilm() = default;
// Member Functions
// Interaction models
//- Absorb parcel into film
template<class filmType>
void absorbInteraction
(
filmType&,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mass,
bool& keepParticle
);
//- Bounce parcel (flip parcel normal velocity)
void bounceInteraction
(
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
) const;
//- Parcel interaction with dry surface
template<class filmType>
void drySplashInteraction
(
filmType&,
const scalar sigma,
const scalar mu,
const parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
);
//- Parcel interaction with wetted surface
template<class filmType>
void wetSplashInteraction
(
filmType&,
const scalar sigma,
const scalar mu,
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
);
//- Bai parcel splash interaction model
template<class filmType>
void splashInteraction
(
filmType&,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mRatio,
const scalar We,
const scalar Wec,
const scalar sigma,
bool& keepParticle
);
// Evaluation
//- Transfer parcel from cloud to surface film
// Returns true if parcel is to be transferred
virtual bool transferParcel
(
parcelType& p,
const polyPatch& pp,
bool& keepParticle
);
// I-O
//- Write surface film info to stream
virtual void info(Ostream& os);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "KinematicSurfaceFilm.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,505 +27,6 @@ License
\*---------------------------------------------------------------------------*/
#include "ThermoSurfaceFilm.H"
#include "surfaceFilmRegionModel.H"
#include "liquidFilmBase.H"
#include "addToRunTimeSelectionTable.H"
#include "unitConversion.H"
#include "Pstream.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class CloudType>
Foam::wordList Foam::ThermoSurfaceFilm<CloudType>::interactionTypeNames_
{
"absorb", "bounce", "splashBai"
};
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class CloudType>
typename Foam::ThermoSurfaceFilm<CloudType>::interactionType
Foam::ThermoSurfaceFilm<CloudType>::interactionTypeEnum(const word& it) const
{
forAll(interactionTypeNames_, i)
{
if (interactionTypeNames_[i] == it)
{
return interactionType(i);
}
}
FatalErrorInFunction
<< "Unknown interaction type " << it
<< ". Valid interaction types include: " << interactionTypeNames_
<< abort(FatalError);
return interactionType(0);
}
template<class CloudType>
Foam::word Foam::ThermoSurfaceFilm<CloudType>::interactionTypeStr
(
const interactionType& it
) const
{
if (it >= interactionTypeNames_.size())
{
FatalErrorInFunction
<< "Unknown interaction type enumeration" << abort(FatalError);
}
return interactionTypeNames_[it];
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
Foam::vector Foam::ThermoSurfaceFilm<CloudType>::tangentVector
(
const vector& v
) const
{
vector tangent = Zero;
scalar magTangent = 0.0;
while (magTangent < SMALL)
{
vector vTest = rndGen_.sample01<vector>();
tangent = vTest - (vTest & v)*v;
magTangent = mag(tangent);
}
return tangent/magTangent;
}
template<class CloudType>
Foam::vector Foam::ThermoSurfaceFilm<CloudType>::splashDirection
(
const vector& tanVec1,
const vector& tanVec2,
const vector& nf
) const
{
// Azimuthal angle [rad]
const scalar phiSi = twoPi*rndGen_.sample01<scalar>();
// Ejection angle [rad]
const scalar thetaSi = degToRad(rndGen_.sample01<scalar>()*(50 - 5) + 5);
// Direction vector of new parcel
const scalar alpha = sin(thetaSi);
const scalar dcorr = cos(thetaSi);
const vector normal = alpha*(tanVec1*cos(phiSi) + tanVec2*sin(phiSi));
vector dirVec = dcorr*nf;
dirVec += normal;
return dirVec/mag(dirVec);
}
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::init()
{
const fvMesh& mesh = this->owner().mesh();
// set up filmModel pointer
filmModel_ =
const_cast<regionFilm*>
(
mesh.time().objectRegistry::template findObject
<
regionFilm
>
(
"surfaceFilmProperties"
)
);
// set up areaFilms
const wordList names =
mesh.time().objectRegistry::template
sortedNames<regionModels::regionFaModel>();
forAll(names, i)
{
const regionModels::regionFaModel* regionFa =
mesh.time().objectRegistry::template findObject
<
regionModels::regionFaModel
>(names[i]);
if (regionFa && isA<areaFilm>(*regionFa))
{
areaFilm& film =
const_cast<areaFilm&>(refCast<const areaFilm>(*regionFa));
areaFilms_.append(&film);
}
}
}
template<class CloudType>
template<class filmType>
void Foam::ThermoSurfaceFilm<CloudType>::absorbInteraction
(
filmType& film,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mass,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " absorbInteraction" << endl;
}
// Patch face normal
const vector& nf = pp.faceNormals()[facei];
// Patch velocity
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
// Relative parcel velocity
const vector Urel = p.U() - Up;
// Parcel normal velocity
const vector Un = nf*(Urel & nf);
// Parcel tangential velocity
const vector Ut = Urel - Un;
film.addSources
(
pp.index(),
facei,
mass, // mass
mass*Ut, // tangential momentum
mass*mag(Un), // impingement pressure
mass*p.hs() // energy
);
this->nParcelsTransferred()++;
this->totalMassTransferred() += mass;
keepParticle = false;
}
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::bounceInteraction
(
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
) const
{
if (debug)
{
Info<< "Parcel " << p.origId() << " bounceInteraction" << endl;
}
// Patch face normal
const vector& nf = pp.faceNormals()[facei];
// Patch velocity
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
// Relative parcel velocity
const vector Urel = p.U() - Up;
// Flip parcel normal velocity component
p.U() -= 2.0*nf*(Urel & nf);
keepParticle = true;
}
template<class CloudType>
template<class filmType>
void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction
(
filmType& filmModel,
const parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl;
}
const liquidProperties& liq = thermo_.liquids().properties()[0];
// Patch face velocity and normal
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Local pressure
const scalar pc = thermo_.thermo().p()[p.cell()];
// Retrieve parcel properties
const scalar m = p.mass()*p.nParticle();
const scalar rho = p.rho();
const scalar d = p.d();
const scalar sigma = liq.sigma(pc, p.T());
const scalar mu = liq.mu(pc, p.T());
const vector Urel = p.U() - Up;
const vector Un = nf*(Urel & nf);
// Laplace number
const scalar La = rho*sigma*d/sqr(mu);
// Weber number
const scalar We = rho*magSqr(Un)*d/sigma;
// Critical Weber number
const scalar Wec = Adry_*pow(La, -0.183);
if (We < Wec) // Adhesion - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else // Splash
{
// Ratio of incident mass to splashing mass
const scalar mRatio = 0.2 + 0.6*rndGen_.sample01<scalar>();
splashInteraction<filmType>
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
}
}
template<class CloudType>
template<class filmType>
void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
(
filmType& filmModel,
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
)
{
if (debug)
{
Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl;
}
const liquidProperties& liq = thermo_.liquids().properties()[0];
// Patch face velocity and normal
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Local pressure
const scalar pc = thermo_.thermo().p()[p.cell()];
// Retrieve parcel properties
const scalar m = p.mass()*p.nParticle();
const scalar rho = p.rho();
const scalar d = p.d();
vector& U = p.U();
const scalar sigma = liq.sigma(pc, p.T());
const scalar mu = liq.mu(pc, p.T());
const vector Urel = p.U() - Up;
const vector Un = nf*(Urel & nf);
const vector Ut = Urel - Un;
// Laplace number
const scalar La = rho*sigma*d/sqr(mu);
// Weber number
const scalar We = rho*magSqr(Un)*d/sigma;
// Critical Weber number
const scalar Wec = Awet_*pow(La, -0.183);
if (We < 2) // Adhesion - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else if ((We >= 2) && (We < 20)) // Bounce
{
// Incident angle of impingement
const scalar theta = piByTwo - acos(U/mag(U) & nf);
// Restitution coefficient
const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
// Update parcel velocity
U = -epsilon*(Un) + 5.0/7.0*(Ut);
keepParticle = true;
return;
}
else if ((We >= 20) && (We < Wec)) // Spread - assume absorb
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
}
else // Splash
{
// Ratio of incident mass to splashing mass
// splash mass can be > incident mass due to film entrainment
const scalar mRatio = 0.2 + 0.9*rndGen_.sample01<scalar>();
splashInteraction<filmType>
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
}
}
template<class CloudType>
template<class filmType>
void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction
(
filmType& filmModel,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mRatio,
const scalar We,
const scalar Wec,
const scalar sigma,
bool& keepParticle
)
{
// Patch face velocity and normal
const fvMesh& mesh = this->owner().mesh();
const vector& Up = this->owner().U().boundaryField()[pp.index()][facei];
const vector& nf = pp.faceNormals()[facei];
// Determine direction vectors tangential to patch normal
const vector tanVec1 = tangentVector(nf);
const vector tanVec2 = nf^tanVec1;
// Retrieve parcel properties
const scalar np = p.nParticle();
const scalar m = p.mass()*np;
const scalar d = p.d();
const vector Urel = p.U() - Up;
const vector Un = nf*(Urel & nf);
const vector Ut = Urel - Un;
const vector& posC = mesh.C()[p.cell()];
const vector& posCf = mesh.Cf().boundaryField()[pp.index()][facei];
// Total mass of (all) splashed parcels
const scalar mSplash = m*mRatio;
// Number of splashed particles per incoming particle
const scalar Ns = 5.0*(We/Wec - 1.0);
// Average diameter of splashed particles
const scalar dBarSplash = 1/cbrt(6.0)*cbrt(mRatio/Ns)*d + ROOTVSMALL;
// Cumulative diameter splash distribution
const scalar dMax = 0.9*cbrt(mRatio)*d;
const scalar dMin = 0.1*dMax;
const scalar K = exp(-dMin/dBarSplash) - exp(-dMax/dBarSplash);
// Surface energy of secondary parcels [J]
scalar ESigmaSec = 0;
// Sample splash distribution to determine secondary parcel diameters
scalarList dNew(parcelsPerSplash_);
scalarList npNew(parcelsPerSplash_);
forAll(dNew, i)
{
const scalar y = rndGen_.sample01<scalar>();
dNew[i] = -dBarSplash*log(exp(-dMin/dBarSplash) - y*K);
npNew[i] = mRatio*np*pow3(d)/pow3(dNew[i])/parcelsPerSplash_;
ESigmaSec += npNew[i]*sigma*p.areaS(dNew[i]);
}
// Incident kinetic energy [J]
const scalar EKIn = 0.5*m*magSqr(Un);
// Incident surface energy [J]
const scalar ESigmaIn = np*sigma*p.areaS(d);
// Dissipative energy
const scalar Ed = max(0.8*EKIn, np*Wec/12*pi*sigma*sqr(d));
// Total energy [J]
const scalar EKs = EKIn + ESigmaIn - ESigmaSec - Ed;
// Switch to absorb if insufficient energy for splash
if (EKs <= 0)
{
absorbInteraction<filmType>
(filmModel, p, pp, facei, m, keepParticle);
return;
}
// Helper variables to calculate magUns0
const scalar logD = log(d);
const scalar coeff2 = log(dNew[0]) - logD + ROOTVSMALL;
scalar coeff1 = 0.0;
forAll(dNew, i)
{
coeff1 += sqr(log(dNew[i]) - logD);
}
// Magnitude of the normal velocity of the first splashed parcel
const scalar magUns0 =
sqrt(2.0*parcelsPerSplash_*EKs/mSplash/(1.0 + coeff1/sqr(coeff2)));
// Set splashed parcel properties
forAll(dNew, i)
{
const vector dirVec = splashDirection(tanVec1, tanVec2, -nf);
// Create a new parcel by copying source parcel
parcelType* pPtr = new parcelType(p);
pPtr->origId() = pPtr->getNewParticleID();
pPtr->origProc() = Pstream::myProcNo();
if (splashParcelType_ >= 0)
{
pPtr->typeId() = splashParcelType_;
}
// Perturb new parcels towards the owner cell centre
pPtr->track(0.5*rndGen_.sample01<scalar>()*(posC - posCf), 0);
pPtr->nParticle() = npNew[i];
pPtr->d() = dNew[i];
pPtr->U() = dirVec*(mag(Cf_*Ut) + magUns0*(log(dNew[i]) - logD)/coeff2);
// Apply correction to velocity for 2-D cases
meshTools::constrainDirection(mesh, mesh.solutionD(), pPtr->U());
// Add the new parcel
this->owner().addParticle(pPtr);
nParcelsSplashed_++;
}
// Transfer remaining part of parcel to film 0 - splashMass can be -ve
// if entraining from the film
const scalar mDash = m - mSplash;
absorbInteraction<filmType>
(filmModel, p, pp, facei, mDash, keepParticle);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -536,45 +37,14 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
CloudType& owner
)
:
SurfaceFilmModel<CloudType>(dict, owner, typeName),
rndGen_(owner.rndGen()),
KinematicSurfaceFilm<CloudType>(dict, owner, typeName, false),
thermo_
(
owner.db().objectRegistry::template lookupObject<SLGThermo>("SLGThermo")
),
filmModel_(nullptr),
areaFilms_(0),
TFilmPatch_(0),
CpFilmPatch_(0),
interactionType_
(
interactionTypeEnum(this->coeffDict().getWord("interactionType"))
),
deltaWet_(0.0),
splashParcelType_(0),
parcelsPerSplash_(0),
Adry_(0.0),
Awet_(0.0),
Cf_(0.0),
nParcelsSplashed_(0)
{
Info<< " Applying " << interactionTypeStr(interactionType_)
<< " interaction model" << endl;
if (interactionType_ == itSplashBai)
{
this->coeffDict().readEntry("deltaWet", deltaWet_);
splashParcelType_ =
this->coeffDict().getOrDefault("splashParcelType", -1);
parcelsPerSplash_ =
this->coeffDict().getOrDefault("parcelsPerSplash", 2);
this->coeffDict().readEntry("Adry", Adry_);
this->coeffDict().readEntry("Awet", Awet_);
this->coeffDict().readEntry("Cf", Cf_);
}
init();
}
CpFilmPatch_(0)
{}
template<class CloudType>
@ -583,30 +53,10 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
const ThermoSurfaceFilm<CloudType>& sfm
)
:
SurfaceFilmModel<CloudType>(sfm),
rndGen_(sfm.rndGen_),
KinematicSurfaceFilm<CloudType>(sfm, false),
thermo_(sfm.thermo_),
filmModel_(nullptr),
areaFilms_(0),
TFilmPatch_(sfm.TFilmPatch_),
CpFilmPatch_(sfm.CpFilmPatch_),
interactionType_(sfm.interactionType_),
deltaWet_(sfm.deltaWet_),
splashParcelType_(sfm.splashParcelType_),
parcelsPerSplash_(sfm.parcelsPerSplash_),
Adry_(sfm.Adry_),
Awet_(sfm.Awet_),
Cf_(sfm.Cf_),
nParcelsSplashed_(sfm.nParcelsSplashed_)
{
init();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ThermoSurfaceFilm<CloudType>::~ThermoSurfaceFilm()
CpFilmPatch_(sfm.CpFilmPatch_)
{}
@ -625,40 +75,46 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
bool bInteraction(false);
// Check the singleLayer film models
if (filmModel_ && filmModel_->isRegionPatch(patchi))
if (this->filmModel_ && this->filmModel_->isRegionPatch(patchi))
{
const label facei = pp.whichFace(p.face());
switch (interactionType_)
switch (this->interactionType_)
{
case itBounce:
case KinematicSurfaceFilm<CloudType>::itBounce:
{
bounceInteraction(p, pp, facei, keepParticle);
this->bounceInteraction(p, pp, facei, keepParticle);
break;
}
case itAbsorb:
case KinematicSurfaceFilm<CloudType>::itAbsorb:
{
const scalar m = p.nParticle()*p.mass();
absorbInteraction<regionFilm>
(*filmModel_, p, pp, facei, m, keepParticle);
this->absorbInteraction //<regionFilm>
(*(this->filmModel_), p, pp, facei, m, keepParticle);
break;
}
case itSplashBai:
case KinematicSurfaceFilm<CloudType>::itSplashBai:
{
bool dry = this->deltaFilmPatch_[patchi][facei] < deltaWet_;
// Local pressure
const scalar pc = thermo_.thermo().p()[p.cell()];
const liquidProperties& liq = thermo_.liquids().properties()[0];
const scalar sigma = liq.sigma(pc, p.T());
const scalar mu = liq.mu(pc, p.T());
bool dry = this->deltaFilmPatch_[patchi][facei] < this->deltaWet_;
if (dry)
{
drySplashInteraction<regionFilm>
(*filmModel_, p, pp, facei, keepParticle);
this->drySplashInteraction //<CloudType, regionFilm>
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
}
else
{
wetSplashInteraction<regionFilm>
(*filmModel_, p, pp, facei, keepParticle);
this->wetSplashInteraction //<regionFilm>
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
}
break;
@ -675,45 +131,51 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
bInteraction = true;
}
for (areaFilm& film : areaFilms_)
for (areaFilm& film : this->areaFilms_)
{
if (patchi == film.patchID())
{
const label facei = pp.whichFace(p.face());
switch (interactionType_)
switch (this->interactionType_)
{
// It only supports absorp model
case itAbsorb:
case KinematicSurfaceFilm<CloudType>::itAbsorb:
{
const scalar m = p.nParticle()*p.mass();
absorbInteraction<areaFilm>
this->absorbInteraction //<areaFilm>
(
film, p, pp, facei, m, keepParticle
);
break;
}
case itBounce:
case KinematicSurfaceFilm<CloudType>::itBounce:
{
bounceInteraction(p, pp, facei, keepParticle);
this->bounceInteraction(p, pp, facei, keepParticle);
break;
}
case itSplashBai:
case KinematicSurfaceFilm<CloudType>::itSplashBai:
{
bool dry = film.h()[facei] < deltaWet_;
// Local pressure
const scalar pc = thermo_.thermo().p()[p.cell()];
const liquidProperties& liq = thermo_.liquids().properties()[0];
const scalar sigma = liq.sigma(pc, p.T());
const scalar mu = liq.mu(pc, p.T());
bool dry = film.h()[facei] < this->deltaWet_;
if (dry)
{
drySplashInteraction<areaFilm>
(film, p, pp, facei, keepParticle);
this->drySplashInteraction //<areaFilm>
(film, sigma, mu, p, pp, facei, keepParticle);
}
else
{
wetSplashInteraction<areaFilm>
(film, p, pp, facei, keepParticle);
this->wetSplashInteraction //<areaFilm>
(film, sigma, mu, p, pp, facei, keepParticle);
}
break;
@ -743,7 +205,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
const regionModels::surfaceFilmModels::surfaceFilmRegionModel& filmModel
)
{
SurfaceFilmModel<CloudType>::cacheFilmFields
KinematicSurfaceFilm<CloudType>::cacheFilmFields
(
filmPatchi,
primaryPatchi,
@ -765,7 +227,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
const areaFilm& filmModel
)
{
SurfaceFilmModel<CloudType>::cacheFilmFields
KinematicSurfaceFilm<CloudType>::cacheFilmFields
(
filmPatchi,
filmModel
@ -786,7 +248,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::setParcelProperties
const label filmFacei
) const
{
SurfaceFilmModel<CloudType>::setParcelProperties(p, filmFacei);
KinematicSurfaceFilm<CloudType>::setParcelProperties(p, filmFacei);
// Set parcel properties
p.T() = TFilmPatch_[filmFacei];
@ -797,19 +259,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::setParcelProperties
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::info(Ostream& os)
{
SurfaceFilmModel<CloudType>::info(os);
label nSplash0 = this->template getModelProperty<label>("nParcelsSplashed");
label nSplashTotal =
nSplash0 + returnReduce(nParcelsSplashed_, sumOp<label>());
os << " - new splash parcels = " << nSplashTotal << endl;
if (this->writeTime())
{
this->setModelProperty("nParcelsSplashed", nSplashTotal);
nParcelsSplashed_ = 0;
}
KinematicSurfaceFilm<CloudType>::info(os);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,19 +33,6 @@ Group
Description
Thermo parcel surface film model.
Responsible for:
- injecting parcelss from the film model into the cloud, e.g. for dripping
- parcel interaction with the film, e.g absorb, bounce, splash
Splash model references:
Bai and Gosman, `Mathematical modelling of wall films formed by
impinging sprays', SAE 960626, 1996
Bai et al, `Modelling of gasoline spray impingement', Atom. Sprays,
vol 12, pp 1-27, 2002
SourceFiles
ThermoSurfaceFilm.C
ThermoSurfaceFilmI.H
@ -54,7 +42,7 @@ SourceFiles
#ifndef ThermoSurfaceFilm_H
#define ThermoSurfaceFilm_H
#include "SurfaceFilmModel.H"
#include "KinematicSurfaceFilm.H"
#include "UPtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,22 +50,6 @@ SourceFiles
namespace Foam
{
//Forward declaration of classes
namespace regionModels
{
namespace surfaceFilmModels
{
class surfaceFilmRegionModel;
}
}
namespace regionModels
{
namespace areaSurfaceFilmModels
{
class liquidFilmBase;
}
}
/*---------------------------------------------------------------------------*\
Class ThermoSurfaceFilm Declaration
\*---------------------------------------------------------------------------*/
@ -85,36 +57,11 @@ namespace regionModels
template<class CloudType>
class ThermoSurfaceFilm
:
public SurfaceFilmModel<CloudType>
public KinematicSurfaceFilm<CloudType>
{
public:
// Public data
// Interaction type enumerations
enum interactionType
{
itAbsorb,
itBounce,
itSplashBai
};
//- Word descriptions of interaction type names
static wordList interactionTypeNames_;
// Public Member Functions
// Return interaction type enum from word
interactionType interactionTypeEnum(const word& it) const;
// Return word from interaction type enum
word interactionTypeStr(const interactionType& it) const;
protected:
// Protected data
// Protected Data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
@ -125,17 +72,9 @@ protected:
typedef typename
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm;
//- Reference to the cloud random number generator
Random& rndGen_;
//- Reference to the cloud thermo package
const SLGThermo& thermo_;
//- Pointer to filmModel
regionFilm* filmModel_;
//- UPointers to area films
UPtrList<areaFilm> areaFilms_;
// Cached injector fields per film patch
@ -146,118 +85,9 @@ protected:
scalarField CpFilmPatch_;
// Interaction model data
//- Interaction type enumeration
interactionType interactionType_;
//- Film thickness beyond which patch is assumed to be wet
scalar deltaWet_;
//- Splash parcel type label - id assigned to identify parcel for
// post-processing. If not specified, defaults to originating cloud
// type
label splashParcelType_;
//- Number of new parcels resulting from splash event
label parcelsPerSplash_;
// Surface roughness coefficient typically in the range 1300 - 5200
// and decreases with increasing surface roughness
//- Dry surface roughness coefficient
// = 2630 for dry interaction (ref. Bai)
scalar Adry_;
//- Wet surface roughness coefficient
// = 1320 for wet interaction (ref. Bai)
scalar Awet_;
//- Skin friction typically in the range 0.6 < Cf < 0.8
scalar Cf_;
//- Counter for number of new splash parcels
label nParcelsSplashed_;
// Protected Member Functions
//- Return a vector tangential to input vector, v
vector tangentVector(const vector& v) const;
//- Return splashed parcel direction
vector splashDirection
(
const vector& tanVec1,
const vector& tanVec2,
const vector& nf
) const;
//- Init films pointers
void init();
// Interaction models
//- Absorb parcel into film
template<class filmType>
void absorbInteraction
(
filmType&,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mass,
bool& keepParticle
);
//- Bounce parcel (flip parcel normal velocity)
void bounceInteraction
(
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
) const;
//- Parcel interaction with dry surface
template<class filmType>
void drySplashInteraction
(
filmType&,
const parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
);
//- Parcel interaction with wetted surface
template<class filmType>
void wetSplashInteraction
(
filmType&,
parcelType& p,
const polyPatch& pp,
const label facei,
bool& keepParticle
);
//- Bai parcel splash interaction model
template<class filmType>
void splashInteraction
(
filmType&,
const parcelType& p,
const polyPatch& pp,
const label facei,
const scalar mRatio,
const scalar We,
const scalar Wec,
const scalar sigma,
bool& keepParticle
);
// Injection from sheet (ejection) helper functions
virtual void cacheFilmFields
(
@ -265,18 +95,14 @@ protected:
const areaFilm&
);
// Injection from sheet (ejection) helper functions
//- Cache the film fields in preparation for injection
//- Cache the film fields in preparation for injection
virtual void cacheFilmFields
(
const label filmPatchi,
const label primaryPatchi,
const regionModels::surfaceFilmModels::surfaceFilmRegionModel&
const regionFilm&
);
//- Set the individual parcel properties
virtual void setParcelProperties
(
@ -310,7 +136,7 @@ public:
//- Destructor
virtual ~ThermoSurfaceFilm();
virtual ~ThermoSurfaceFilm() = default;
// Member Functions

View File

@ -27,7 +27,6 @@ License
#include "liquidFilmBase.H"
#include "faMesh.H"
#include "faCFD.H"
#include "gravityMeshObject.H"
#include "movingWallVelocityFvPatchVectorField.H"
#include "turbulentFluidThermoModel.H"
@ -51,53 +50,8 @@ defineRunTimeSelectionTable(liquidFilmBase, dictionary);
const Foam::word liquidFilmName("liquidFilm");
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool liquidFilmBase::read(const dictionary& dict)
{
regionFaModel::read(dict);
if (active_)
{
const dictionary& solution = this->solution().subDict("PIMPLE");
solution.readEntry("momentumPredictor", momentumPredictor_);
solution.readEntry("nOuterCorr", nOuterCorr_);
solution.readEntry("nCorr", nCorr_);
solution.readEntry("nFilmCorr", nFilmCorr_);
}
return true;
}
scalar liquidFilmBase::CourantNumber() const
{
scalar CoNum = 0.0;
scalar velMag = 0.0;
edgeScalarField SfUfbyDelta
(
regionMesh().edgeInterpolation::deltaCoeffs()*mag(phif_)
);
CoNum = max(SfUfbyDelta/regionMesh().magLe())
.value()*time().deltaT().value();
velMag = max(mag(phif_)/regionMesh().magLe()).value();
reduce(CoNum, maxOp<scalar>());
reduce(velMag, maxOp<scalar>());
Info<< "Film Courant Number: "
<< " max: " << CoNum
<< " Film velocity magnitude: (h)" << velMag << endl;
return CoNum;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
liquidFilmBase::liquidFilmBase
(
const word& modelType,
@ -291,6 +245,7 @@ liquidFilmBase::liquidFilmBase
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
liquidFilmBase::~liquidFilmBase()
@ -299,6 +254,32 @@ liquidFilmBase::~liquidFilmBase()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
scalar liquidFilmBase::CourantNumber() const
{
scalar CoNum = 0.0;
scalar velMag = 0.0;
edgeScalarField SfUfbyDelta
(
regionMesh().edgeInterpolation::deltaCoeffs()*mag(phif_)
);
CoNum =
max(SfUfbyDelta/regionMesh().magLe()).value()*time().deltaT().value();
velMag = max(mag(phif_)/regionMesh().magLe()).value();
reduce(CoNum, maxOp<scalar>());
reduce(velMag, maxOp<scalar>());
Info<< "Film Courant Number: "
<< " max: " << CoNum
<< " Film velocity magnitude: (h)" << velMag << endl;
return CoNum;
}
Foam::tmp<Foam::areaVectorField> liquidFilmBase::Uw() const
{
tmp<areaVectorField> tUw
@ -413,6 +394,7 @@ Foam::tmp<Foam::areaVectorField> liquidFilmBase::Up() const
return tUp;
}
tmp<areaScalarField> liquidFilmBase::pg() const
{
tmp<areaScalarField> tpg
@ -444,7 +426,6 @@ tmp<areaScalarField> liquidFilmBase::pg() const
pfg.primitiveFieldRef() = vsmPtr_->mapInternalToSurface<scalar>(pw)();
}
return tpg;
}
@ -483,13 +464,9 @@ void liquidFilmBase::addSources
const scalar energySource
)
{
massSource_.boundaryFieldRef()[patchi][facei] += massSource;
pnSource_.boundaryFieldRef()[patchi][facei] += pressureSource;
momentumSource_.boundaryFieldRef()[patchi][facei] += momentumSource;
}
@ -498,6 +475,7 @@ void liquidFilmBase::preEvolveRegion()
regionFaModel::preEvolveRegion();
}
void liquidFilmBase::postEvolveRegion()
{
if (debug && primaryMesh().time().writeTime())
@ -514,52 +492,66 @@ void liquidFilmBase::postEvolveRegion()
regionFaModel::postEvolveRegion();
}
Foam::fa::options& liquidFilmBase::faOptions()
{
return faOptions_;
}
const areaVectorField& liquidFilmBase::Uf() const
{
return Uf_;
}
const areaScalarField& liquidFilmBase::gn() const
{
return gn_;
}
const uniformDimensionedVectorField& liquidFilmBase::g() const
{
return g_;
}
const areaScalarField& liquidFilmBase::h() const
{
return h_;
}
const edgeScalarField& liquidFilmBase::phif() const
{
return phif_;
}
const edgeScalarField& liquidFilmBase::phi2s() const
{
return phi2s_;
}
const dimensionedScalar& liquidFilmBase::h0() const
{
return h0_;
}
const regionFaModel& liquidFilmBase::region() const
{
return *this;
}
scalar liquidFilmBase::pRef()
{
return pRef_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace areaSurfaceFilmModels

View File

@ -39,7 +39,7 @@ SourceFiles
#include "runTimeSelectionTables.H"
#include "autoPtr.H"
#include "areaFieldsFwd.H"
#include "faCFD.H"
#include "volFieldsFwd.H"
#include "uniformDimensionedFields.H"
#include "regionFaModel.H"
@ -62,20 +62,6 @@ class liquidFilmBase
:
public regionFaModel
{
private:
// Private Member Functions
//- No copy construct
liquidFilmBase(const liquidFilmBase&) = delete;
//- No copy assignment
void operator=(const liquidFilmBase&) = delete;
//- Initialize thermal Baffle
void init();
protected:
// Protected Data
@ -141,36 +127,28 @@ protected:
uniformDimensionedVectorField g_;
// Mass exchanage fields from the primary region (lagragian)
// Mass exchanage fields from the primary region (lagragian)
//- Mass
volScalarField massSource_;
//- Mass
volScalarField massSource_;
//- Momentum
volVectorField momentumSource_;
//- Momentum
volVectorField momentumSource_;
//- Normal pressure by particles
volScalarField pnSource_;
//- Normal pressure by particles
volScalarField pnSource_;
//- Energy
volScalarField energySource_;
//- Energy
volScalarField energySource_;
//- Total mass added
scalar addedMassTotal_;
//- Total mass added
scalar addedMassTotal_;
//- Pointer to faOptions
//- faOptions
Foam::fa::options& faOptions_;
// Protected Member Functions
//- Read control parameters from dictionary
virtual bool read(const dictionary&);
public:
//- Runtime type information
@ -204,6 +182,12 @@ public:
const dictionary& dict
);
//- No copy construct
liquidFilmBase(const liquidFilmBase&) = delete;
//- No copy assignment
void operator=(const liquidFilmBase&) = delete;
// Selectors
@ -274,6 +258,9 @@ public:
//- Access to this region
const regionFaModel& region() const;
//- Access to pRef
scalar pRef();
// Transfer fields - to the primary region (lagragian injection)

View File

@ -47,12 +47,6 @@ defineTypeNameAndDebug(liquidFilmModel, 0);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool liquidFilmModel::read(const dictionary& dict)
{
liquidFilmBase::read(dict);
return true;
}
void liquidFilmModel::correctThermoFields()
{
scalarField X(thermo_.size(), 1);
@ -254,16 +248,12 @@ liquidFilmModel::liquidFilmModel
if (dict.found("T0"))
{
Tref_ = dict.get<scalar>("T0");
Tf_ = dimensionedScalar("T0", dimTemperature, dict);
}
correctThermoFields();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
liquidFilmModel::~liquidFilmModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
@ -296,6 +286,19 @@ const areaScalarField& liquidFilmModel::Cp() const
return Cp_;
}
const liquidMixtureProperties& liquidFilmModel::thermo() const
{
return thermo_;
}
scalar liquidFilmModel::Tref() const
{
return Tref_;
}
const volScalarField& liquidFilmModel::cloudMassTrans() const
{
return cloudMassTrans_;
@ -318,7 +321,7 @@ void liquidFilmModel::preEvolveRegion()
cloudDiameterTrans_ == dimensionedScalar(dimLength, Zero);
const scalar deltaT = primaryMesh().time().deltaTValue();
const scalarField rAreaDeltaT = 1/deltaT/regionMesh().S().field();
const scalarField rAreaDeltaT(scalar(1)/deltaT/regionMesh().S().field());
// Map the total mass, mom and pnSource from particles
rhoSp_.primitiveFieldRef() =
@ -341,6 +344,7 @@ void liquidFilmModel::preEvolveRegion()
USp_.relax();
}
void liquidFilmModel::postEvolveRegion()
{
availableMass_ = (h() - h0_)*rho()*regionMesh().S();

View File

@ -42,15 +42,10 @@ SourceFiles
#include "volFieldsFwd.H"
#include "liquidFilmBase.H"
#include "faMesh.H"
#include "filmTurbulenceModel.H"
#include "liquidMixtureProperties.H"
#include "injectionModelList.H"
#include "faCFD.H"
//#include "transferModelList.H"
#include "forceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -62,7 +57,6 @@ namespace regionModels
namespace areaSurfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class liquidFilmModel Declaration
\*---------------------------------------------------------------------------*/
@ -71,99 +65,78 @@ class liquidFilmModel
:
public liquidFilmBase
{
private:
// Private member functions
//- No copy construct
liquidFilmModel(const liquidFilmModel&) = delete;
//- No copy assignment
void operator=(const liquidFilmModel&) = delete;
//- Initialize liquidFilmModel
void init();
protected:
// Thermo properties
//- Liquid thermo
liquidMixtureProperties thermo_;
//- Liquid thermo
liquidMixtureProperties thermo_;
//- Reference tempararure
scalar Tref_;
// Fields
// Fields
//- Density [kg/m3]
areaScalarField rho_;
//- Density [kg/m3]
areaScalarField rho_;
//- Dynamic viscosity [Pa.s]
areaScalarField mu_;
//- Dynamic viscosity [Pa.s]
areaScalarField mu_;
//- Film temperature
areaScalarField Tf_;
//- Film temperature
areaScalarField Tf_;
//- Film Heat capacity
areaScalarField Cp_;
//- Film Heat capacity
areaScalarField Cp_;
//- Surface tension [m/s2]
areaScalarField sigma_;
//- Surface tension [m/s2]
areaScalarField sigma_;
//- Film rho*height
areaScalarField hRho_;
// Mass exchange sources
//- Mass source
areaScalarField rhoSp_;
//- Momentum source
areaVectorField USp_;
//- Normal pressure by particles
areaScalarField pnSp_;
//- Film rho*height
areaScalarField hRho_;
// Transfer fields
// Mass exchange sources
//- Film mass for transfer to cloud
volScalarField cloudMassTrans_;
//- Mass source
areaScalarField rhoSp_;
//- Parcel diameters originating from film to cloud
volScalarField cloudDiameterTrans_;
//- Momentum source
areaVectorField USp_;
//- Normal pressure by particles
areaScalarField pnSp_;
// Transfer fields
//- Film mass for transfer to cloud
volScalarField cloudMassTrans_;
//- Parcel diameters originating from film to cloud
volScalarField cloudDiameterTrans_;
// General properties
//- Turbulence model
autoPtr<filmTurbulenceModel> turbulence_;
//- Turbulence model
autoPtr<filmTurbulenceModel> turbulence_;
// Sub-models
//- Available mass for transfer via sub-models
scalarField availableMass_;
// Sub-models
//- Cloud injection
injectionModelList injection_;
//- Available mass for transfer via sub-models
scalarField availableMass_;
//- Transfer with the continuous phase
//transferModelList transfer_;
//- Cloud injection
injectionModelList injection_;
//- Transfer with the continuous phase
//transferModelList transfer_;
//- List of film forces
forceList forces_;
// Protected member functions
//- Read control parameters from dictionary
virtual bool read(const dictionary& dict);
//- List of film forces
forceList forces_;
public:
@ -174,7 +147,6 @@ public:
// Constructors
//- Construct from components and dict
liquidFilmModel
(
@ -183,21 +155,26 @@ public:
const dictionary& dict
);
//- No copy construct
liquidFilmModel(const liquidFilmModel&) = delete;
//- No copy assignment
void operator=(const liquidFilmModel&) = delete;
//- Destructor
virtual ~liquidFilmModel();
virtual ~liquidFilmModel() = default;
// Member Functions
// Help function
// Helpers
//- Correct thermo
void correctThermoFields();
// Access functions
// Access
//- Access const reference mu
const areaScalarField& mu() const;
@ -214,28 +191,32 @@ public:
//- Access const reference Cp
const areaScalarField& Cp() const;
//- Access to thermo
const liquidMixtureProperties& thermo() const;
// Transfer fields - to the primary region (lagragian injection)
//- Access to reference temperature
scalar Tref() const;
//- Return the film mass available for transfer to cloud
virtual const volScalarField& cloudMassTrans() const;
//- Return the parcel diameters originating from film to cloud
virtual const volScalarField& cloudDiameterTrans() const;
// Transfer fields - to the primary region (lagragian injection)
//- Return the film mass available for transfer to cloud
virtual const volScalarField& cloudMassTrans() const;
//- Return the parcel diameters originating from film to cloud
virtual const volScalarField& cloudDiameterTrans() const;
// Evolution
//- Pre-evolve film
virtual void preEvolveRegion();
//- Evolve the film
//virtual void evolveRegion();
//- Post-evolve film
virtual void postEvolveRegion();
// I-O
// I-O
//- Provide some feedback
virtual void info();

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
".*"
{
type fixedValue;
value uniform 300;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (3 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (3 0 0);
inletValue uniform (0 0 0);
}
outlet
{
type pressureInletOutletVelocity;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
"(top|sides)"
{
type noSlip;
}
base
{
type velocityFilmShell;
active true;
infoOutput true;
U U;
pRef 1e5; // Reference pressure for thermo
T0 300;
thermo
{
H2O;
}
turbulence laminar;
laminarCoeffs
{
friction ManningStrickler; // Wall friction model
n 0.005; // Manning number
Cf 0; // Gas friction
}
injectionModels
(
curvatureSeparation
);
forces ();
curvatureSeparationCoeffs
{
definedPatchRadii 0;
minInvR1 0;
deltaByR1Min 0; // h*invRi = 0.004*10
}
region film;
liquidFilmModel kinematicThinFilm;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class areaVectorField;
object Uf_film;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (5 0 0);
}
outlet
{
type zeroGradient;
}
sides
{
type slip;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 200;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 1;
}
outlet
{
type inletOutlet;
inletValue uniform 200;
value uniform 200;
}
".*"
{
type epsilonWallFunction;
value uniform 200;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class areaScalarField;
object hf_film;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0.0001;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.001;
}
outlet
{
type zeroGradient;
}
sides
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 1;
}
outlet
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
".*"
{
type kqRWallFunction;
value uniform 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
".*"
{
type nutkWallFunction;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type totalPressure;
p0 uniform 0;
}
"(top|sides)"
{
type zeroGradient;
}
base
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
cleanFaMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,16 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
runApplication blockMesh
runParallel -s decompose redistributePar -decompose
runParallel makeFaMesh
runParallel $(getApplication)
runParallel -s reconstruct redistributePar -reconstruct
#------------------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 -9.8);
// ************************************************************************* //

View File

@ -0,0 +1,126 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object kinematicCloudProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solution
{
active true;
coupled yes;
transient yes;
cellValueSourceCorrection no;
maxCo 0.3;
sourceTerms
{
schemes
{
U semiImplicit 1;
}
}
interpolationSchemes
{
rho cell;
U cellPoint;
muc cell;
p cell;
}
integrationSchemes
{
U Euler;
}
}
constantProperties
{
rho0 1000;
}
subModels
{
particleForces
{
sphereDrag;
gravity;
}
injectionModels
{
model1
{
type coneInjection;
SOI 10.00;
duration 13.000;
positionAxis
(
((-0.5 0.1 0.7) (1 0 -1))
((-0.5 0.2 0.7) (1 0 -1))
((-0.5 0.3 0.7) (1 0 -1))
((-0.5 0.4 0.7) (1 0 -1))
((-0.5 0.5 0.7) (1 0 -1))
((-0.5 0.6 0.7) (1 0 -1))
((-0.5 0.7 0.7) (1 0 -1))
((-0.5 0.8 0.7) (1 0 -1))
((-0.5 0.9 0.7) (1 0 -1))
);
massTotal 5;
parcelsPerInjector 20000;
parcelBasisType mass;
flowRateProfile constant 1;
Umag constant 1.0;
thetaInner constant 0;
thetaOuter constant 45;
sizeDistribution
{
type RosinRammler;
RosinRammlerDistribution
{
minValue 5e-04;
maxValue 0.0012;
d 7.5e-05;
n 0.5;
}
}
}
}
dispersionModel none;
patchInteractionModel standardWallInteraction;
stochasticCollisionModel none;
surfaceFilmModel kinematicSurfaceFilm;
standardWallInteractionCoeffs
{
type rebound;
}
kinematicSurfaceFilmCoeffs
{
interactionType absorb;
}
}
cloudFunctions
{}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu 1e-05;
rhoInf 1.2;
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(0 0 0) //0
(5 0 0) //1
(5 1 0) //2
(0 1 0) //3
(-1 0 0.5) //4
(-1 1 0.5) //5
(-1 1 1) //6
(-1 0 1) //7
(5 1 1) //8
(0 1 0.5) //9
(5 0 0.5) //10
(5 1 0.5) //11
(0 0 1) //12
(0 1 1) //13
(0 0 0.5) //14
(5 0 1) //15
);
blocks
(
hex (14 10 11 9 12 15 8 13 ) (100 20 10) simpleGrading (1 1 1)
hex (0 1 2 3 14 10 11 9) (100 20 10) simpleGrading (1 1 1)
hex (4 14 9 5 7 12 13 6) (20 20 10) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
base
{
type wall;
faces
(
(0 1 2 3)
(0 3 9 14)
(4 14 9 5)
);
}
outlet
{
type patch;
faces
(
(1 2 11 10)
(15 10 11 8)
);
}
inlet
{
type patch;
faces
(
(4 5 6 7)
);
}
sides
{
type wall;
faces
(
(0 1 10 14)
(14 10 15 12)
(4 14 12 7)
(3 2 11 9)
(9 11 8 13)
(5 9 13 6)
);
}
top
{
type wall;
faces
(
(12 15 8 13)
(7 12 13 6)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application kinematicParcelFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1; // increase it by 13 if need be
deltaT 0.005;
writeControl adjustable;
writeInterval 0.25;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.9;
regionFaMaxCo 1;
maxDeltaT 0.1;
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method hierarchical;
coeffs
{
n ( 2 2 1 );
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faMeshDefinition;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
polyMeshPatches ( base );
boundary
{
inlet
{
type patch;
ownerPolyPatch base;
neighbourPolyPatch inlet;
}
outlet
{
type patch;
ownerPolyPatch base;
neighbourPolyPatch outlet;
}
sides
{
type patch;
ownerPolyPatch base;
neighbourPolyPatch sides;
}
}
// ************************************************************************** //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phif_film,hf_film) Gauss upwind;
div(phi2s_film,Uf_film) Gauss upwind;
div(faceAreaNormals) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(hf_film) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
hf_film true;
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object faSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
Uf_film
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0.0;
}
hf_film
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0.0;
}
}
PIMPLE
{
momentumPredictor true;
nOuterCorr 2;
nCorr 2;
nFilmCorr 1;
}
relaxationFactors
{
hf_Film 1;
Uf_Film 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(U) Gauss linear;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,K) Gauss upwind;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,85 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PBiCGStab;
tolerance 0;
relTol 0.1;
smoother GaussSeidel;
preconditioner DIC;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}
"(k|epsilon)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
"(k|epsilon)Final"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
}
U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-05;
relTol 0.01;
}
UFinal
{
$U;
tolerance 1e-06;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
correctPhi no;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
equations
{
".*" 1;
}
}
// ************************************************************************* //