surfaceFilmModels: Superseded by the new isothermalFilm and film solver modules
The new general multi-region framework using the isothermalFilm and film solver modules and executed with foamMultiRun is a much more flexible approach to the inclusion of liquid films in simulations with the support for coupling to other regions of various types e.g. gas flows, Lagrangian clouds, VoF, CHT etc. This has all been achieved with a significant reduction in the number of lines of code and significant improvements in code structure, readability and maintainability.
This commit is contained in:
@ -5,7 +5,6 @@ wclean
|
||||
|
||||
wclean libso fvModels/VoFTurbulenceDamping
|
||||
wclean libso fvModels/VoFClouds
|
||||
wclean libso fvModels/VoFSurfaceFilm
|
||||
wclean libso fvModels/VoFCavitation
|
||||
wclean libso fvModels/VoFSolidificationMeltingSource
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ wmake $targetType
|
||||
|
||||
wmake $targetType fvModels/VoFTurbulenceDamping
|
||||
wmake $targetType fvModels/VoFClouds
|
||||
wmake $targetType fvModels/VoFSurfaceFilm
|
||||
wmake $targetType fvModels/VoFCavitation
|
||||
wmake $targetType fvModels/VoFSolidificationMeltingSource
|
||||
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
VoFSurfaceFilm.C
|
||||
VoFPatchTransfer/VoFPatchTransfer.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libVoFSurfaceFilm
|
||||
@ -1,15 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SOLVERS)/modules/twoPhaseVoFSolver/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/modules/twoPhaseSolver/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/modules/VoFSolver/lnInclude \
|
||||
-I$(FOAM_SOLVERS)/modules/compressibleVoF/lnInclude \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhases/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lsurfaceFilmModels
|
||||
@ -1,357 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "VoFPatchTransfer.H"
|
||||
#include "compressibleTwoPhaseVoFMixture.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(VoFPatchTransfer, 0);
|
||||
addToRunTimeSelectionTable(transferModel, VoFPatchTransfer, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
VoFPatchTransfer::VoFPatchTransfer
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
transferModel(type(), film, dict),
|
||||
deltaFactorToVoF_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("deltaFactorToVoF", 1.0)
|
||||
),
|
||||
deltaFactorToFilm_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("deltaFactorToFilm", 0.5)
|
||||
),
|
||||
alphaToVoF_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("alphaToVoF", 0.5)
|
||||
),
|
||||
alphaToFilm_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("alphaToFilm", 0.1)
|
||||
),
|
||||
transferRateCoeff_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("transferRateCoeff", 0.1)
|
||||
)
|
||||
{
|
||||
const polyBoundaryMesh& pbm = film.mesh().boundaryMesh();
|
||||
patchIDs_.setSize
|
||||
(
|
||||
pbm.size() - film.mesh().globalData().processorPatches().size()
|
||||
);
|
||||
|
||||
if (coeffDict_.found("patches"))
|
||||
{
|
||||
const wordReList patchNames(coeffDict_.lookup("patches"));
|
||||
const labelHashSet patchSet = pbm.patchSet(patchNames);
|
||||
|
||||
Info<< " applying to patches:" << nl;
|
||||
|
||||
label pidi = 0;
|
||||
forAllConstIter(labelHashSet, patchSet, iter)
|
||||
{
|
||||
const label patchi = iter.key();
|
||||
patchIDs_[pidi++] = patchi;
|
||||
Info<< " " << pbm[patchi].name() << endl;
|
||||
}
|
||||
patchIDs_.setSize(pidi);
|
||||
patchTransferredMasses_.setSize(pidi, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " applying to all patches" << endl;
|
||||
|
||||
forAll(patchIDs_, patchi)
|
||||
{
|
||||
patchIDs_[patchi] = patchi;
|
||||
}
|
||||
|
||||
patchTransferredMasses_.setSize(patchIDs_.size(), 0);
|
||||
}
|
||||
|
||||
if (!patchIDs_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No patches selected"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
VoFPatchTransfer::~VoFPatchTransfer()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void VoFPatchTransfer::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer
|
||||
)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void VoFPatchTransfer::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer,
|
||||
scalarField& energyToTransfer
|
||||
)
|
||||
{
|
||||
// Do not correct if no patches selected
|
||||
if (!patchIDs_.size()) return;
|
||||
|
||||
// Film properties
|
||||
|
||||
const thermoSurfaceFilm& film = filmType<thermoSurfaceFilm>();
|
||||
|
||||
const scalarField& delta = film.delta();
|
||||
const scalarField& rho = film.rho();
|
||||
const vectorField& U = film.U();
|
||||
const scalarField& he = film.thermo().he();
|
||||
|
||||
const scalarField& magSf = film.magSf();
|
||||
|
||||
const polyBoundaryMesh& pbm = film.mesh().boundaryMesh();
|
||||
|
||||
|
||||
// Primary region properties
|
||||
|
||||
const fvMesh& primaryMesh = film.primaryMesh();
|
||||
|
||||
const compressibleTwoPhaseVoFMixture& thermo
|
||||
(
|
||||
primaryMesh.lookupObject<compressibleTwoPhaseVoFMixture>
|
||||
(
|
||||
"phaseProperties"
|
||||
)
|
||||
);
|
||||
|
||||
const volScalarField& alphaVoF = thermo.alpha1();
|
||||
const volScalarField& rhoVoF = thermo.thermo1().rho()();
|
||||
const volScalarField& heVoF = thermo.thermo1().he();
|
||||
|
||||
const volVectorField& UVoF
|
||||
(
|
||||
primaryMesh.lookupObject<volVectorField>("U")
|
||||
);
|
||||
|
||||
forAll(patchIDs_, pidi)
|
||||
{
|
||||
const label patchi = patchIDs_[pidi];
|
||||
label primaryPatchi = -1;
|
||||
|
||||
forAll(film.intCoupledPatchIDs(), i)
|
||||
{
|
||||
const label filmPatchi = film.intCoupledPatchIDs()[i];
|
||||
|
||||
if (filmPatchi == patchi)
|
||||
{
|
||||
primaryPatchi = film.primaryPatchIDs()[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (primaryPatchi != -1)
|
||||
{
|
||||
const scalarField deltaCoeffsVoF
|
||||
(
|
||||
film.toFilm
|
||||
(
|
||||
patchi,
|
||||
primaryMesh.boundary()[primaryPatchi].deltaCoeffs()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField alphaVoFp
|
||||
(
|
||||
film.toFilm(patchi, alphaVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField rhoVoFp
|
||||
(
|
||||
film.toFilm(patchi, rhoVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const vectorField UVoFp
|
||||
(
|
||||
film.toFilm(patchi, UVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField heVoFp
|
||||
(
|
||||
film.toFilm(patchi, heVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField VVoFp
|
||||
(
|
||||
film.toFilm
|
||||
(
|
||||
patchi,
|
||||
primaryMesh.boundary()[primaryPatchi]
|
||||
.patchInternalField(primaryMesh.V())
|
||||
)
|
||||
);
|
||||
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
|
||||
// Accumulate the total mass removed from patch
|
||||
scalar dMassPatch = 0;
|
||||
|
||||
forAll(faceCells, facei)
|
||||
{
|
||||
const label celli = faceCells[facei];
|
||||
|
||||
scalar dMass = 0;
|
||||
|
||||
// Film->VoF transfer
|
||||
if
|
||||
(
|
||||
delta[celli] > 2*deltaFactorToVoF_/deltaCoeffsVoF[facei]
|
||||
|| alphaVoFp[facei] > alphaToVoF_
|
||||
)
|
||||
{
|
||||
dMass =
|
||||
transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli];
|
||||
|
||||
massToTransfer[celli] += dMass;
|
||||
momentumToTransfer[celli] += dMass*U[celli];
|
||||
energyToTransfer[celli] += dMass*he[celli];
|
||||
}
|
||||
|
||||
// VoF->film transfer
|
||||
if
|
||||
(
|
||||
alphaVoFp[facei] > 0
|
||||
&& delta[celli] < 2*deltaFactorToFilm_/deltaCoeffsVoF[facei]
|
||||
&& alphaVoFp[facei] < alphaToFilm_
|
||||
)
|
||||
{
|
||||
dMass =
|
||||
-transferRateCoeff_
|
||||
*alphaVoFp[facei]*rhoVoFp[facei]*VVoFp[facei];
|
||||
|
||||
massToTransfer[celli] += dMass;
|
||||
momentumToTransfer[celli] += dMass*UVoFp[facei];
|
||||
energyToTransfer[celli] += dMass*heVoFp[facei];
|
||||
}
|
||||
|
||||
availableMass[celli] -= dMass;
|
||||
dMassPatch += dMass;
|
||||
}
|
||||
|
||||
patchTransferredMasses_[pidi] += dMassPatch;
|
||||
addToTransferredMass(dMassPatch);
|
||||
}
|
||||
}
|
||||
|
||||
transferModel::correct();
|
||||
|
||||
if (writeTime())
|
||||
{
|
||||
scalarField patchTransferredMasses0
|
||||
(
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchTransferredMasses",
|
||||
scalarField(patchTransferredMasses_.size(), 0)
|
||||
)
|
||||
);
|
||||
|
||||
scalarField patchTransferredMassTotals(patchTransferredMasses_);
|
||||
Pstream::listCombineGather
|
||||
(
|
||||
patchTransferredMassTotals,
|
||||
plusEqOp<scalar>()
|
||||
);
|
||||
patchTransferredMasses0 += patchTransferredMassTotals;
|
||||
|
||||
setModelProperty<scalarField>
|
||||
(
|
||||
"patchTransferredMasses",
|
||||
patchTransferredMasses0
|
||||
);
|
||||
|
||||
patchTransferredMasses_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void VoFPatchTransfer::patchTransferredMassTotals
|
||||
(
|
||||
scalarField& patchMasses
|
||||
) const
|
||||
{
|
||||
// Do not correct if no patches selected
|
||||
if (!patchIDs_.size()) return;
|
||||
|
||||
scalarField patchTransferredMasses
|
||||
(
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchTransferredMasses",
|
||||
scalarField(patchTransferredMasses_.size(), 0)
|
||||
)
|
||||
);
|
||||
|
||||
scalarField patchTransferredMassTotals(patchTransferredMasses_);
|
||||
Pstream::listCombineGather(patchTransferredMassTotals, plusEqOp<scalar>());
|
||||
|
||||
forAll(patchIDs_, pidi)
|
||||
{
|
||||
const label patchi = patchIDs_[pidi];
|
||||
patchMasses[patchi] +=
|
||||
patchTransferredMasses[pidi] + patchTransferredMassTotals[pidi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,143 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::VoFPatchTransfer
|
||||
|
||||
Description
|
||||
Transfer mass between the film and the VoF in the continuous phase.
|
||||
|
||||
SourceFiles
|
||||
VoFPatchTransfer.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VoFPatchTransfer_H
|
||||
#define VoFPatchTransfer_H
|
||||
|
||||
#include "transferModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class VoFPatchTransfer Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class VoFPatchTransfer
|
||||
:
|
||||
public transferModel
|
||||
{
|
||||
protected:
|
||||
|
||||
//- Factor of the cell height above which the film is transferred
|
||||
// to the VoF
|
||||
scalar deltaFactorToVoF_;
|
||||
|
||||
//- Factor of the cell height below which the VoF may be transferred
|
||||
// to the film
|
||||
scalar deltaFactorToFilm_;
|
||||
|
||||
//- VoF limit above which all of the film is transferred to the VoF
|
||||
scalar alphaToVoF_;
|
||||
|
||||
//- VoF limit below which the VoF may be transferred to the film
|
||||
scalar alphaToFilm_;
|
||||
|
||||
//- Transfer rate coefficient
|
||||
scalar transferRateCoeff_;
|
||||
|
||||
//- List of patch IDs at which the film is removed
|
||||
labelList patchIDs_;
|
||||
|
||||
//- Transferred mass for each patch at which the film is removed
|
||||
scalarField patchTransferredMasses_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("VoFPatchTransfer");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
VoFPatchTransfer(surfaceFilm& film, const dictionary& dict);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
VoFPatchTransfer(const VoFPatchTransfer&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~VoFPatchTransfer();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer
|
||||
);
|
||||
|
||||
//- Correct kinematic and thermodynamic transfers
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer,
|
||||
scalarField& energyToTransfer
|
||||
);
|
||||
|
||||
//- Accumulate the total mass injected for the patches into the
|
||||
// scalarField provided
|
||||
virtual void patchTransferredMassTotals
|
||||
(
|
||||
scalarField& patchMasses
|
||||
) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const VoFPatchTransfer&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,197 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "VoFSurfaceFilm.H"
|
||||
#include "compressibleTwoPhaseVoFMixture.H"
|
||||
#include "fvmSup.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace fv
|
||||
{
|
||||
defineTypeNameAndDebug(VoFSurfaceFilm, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
fvModel,
|
||||
VoFSurfaceFilm,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fv::VoFSurfaceFilm::VoFSurfaceFilm
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvModel(sourceName, modelType, mesh, dict),
|
||||
surfaceFilm_
|
||||
(
|
||||
thermoSurfaceFilm::typeName,
|
||||
mesh,
|
||||
mesh.lookupObject<uniformDimensionedVectorField>("g"),
|
||||
surfaceFilm::typeName
|
||||
),
|
||||
curTimeIndex_(-1)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::fv::VoFSurfaceFilm::addSupFields() const
|
||||
{
|
||||
return wordList
|
||||
(
|
||||
{
|
||||
surfaceFilm_.rhoPrimary().name(),
|
||||
surfaceFilm_.UPrimary().name(),
|
||||
surfaceFilm_.primaryThermo().he().name()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::fv::VoFSurfaceFilm::maxDeltaT() const
|
||||
{
|
||||
return surfaceFilm_.maxDeltaT();
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::correct()
|
||||
{
|
||||
if (curTimeIndex_ == mesh().time().timeIndex())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
surfaceFilm_.evolve();
|
||||
|
||||
curTimeIndex_ = mesh().time().timeIndex();
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::addSup
|
||||
(
|
||||
const volScalarField& alpha,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
if (fieldName == surfaceFilm_.rhoPrimary().name())
|
||||
{
|
||||
eqn += surfaceFilm_.Srho();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Support for field " << fieldName << " is not implemented"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::addSup
|
||||
(
|
||||
const volScalarField& alpha,
|
||||
const volScalarField& rho,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
if (fieldName == surfaceFilm_.primaryThermo().he().name())
|
||||
{
|
||||
eqn += surfaceFilm_.Sh();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Support for field " << fieldName << " is not implemented"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<vector>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
eqn += surfaceFilm_.SU();
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::topoChange(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::VoFSurfaceFilm::distribute(const polyDistributionMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::fv::VoFSurfaceFilm::movePoints()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,176 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::fv::VoFSurfaceFilm
|
||||
|
||||
Description
|
||||
Surface film model for VoF simulations.
|
||||
|
||||
Usage
|
||||
Example usage:
|
||||
\verbatim
|
||||
VoFSurfaceFilm
|
||||
{
|
||||
type VoFSurfaceFilm;
|
||||
phase water;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
VoFSurfaceFilm.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef VoFSurfaceFilm_H
|
||||
#define VoFSurfaceFilm_H
|
||||
|
||||
#include "fvModel.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class VoFSurfaceFilm Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class VoFSurfaceFilm
|
||||
:
|
||||
public fvModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- The surface film model
|
||||
thermoSurfaceFilm surfaceFilm_;
|
||||
|
||||
//- Current time index (used for updating)
|
||||
mutable label curTimeIndex_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("VoFSurfaceFilm");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from explicit source name and mesh
|
||||
VoFSurfaceFilm
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
VoFSurfaceFilm
|
||||
(
|
||||
const VoFSurfaceFilm&
|
||||
) = delete;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Checks
|
||||
|
||||
//- Return the list of fields for which the option adds source term
|
||||
// to the transport equation
|
||||
virtual wordList addSupFields() const;
|
||||
|
||||
//- Return the maximum time-step for stable operation
|
||||
virtual scalar maxDeltaT() const;
|
||||
|
||||
|
||||
// Correct
|
||||
|
||||
//- Solve the film and update the sources
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Add explicit and implicit contributions to compressible equation
|
||||
|
||||
//- Add explicit contribution to phase continuity
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& alpha,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
//- Add explicit contribution to phase energy equation
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& alpha,
|
||||
const volScalarField& rho,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
//- Add implicit contribution to mixture momentum equation
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<vector>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
//- Update for mesh motion
|
||||
virtual bool movePoints();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const VoFSurfaceFilm&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration | Website: https://openfoam.org
|
||||
# \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -206,7 +206,6 @@ modelsInFamily () {
|
||||
_modelDirs="\
|
||||
$(findModelDirs "$_familyDir" 2) \
|
||||
$(findModelDirs "$FOAM_SRC/lagrangian/parcel/fvModels") \
|
||||
$(findModelDirs "$FOAM_SRC/surfaceFilmModels/fvModels") \
|
||||
$(findModelDirs "$FOAM_SRC/radiationModels/fvModels/radiation")"
|
||||
|
||||
[ "$_modelDirs" ] || return 0
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object surfaceFilms;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
type surfaceFilms;
|
||||
|
||||
libs ("libsurfaceFilmModels.so");
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -77,9 +77,6 @@ functionObjects/Allwmake $targetType $*
|
||||
|
||||
lagrangian/Allwmake $targetType $*
|
||||
|
||||
wmake $targetType surfaceFilmModels
|
||||
wmake $targetType parcelSurfaceFilmModels
|
||||
|
||||
wmake $targetType sixDoFRigidBodyMotion
|
||||
wmake $targetType sixDoFRigidBodyState
|
||||
wmake $targetType rigidBodyDynamics
|
||||
|
||||
@ -66,7 +66,7 @@ void Foam::MomentumCloud<CloudType>::setModels()
|
||||
).ptr()
|
||||
);
|
||||
|
||||
surfaceFilmModel_.reset
|
||||
filmModel_.reset
|
||||
(
|
||||
SurfaceFilmModel<MomentumCloud<CloudType>>::New
|
||||
(
|
||||
@ -250,7 +250,7 @@ void Foam::MomentumCloud<CloudType>::cloudReset(MomentumCloud<CloudType>& c)
|
||||
dispersionModel_.reset(c.dispersionModel_.ptr());
|
||||
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
|
||||
stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr());
|
||||
surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr());
|
||||
filmModel_.reset(c.filmModel_.ptr());
|
||||
|
||||
UIntegrator_.reset(c.UIntegrator_.ptr());
|
||||
}
|
||||
@ -333,7 +333,7 @@ Foam::MomentumCloud<CloudType>::MomentumCloud
|
||||
dispersionModel_(nullptr),
|
||||
patchInteractionModel_(nullptr),
|
||||
stochasticCollisionModel_(nullptr),
|
||||
surfaceFilmModel_(nullptr),
|
||||
filmModel_(nullptr),
|
||||
UIntegrator_(nullptr),
|
||||
UTrans_
|
||||
(
|
||||
@ -426,7 +426,7 @@ Foam::MomentumCloud<CloudType>::MomentumCloud
|
||||
dispersionModel_(c.dispersionModel_->clone()),
|
||||
patchInteractionModel_(c.patchInteractionModel_->clone()),
|
||||
stochasticCollisionModel_(c.stochasticCollisionModel_->clone()),
|
||||
surfaceFilmModel_(c.surfaceFilmModel_->clone()),
|
||||
filmModel_(c.filmModel_->clone()),
|
||||
UIntegrator_(c.UIntegrator_->clone()),
|
||||
UTrans_
|
||||
(
|
||||
@ -515,7 +515,7 @@ Foam::MomentumCloud<CloudType>::MomentumCloud
|
||||
dispersionModel_(nullptr),
|
||||
patchInteractionModel_(nullptr),
|
||||
stochasticCollisionModel_(nullptr),
|
||||
surfaceFilmModel_(nullptr),
|
||||
filmModel_(nullptr),
|
||||
UIntegrator_(nullptr),
|
||||
UTrans_(nullptr),
|
||||
UCoeff_(nullptr)
|
||||
|
||||
@ -210,9 +210,8 @@ protected:
|
||||
autoPtr<StochasticCollisionModel<MomentumCloud<CloudType>>>
|
||||
stochasticCollisionModel_;
|
||||
|
||||
//- Surface film model
|
||||
autoPtr<SurfaceFilmModel<MomentumCloud<CloudType>>>
|
||||
surfaceFilmModel_;
|
||||
//- Optional film model
|
||||
autoPtr<SurfaceFilmModel<MomentumCloud<CloudType>>> filmModel_;
|
||||
|
||||
|
||||
// Reference to the particle integration schemes
|
||||
|
||||
@ -232,7 +232,7 @@ template<class CloudType>
|
||||
inline const Foam::SurfaceFilmModel<Foam::MomentumCloud<CloudType>>&
|
||||
Foam::MomentumCloud<CloudType>::surfaceFilm() const
|
||||
{
|
||||
return surfaceFilmModel_();
|
||||
return filmModel_();
|
||||
}
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ template<class CloudType>
|
||||
inline Foam::SurfaceFilmModel<Foam::MomentumCloud<CloudType>>&
|
||||
Foam::MomentumCloud<CloudType>::surfaceFilm()
|
||||
{
|
||||
return surfaceFilmModel_();
|
||||
return filmModel_();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
ThermoSurfaceFilm/ThermoSurfaceFilmBase.C
|
||||
makeThermoParcelSurfaceFilmModels.C
|
||||
makeReactingParcelSurfaceFilmModels.C
|
||||
makeReactingMultiphaseParcelSurfaceFilmModels.C
|
||||
makeSprayParcelSurfaceFilmModels.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libparcelSurfaceFilmModels
|
||||
@ -1,23 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/parcel/lnInclude \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-llagrangian \
|
||||
-llagrangianParcel \
|
||||
-lphysicalProperties \
|
||||
-lspecie \
|
||||
-lfluidThermophysicalModels \
|
||||
-lthermophysicalProperties \
|
||||
-lmulticomponentThermophysicalModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -1,752 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
#include "ThermoCloud.H"
|
||||
#include "meshTools.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
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 = pi/180.0*(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>::absorbInteraction
|
||||
(
|
||||
thermoSurfaceFilm& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
const scalar mass,
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Parcel " << p.origId() << " absorbInteraction" << endl;
|
||||
}
|
||||
|
||||
const fluidThermo& carrierThermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner())
|
||||
.carrierThermo();
|
||||
|
||||
const parcelThermo& thermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner()).thermo();
|
||||
|
||||
// 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;
|
||||
|
||||
const liquidProperties& liq = thermo.liquids().properties()[0];
|
||||
|
||||
// Local pressure
|
||||
const scalar pc = carrierThermo.p()[p.cell()];
|
||||
|
||||
filmModel.addSources
|
||||
(
|
||||
pp.index(),
|
||||
facei,
|
||||
mass, // mass
|
||||
mass*Ut, // tangential momentum
|
||||
mass*mag(Un), // impingement pressure
|
||||
mass*liq.Hs(pc, p.T()) // energy
|
||||
);
|
||||
|
||||
this->nParcelsTransferred()++;
|
||||
|
||||
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>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction
|
||||
(
|
||||
thermoSurfaceFilm& filmModel,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl;
|
||||
}
|
||||
|
||||
const fluidThermo& carrierThermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner())
|
||||
.carrierThermo();
|
||||
|
||||
const parcelThermo& thermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner()).thermo();
|
||||
|
||||
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 = carrierThermo.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(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
|
||||
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
|
||||
(
|
||||
thermoSurfaceFilm& filmModel,
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl;
|
||||
}
|
||||
|
||||
const fluidThermo& carrierThermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner())
|
||||
.carrierThermo();
|
||||
|
||||
const parcelThermo& thermo =
|
||||
static_cast<const ThermoCloud<CloudType>&>(this->owner()).thermo();
|
||||
|
||||
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 = carrierThermo.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(filmModel, p, pp, facei, m, keepParticle);
|
||||
}
|
||||
else if ((We >= 2) && (We < 20)) // Bounce
|
||||
{
|
||||
// Incident angle of impingement
|
||||
const scalar theta = pi/2 - 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(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
|
||||
(filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction
|
||||
(
|
||||
thermoSurfaceFilm& 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 = normalised(perpendicular(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(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(mesh, 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(filmModel, p, pp, facei, mDash, keepParticle);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::UPtrList<Foam::thermoSurfaceFilm>&
|
||||
Foam::ThermoSurfaceFilm<CloudType>::filmPtrs() const
|
||||
{
|
||||
const objectRegistry& db = this->owner().mesh().time();
|
||||
|
||||
if (!filmNames_.empty() && films_.empty())
|
||||
{
|
||||
// If there are multiple surface films and/or surface films with
|
||||
// non-default names, then require the films entry to have been
|
||||
// specified
|
||||
{
|
||||
HashTable<const thermoSurfaceFilm*> filmPtrs =
|
||||
db.lookupClass<thermoSurfaceFilm>();
|
||||
|
||||
const word defaultName = surfaceFilm::typeName + "Properties";
|
||||
|
||||
if
|
||||
(
|
||||
(
|
||||
filmPtrs.size() == 1
|
||||
&& filmPtrs.begin().key() != defaultName
|
||||
)
|
||||
|| (filmPtrs.size() > 1)
|
||||
)
|
||||
{
|
||||
Info << filmPtrs.begin().key() << " " << defaultName << endl;
|
||||
this->coeffDict().lookup("surfaceFilms");
|
||||
}
|
||||
}
|
||||
|
||||
// Cache pointers to the surface film models
|
||||
films_.resize(filmNames_.size());
|
||||
filmPatches_.setSize(films_.size());
|
||||
|
||||
forAll(films_, filmi)
|
||||
{
|
||||
films_.set
|
||||
(
|
||||
filmi,
|
||||
&db.template lookupObjectRef<thermoSurfaceFilm>
|
||||
(
|
||||
filmNames_[filmi] + "Properties"
|
||||
)
|
||||
);
|
||||
|
||||
if (films_[filmi].primaryPatchIDs().size() > 1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Number of film primary patch IDs > 1 for film "
|
||||
<< films_[filmi].name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
filmPatches_[filmi] = films_[filmi].primaryPatchIDs()[0];
|
||||
}
|
||||
}
|
||||
|
||||
return films_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::labelList& Foam::ThermoSurfaceFilm<CloudType>::filmPatches() const
|
||||
{
|
||||
// Ensure filmPatches_ has been initialise
|
||||
filmPtrs();
|
||||
|
||||
return filmPatches_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields(const label filmi)
|
||||
{
|
||||
const thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi];
|
||||
const label filmPatchi = filmModel.intCoupledPatchIDs()[0];
|
||||
|
||||
this->massParcelPatch_ =
|
||||
filmModel.cloudMassTrans().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, this->massParcelPatch_);
|
||||
|
||||
this->diameterParcelPatch_ =
|
||||
filmModel.cloudDiameterTrans().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, this->diameterParcelPatch_);
|
||||
|
||||
UFilmPatch_ = filmModel.U().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, UFilmPatch_);
|
||||
|
||||
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, rhoFilmPatch_);
|
||||
|
||||
this->deltaFilmPatch_ =
|
||||
filmModel.delta().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, this->deltaFilmPatch_);
|
||||
|
||||
TFilmPatch_ = filmModel.thermo().T().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, TFilmPatch_);
|
||||
|
||||
CpFilmPatch_ = filmModel.thermo().Cpv().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, CpFilmPatch_);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoSurfaceFilm<CloudType>::setParcelProperties
|
||||
(
|
||||
parcelType& p,
|
||||
const label filmFacei
|
||||
) const
|
||||
{
|
||||
// Set parcel properties
|
||||
const scalar vol =
|
||||
mathematical::pi/6.0*pow3(this->diameterParcelPatch_[filmFacei]);
|
||||
p.d() = this->diameterParcelPatch_[filmFacei];
|
||||
p.U() = UFilmPatch_[filmFacei];
|
||||
p.rho() = rhoFilmPatch_[filmFacei];
|
||||
|
||||
p.nParticle() = this->massParcelPatch_[filmFacei]/p.rho()/vol;
|
||||
|
||||
if (this->ejectedParcelType_ >= 0)
|
||||
{
|
||||
p.typeId() = this->ejectedParcelType_;
|
||||
}
|
||||
|
||||
// Set parcel properties
|
||||
p.T() = TFilmPatch_[filmFacei];
|
||||
p.Cp() = CpFilmPatch_[filmFacei];
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
SurfaceFilmModel<CloudType>(dict, owner, typeName),
|
||||
rndGen_(owner.rndGen()),
|
||||
filmNames_
|
||||
(
|
||||
this->coeffDict().lookupOrDefault
|
||||
(
|
||||
"surfaceFilms",
|
||||
wordList(1, surfaceFilm::typeName)
|
||||
)
|
||||
),
|
||||
films_(),
|
||||
UFilmPatch_(0),
|
||||
rhoFilmPatch_(0),
|
||||
TFilmPatch_(0),
|
||||
CpFilmPatch_(0),
|
||||
interactionType_
|
||||
(
|
||||
interactionTypeNames_.read(this->coeffDict().lookup("interactionType"))
|
||||
),
|
||||
deltaWet_(0.0),
|
||||
splashParcelType_(0),
|
||||
parcelsPerSplash_(0),
|
||||
Adry_(0.0),
|
||||
Awet_(0.0),
|
||||
Cf_(0.0),
|
||||
nParcelsSplashed_(0)
|
||||
{
|
||||
Info<< " Applying " << interactionTypeNames_[interactionType_]
|
||||
<< " interaction model" << endl;
|
||||
|
||||
if (interactionType_ == interactionType::splashBai)
|
||||
{
|
||||
this->coeffDict().lookup("deltaWet") >> deltaWet_;
|
||||
splashParcelType_ =
|
||||
this->coeffDict().lookupOrDefault("splashParcelType", -1);
|
||||
parcelsPerSplash_ =
|
||||
this->coeffDict().lookupOrDefault("parcelsPerSplash", 2);
|
||||
this->coeffDict().lookup("Adry") >> Adry_;
|
||||
this->coeffDict().lookup("Awet") >> Awet_;
|
||||
this->coeffDict().lookup("Cf") >> Cf_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
|
||||
(
|
||||
const ThermoSurfaceFilm<CloudType>& sfm
|
||||
)
|
||||
:
|
||||
SurfaceFilmModel<CloudType>(sfm),
|
||||
rndGen_(sfm.rndGen_),
|
||||
filmNames_(sfm.filmNames_),
|
||||
films_(),
|
||||
UFilmPatch_(sfm.UFilmPatch_),
|
||||
rhoFilmPatch_(sfm.rhoFilmPatch_),
|
||||
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_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ThermoSurfaceFilm<CloudType>::~ThermoSurfaceFilm()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
(
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
bool& keepParticle
|
||||
)
|
||||
{
|
||||
const label patchi = pp.index();
|
||||
|
||||
forAll(this->filmPtrs(), filmi)
|
||||
{
|
||||
thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi];
|
||||
|
||||
if (filmModel.isFilmPatch(patchi))
|
||||
{
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
switch (interactionType_)
|
||||
{
|
||||
case interactionType::bounce:
|
||||
{
|
||||
bounceInteraction(p, pp, facei, keepParticle);
|
||||
break;
|
||||
}
|
||||
case interactionType::absorb:
|
||||
{
|
||||
absorbInteraction
|
||||
(
|
||||
filmModel,
|
||||
p,
|
||||
pp,
|
||||
facei,
|
||||
p.nParticle()*p.mass(),
|
||||
keepParticle
|
||||
);
|
||||
break;
|
||||
}
|
||||
case interactionType::splashBai:
|
||||
{
|
||||
if (this->deltaFilmPatch_[facei] < deltaWet_)
|
||||
{
|
||||
drySplashInteraction
|
||||
(
|
||||
filmModel,
|
||||
p,
|
||||
pp,
|
||||
facei,
|
||||
keepParticle
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
wetSplashInteraction
|
||||
(
|
||||
filmModel,
|
||||
p,
|
||||
pp,
|
||||
facei,
|
||||
keepParticle
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type enumeration"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer parcel/parcel interactions complete
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Parcel not interacting with film
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
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 film splash parcels = " << nSplashTotal << endl;
|
||||
|
||||
if (this->writeTime())
|
||||
{
|
||||
this->setModelProperty("nParcelsSplashed", nSplashTotal);
|
||||
nParcelsSplashed_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,318 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::ThermoSurfaceFilm
|
||||
|
||||
Description
|
||||
Thermo parcel surface film model.
|
||||
|
||||
Responsible for:
|
||||
- injecting parcels 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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ThermoSurfaceFilm_H
|
||||
#define ThermoSurfaceFilm_H
|
||||
|
||||
#include "SurfaceFilmModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class thermoSurfaceFilm;
|
||||
class Random;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ThermoSurfaceFilmBase Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ThermoSurfaceFilmBase
|
||||
{
|
||||
public:
|
||||
|
||||
//- Interaction types
|
||||
enum class interactionType
|
||||
{
|
||||
absorb,
|
||||
bounce,
|
||||
splashBai
|
||||
};
|
||||
|
||||
//- Interaction type names
|
||||
static const NamedEnum<interactionType, 3> interactionTypeNames_;
|
||||
};
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ThermoSurfaceFilm Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class ThermoSurfaceFilm
|
||||
:
|
||||
public SurfaceFilmModel<CloudType>,
|
||||
public ThermoSurfaceFilmBase
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Return pointers to the films
|
||||
UPtrList<thermoSurfaceFilm>& filmPtrs() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Data
|
||||
|
||||
//- Convenience typedef to the cloud's parcel type
|
||||
typedef typename CloudType::parcelType parcelType;
|
||||
|
||||
//- Reference to the cloud random number generator
|
||||
Random& rndGen_;
|
||||
|
||||
|
||||
// Film models
|
||||
|
||||
//- Names of the films
|
||||
const wordList filmNames_;
|
||||
|
||||
//- Pointers to the films
|
||||
mutable UPtrList<thermoSurfaceFilm> films_;
|
||||
|
||||
//- List of film patches
|
||||
mutable labelList filmPatches_;
|
||||
|
||||
|
||||
// Cached injector fields per film patch
|
||||
|
||||
//- Film velocity / patch face
|
||||
vectorField UFilmPatch_;
|
||||
|
||||
//- Film density / patch face
|
||||
scalarField rhoFilmPatch_;
|
||||
|
||||
//- Film temperature / patch face
|
||||
scalarField TFilmPatch_;
|
||||
|
||||
//- Film specific heat capacity / patch face
|
||||
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 splashed parcel direction
|
||||
vector splashDirection
|
||||
(
|
||||
const vector& tanVec1,
|
||||
const vector& tanVec2,
|
||||
const vector& nf
|
||||
) const;
|
||||
|
||||
|
||||
// Interaction models
|
||||
|
||||
//- Absorb parcel into film
|
||||
void absorbInteraction
|
||||
(
|
||||
thermoSurfaceFilm&,
|
||||
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
|
||||
void drySplashInteraction
|
||||
(
|
||||
thermoSurfaceFilm&,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
bool& keepParticle
|
||||
);
|
||||
|
||||
//- Parcel interaction with wetted surface
|
||||
void wetSplashInteraction
|
||||
(
|
||||
thermoSurfaceFilm&,
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
bool& keepParticle
|
||||
);
|
||||
|
||||
//- Bai parcel splash interaction model
|
||||
void splashInteraction
|
||||
(
|
||||
thermoSurfaceFilm&,
|
||||
const parcelType& p,
|
||||
const polyPatch& pp,
|
||||
const label facei,
|
||||
const scalar mRatio,
|
||||
const scalar We,
|
||||
const scalar Wec,
|
||||
const scalar sigma,
|
||||
bool& keepParticle
|
||||
);
|
||||
|
||||
//- Return pointers to the films
|
||||
virtual const labelList& filmPatches() const;
|
||||
|
||||
//- Cache the film fields in preparation for injection
|
||||
virtual void cacheFilmFields(const label filmi);
|
||||
|
||||
//- Set the individual parcel properties
|
||||
virtual void setParcelProperties
|
||||
(
|
||||
parcelType& p,
|
||||
const label filmFacei
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("thermoSurfaceFilm");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
ThermoSurfaceFilm(const dictionary& dict, CloudType& owner);
|
||||
|
||||
//- Construct copy
|
||||
ThermoSurfaceFilm(const ThermoSurfaceFilm<CloudType>& sfm);
|
||||
|
||||
//- Construct and return a clone using supplied owner cloud
|
||||
virtual autoPtr<SurfaceFilmModel<CloudType>> clone() const
|
||||
{
|
||||
return autoPtr<SurfaceFilmModel<CloudType>>
|
||||
(
|
||||
new ThermoSurfaceFilm<CloudType>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ThermoSurfaceFilm();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Transfer parcel from cloud to film
|
||||
// Returns true if parcel is to be transferred
|
||||
virtual bool transferParcel
|
||||
(
|
||||
parcelType& p,
|
||||
const polyPatch& pp,
|
||||
bool& keepParticle
|
||||
);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write film info to stream
|
||||
virtual void info(Ostream& os);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "ThermoSurfaceFilm.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,48 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<>
|
||||
const char* NamedEnum
|
||||
<
|
||||
ThermoSurfaceFilmBase::interactionType,
|
||||
3
|
||||
>::names[] = {"absorb", "bounce", "splashBai"};
|
||||
}
|
||||
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::ThermoSurfaceFilmBase::interactionType,
|
||||
3
|
||||
> Foam::ThermoSurfaceFilmBase::interactionTypeNames_;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "reactingMultiphaseCloud.H"
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeSurfaceFilmModelType(ThermoSurfaceFilm, reactingMultiphaseCloud);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "reactingCloud.H"
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeSurfaceFilmModelType(ThermoSurfaceFilm, reactingCloud);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sprayCloud.H"
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeSurfaceFilmModelType(ThermoSurfaceFilm, sprayCloud);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,33 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "thermoCloud.H"
|
||||
#include "ThermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeSurfaceFilmModelType(ThermoSurfaceFilm, thermoCloud);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,76 +0,0 @@
|
||||
# Surface film models
|
||||
surfaceFilm/surfaceFilm.C
|
||||
momentumSurfaceFilm/momentumSurfaceFilm.C
|
||||
thermoSurfaceFilm/thermoSurfaceFilm.C
|
||||
|
||||
# Sub-models
|
||||
submodels/filmSubModelBase.C
|
||||
|
||||
MOMENTUMMODELS=submodels/momentum
|
||||
$(MOMENTUMMODELS)/force/force/force.C
|
||||
$(MOMENTUMMODELS)/force/force/forceNew.C
|
||||
$(MOMENTUMMODELS)/force/forceList/forceList.C
|
||||
$(MOMENTUMMODELS)/force/contactAngleForces/contactAngleForce/contactAngleForce.C
|
||||
$(MOMENTUMMODELS)/force/contactAngleForces/distribution/distributionContactAngleForce.C
|
||||
$(MOMENTUMMODELS)/force/contactAngleForces/temperatureDependent/temperatureDependentContactAngleForce.C
|
||||
$(MOMENTUMMODELS)/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C
|
||||
$(MOMENTUMMODELS)/force/thermocapillaryForce/thermocapillaryForce.C
|
||||
|
||||
$(MOMENTUMMODELS)/ejectionModel/ejectionModel/ejectionModel.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/ejectionModel/ejectionModelNew.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/ejectionModelList/ejectionModelList.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/drippingEjection/drippingEjection.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/BrunDrippingEjection/BrunDrippingEjection.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/patchEjection/patchEjection.C
|
||||
$(MOMENTUMMODELS)/ejectionModel/curvatureSeparation/curvatureSeparation.C
|
||||
|
||||
$(MOMENTUMMODELS)/transferModels/transferModel/transferModel.C
|
||||
$(MOMENTUMMODELS)/transferModels/transferModel/transferModelNew.C
|
||||
$(MOMENTUMMODELS)/transferModels/transferModelList/transferModelList.C
|
||||
|
||||
$(MOMENTUMMODELS)/filmMomentumTransportModel/filmMomentumTransportModel/filmMomentumTransportModel.C
|
||||
$(MOMENTUMMODELS)/filmMomentumTransportModel/filmMomentumTransportModel/filmMomentumTransportModelNew.C
|
||||
$(MOMENTUMMODELS)/filmMomentumTransportModel/laminar/laminar.C
|
||||
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModel.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/constant/constantViscosity.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/Newtonian/NewtonianViscosity.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/thixotropic/thixotropicViscosity.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/Arrhenius/ArrheniusViscosity.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/function1/function1Viscosity.C
|
||||
$(MOMENTUMMODELS)/filmViscosityModel/waxSolvent/waxSolventViscosity.C
|
||||
|
||||
THERMOMODELS=submodels/thermo
|
||||
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModel.C
|
||||
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C
|
||||
$(THERMOMODELS)/phaseChangeModel/noPhaseChange/noPhaseChange.C
|
||||
$(THERMOMODELS)/phaseChangeModel/speciePhaseChange/speciePhaseChange.C
|
||||
$(THERMOMODELS)/phaseChangeModel/standardPhaseChange/standardPhaseChange.C
|
||||
$(THERMOMODELS)/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C
|
||||
$(THERMOMODELS)/phaseChangeModel/solidification/solidification.C
|
||||
|
||||
$(THERMOMODELS)/heatTransferModel/heatTransferModel/heatTransferModel.C
|
||||
$(THERMOMODELS)/heatTransferModel/heatTransferModel/heatTransferModelNew.C
|
||||
$(THERMOMODELS)/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C
|
||||
$(THERMOMODELS)/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C
|
||||
|
||||
$(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModel.C
|
||||
$(THERMOMODELS)/filmRadiationModel/filmRadiationModel/filmRadiationModelNew.C
|
||||
$(THERMOMODELS)/filmRadiationModel/noRadiation/noRadiation.C
|
||||
$(THERMOMODELS)/filmRadiationModel/constantRadiation/constantRadiation.C
|
||||
$(THERMOMODELS)/filmRadiationModel/primaryRadiation/primaryRadiation.C
|
||||
$(THERMOMODELS)/filmRadiationModel/standardRadiation/standardRadiation.C
|
||||
|
||||
# Boundary conditions
|
||||
PATCHFIELDS=derivedFvPatchFields
|
||||
$(PATCHFIELDS)/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
|
||||
$(PATCHFIELDS)/inclinedFilmNusseltHeight/inclinedFilmNusseltHeightFvPatchScalarField.C
|
||||
$(PATCHFIELDS)/inclinedFilmNusseltInletVelocity/inclinedFilmNusseltInletVelocityFvPatchVectorField.C
|
||||
$(PATCHFIELDS)/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C
|
||||
$(PATCHFIELDS)/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C
|
||||
|
||||
# fvModel
|
||||
fvModels/surfaceFilms/surfaceFilms.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels
|
||||
@ -1,23 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \
|
||||
-I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
-lthermophysicalProperties \
|
||||
-lmulticomponentThermophysicalModels \
|
||||
-lmomentumTransportModels \
|
||||
-lcompressibleMomentumTransportModels \
|
||||
-lfluidThermoThermophysicalTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -1,152 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmHeightInletVelocityFvPatchVectorField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::filmHeightInletVelocityFvPatchVectorField::
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
phiName_("phi"),
|
||||
rhoName_("rho"),
|
||||
deltafName_("delta")
|
||||
{}
|
||||
|
||||
|
||||
Foam::filmHeightInletVelocityFvPatchVectorField::
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF, dict),
|
||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||
deltafName_(dict.lookupOrDefault<word>("delta", "delta"))
|
||||
{}
|
||||
|
||||
|
||||
Foam::filmHeightInletVelocityFvPatchVectorField::
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const filmHeightInletVelocityFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
deltafName_(ptf.deltafName_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::filmHeightInletVelocityFvPatchVectorField::
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const filmHeightInletVelocityFvPatchVectorField& fhivpvf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(fhivpvf, iF),
|
||||
phiName_(fhivpvf.phiName_),
|
||||
rhoName_(fhivpvf.rhoName_),
|
||||
deltafName_(fhivpvf.deltafName_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
|
||||
const fvPatchField<scalar>& deltafp =
|
||||
patch().lookupPatchField<volScalarField, scalar>(deltafName_);
|
||||
|
||||
vectorField n(patch().nf());
|
||||
const scalarField& magSf = patch().magSf();
|
||||
|
||||
operator==(n*phip/(rhop*magSf*deltafp + rootVSmall));
|
||||
|
||||
fixedValueFvPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::filmHeightInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchVectorField::write(os);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||
writeEntryIfDifferent<word>(os, "delta", "delta", deltafName_);
|
||||
writeEntry(os, "value", *this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::filmHeightInletVelocityFvPatchVectorField::operator=
|
||||
(
|
||||
const fvPatchField<vector>& pvf
|
||||
)
|
||||
{
|
||||
fvPatchField<vector>::operator=(patch().nf()*(patch().nf() & pvf));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,236 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::filmHeightInletVelocityFvPatchVectorField
|
||||
|
||||
Description
|
||||
This boundary condition is designed to be used in conjunction with
|
||||
surface film modelling. It provides a velocity inlet boundary condition
|
||||
for patches where the film height is specified. The inflow velocity is
|
||||
obtained from the flux with a direction normal to the patch faces using:
|
||||
|
||||
\f[
|
||||
U_p = \frac{n \phi}{\rho |Sf| \delta}
|
||||
\f]
|
||||
|
||||
where
|
||||
\vartable
|
||||
U_p | patch velocity [m/s]
|
||||
n | patch normal vector
|
||||
\phi | mass flux [kg/s]
|
||||
\rho | density [kg/m^3]
|
||||
Sf | patch face area vectors [m^2]
|
||||
\delta | film height [m]
|
||||
\endvartable
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
phi | Flux field name | no | phi
|
||||
rho | density field name | no | rho
|
||||
deltaf | height field name | no | deltaf
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type filmHeightInletVelocity;
|
||||
phi phi;
|
||||
rho rho;
|
||||
deltaf deltaf;
|
||||
value uniform (0 0 0); // initial velocity / [m/s]
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::fixedValueFvPatchField
|
||||
|
||||
SourceFiles
|
||||
filmHeightInletVelocityFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef filmHeightInletVelocityFvPatchVectorField_H
|
||||
#define filmHeightInletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "fvPatchFields.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class filmHeightInletVelocityFvPatchVectorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class filmHeightInletVelocityFvPatchVectorField
|
||||
:
|
||||
public fixedValueFvPatchVectorField
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Name of flux field
|
||||
word phiName_;
|
||||
|
||||
//- Name of density field
|
||||
word rhoName_;
|
||||
|
||||
//- Name of film height field
|
||||
word deltafName_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("filmHeightInletVelocity");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given filmHeightInletVelocityFvPatchVectorField
|
||||
// onto a new patch
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const filmHeightInletVelocityFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Disallow copy without setting internal field reference
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const filmHeightInletVelocityFvPatchVectorField&
|
||||
) = delete;
|
||||
|
||||
//- Copy constructor setting internal field reference
|
||||
filmHeightInletVelocityFvPatchVectorField
|
||||
(
|
||||
const filmHeightInletVelocityFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchVectorField> clone
|
||||
(
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new filmHeightInletVelocityFvPatchVectorField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Attributes
|
||||
|
||||
//- Return true: this patch field is altered by assignment
|
||||
virtual bool assignable() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the name of phi
|
||||
const word& phiName() const
|
||||
{
|
||||
return phiName_;
|
||||
}
|
||||
|
||||
//- Return reference to the name of phi to allow adjustment
|
||||
word& phiName()
|
||||
{
|
||||
return phiName_;
|
||||
}
|
||||
|
||||
//- Return the name of rho
|
||||
const word& rhoName() const
|
||||
{
|
||||
return rhoName_;
|
||||
}
|
||||
|
||||
//- Return reference to the name of rho to allow adjustment
|
||||
word& rhoName()
|
||||
{
|
||||
return rhoName_;
|
||||
}
|
||||
|
||||
//- Return the name of deltaf
|
||||
const word& deltafName() const
|
||||
{
|
||||
return deltafName_;
|
||||
}
|
||||
|
||||
//- Return reference to the name of df to allow adjustment
|
||||
word& deltafName()
|
||||
{
|
||||
return deltafName_;
|
||||
}
|
||||
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,215 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "inclinedFilmNusseltHeightFvPatchScalarField.H"
|
||||
#include "volFields.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::inclinedFilmNusseltHeightFvPatchScalarField::
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
filmName_(surfaceFilm::typeName),
|
||||
GammaMean_(),
|
||||
a_(),
|
||||
omega_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltHeightFvPatchScalarField::
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict),
|
||||
filmName_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"film",
|
||||
surfaceFilm::typeName
|
||||
)
|
||||
),
|
||||
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
|
||||
a_(Function1<scalar>::New("a", dict)),
|
||||
omega_(Function1<scalar>::New("omega", dict))
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltHeightFvPatchScalarField::
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const inclinedFilmNusseltHeightFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||
filmName_(ptf.filmName_),
|
||||
GammaMean_(ptf.GammaMean_().clone().ptr()),
|
||||
a_(ptf.a_().clone().ptr()),
|
||||
omega_(ptf.omega_().clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltHeightFvPatchScalarField::
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const inclinedFilmNusseltHeightFvPatchScalarField& wmfrhpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(wmfrhpsf, iF),
|
||||
filmName_(wmfrhpsf.filmName_),
|
||||
GammaMean_(wmfrhpsf.GammaMean_().clone().ptr()),
|
||||
a_(wmfrhpsf.a_().clone().ptr()),
|
||||
omega_(wmfrhpsf.omega_().clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::inclinedFilmNusseltHeightFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// retrieve the film film from the database
|
||||
|
||||
const momentumSurfaceFilm& film =
|
||||
db().time().lookupObject<momentumSurfaceFilm>
|
||||
(
|
||||
filmName_ + "Properties"
|
||||
);
|
||||
|
||||
// calculate the vector tangential to the patch
|
||||
|
||||
// note: normal pointing into the domain
|
||||
const vectorField n(-patch().nf());
|
||||
|
||||
const scalarField gTan
|
||||
(
|
||||
(
|
||||
film.g().value()
|
||||
- film.nHat().boundaryField()[patchi]
|
||||
*(film.g().value() & film.nHat().boundaryField()[patchi])
|
||||
) & n
|
||||
);
|
||||
|
||||
if (patch().size() && (max(mag(gTan)) < small))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "is designed to operate on patches inclined with respect to "
|
||||
<< "gravity"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
const volVectorField& nHat = film.nHat();
|
||||
|
||||
const vectorField nHatp(nHat.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
vectorField nTan(nHatp ^ n);
|
||||
nTan /= mag(nTan) + rootVSmall;
|
||||
|
||||
// calculate distance in patch tangential direction
|
||||
|
||||
const vectorField& Cf = patch().Cf();
|
||||
scalarField d(nTan & Cf);
|
||||
|
||||
// calculate the wavy film height
|
||||
|
||||
const scalar t = db().time().userTimeValue();
|
||||
|
||||
const scalar GMean = GammaMean_->value(t);
|
||||
const scalar a = a_->value(t);
|
||||
const scalar omega = omega_->value(t);
|
||||
|
||||
const scalarField G(GMean + a*sin(omega*constant::mathematical::twoPi*d));
|
||||
|
||||
const volScalarField& mu = film.mu();
|
||||
const scalarField mup(mu.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
const volScalarField& rho = film.rho();
|
||||
const scalarField rhop(rho.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
const scalarField Re(max(G, scalar(0))/mup);
|
||||
|
||||
operator==
|
||||
(
|
||||
pow(3*sqr(mup/rhop)/(gTan + rootVSmall), 1.0/3.0)*pow(Re, 1.0/3.0)
|
||||
);
|
||||
|
||||
fixedValueFvPatchScalarField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::inclinedFilmNusseltHeightFvPatchScalarField::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
fixedValueFvPatchScalarField::write(os);
|
||||
writeEntryIfDifferent
|
||||
(
|
||||
os,
|
||||
"film",
|
||||
surfaceFilm::typeName,
|
||||
filmName_
|
||||
);
|
||||
writeEntry(os, GammaMean_());
|
||||
writeEntry(os, a_());
|
||||
writeEntry(os, omega_());
|
||||
writeEntry(os, "value", *this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,149 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::inclinedFilmNusseltHeightFvPatchScalarField
|
||||
|
||||
Description
|
||||
Film height boundary condition for inclined films that imposes a
|
||||
sinusoidal perturbation on top of a mean flow rate, where the height is
|
||||
calculated using the Nusselt solution.
|
||||
|
||||
SourceFiles
|
||||
inclinedFilmNusseltHeightFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef inclinedFilmNusseltHeightFvPatchScalarField_H
|
||||
#define inclinedFilmNusseltHeightFvPatchScalarField_H
|
||||
|
||||
#include "fvPatchFields.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class inclinedFilmNusseltHeightFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class inclinedFilmNusseltHeightFvPatchScalarField
|
||||
:
|
||||
public fixedValueFvPatchScalarField
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- The name of the film
|
||||
const word filmName_;
|
||||
|
||||
//- Mean mass flow rate per unit length [kg/s/m]
|
||||
autoPtr<Function1<scalar>> GammaMean_;
|
||||
|
||||
//- Perturbation amplitude [m]
|
||||
autoPtr<Function1<scalar>> a_;
|
||||
|
||||
//- Perturbation frequency [rad/s/m]
|
||||
autoPtr<Function1<scalar>> omega_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("inclinedFilmNusseltHeight");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// inclinedFilmNusseltHeightFvPatchScalarField onto a new patch
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const inclinedFilmNusseltHeightFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Disallow copy without setting internal field reference
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const inclinedFilmNusseltHeightFvPatchScalarField&
|
||||
) = delete;
|
||||
|
||||
//- Copy constructor setting internal field reference
|
||||
inclinedFilmNusseltHeightFvPatchScalarField
|
||||
(
|
||||
const inclinedFilmNusseltHeightFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new inclinedFilmNusseltHeightFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,211 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "inclinedFilmNusseltInletVelocityFvPatchVectorField.H"
|
||||
#include "volFields.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
filmName_(surfaceFilm::typeName),
|
||||
GammaMean_(),
|
||||
a_(),
|
||||
omega_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF, dict),
|
||||
filmName_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"film",
|
||||
surfaceFilm::typeName
|
||||
)
|
||||
),
|
||||
GammaMean_(Function1<scalar>::New("GammaMean", dict)),
|
||||
a_(Function1<scalar>::New("a", dict)),
|
||||
omega_(Function1<scalar>::New("omega", dict))
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const inclinedFilmNusseltInletVelocityFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
||||
filmName_(ptf.filmName_),
|
||||
GammaMean_(ptf.GammaMean_().clone().ptr()),
|
||||
a_(ptf.a_().clone().ptr()),
|
||||
omega_(ptf.omega_().clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const inclinedFilmNusseltInletVelocityFvPatchVectorField& fmfrpvf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(fmfrpvf, iF),
|
||||
filmName_(fmfrpvf.filmName_),
|
||||
GammaMean_(fmfrpvf.GammaMean_().clone().ptr()),
|
||||
a_(fmfrpvf.a_().clone().ptr()),
|
||||
omega_(fmfrpvf.omega_().clone().ptr())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve the film film from the database
|
||||
|
||||
const momentumSurfaceFilm& film =
|
||||
db().time().lookupObject<momentumSurfaceFilm>
|
||||
(
|
||||
filmName_ + "Properties"
|
||||
);
|
||||
|
||||
// Calculate the vector tangential to the patch
|
||||
// note: normal pointing into the domain
|
||||
const vectorField n(-patch().nf());
|
||||
|
||||
const scalarField gTan
|
||||
(
|
||||
(
|
||||
film.g().value()
|
||||
- film.nHat().boundaryField()[patchi]
|
||||
*(film.g().value() & film.nHat().boundaryField()[patchi])
|
||||
) & n
|
||||
);
|
||||
|
||||
if (patch().size() && (max(mag(gTan)) < small))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "is designed to operate on patches inclined with respect to "
|
||||
<< "gravity"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
const volVectorField& nHat = film.nHat();
|
||||
|
||||
const vectorField nHatp(nHat.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
vectorField nTan(nHatp ^ n);
|
||||
nTan /= mag(nTan) + rootVSmall;
|
||||
|
||||
// calculate distance in patch tangential direction
|
||||
|
||||
const vectorField& Cf = patch().Cf();
|
||||
scalarField d(nTan & Cf);
|
||||
|
||||
// calculate the wavy film height
|
||||
|
||||
const scalar t = db().time().userTimeValue();
|
||||
|
||||
const scalar GMean = GammaMean_->value(t);
|
||||
const scalar a = a_->value(t);
|
||||
const scalar omega = omega_->value(t);
|
||||
|
||||
const scalarField G(GMean + a*sin(omega*constant::mathematical::twoPi*d));
|
||||
|
||||
const volScalarField& mu = film.mu();
|
||||
const scalarField mup(mu.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
const volScalarField& rho = film.rho();
|
||||
const scalarField rhop(rho.boundaryField()[patchi].patchInternalField());
|
||||
|
||||
const scalarField Re(max(G, scalar(0))/mup);
|
||||
|
||||
operator==(n*pow(gTan*mup/(3*rhop), 1.0/3.0)*pow(Re, 2.0/3.0));
|
||||
|
||||
fixedValueFvPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
fvPatchVectorField::write(os);
|
||||
writeEntryIfDifferent
|
||||
(
|
||||
os,
|
||||
"film",
|
||||
surfaceFilm::typeName,
|
||||
filmName_
|
||||
);
|
||||
writeEntry(os, GammaMean_());
|
||||
writeEntry(os, a_());
|
||||
writeEntry(os, omega_());
|
||||
writeEntry(os, "value", *this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,152 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
|
||||
Description
|
||||
Film velocity boundary condition for inclined films that imposes a
|
||||
sinusoidal perturbation on top of a mean flow rate, where the velocity is
|
||||
calculated using the Nusselt solution.
|
||||
|
||||
SourceFiles
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef inclinedFilmNusseltInletVelocityFvPatchVectorField_H
|
||||
#define inclinedFilmNusseltInletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "fvPatchFields.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class inclinedFilmNusseltInletVelocityFvPatchVectorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
:
|
||||
public fixedValueFvPatchVectorField
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- The name of the film
|
||||
const word filmName_;
|
||||
|
||||
//- Mean mass flow rate per unit length [kg/s/m]
|
||||
autoPtr<Function1<scalar>> GammaMean_;
|
||||
|
||||
//- Perturbation amplitude [m]
|
||||
autoPtr<Function1<scalar>> a_;
|
||||
|
||||
//- Perturbation frequency [rad/s/m]
|
||||
autoPtr<Function1<scalar>> omega_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("inclinedFilmNusseltInletVelocity");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// inclinedFilmNusseltInletVelocityFvPatchVectorField onto a new patch
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const inclinedFilmNusseltInletVelocityFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Disallow copy without setting internal field reference
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const inclinedFilmNusseltInletVelocityFvPatchVectorField&
|
||||
) = delete;
|
||||
|
||||
//- Copy constructor setting internal field reference
|
||||
inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
const inclinedFilmNusseltInletVelocityFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchVectorField> clone
|
||||
(
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new inclinedFilmNusseltInletVelocityFvPatchVectorField
|
||||
(
|
||||
*this, iF
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,263 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "alphatFilmWallFunctionFvPatchScalarField.H"
|
||||
#include "fluidThermophysicalTransportModel.H"
|
||||
#include "surfaceFilm.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mappedWallPolyPatch.H"
|
||||
#include "distributionMap.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
alphatFilmWallFunctionFvPatchScalarField::
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
filmName_(surfaceFilm::typeName),
|
||||
B_(5.5),
|
||||
yPlusCrit_(11.05),
|
||||
Cmu_(0.09),
|
||||
kappa_(0.41),
|
||||
Prt_(0.85)
|
||||
{}
|
||||
|
||||
|
||||
alphatFilmWallFunctionFvPatchScalarField::
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict),
|
||||
filmName_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"film",
|
||||
surfaceFilm::typeName
|
||||
)
|
||||
),
|
||||
B_(dict.lookupOrDefault("B", 5.5)),
|
||||
yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05)),
|
||||
Cmu_(dict.lookupOrDefault("Cmu", 0.09)),
|
||||
kappa_(dict.lookupOrDefault("kappa", 0.41)),
|
||||
Prt_(dict.lookupOrDefault("Prt", 0.85))
|
||||
{}
|
||||
|
||||
|
||||
alphatFilmWallFunctionFvPatchScalarField::
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const alphatFilmWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||
filmName_(ptf.filmName_),
|
||||
B_(ptf.B_),
|
||||
yPlusCrit_(ptf.yPlusCrit_),
|
||||
Cmu_(ptf.Cmu_),
|
||||
kappa_(ptf.kappa_),
|
||||
Prt_(ptf.Prt_)
|
||||
{}
|
||||
|
||||
|
||||
alphatFilmWallFunctionFvPatchScalarField::
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const alphatFilmWallFunctionFvPatchScalarField& fwfpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(fwfpsf, iF),
|
||||
filmName_(fwfpsf.filmName_),
|
||||
B_(fwfpsf.B_),
|
||||
yPlusCrit_(fwfpsf.yPlusCrit_),
|
||||
Cmu_(fwfpsf.Cmu_),
|
||||
kappa_(fwfpsf.kappa_),
|
||||
Prt_(fwfpsf.Prt_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
typedef surfaceFilm modelType;
|
||||
|
||||
// Since we're inside initEvaluate/evaluate there might be processor
|
||||
// comms underway. Change the tag we use.
|
||||
int oldTag = UPstream::msgType();
|
||||
UPstream::msgType() = oldTag+1;
|
||||
|
||||
bool foundFilm =
|
||||
db().time().foundObject<modelType>(filmName_ + "Properties");
|
||||
|
||||
if (!foundFilm)
|
||||
{
|
||||
// Do nothing on construction - film model doesn't exist yet
|
||||
return;
|
||||
}
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve phase change mass from surface film model
|
||||
const modelType& filmModel =
|
||||
db().time().lookupObject<modelType>(filmName_ + "Properties");
|
||||
|
||||
const label filmPatchi = filmModel.filmPatchID(patchi);
|
||||
|
||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, mDotFilmp);
|
||||
|
||||
const fluidThermophysicalTransportModel& ttm =
|
||||
db().lookupType<fluidThermophysicalTransportModel>
|
||||
(
|
||||
internalField().group()
|
||||
);
|
||||
|
||||
const compressibleMomentumTransportModel& turbModel =
|
||||
ttm.momentumTransport();
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
const tmp<scalarField> talphaw
|
||||
(
|
||||
ttm.thermo().kappa().boundaryField()[patchi]
|
||||
/ttm.thermo().Cp().boundaryField()[patchi]
|
||||
);
|
||||
const scalarField& alphaw = talphaw();
|
||||
|
||||
const scalar Cmu25 = pow(Cmu_, 0.25);
|
||||
|
||||
// Populate alphat field values
|
||||
scalarField& alphat = *this;
|
||||
forAll(alphat, facei)
|
||||
{
|
||||
label faceCelli = patch().faceCells()[facei];
|
||||
|
||||
scalar uTau = Cmu25*sqrt(k[faceCelli]);
|
||||
|
||||
scalar yPlus = y[facei]*uTau/nuw[facei];
|
||||
|
||||
scalar Pr = rhow[facei]*nuw[facei]/alphaw[facei];
|
||||
|
||||
scalar factor = 0.0;
|
||||
scalar mStar = mDotFilmp[facei]/(y[facei]*uTau);
|
||||
if (yPlus > yPlusCrit_)
|
||||
{
|
||||
scalar expTerm = exp(min(50.0, yPlusCrit_*mStar*Pr));
|
||||
scalar yPlusRatio = yPlus/yPlusCrit_;
|
||||
scalar powTerm = mStar*Prt_/kappa_;
|
||||
factor =
|
||||
mStar/(expTerm*(pow(yPlusRatio, powTerm)) - 1.0 + rootVSmall);
|
||||
}
|
||||
else
|
||||
{
|
||||
scalar expTerm = exp(min(50.0, yPlus*mStar*Pr));
|
||||
factor = mStar/(expTerm - 1.0 + rootVSmall);
|
||||
}
|
||||
|
||||
scalar dx = patch().deltaCoeffs()[facei];
|
||||
|
||||
scalar alphaEff = dx*rhow[facei]*uTau*factor;
|
||||
|
||||
alphat[facei] = max(alphaEff - alphaw[facei], 0.0);
|
||||
}
|
||||
|
||||
// Restore tag
|
||||
UPstream::msgType() = oldTag;
|
||||
|
||||
fixedValueFvPatchScalarField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
writeEntryIfDifferent
|
||||
(
|
||||
os,
|
||||
"film",
|
||||
surfaceFilm::typeName,
|
||||
filmName_
|
||||
);
|
||||
writeEntry(os, "B", B_);
|
||||
writeEntry(os, "yPlusCrit", yPlusCrit_);
|
||||
writeEntry(os, "Cmu", Cmu_);
|
||||
writeEntry(os, "kappa", kappa_);
|
||||
writeEntry(os, "Prt", Prt_);
|
||||
writeEntry(os, "value", *this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,195 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::compressible::RASModels::alphatFilmWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
This boundary condition provides a turbulent thermal diffusivity condition
|
||||
when using wall functions, for use with surface film models. This
|
||||
condition varies from the standard wall function by taking into account any
|
||||
mass released from the film model.
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
B | model coefficient | no | 5.5
|
||||
yPlusCrit | critical y+ for transition to turbulent flow | no|11.05
|
||||
Cmu | model coefficient | no | 0.09
|
||||
kappa | Von-Karman constant | no | 0.41
|
||||
Prt | turbulent Prandtl number | no | 0.85
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type alphatFilmWallFunction;
|
||||
B 5.5;
|
||||
yPlusCrit 11.05;
|
||||
Cmu 0.09;
|
||||
kappa 0.41;
|
||||
Prt 0.85;
|
||||
value uniform 0;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::fixedValueFvPatchField
|
||||
|
||||
SourceFiles
|
||||
alphatFilmWallFunctionFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef alphatFilmWallFunctionFvPatchScalarField_H
|
||||
#define alphatFilmWallFunctionFvPatchScalarField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class alphatFilmWallFunctionFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class alphatFilmWallFunctionFvPatchScalarField
|
||||
:
|
||||
public fixedValueFvPatchScalarField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- The name of the film
|
||||
const word filmName_;
|
||||
|
||||
//- B Coefficient (default = 5.5)
|
||||
scalar B_;
|
||||
|
||||
//- y+ value for laminar -> turbulent transition (default = 11.05)
|
||||
scalar yPlusCrit_;
|
||||
|
||||
//- Turbulent Cmu coefficient (default = 0.09)
|
||||
scalar Cmu_;
|
||||
|
||||
//- Von-Karman constant (default = 0.41)
|
||||
scalar kappa_;
|
||||
|
||||
//- Turbulent Prandtl number (default = 0.85)
|
||||
scalar Prt_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("alphatFilmWallFunction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// alphatFilmWallFunctionFvPatchScalarField
|
||||
// onto a new patch
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const alphatFilmWallFunctionFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Disallow copy without setting internal field reference
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const alphatFilmWallFunctionFvPatchScalarField&
|
||||
) = delete;
|
||||
|
||||
//- Copy constructor setting internal field reference
|
||||
alphatFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const alphatFilmWallFunctionFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new alphatFilmWallFunctionFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,248 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "nutkFilmWallFunctionFvPatchScalarField.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "compressibleMomentumTransportModels.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "surfaceFilm.H"
|
||||
#include "mappedWallPolyPatch.H"
|
||||
#include "distributionMap.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
tmp<scalarField> nutkFilmWallFunctionFvPatchScalarField::calcUTau
|
||||
(
|
||||
const scalarField& magGradU
|
||||
) const
|
||||
{
|
||||
tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));
|
||||
scalarField& uTau = tuTau.ref();
|
||||
|
||||
typedef surfaceFilm modelType;
|
||||
|
||||
bool foundFilm =
|
||||
db().time().foundObject<modelType>(filmName_+ "Properties");
|
||||
|
||||
if (!foundFilm)
|
||||
{
|
||||
// Do nothing on construction - film model doesn't exist yet
|
||||
return tuTau;
|
||||
}
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve phase change mass from surface film model
|
||||
const modelType& filmModel =
|
||||
db().time().lookupObject<modelType>(filmName_+ "Properties");
|
||||
|
||||
const label filmPatchi = filmModel.filmPatchID(patchi);
|
||||
|
||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi];
|
||||
filmModel.toPrimary(filmPatchi, mDotFilmp);
|
||||
|
||||
// Retrieve RAS turbulence model
|
||||
const momentumTransportModel& turbModel =
|
||||
db().lookupType<momentumTransportModel>(internalField().group());
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
const scalar Cmu25 = pow(Cmu_, 0.25);
|
||||
|
||||
forAll(uTau, facei)
|
||||
{
|
||||
label faceCelli = patch().faceCells()[facei];
|
||||
|
||||
scalar ut = Cmu25*sqrt(k[faceCelli]);
|
||||
|
||||
scalar yPlus = y[facei]*ut/nuw[facei];
|
||||
|
||||
scalar mStar = mDotFilmp[facei]/(y[facei]*ut);
|
||||
|
||||
scalar factor = 0.0;
|
||||
if (yPlus > yPlusCrit_)
|
||||
{
|
||||
scalar expTerm = exp(min(50.0, B_*mStar));
|
||||
scalar powTerm = pow(yPlus, mStar/kappa_);
|
||||
factor = mStar/(expTerm*powTerm - 1.0 + rootVSmall);
|
||||
}
|
||||
else
|
||||
{
|
||||
scalar expTerm = exp(min(50.0, mStar));
|
||||
factor = mStar/(expTerm*yPlus - 1.0 + rootVSmall);
|
||||
}
|
||||
|
||||
uTau[facei] = sqrt(max(0, magGradU[facei]*ut*factor));
|
||||
}
|
||||
|
||||
return tuTau;
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField> nutkFilmWallFunctionFvPatchScalarField::nut() const
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
|
||||
const momentumTransportModel& turbModel =
|
||||
db().lookupType<momentumTransportModel>(internalField().group());
|
||||
|
||||
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||
const scalarField magGradU(mag(Uw.snGrad()));
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
return max
|
||||
(
|
||||
scalar(0),
|
||||
sqr(calcUTau(magGradU))/(magGradU + rootVSmall) - nuw
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
nutkFilmWallFunctionFvPatchScalarField::nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(p, iF),
|
||||
filmName_(surfaceFilm::typeName),
|
||||
B_(5.5),
|
||||
yPlusCrit_(11.05)
|
||||
{}
|
||||
|
||||
|
||||
nutkFilmWallFunctionFvPatchScalarField::nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
filmName_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"film",
|
||||
surfaceFilm::typeName
|
||||
)
|
||||
),
|
||||
B_(dict.lookupOrDefault("B", 5.5)),
|
||||
yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05))
|
||||
{}
|
||||
|
||||
|
||||
nutkFilmWallFunctionFvPatchScalarField::nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkFilmWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
||||
filmName_(ptf.filmName_),
|
||||
B_(ptf.B_),
|
||||
yPlusCrit_(ptf.yPlusCrit_)
|
||||
{}
|
||||
|
||||
|
||||
nutkFilmWallFunctionFvPatchScalarField::nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkFilmWallFunctionFvPatchScalarField& wfpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(wfpsf, iF),
|
||||
filmName_(wfpsf.filmName_),
|
||||
B_(wfpsf.B_),
|
||||
yPlusCrit_(wfpsf.yPlusCrit_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
tmp<scalarField> nutkFilmWallFunctionFvPatchScalarField::yPlus() const
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
|
||||
const momentumTransportModel& turbModel =
|
||||
db().lookupType<momentumTransportModel>(internalField().group());
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
return y*calcUTau(mag(Uw.snGrad()))/nuw;
|
||||
}
|
||||
|
||||
|
||||
void nutkFilmWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
writeLocalEntries(os);
|
||||
writeEntryIfDifferent
|
||||
(
|
||||
os,
|
||||
"film",
|
||||
surfaceFilm::typeName,
|
||||
filmName_
|
||||
);
|
||||
writeEntry(os, "B", B_);
|
||||
writeEntry(os, "yPlusCrit", yPlusCrit_);
|
||||
writeEntry(os, "value", *this);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField(fvPatchScalarField, nutkFilmWallFunctionFvPatchScalarField);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,180 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::compressible::RASModels::nutkFilmWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
This boundary condition provides a turbulent viscosity condition when
|
||||
using wall functions, based on turbulence kinetic energy, for use with
|
||||
surface film models.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type nutkFilmWallFunction;
|
||||
value uniform 0;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
See also
|
||||
Foam::nutkWallFunctionFvPatchScalarField
|
||||
|
||||
SourceFiles
|
||||
nutkFilmWallFunctionFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef nutkFilmWallFunctionFvPatchScalarField_H
|
||||
#define nutkFilmWallFunctionFvPatchScalarField_H
|
||||
|
||||
#include "nutkWallFunctionFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class nutkFilmWallFunctionFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class nutkFilmWallFunctionFvPatchScalarField
|
||||
:
|
||||
public nutkWallFunctionFvPatchScalarField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- The name of the film
|
||||
const word filmName_;
|
||||
|
||||
//- B Coefficient (default = 5.5)
|
||||
scalar B_;
|
||||
|
||||
//- y+ value for laminar -> turbulent transition (default = 11.05)
|
||||
scalar yPlusCrit_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Calculate the turbulence viscosity
|
||||
virtual tmp<scalarField> nut() const;
|
||||
|
||||
//- Calculate the friction velocity
|
||||
virtual tmp<scalarField> calcUTau(const scalarField& magGradU) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("nutkFilmWallFunction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// nutkFilmWallFunctionFvPatchScalarField
|
||||
// onto a new patch
|
||||
nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkFilmWallFunctionFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Disallow copy without setting internal field reference
|
||||
nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkFilmWallFunctionFvPatchScalarField&
|
||||
) = delete;
|
||||
|
||||
//- Copy constructor setting internal field reference
|
||||
nutkFilmWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkFilmWallFunctionFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new nutkFilmWallFunctionFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Calculate and return the yPlus at the boundary
|
||||
virtual tmp<scalarField> yPlus() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace compressible
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,309 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "surfaceFilms.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "fvMatrix.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace fv
|
||||
{
|
||||
defineTypeNameAndDebug(surfaceFilms, 0);
|
||||
|
||||
addToRunTimeSelectionTable(fvModel, surfaceFilms, dictionary);
|
||||
|
||||
// !!! Backwards compatible lookup name
|
||||
addNamedToRunTimeSelectionTable
|
||||
(
|
||||
fvModel,
|
||||
surfaceFilms,
|
||||
dictionary,
|
||||
surfaceFilm
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fv::surfaceFilms::surfaceFilms
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvModel(sourceName, modelType, mesh, dict),
|
||||
surfaceFilms_(),
|
||||
surfaceFilmPrimaryRhoNames_(),
|
||||
fieldNames_(),
|
||||
curTimeIndex_(-1)
|
||||
{
|
||||
const wordList surfaceFilmNames =
|
||||
dict.lookupOrDefault<wordList>
|
||||
(
|
||||
"surfaceFilms",
|
||||
wordList(1, surfaceFilm::typeName)
|
||||
);
|
||||
|
||||
surfaceFilms_.resize(surfaceFilmNames.size());
|
||||
surfaceFilmPrimaryRhoNames_.resize(surfaceFilmNames.size());
|
||||
|
||||
wordHashSet fieldNamesSet;
|
||||
|
||||
forAll(surfaceFilmNames, i)
|
||||
{
|
||||
surfaceFilms_.set
|
||||
(
|
||||
i,
|
||||
new thermoSurfaceFilm
|
||||
(
|
||||
thermoSurfaceFilm::typeName,
|
||||
mesh,
|
||||
mesh.lookupObject<uniformDimensionedVectorField>("g"),
|
||||
surfaceFilmNames[i]
|
||||
)
|
||||
);
|
||||
|
||||
const basicThermo& primaryThermo = surfaceFilms_[i].primaryThermo();
|
||||
|
||||
const word transportRhoName =
|
||||
IOobject::groupName("rho", surfaceFilms_[i].phaseName());
|
||||
|
||||
surfaceFilmPrimaryRhoNames_[i] =
|
||||
mesh.foundObject<volScalarField>(transportRhoName)
|
||||
? transportRhoName
|
||||
: primaryThermo.rho()().name();
|
||||
|
||||
fieldNamesSet.insert(surfaceFilmPrimaryRhoNames_[i]);
|
||||
fieldNamesSet.insert(surfaceFilms_[i].UPrimary().name());
|
||||
fieldNamesSet.insert(primaryThermo.he().name());
|
||||
|
||||
if (isA<basicSpecieMixture>(primaryThermo))
|
||||
{
|
||||
const basicSpecieMixture& mixture =
|
||||
refCast<const basicSpecieMixture>(primaryThermo);
|
||||
|
||||
forAll(mixture.Y(), Yi)
|
||||
{
|
||||
if (mixture.solve(Yi))
|
||||
{
|
||||
fieldNamesSet.insert(mixture.Y()[Yi].name());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fieldNames_ = fieldNamesSet.toc();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::fv::surfaceFilms::addSupFields() const
|
||||
{
|
||||
return fieldNames_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::fv::surfaceFilms::maxDeltaT() const
|
||||
{
|
||||
scalar result = vGreat;
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
result = min(result, surfaceFilms_[i].maxDeltaT());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::correct()
|
||||
{
|
||||
if (curTimeIndex_ == mesh().time().timeIndex())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
surfaceFilms_[i].evolve();
|
||||
}
|
||||
|
||||
curTimeIndex_ = mesh().time().timeIndex();
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::addSup
|
||||
(
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
if (eqn.psi().group() == surfaceFilms_[i].phaseName())
|
||||
{
|
||||
if (fieldName == surfaceFilmPrimaryRhoNames_[i])
|
||||
{
|
||||
eqn += surfaceFilms_[i].Srho();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Support for field " << fieldName
|
||||
<< " is not implemented" << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
const basicThermo& primaryThermo = surfaceFilms_[i].primaryThermo();
|
||||
|
||||
if (eqn.psi().group() == surfaceFilms_[i].phaseName())
|
||||
{
|
||||
if (fieldName == surfaceFilmPrimaryRhoNames_[i])
|
||||
{
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
eqn += surfaceFilms_[i].Srho();
|
||||
}
|
||||
}
|
||||
else if (fieldName == primaryThermo.he().name())
|
||||
{
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
eqn += surfaceFilms_[i].Sh();
|
||||
}
|
||||
}
|
||||
else if
|
||||
(
|
||||
isA<basicSpecieMixture>(primaryThermo)
|
||||
&& refCast<const basicSpecieMixture>(primaryThermo).contains
|
||||
(
|
||||
eqn.psi().name()
|
||||
)
|
||||
)
|
||||
{
|
||||
eqn += surfaceFilms_[i].SYi
|
||||
(
|
||||
refCast<const basicSpecieMixture>(primaryThermo).index
|
||||
(
|
||||
eqn.psi()
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Support for field " << fieldName
|
||||
<< " is not implemented" << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<vector>& eqn,
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< type() << ": applying source to " << eqn.psi().name() << endl;
|
||||
}
|
||||
|
||||
forAll(surfaceFilms_, i)
|
||||
{
|
||||
if (eqn.psi().group() == surfaceFilms_[i].phaseName())
|
||||
{
|
||||
if (fieldName == surfaceFilms_[i].UPrimary().name())
|
||||
{
|
||||
eqn += surfaceFilms_[i].SU();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Support for field " << fieldName
|
||||
<< " is not implemented" << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::topoChange(const polyTopoChangeMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::mapMesh(const polyMeshMap& map)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fv::surfaceFilms::distribute(const polyDistributionMap&)
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::fv::surfaceFilms::movePoints()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,182 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::fv::surfaceFilms
|
||||
|
||||
Description
|
||||
Surface films fvModel
|
||||
|
||||
Usage
|
||||
Example usage:
|
||||
\verbatim
|
||||
surfaceFilms
|
||||
{
|
||||
type surfaceFilms;
|
||||
libs ("libsurfaceFilmModels.so");
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
surfaceFilms.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef surfaceFilms_H
|
||||
#define surfaceFilms_H
|
||||
|
||||
#include "fvModel.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class surfaceFilms Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class surfaceFilms
|
||||
:
|
||||
public fvModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- The surface film models
|
||||
PtrList<thermoSurfaceFilm> surfaceFilms_;
|
||||
|
||||
//- For each surface film model, the corresponding density name in the
|
||||
// primary film
|
||||
wordList surfaceFilmPrimaryRhoNames_;
|
||||
|
||||
//- List of fields for which the fvModel adds source term
|
||||
// to the transport equation
|
||||
wordList fieldNames_;
|
||||
|
||||
//- Current time index (used for updating)
|
||||
mutable label curTimeIndex_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("surfaceFilms");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from explicit source name and mesh
|
||||
surfaceFilms
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
surfaceFilms
|
||||
(
|
||||
const surfaceFilms&
|
||||
) = delete;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Checks
|
||||
|
||||
//- Return the list of fields for which the option adds source term
|
||||
// to the transport equation
|
||||
virtual wordList addSupFields() const;
|
||||
|
||||
//- Return the maximum time-step for stable operation
|
||||
virtual scalar maxDeltaT() const;
|
||||
|
||||
|
||||
// Correct
|
||||
|
||||
//- Solve the Lagrangian surfaceFilms and update the sources
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// Add explicit and implicit contributions to compressible equation
|
||||
|
||||
//- Add source to continuity equation
|
||||
virtual void addSup
|
||||
(
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
//- Add source to pressure or enthalpy equation
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<scalar>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
//- Add source to momentum equation
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<vector>& eqn,
|
||||
const word& fieldName
|
||||
) const;
|
||||
|
||||
|
||||
// Mesh changes
|
||||
|
||||
//- Update topology using the given map
|
||||
virtual void topoChange(const polyTopoChangeMap&);
|
||||
|
||||
//- Update from another mesh using the given map
|
||||
virtual void mapMesh(const polyMeshMap&);
|
||||
|
||||
//- Redistribute or update using the given distribution map
|
||||
virtual void distribute(const polyDistributionMap&);
|
||||
|
||||
//- Update for mesh motion
|
||||
virtual bool movePoints();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const surfaceFilms&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,534 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::momentumSurfaceFilm
|
||||
|
||||
Description
|
||||
Kinematic form of single-cell layer surface film model
|
||||
|
||||
SourceFiles
|
||||
momentumSurfaceFilm.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef momentumSurfaceFilm_H
|
||||
#define momentumSurfaceFilm_H
|
||||
|
||||
#include "surfaceFilm.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "rhoThermo.H"
|
||||
#include "Function1.H"
|
||||
#include "ejectionModelList.H"
|
||||
#include "transferModelList.H"
|
||||
#include "forceList.H"
|
||||
#include "filmMomentumTransportModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward class declarations
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
class viscosityModel;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class momentumSurfaceFilm Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class momentumSurfaceFilm
|
||||
:
|
||||
public surfaceFilm
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
const word phaseName_;
|
||||
|
||||
// Solution parameters
|
||||
|
||||
pimpleControl pimple_;
|
||||
|
||||
//- Cumulative continuity error
|
||||
scalar cumulativeContErr_;
|
||||
|
||||
//- Small delta
|
||||
const dimensionedScalar deltaSmall_;
|
||||
|
||||
//- Optional maximum Courant number for stable film solution
|
||||
scalar maxCo_;
|
||||
|
||||
|
||||
// Thermo properties
|
||||
|
||||
//- Pressure [Pa]
|
||||
volScalarField p_;
|
||||
|
||||
//- Thermo package
|
||||
autoPtr<rhoThermo> thermo_;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
//- Dynamic viscosity [Pa.s]
|
||||
volScalarField mu_;
|
||||
|
||||
//- Film thickness [m]
|
||||
volScalarField delta_;
|
||||
|
||||
//- Film volume fraction in the cell layer []
|
||||
volScalarField alpha_;
|
||||
|
||||
//- Velocity - mean [m/s]
|
||||
volVectorField U_;
|
||||
|
||||
//- Velocity - wall [m/s]
|
||||
volVectorField::Internal Uw_;
|
||||
|
||||
//- Mass flux [kg m/s]
|
||||
surfaceScalarField phi_;
|
||||
|
||||
//- Film velocity flux [m^3/s]
|
||||
surfaceScalarField phiU_;
|
||||
|
||||
//- Current continuity error caused by delta_ bounding
|
||||
volScalarField::Internal continuityErr_;
|
||||
|
||||
//- Film coverage indicator, 1 = covered, 0 = uncovered []
|
||||
volScalarField coverage_;
|
||||
|
||||
|
||||
// Transfer fields
|
||||
|
||||
//- Film mass available for transfer to the primary film
|
||||
volScalarField primaryMassTrans_;
|
||||
|
||||
//- Film mass available for transfer to cloud
|
||||
volScalarField cloudMassTrans_;
|
||||
|
||||
//- Parcel diameters originating from film to cloud
|
||||
volScalarField cloudDiameterTrans_;
|
||||
|
||||
//- Film momentum transfer
|
||||
volVectorField primaryMomentumTrans_;
|
||||
|
||||
|
||||
// Source term fields
|
||||
|
||||
// Film film - registered to the film film mesh
|
||||
// Note: need boundary value mapped from primary film, and then
|
||||
// pushed into the patch internal field
|
||||
|
||||
//- Mass [kg/m^2/s]
|
||||
volScalarField::Internal rhoSp_;
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
volVectorField::Internal USp_;
|
||||
|
||||
//- Pressure [Pa]
|
||||
volScalarField::Internal pSp_;
|
||||
|
||||
|
||||
// Primary film - registered to the primary film mesh
|
||||
// Internal use only - not read-in
|
||||
|
||||
//- Primary film mass source [kg]
|
||||
volScalarField rhoSpPrimary_;
|
||||
|
||||
//- Primary film tangential momentum source [kg m/s]
|
||||
volVectorField USpPrimary_;
|
||||
|
||||
//- Primary film normal momentum source (pressure) [kg m/s]
|
||||
volScalarField pSpPrimary_;
|
||||
|
||||
|
||||
// Fields mapped from primary film - registered to the film film
|
||||
// Note: need both boundary AND patch internal fields to be mapped
|
||||
|
||||
//- Velocity [m/s]
|
||||
volVectorField UPrimary_;
|
||||
|
||||
//- Density [kg/m^3]
|
||||
volScalarField rhoPrimary_;
|
||||
|
||||
//- Viscosity [Pa.s]
|
||||
volScalarField muPrimary_;
|
||||
|
||||
|
||||
// Sub-models
|
||||
|
||||
//- Viscosity model
|
||||
autoPtr<surfaceFilmModels::viscosityModel> viscosity_;
|
||||
|
||||
//- Surface tension function
|
||||
autoPtr<Function1<scalar>> sigma_;
|
||||
|
||||
//- Available mass for transfer via sub-models
|
||||
scalarField availableMass_;
|
||||
|
||||
//- Cloud ejection
|
||||
surfaceFilmModels::ejectionModelList ejection_;
|
||||
|
||||
//- Transfer with the continuous phase
|
||||
surfaceFilmModels::transferModelList transfer_;
|
||||
|
||||
//- Momentum transport model
|
||||
autoPtr<surfaceFilmModels::momentumTransportModel>
|
||||
momentumTransport_;
|
||||
|
||||
//- List of film forces
|
||||
surfaceFilmModels::forceList forces_;
|
||||
|
||||
|
||||
// Checks
|
||||
|
||||
//- Cumulative mass added via sources [kg]
|
||||
scalar addedMassTotal_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Read control parameters from dictionary
|
||||
virtual bool read();
|
||||
|
||||
//- Reset source term fields
|
||||
virtual void resetPrimaryFilmSourceTerms();
|
||||
|
||||
//- Transfer thermo fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmThermoFields();
|
||||
|
||||
//- Transfer source fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmSourceFields();
|
||||
|
||||
//- Hydrostatic pressure coefficient
|
||||
tmp<surfaceScalarField> rhog() const;
|
||||
|
||||
//- Hydrostatic pressure coefficient gradient
|
||||
tmp<surfaceScalarField> gGradRho() const;
|
||||
|
||||
//- Capillary pressure
|
||||
tmp<volScalarField> pc();
|
||||
|
||||
//- Explicit pressure
|
||||
tmp<volScalarField> pe();
|
||||
|
||||
//- Correct film coverage field
|
||||
virtual void correctCoverage();
|
||||
|
||||
//- Update the film sub-models
|
||||
virtual void updateSubmodels();
|
||||
|
||||
// Update continuity error
|
||||
virtual void updateContinuityErr();
|
||||
|
||||
//- Continuity check
|
||||
virtual void continuityCheck();
|
||||
|
||||
//- Constrain a film film master/slave boundaries of a field to a
|
||||
// given value
|
||||
template<class Type>
|
||||
tmp<Type> constrainFilmField
|
||||
(
|
||||
const tmp<Type>& field,
|
||||
const typename Type::cmptType& value
|
||||
);
|
||||
|
||||
|
||||
// Equations
|
||||
|
||||
//- Predict delta_ from the continuity equation
|
||||
virtual void predictDelta();
|
||||
|
||||
//- Solve for film velocity
|
||||
virtual tmp<fvVectorMatrix> solveMomentum
|
||||
(
|
||||
const volScalarField& pc,
|
||||
const volScalarField& pe
|
||||
);
|
||||
|
||||
//- Solve for film volume fraction and thickness
|
||||
virtual void solveAlpha
|
||||
(
|
||||
const fvVectorMatrix& UEqn,
|
||||
const volScalarField& pc,
|
||||
const volScalarField& pe
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("momentumSurfaceFilm");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
momentumSurfaceFilm
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& filmType,
|
||||
const bool readFields = true
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
momentumSurfaceFilm(const momentumSurfaceFilm&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~momentumSurfaceFilm();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Solution parameters
|
||||
|
||||
//- Courant number
|
||||
virtual scalar CourantNumber() const;
|
||||
|
||||
//- Return the maximum time-step for stable operation
|
||||
// based on the Courant number
|
||||
virtual scalar maxDeltaT() const;
|
||||
|
||||
//- Return small delta
|
||||
inline const dimensionedScalar& deltaSmall() const;
|
||||
|
||||
|
||||
// Thermo properties
|
||||
|
||||
//- Return the name of the phase deposited to form the film
|
||||
inline const word& phaseName() const;
|
||||
|
||||
//- Return the film density [kg/m^3]
|
||||
inline const volScalarField& rho() const;
|
||||
|
||||
//- Return const access to the dynamic viscosity [Pa.s]
|
||||
inline const volScalarField& mu() const;
|
||||
|
||||
//- Return the surface tension coefficient [kg/s^2]
|
||||
tmp<volScalarField> sigma() const;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
//- Return const access to the film thickness [m]
|
||||
inline const volScalarField& delta() const;
|
||||
|
||||
//- Return const access to the film volume fraction []
|
||||
inline const volScalarField& alpha() const;
|
||||
|
||||
//- Return the film velocity [m/s]
|
||||
inline const volVectorField& U() const;
|
||||
|
||||
//- Return the film flux [kg m/s]
|
||||
inline const surfaceScalarField& phi() const;
|
||||
|
||||
//- Return the film velocity flux [m^3/s]
|
||||
inline const surfaceScalarField& phiU() const;
|
||||
|
||||
//- Return the current continuity error
|
||||
inline const volScalarField::Internal& continuityErr() const;
|
||||
|
||||
//- Return the film coverage, 1 = covered, 0 = uncovered []
|
||||
inline const volScalarField& coverage() const;
|
||||
|
||||
|
||||
// Derived Fields
|
||||
|
||||
//- Return the film surface velocity [m/s]
|
||||
inline tmp<volVectorField::Internal> Us() const;
|
||||
|
||||
//- Return the film wall velocity [m/s]
|
||||
tmp<volVectorField::Internal> Uw() const;
|
||||
|
||||
|
||||
// Transfer fields - to the primary film
|
||||
|
||||
//- Return mass transfer source - Eulerian phase only
|
||||
virtual tmp<volScalarField> primaryMassTrans() 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;
|
||||
|
||||
//- Return momentum transfer source - Eulerian phase only
|
||||
virtual tmp<volVectorField> primaryMomentumTrans() const;
|
||||
|
||||
|
||||
// External helper functions
|
||||
|
||||
//- External hook to add sources to the film
|
||||
virtual void addSources
|
||||
(
|
||||
const label patchi, // patchi on primary film
|
||||
const label facei, // facei of patchi
|
||||
const scalar massSource, // [kg]
|
||||
const vector& momentumSource, // [kg m/s] (tang'l momentum)
|
||||
const scalar pressureSource, // [kg m/s] (normal momentum)
|
||||
const scalar energySource = 0 // [J]
|
||||
);
|
||||
|
||||
|
||||
// Source fields (read/write access)
|
||||
|
||||
// Primary film
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
inline volVectorField& USpPrimary();
|
||||
|
||||
//- Pressure [Pa]
|
||||
inline volScalarField& pSpPrimary();
|
||||
|
||||
//- Mass [kg/m^2/s]
|
||||
inline volScalarField& rhoSpPrimary();
|
||||
|
||||
|
||||
// Film film
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
inline volVectorField::Internal& USp();
|
||||
|
||||
//- Pressure [Pa]
|
||||
inline volScalarField::Internal& pSp();
|
||||
|
||||
//- Mass [kg/m^2/s]
|
||||
inline volScalarField::Internal& rhoSp();
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
inline const volVectorField::Internal& USp() const;
|
||||
|
||||
//- Pressure [Pa]
|
||||
inline const volScalarField::Internal& pSp() const;
|
||||
|
||||
//- Mass [kg/m^2/s]
|
||||
inline const volScalarField::Internal& rhoSp() const;
|
||||
|
||||
|
||||
// Fields mapped from primary film
|
||||
|
||||
//- Velocity [m/s]
|
||||
inline const volVectorField& UPrimary() const;
|
||||
|
||||
//- Pressure [Pa]
|
||||
inline const volScalarField& pPrimary() const;
|
||||
|
||||
//- Density [kg/m^3]
|
||||
inline const volScalarField& rhoPrimary() const;
|
||||
|
||||
//- Viscosity [Pa.s]
|
||||
inline const volScalarField& muPrimary() const;
|
||||
|
||||
|
||||
// Sub-models
|
||||
|
||||
//- Film thermo
|
||||
inline const rhoThermo& thermo() const;
|
||||
|
||||
//- Ejection
|
||||
inline surfaceFilmModels::ejectionModelList& ejection();
|
||||
|
||||
//- Transfer
|
||||
inline surfaceFilmModels::transferModelList& transfer();
|
||||
|
||||
//- Momentum transport
|
||||
inline const surfaceFilmModels::momentumTransportModel&
|
||||
momentumTransport() const;
|
||||
|
||||
|
||||
// Helper functions
|
||||
|
||||
//- Return the current film mass
|
||||
inline tmp<volScalarField::Internal> mass() const;
|
||||
|
||||
//- Return the change in film mass due to sources/sinks
|
||||
inline tmp<volScalarField::Internal> deltaMass() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve film hook
|
||||
virtual void preEvolveFilm();
|
||||
|
||||
//- Evolve the film equations
|
||||
virtual void evolveFilm();
|
||||
|
||||
|
||||
// Primary film source fields
|
||||
|
||||
//- Return total mass source - Eulerian phase only
|
||||
virtual tmp<volScalarField::Internal> Srho() const;
|
||||
|
||||
//- Return mass source for specie i - Eulerian phase only
|
||||
virtual tmp<volScalarField::Internal> SYi
|
||||
(
|
||||
const label i
|
||||
) const;
|
||||
|
||||
//- Return momentum source - Eulerian phase only
|
||||
virtual tmp<volVectorField::Internal> SU() const;
|
||||
|
||||
//- Return enthalpy source - Eulerian phase only
|
||||
virtual tmp<volScalarField::Internal> Sh() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Provide some feedback
|
||||
virtual void info();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const momentumSurfaceFilm&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "momentumSurfaceFilmTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "momentumSurfaceFilmI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,249 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcSurfaceIntegrate.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::dimensionedScalar&
|
||||
Foam::momentumSurfaceFilm::deltaSmall() const
|
||||
{
|
||||
return deltaSmall_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word&
|
||||
Foam::momentumSurfaceFilm::phaseName() const
|
||||
{
|
||||
return phaseName_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::rho() const
|
||||
{
|
||||
return thermo_->rho();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::mu() const
|
||||
{
|
||||
return mu_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::delta() const
|
||||
{
|
||||
return delta_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::alpha() const
|
||||
{
|
||||
return alpha_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volVectorField&
|
||||
Foam::momentumSurfaceFilm::U() const
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tmp<Foam::volVectorField::Internal>
|
||||
Foam::momentumSurfaceFilm::Us() const
|
||||
{
|
||||
return momentumTransport_->Us();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::surfaceScalarField&
|
||||
Foam::momentumSurfaceFilm::phi() const
|
||||
{
|
||||
return phi_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::surfaceScalarField&
|
||||
Foam::momentumSurfaceFilm::phiU() const
|
||||
{
|
||||
return phiU_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField::Internal&
|
||||
Foam::momentumSurfaceFilm::continuityErr() const
|
||||
{
|
||||
return continuityErr_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::coverage() const
|
||||
{
|
||||
return coverage_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volVectorField&
|
||||
Foam::momentumSurfaceFilm::USpPrimary()
|
||||
{
|
||||
return USpPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::pSpPrimary()
|
||||
{
|
||||
return pSpPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::rhoSpPrimary()
|
||||
{
|
||||
return rhoSpPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volVectorField::Internal&
|
||||
Foam::momentumSurfaceFilm::USp()
|
||||
{
|
||||
return USp_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volScalarField::Internal&
|
||||
Foam::momentumSurfaceFilm::pSp()
|
||||
{
|
||||
return pSp_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::volScalarField::Internal&
|
||||
Foam::momentumSurfaceFilm::rhoSp()
|
||||
{
|
||||
return rhoSp_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volVectorField::Internal&
|
||||
Foam::momentumSurfaceFilm::USp() const
|
||||
{
|
||||
return USp_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField::Internal&
|
||||
Foam::momentumSurfaceFilm::pSp() const
|
||||
{
|
||||
return pSp_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField::Internal&
|
||||
Foam::momentumSurfaceFilm::rhoSp() const
|
||||
{
|
||||
return rhoSp_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volVectorField&
|
||||
Foam::momentumSurfaceFilm::UPrimary() const
|
||||
{
|
||||
return UPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::pPrimary() const
|
||||
{
|
||||
return thermo_->p();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::rhoPrimary() const
|
||||
{
|
||||
return rhoPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::volScalarField&
|
||||
Foam::momentumSurfaceFilm::muPrimary() const
|
||||
{
|
||||
return muPrimary_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::rhoThermo&
|
||||
Foam::momentumSurfaceFilm::thermo() const
|
||||
{
|
||||
return thermo_();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::surfaceFilmModels::ejectionModelList&
|
||||
Foam::momentumSurfaceFilm::ejection()
|
||||
{
|
||||
return ejection_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::surfaceFilmModels::transferModelList&
|
||||
Foam::momentumSurfaceFilm::transfer()
|
||||
{
|
||||
return transfer_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::surfaceFilmModels::momentumTransportModel&
|
||||
Foam::momentumSurfaceFilm::momentumTransport() const
|
||||
{
|
||||
return momentumTransport_();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tmp<Foam::volScalarField::Internal>
|
||||
Foam::momentumSurfaceFilm::mass() const
|
||||
{
|
||||
return rho()()*delta_()*magSf();
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tmp<Foam::volScalarField::Internal>
|
||||
Foam::momentumSurfaceFilm::deltaMass() const
|
||||
{
|
||||
return rhoSp_*magSf()*time().deltaT();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "momentumSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Type> Foam::momentumSurfaceFilm::constrainFilmField
|
||||
(
|
||||
const tmp<Type>& tfield,
|
||||
const typename Type::cmptType& value
|
||||
)
|
||||
{
|
||||
tmp<Type> tresult(tfield);
|
||||
Type& result = tresult.ref();
|
||||
|
||||
typename Type::Boundary& fieldBf = result.boundaryFieldRef();
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchi = intCoupledPatchIDs_[i];
|
||||
fieldBf[patchi] = value;
|
||||
|
||||
DebugInFunction
|
||||
<< "Constraining " << tfield().name()
|
||||
<< " boundary " << tfield().boundaryField()[patchi].patch().name()
|
||||
<< " to " << value << endl;
|
||||
}
|
||||
|
||||
forAll(passivePatchIDs(), i)
|
||||
{
|
||||
const label patchi = passivePatchIDs()[i];
|
||||
fieldBf[patchi] = value;
|
||||
DebugInFunction
|
||||
<< "Constraining " << tfield().name()
|
||||
<< " boundary " << tfield().boundaryField()[patchi].patch().name()
|
||||
<< " to " << value << endl;
|
||||
}
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,105 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
filmSubModelBase::filmSubModelBase(surfaceFilm& film)
|
||||
:
|
||||
subModelBase(film.outputProperties()),
|
||||
filmModel_(film)
|
||||
{}
|
||||
|
||||
|
||||
filmSubModelBase::filmSubModelBase
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& modelType,
|
||||
const word& dictExt
|
||||
)
|
||||
:
|
||||
subModelBase
|
||||
(
|
||||
film.outputProperties(),
|
||||
dict,
|
||||
baseName,
|
||||
modelType,
|
||||
dictExt
|
||||
),
|
||||
filmModel_(film)
|
||||
{}
|
||||
|
||||
|
||||
filmSubModelBase::filmSubModelBase
|
||||
(
|
||||
const word& modelName,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& modelType
|
||||
)
|
||||
:
|
||||
subModelBase
|
||||
(
|
||||
modelName,
|
||||
film.outputProperties(),
|
||||
dict,
|
||||
baseName,
|
||||
modelType
|
||||
),
|
||||
filmModel_(film)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
filmSubModelBase::~filmSubModelBase()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool filmSubModelBase::writeTime() const
|
||||
{
|
||||
return filmModel_.time().writeTime();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,134 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::filmSubModelBase
|
||||
|
||||
Description
|
||||
Base class for surface film sub-models
|
||||
|
||||
SourceFiles
|
||||
filmSubModelBaseI.H
|
||||
filmSubModelBase.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef filmSubModelBase_H
|
||||
#define filmSubModelBase_H
|
||||
|
||||
#include "surfaceFilm.H"
|
||||
#include "subModelBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class filmSubModelBase Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class filmSubModelBase
|
||||
:
|
||||
public subModelBase
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to the film surface film model
|
||||
surfaceFilm& filmModel_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
filmSubModelBase(surfaceFilm& film);
|
||||
|
||||
//- Construct from film film without name
|
||||
filmSubModelBase
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& modelType,
|
||||
const word& dictExt = "Coeffs"
|
||||
);
|
||||
|
||||
//- Construct from film film with name
|
||||
filmSubModelBase
|
||||
(
|
||||
const word& modelName,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& baseName,
|
||||
const word& modelType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~filmSubModelBase();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Flag to indicate when to write a property
|
||||
virtual bool writeTime() const;
|
||||
|
||||
//- Return const access to the film surface film model
|
||||
inline const surfaceFilm& film() const;
|
||||
|
||||
//- Return the reference to the film surface film model
|
||||
inline surfaceFilm& film();
|
||||
|
||||
template<class FilmType>
|
||||
inline const FilmType& filmType() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "filmSubModelBaseI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "filmSubModelBaseTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,52 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const surfaceFilm& filmSubModelBase::film() const
|
||||
{
|
||||
return filmModel_;
|
||||
}
|
||||
|
||||
|
||||
inline surfaceFilm& filmSubModelBase::film()
|
||||
{
|
||||
return filmModel_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,53 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class FilmType>
|
||||
const FilmType& filmSubModelBase::filmType() const
|
||||
{
|
||||
if (!isA<FilmType>(filmModel_))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Model " << this->modelType() << " requested film type "
|
||||
<< FilmType::typeName << " but film is type " << filmModel_.type()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return refCast<const FilmType>(filmModel_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,143 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "BrunDrippingEjection.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(BrunDrippingEjection, 0);
|
||||
addToRunTimeSelectionTable(ejectionModel, BrunDrippingEjection, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
BrunDrippingEjection::BrunDrippingEjection
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
ejectionModel(type(), film, dict),
|
||||
ubarStar_(coeffDict_.lookupOrDefault("ubarStar", 1.62208)),
|
||||
dCoeff_(coeffDict_.lookupOrDefault("dCoeff", 3.3)),
|
||||
deltaStable_(coeffDict_.lookupOrDefault("deltaStable", scalar(0))),
|
||||
diameter_(film.mesh().nCells(), -1.0)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
BrunDrippingEjection::~BrunDrippingEjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void BrunDrippingEjection::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
)
|
||||
{
|
||||
const momentumSurfaceFilm& film =
|
||||
refCast<const momentumSurfaceFilm>(this->film());
|
||||
|
||||
// Calculate available dripping mass
|
||||
tmp<volScalarField> tsinAlpha((film.g()/mag(film.g())) & film.nHat());
|
||||
const scalarField& sinAlpha = tsinAlpha();
|
||||
const scalarField& magSf = film.magSf();
|
||||
|
||||
const scalarField& delta = film.delta();
|
||||
const scalarField& rho = film.rho();
|
||||
|
||||
const tmp<volScalarField> tsigma = film.sigma();
|
||||
const volScalarField::Internal& sigma = tsigma();
|
||||
|
||||
const scalar magg = mag(film.g().value());
|
||||
|
||||
forAll(delta, celli)
|
||||
{
|
||||
bool dripping = false;
|
||||
|
||||
if (sinAlpha[celli] > small && delta[celli] > deltaStable_)
|
||||
{
|
||||
const scalar rhoc = rho[celli];
|
||||
const scalar lc = sqrt(sigma[celli]/(rhoc*magg));
|
||||
const scalar deltaStable = max
|
||||
(
|
||||
3*lc*sqrt(1 - sqr(sinAlpha[celli]))
|
||||
/(ubarStar_*sqrt(sinAlpha[celli])*sinAlpha[celli]),
|
||||
deltaStable_
|
||||
);
|
||||
|
||||
if (delta[celli] > deltaStable)
|
||||
{
|
||||
const scalar ddelta = max(delta[celli] - deltaStable, 0);
|
||||
|
||||
const scalar massDrip =
|
||||
min(availableMass[celli], max(ddelta*rhoc*magSf[celli], 0));
|
||||
|
||||
if (massDrip > 0)
|
||||
{
|
||||
const scalar diam = dCoeff_*lc;
|
||||
diameter_[celli] = diam;
|
||||
|
||||
massToEject[celli] += massDrip;
|
||||
availableMass[celli] -= massDrip;
|
||||
|
||||
diameterToEject[celli] = diam;
|
||||
addToEjectedMass(massDrip);
|
||||
|
||||
dripping = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dripping)
|
||||
{
|
||||
diameterToEject[celli] = 0;
|
||||
massToEject[celli] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
ejectionModel::correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,149 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::BrunDrippingEjection
|
||||
|
||||
Description
|
||||
Film Dripping mass transfer model.
|
||||
|
||||
If the film thickness exceeds the critical value needed to generate one or
|
||||
more drops, the equivalent mass is removed from the film. The critical film
|
||||
thickness is calculated from the Rayleigh-Taylor stability analysis of film
|
||||
flow on an inclined plane by Brun et.al.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Brun, P. T., Damiano, A., Rieu, P., Balestra, G., & Gallaire, F. (2015).
|
||||
Rayleigh-Taylor instability under an inclined plane.
|
||||
Physics of Fluids (1994-present), 27(8), 084107.
|
||||
\endverbatim
|
||||
|
||||
The diameter of the drops formed are obtained from the local capillary
|
||||
length multiplied by the \c dCoeff coefficient which defaults to 3.3.
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Lefebvre, A. (1988).
|
||||
Atomisation and sprays
|
||||
(Vol. 1040, No. 2756). CRC press.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
BrunDrippingEjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef BrunDrippingEjection_H
|
||||
#define BrunDrippingEjection_H
|
||||
|
||||
#include "ejectionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class BrunDrippingEjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class BrunDrippingEjection
|
||||
:
|
||||
public ejectionModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Critical non-dimensional interface velocity
|
||||
// Coefficient in the film angle stability function.
|
||||
// Defaults to 1.62208
|
||||
scalar ubarStar_;
|
||||
|
||||
//- Coefficient relating the diameter of the drops formed to
|
||||
// the capillary length.
|
||||
// Defaults to 3.3
|
||||
scalar dCoeff_;
|
||||
|
||||
//- Stable film thickness - drips only formed if thickness
|
||||
// exceeds this threshold value
|
||||
scalar deltaStable_;
|
||||
|
||||
//- Diameters of particles to eject into the dripping
|
||||
scalarList diameter_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("BrunDrippingEjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
BrunDrippingEjection
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
BrunDrippingEjection(const BrunDrippingEjection&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~BrunDrippingEjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const BrunDrippingEjection&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,325 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "curvatureSeparation.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(curvatureSeparation, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
ejectionModel,
|
||||
curvatureSeparation,
|
||||
dictionary
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField> curvatureSeparation::calcInvR1
|
||||
(
|
||||
const volVectorField& U
|
||||
) const
|
||||
{
|
||||
const dimensionedScalar smallU("smallU", dimVelocity, rootVSmall);
|
||||
const volVectorField UHat(U/(mag(U) + smallU));
|
||||
|
||||
tmp<volScalarField> tinvR1
|
||||
(
|
||||
volScalarField::New("invR1", UHat & (UHat & gradNHat_))
|
||||
);
|
||||
|
||||
scalarField& invR1 = tinvR1.ref().primitiveFieldRef();
|
||||
|
||||
// Apply defined patch radii
|
||||
const scalar rMin = 1e-6;
|
||||
const fvMesh& mesh = film().mesh();
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
forAll(definedPatchRadii_, i)
|
||||
{
|
||||
const label patchi = definedPatchRadii_[i].first();
|
||||
const scalar definedInvR1 =
|
||||
1.0/max(rMin, definedPatchRadii_[i].second());
|
||||
UIndirectList<scalar>(invR1, pbm[patchi].faceCells()) = definedInvR1;
|
||||
}
|
||||
|
||||
// Filter out large radii
|
||||
const scalar rMax = 1e6;
|
||||
forAll(invR1, i)
|
||||
{
|
||||
if (mag(invR1[i]) < 1/rMax)
|
||||
{
|
||||
invR1[i] = -1.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug && mesh.time().writeTime())
|
||||
{
|
||||
tinvR1().write();
|
||||
}
|
||||
|
||||
return tinvR1;
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField> curvatureSeparation::calcCosAngle
|
||||
(
|
||||
const surfaceScalarField& phi
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = film().mesh();
|
||||
const vectorField nf(mesh.Sf()/mesh.magSf());
|
||||
const labelUList& own = mesh.owner();
|
||||
const labelUList& nbr = mesh.neighbour();
|
||||
|
||||
scalarField phiMax(mesh.nCells(), -great);
|
||||
scalarField cosAngle(mesh.nCells(), 0);
|
||||
|
||||
forAll(nbr, facei)
|
||||
{
|
||||
const label cellO = own[facei];
|
||||
const label cellN = nbr[facei];
|
||||
|
||||
if (phi[facei] > phiMax[cellO])
|
||||
{
|
||||
phiMax[cellO] = phi[facei];
|
||||
cosAngle[cellO] = -gHat_ & nf[facei];
|
||||
}
|
||||
if (-phi[facei] > phiMax[cellN])
|
||||
{
|
||||
phiMax[cellN] = -phi[facei];
|
||||
cosAngle[cellN] = -gHat_ & -nf[facei];
|
||||
}
|
||||
}
|
||||
|
||||
forAll(phi.boundaryField(), patchi)
|
||||
{
|
||||
const fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
||||
const fvPatch& pp = phip.patch();
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
const vectorField nf(pp.nf());
|
||||
forAll(phip, i)
|
||||
{
|
||||
const label celli = faceCells[i];
|
||||
if (phip[i] > phiMax[celli])
|
||||
{
|
||||
phiMax[celli] = phip[i];
|
||||
cosAngle[celli] = -gHat_ & nf[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug && mesh.time().writeTime())
|
||||
{
|
||||
volScalarField volCosAngle
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"cosAngle",
|
||||
mesh.time().name(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
volCosAngle.primitiveFieldRef() = cosAngle;
|
||||
volCosAngle.correctBoundaryConditions();
|
||||
volCosAngle.write();
|
||||
}
|
||||
|
||||
return max(min(cosAngle, scalar(1)), scalar(-1));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
curvatureSeparation::curvatureSeparation
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
ejectionModel(type(), film, dict),
|
||||
gradNHat_(fvc::grad(film.nHat())),
|
||||
deltaByR1Min_
|
||||
(
|
||||
coeffDict_.lookupOrDefault<scalar>("deltaByR1Min", scalar(0))
|
||||
),
|
||||
deltaStable_(coeffDict_.lookupOrDefault("deltaStable", scalar(0))),
|
||||
definedPatchRadii_(),
|
||||
magG_(mag(film.g().value())),
|
||||
gHat_(Zero)
|
||||
{
|
||||
if (magG_ < rootVSmall)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Acceleration due to gravity must be non-zero"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
gHat_ = film.g().value()/magG_;
|
||||
|
||||
const List<Tuple2<word, scalar>> prIn
|
||||
(
|
||||
coeffDict_.lookup("definedPatchRadii")
|
||||
);
|
||||
const wordList& allPatchNames = film.mesh().boundaryMesh().names();
|
||||
|
||||
DynamicList<Tuple2<label, scalar>> prData(allPatchNames.size());
|
||||
|
||||
labelHashSet uniquePatchIDs;
|
||||
|
||||
forAllReverse(prIn, i)
|
||||
{
|
||||
labelList patchIDs = findStrings(prIn[i].first(), allPatchNames);
|
||||
forAll(patchIDs, j)
|
||||
{
|
||||
const label patchi = patchIDs[j];
|
||||
|
||||
if (!uniquePatchIDs.found(patchi))
|
||||
{
|
||||
const scalar radius = prIn[i].second();
|
||||
prData.append(Tuple2<label, scalar>(patchi, radius));
|
||||
|
||||
uniquePatchIDs.insert(patchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
definedPatchRadii_.transfer(prData);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
curvatureSeparation::~curvatureSeparation()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void curvatureSeparation::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
)
|
||||
{
|
||||
const momentumSurfaceFilm& film =
|
||||
refCast<const momentumSurfaceFilm>(this->film());
|
||||
const fvMesh& mesh = film.mesh();
|
||||
|
||||
const volScalarField& delta = film.delta();
|
||||
const volVectorField& U = film.U();
|
||||
const surfaceScalarField& phi = film.phi();
|
||||
const volScalarField& rho = film.rho();
|
||||
const scalarField magSqrU(magSqr(film.U()));
|
||||
|
||||
const tmp<volScalarField> tsigma = film.sigma();
|
||||
const volScalarField::Internal& sigma = tsigma();
|
||||
|
||||
const scalarField invR1(calcInvR1(U));
|
||||
const scalarField cosAngle(calcCosAngle(phi));
|
||||
|
||||
// Calculate force balance
|
||||
const scalar Fthreshold = 1e-10;
|
||||
scalarField Fnet(mesh.nCells(), 0);
|
||||
scalarField separated(mesh.nCells(), 0);
|
||||
|
||||
forAll(invR1, i)
|
||||
{
|
||||
if ((invR1[i] > 0) && (delta[i]*invR1[i] > deltaByR1Min_))
|
||||
{
|
||||
const scalar R1 = 1.0/(invR1[i] + rootVSmall);
|
||||
const scalar R2 = R1 + delta[i];
|
||||
|
||||
// Inertial force
|
||||
const scalar Fi = -delta[i]*rho[i]*magSqrU[i]*72.0/60.0*invR1[i];
|
||||
|
||||
// Body force
|
||||
const scalar Fb =
|
||||
- 0.5*rho[i]*magG_*invR1[i]*(sqr(R1) - sqr(R2))*cosAngle[i];
|
||||
|
||||
// Surface force
|
||||
const scalar Fs = sigma[i]/R2;
|
||||
|
||||
Fnet[i] = Fi + Fb + Fs;
|
||||
|
||||
if (Fnet[i] + Fthreshold < 0 && delta[i] > deltaStable_)
|
||||
{
|
||||
separated[i] = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Eject all available mass
|
||||
massToEject = separated*availableMass;
|
||||
diameterToEject = separated*delta;
|
||||
availableMass -= separated*availableMass;
|
||||
|
||||
addToEjectedMass(sum(separated*availableMass));
|
||||
|
||||
if (debug && mesh.time().writeTime())
|
||||
{
|
||||
volScalarField volFnet
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Fnet",
|
||||
mesh.time().name(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimForce, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
volFnet.primitiveFieldRef() = Fnet;
|
||||
volFnet.correctBoundaryConditions();
|
||||
volFnet.write();
|
||||
}
|
||||
|
||||
ejectionModel::correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,156 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::curvatureSeparation
|
||||
|
||||
Description
|
||||
Curvature film separation model
|
||||
|
||||
Assesses film curvature via the mesh geometry and calculates a force
|
||||
balance of the form:
|
||||
|
||||
F_sum = F_inertial + F_body + F_surface
|
||||
|
||||
If F_sum < 0, the film separates. Similarly, if F_sum > 0 the film will
|
||||
remain attached.
|
||||
|
||||
Based on description given by
|
||||
Owen and D. J. Ryley. The flow of thin liquid films around corners.
|
||||
International Journal of Multiphase Flow, 11(1):51-62, 1985.
|
||||
|
||||
|
||||
SourceFiles
|
||||
curvatureSeparation.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef curvatureSeparation_H
|
||||
#define curvatureSeparation_H
|
||||
|
||||
#include "ejectionModel.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class curvatureSeparation Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class curvatureSeparation
|
||||
:
|
||||
public ejectionModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Gradient of surface normals
|
||||
volTensorField gradNHat_;
|
||||
|
||||
//- Minimum gravity driven film thickness (non-dimensionalised delta/R1)
|
||||
scalar deltaByR1Min_;
|
||||
|
||||
//- Stable film thickness - drips only formed if thickness
|
||||
// exceeds this threshold value
|
||||
scalar deltaStable_;
|
||||
|
||||
//- List of radii for patches - if patch not defined, radius
|
||||
// calculated based on mesh geometry
|
||||
List<Tuple2<label, scalar>> definedPatchRadii_;
|
||||
|
||||
//- Magnitude of gravity vector
|
||||
scalar magG_;
|
||||
|
||||
//- Direction of gravity vector
|
||||
vector gHat_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate local (inverse) radius of curvature
|
||||
tmp<volScalarField> calcInvR1(const volVectorField& U) const;
|
||||
|
||||
//- Calculate the cosine of the angle between gravity vector and
|
||||
// cell out flow direction
|
||||
tmp<scalarField> calcCosAngle(const surfaceScalarField& phi) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("curvatureSeparation");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
curvatureSeparation
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
curvatureSeparation(const curvatureSeparation&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~curvatureSeparation();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const curvatureSeparation&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,164 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "drippingEjection.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "Random.H"
|
||||
#include "volFields.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(drippingEjection, 0);
|
||||
addToRunTimeSelectionTable(ejectionModel, drippingEjection, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
drippingEjection::drippingEjection
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
ejectionModel(type(), film, dict),
|
||||
deltaStable_(coeffDict_.lookup<scalar>("deltaStable")),
|
||||
particlesPerParcel_(coeffDict_.lookup<scalar>("particlesPerParcel")),
|
||||
rndGen_(label(0)),
|
||||
parcelDistribution_
|
||||
(
|
||||
distribution::New
|
||||
(
|
||||
coeffDict_.subDict("parcelDistribution"),
|
||||
rndGen_,
|
||||
0
|
||||
)
|
||||
),
|
||||
diameter_(film.mesh().nCells(), -1.0)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
drippingEjection::~drippingEjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void drippingEjection::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
)
|
||||
{
|
||||
const momentumSurfaceFilm& film =
|
||||
refCast<const momentumSurfaceFilm>(this->film());
|
||||
|
||||
const scalar pi = constant::mathematical::pi;
|
||||
|
||||
// calculate available dripping mass
|
||||
const scalarField gNorm(film.g() & film.nHat()());
|
||||
const scalarField& magSf = film.magSf();
|
||||
|
||||
const scalarField& delta = film.delta();
|
||||
const scalarField& rho = film.rho();
|
||||
|
||||
scalarField massDrip(film.mesh().nCells(), 0.0);
|
||||
|
||||
forAll(gNorm, i)
|
||||
{
|
||||
if (gNorm[i] > small)
|
||||
{
|
||||
const scalar ddelta = max(0.0, delta[i] - deltaStable_);
|
||||
massDrip[i] +=
|
||||
min(availableMass[i], max(0.0, ddelta*rho[i]*magSf[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Collect the data to be transferred
|
||||
forAll(massDrip, celli)
|
||||
{
|
||||
if (massDrip[celli] > 0)
|
||||
{
|
||||
// set new particle diameter if not already set
|
||||
if (diameter_[celli] < 0)
|
||||
{
|
||||
diameter_[celli] = parcelDistribution_->sample();
|
||||
}
|
||||
|
||||
scalar& diam = diameter_[celli];
|
||||
scalar rhoc = rho[celli];
|
||||
scalar minMass = particlesPerParcel_*rhoc*pi/6*pow3(diam);
|
||||
|
||||
if (massDrip[celli] > minMass)
|
||||
{
|
||||
// All drip mass can be ejected
|
||||
massToEject[celli] += massDrip[celli];
|
||||
availableMass[celli] -= massDrip[celli];
|
||||
|
||||
// Set particle diameter
|
||||
diameterToEject[celli] = diam;
|
||||
|
||||
// Retrieve new particle diameter sample
|
||||
diam = parcelDistribution_->sample();
|
||||
|
||||
addToEjectedMass(massDrip[celli]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Particle mass below minimum threshold - cannot be ejected
|
||||
massToEject[celli] = 0.0;
|
||||
diameterToEject[celli] = 0.0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
massToEject[celli] = 0.0;
|
||||
diameterToEject[celli] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
ejectionModel::correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,135 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::drippingEjection
|
||||
|
||||
Description
|
||||
Film Dripping mass transfer model.
|
||||
|
||||
If the film mass exceeds that needed to generate a valid parcel, the
|
||||
equivalent mass is removed from the film.
|
||||
|
||||
New parcel diameters are sampled from a PDF.
|
||||
|
||||
SourceFiles
|
||||
drippingEjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef drippingEjection_H
|
||||
#define drippingEjection_H
|
||||
|
||||
#include "ejectionModel.H"
|
||||
#include "distribution.H"
|
||||
#include "Random.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class drippingEjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class drippingEjection
|
||||
:
|
||||
public ejectionModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Stable film thickness - drips only formed if thickness
|
||||
// exceeds this threshold value
|
||||
scalar deltaStable_;
|
||||
|
||||
//- Number of particles per parcel
|
||||
scalar particlesPerParcel_;
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<distribution> parcelDistribution_;
|
||||
|
||||
//- Diameters of particles to eject into the dripping
|
||||
scalarList diameter_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("drippingEjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
drippingEjection
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
drippingEjection(const drippingEjection&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~drippingEjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const drippingEjection&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,101 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ejectionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(ejectionModel, 0);
|
||||
defineRunTimeSelectionTable(ejectionModel, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void ejectionModel::addToEjectedMass(const scalar dMass)
|
||||
{
|
||||
ejectedMass_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
ejectionModel::ejectionModel(surfaceFilm& film)
|
||||
:
|
||||
filmSubModelBase(film),
|
||||
ejectedMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
ejectionModel::ejectionModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film, dict, typeName, modelType),
|
||||
ejectedMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
ejectionModel::~ejectionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void ejectionModel::correct()
|
||||
{
|
||||
if (writeTime())
|
||||
{
|
||||
scalar ejectedMass0 = getModelProperty<scalar>("ejectedMass");
|
||||
ejectedMass0 += returnReduce(ejectedMass_, sumOp<scalar>());
|
||||
setModelProperty<scalar>("ejectedMass", ejectedMass0);
|
||||
ejectedMass_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scalar ejectionModel::ejectedMassTotal() const
|
||||
{
|
||||
scalar ejectedMass0 = getModelProperty<scalar>("ejectedMass");
|
||||
return ejectedMass0 + returnReduce(ejectedMass_, sumOp<scalar>());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,164 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::ejectionModel
|
||||
|
||||
Description
|
||||
Base class for film ejection models, handling mass transfer from the
|
||||
film.
|
||||
|
||||
SourceFiles
|
||||
ejectionModel.C
|
||||
ejectionModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ejectionModel_H
|
||||
#define ejectionModel_H
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "scalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ejectionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ejectionModel
|
||||
:
|
||||
public filmSubModelBase
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Ejected mass
|
||||
scalar ejectedMass_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Add to ejected mass
|
||||
void addToEjectedMass(const scalar dMass);
|
||||
|
||||
//- Correct
|
||||
void correct();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("ejectionModel");
|
||||
|
||||
|
||||
// Declare runtime constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
ejectionModel,
|
||||
dictionary,
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
),
|
||||
(film, dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ejectionModel(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
ejectionModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
ejectionModel(const ejectionModel&) = delete;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected ejection model
|
||||
static autoPtr<ejectionModel> New
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& mdoelType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ejectionModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
) = 0;
|
||||
|
||||
//- Return the total mass ejected
|
||||
virtual scalar ejectedMassTotal() const;
|
||||
|
||||
//- Accumulate the total mass ejected for the patches into the
|
||||
// scalarField provided
|
||||
virtual void patchEjectedMassTotals(scalarField& patchMasses) const
|
||||
{}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ejectionModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ejectionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<ejectionModel> ejectionModel::New
|
||||
(
|
||||
surfaceFilm& model,
|
||||
const dictionary& dict,
|
||||
const word& modelType
|
||||
)
|
||||
{
|
||||
Info<< " " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown ejectionModel type " << modelType
|
||||
<< nl << nl << "Valid ejectionModel types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<ejectionModel>(cstrIter()(model, dict));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,198 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ejectionModelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
ejectionModelList::ejectionModelList(surfaceFilm& film)
|
||||
:
|
||||
PtrList<ejectionModel>(),
|
||||
filmSubModelBase(film)
|
||||
{}
|
||||
|
||||
|
||||
ejectionModelList::ejectionModelList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
PtrList<ejectionModel>(),
|
||||
filmSubModelBase
|
||||
(
|
||||
"ejectionModelList",
|
||||
film,
|
||||
dict,
|
||||
"ejectionModelList",
|
||||
"ejectionModelList"
|
||||
),
|
||||
massEjected_(film.intCoupledPatchIDs().size(), 0.0)
|
||||
{
|
||||
Info<< " Selecting film ejection" << endl;
|
||||
|
||||
if (dict.isDict("ejection"))
|
||||
{
|
||||
const dictionary& ejectionDict(dict.subDict("ejection"));
|
||||
this->setSize(ejectionDict.size());
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(dictionary, ejectionDict, iter)
|
||||
{
|
||||
set
|
||||
(
|
||||
i++,
|
||||
ejectionModel::New
|
||||
(
|
||||
film,
|
||||
ejectionDict.isDict(iter().keyword())
|
||||
? ejectionDict.subDict(iter().keyword())
|
||||
: dictionary::null,
|
||||
iter().keyword()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (dict.found("ejectionModels"))
|
||||
{
|
||||
const wordList models(dict.lookup("ejectionModels"));
|
||||
this->setSize(models.size());
|
||||
|
||||
forAll(models, i)
|
||||
{
|
||||
set(i, ejectionModel::New(film, dict, models[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if (!size())
|
||||
{
|
||||
Info<< " none" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
ejectionModelList::~ejectionModelList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ejectionModelList::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToEject,
|
||||
volScalarField& diameterToEject
|
||||
)
|
||||
{
|
||||
// Correct models that accumulate mass and diameter transfers
|
||||
forAll(*this, i)
|
||||
{
|
||||
ejectionModel& im = operator[](i);
|
||||
im.correct(availableMass, massToEject, diameterToEject);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToEject.correctBoundaryConditions();
|
||||
diameterToEject.correctBoundaryConditions();
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchi = patchIDs[i];
|
||||
massEjected_[i] =
|
||||
massEjected_[i] + sum(massToEject.boundaryField()[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ejectionModelList::info(Ostream& os)
|
||||
{
|
||||
const polyBoundaryMesh& pbm = film().mesh().boundaryMesh();
|
||||
|
||||
scalar ejectedMass = 0;
|
||||
scalarField patchEjectedMasses
|
||||
(
|
||||
pbm.size() - film().mesh().globalData().processorPatches().size(),
|
||||
0
|
||||
);
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
const ejectionModel& im = operator[](i);
|
||||
ejectedMass += im.ejectedMassTotal();
|
||||
im.patchEjectedMassTotals(patchEjectedMasses);
|
||||
}
|
||||
|
||||
os << indent << "ejected mass = " << ejectedMass << nl;
|
||||
|
||||
forAll(patchEjectedMasses, patchi)
|
||||
{
|
||||
if (mag(patchEjectedMasses[patchi]) > vSmall)
|
||||
{
|
||||
os << indent << indent << "from patch " << pbm[patchi].name()
|
||||
<< " = " << patchEjectedMasses[patchi] << nl;
|
||||
}
|
||||
}
|
||||
|
||||
scalarField mass0(massEjected_.size(), 0);
|
||||
this->getBaseProperty("massEjected", mass0);
|
||||
|
||||
scalarField mass(massEjected_);
|
||||
Pstream::listCombineGather(mass, plusEqOp<scalar>());
|
||||
mass += mass0;
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchi = patchIDs[i];
|
||||
Info<< indent << " - patch: " << pbm[patchi].name() << ": "
|
||||
<< mass[i] << endl;
|
||||
}
|
||||
|
||||
if (film().time().writeTime())
|
||||
{
|
||||
setBaseProperty("massEjected", mass);
|
||||
massEjected_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,121 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::ejectionModelList
|
||||
|
||||
Description
|
||||
List container for film ejection models
|
||||
|
||||
SourceFiles
|
||||
ejectionModelList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ejectionModelList_H
|
||||
#define ejectionModelList_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "ejectionModel.H"
|
||||
#include "filmSubModelBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ejectionModelList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ejectionModelList
|
||||
:
|
||||
public PtrList<ejectionModel>,
|
||||
public filmSubModelBase
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- List of mass ejected per patch
|
||||
scalarField massEjected_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ejectionModelList(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
ejectionModelList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
ejectionModelList(const ejectionModelList&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ejectionModelList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToEject,
|
||||
volScalarField& diameterToEject
|
||||
);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Provide some info
|
||||
virtual void info(Ostream& os);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ejectionModelList&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,203 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "patchEjection.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(patchEjection, 0);
|
||||
addToRunTimeSelectionTable(ejectionModel, patchEjection, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
patchEjection::patchEjection
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
ejectionModel(type(), film, dict),
|
||||
deltaStable_(coeffDict_.lookupOrDefault<scalar>("deltaStable", 0.0))
|
||||
{
|
||||
const polyBoundaryMesh& pbm = film.mesh().boundaryMesh();
|
||||
patchIDs_.setSize
|
||||
(
|
||||
pbm.size() - film.mesh().globalData().processorPatches().size()
|
||||
);
|
||||
|
||||
if (coeffDict_.found("patches"))
|
||||
{
|
||||
wordReList patchNames(coeffDict_.lookup("patches"));
|
||||
const labelHashSet patchSet = pbm.patchSet(patchNames);
|
||||
|
||||
Info<< " applying to patches:" << nl;
|
||||
|
||||
label pidi = 0;
|
||||
forAllConstIter(labelHashSet, patchSet, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
patchIDs_[pidi++] = patchi;
|
||||
Info<< " " << pbm[patchi].name() << endl;
|
||||
}
|
||||
patchIDs_.setSize(pidi);
|
||||
patchEjectedMasses_.setSize(pidi, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " applying to all patches" << endl;
|
||||
|
||||
forAll(patchIDs_, patchi)
|
||||
{
|
||||
patchIDs_[patchi] = patchi;
|
||||
}
|
||||
|
||||
patchEjectedMasses_.setSize(patchIDs_.size(), 0);
|
||||
}
|
||||
|
||||
if (!patchIDs_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "No patches selected"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
patchEjection::~patchEjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void patchEjection::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
)
|
||||
{
|
||||
// Do not correct if no patches selected
|
||||
if (!patchIDs_.size()) return;
|
||||
|
||||
const scalarField& delta = film().delta();
|
||||
const scalarField& rho = film().rho();
|
||||
const scalarField& magSf = film().magSf();
|
||||
|
||||
const polyBoundaryMesh& pbm = film().mesh().boundaryMesh();
|
||||
|
||||
forAll(patchIDs_, pidi)
|
||||
{
|
||||
label patchi = patchIDs_[pidi];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
|
||||
// Accumulate the total mass removed from patch
|
||||
scalar dMassPatch = 0;
|
||||
|
||||
forAll(faceCells, fci)
|
||||
{
|
||||
label celli = faceCells[fci];
|
||||
|
||||
scalar ddelta = max(0.0, delta[celli] - deltaStable_);
|
||||
scalar dMass = ddelta*rho[celli]*magSf[celli];
|
||||
massToEject[celli] += dMass;
|
||||
availableMass[celli] -= dMass;
|
||||
dMassPatch += dMass;
|
||||
}
|
||||
|
||||
patchEjectedMasses_[pidi] += dMassPatch;
|
||||
addToEjectedMass(dMassPatch);
|
||||
}
|
||||
|
||||
ejectionModel::correct();
|
||||
|
||||
if (writeTime())
|
||||
{
|
||||
scalarField patchEjectedMasses0
|
||||
(
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchEjectedMasses",
|
||||
scalarField(patchEjectedMasses_.size(), 0)
|
||||
)
|
||||
);
|
||||
|
||||
scalarField patchEjectedMassTotals(patchEjectedMasses_);
|
||||
Pstream::listCombineGather(patchEjectedMassTotals, plusEqOp<scalar>());
|
||||
patchEjectedMasses0 += patchEjectedMassTotals;
|
||||
|
||||
setModelProperty<scalarField>
|
||||
(
|
||||
"patchEjectedMasses",
|
||||
patchEjectedMasses0
|
||||
);
|
||||
|
||||
patchEjectedMasses_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void patchEjection::patchEjectedMassTotals(scalarField& patchMasses) const
|
||||
{
|
||||
// Do not correct if no patches selected
|
||||
if (!patchIDs_.size()) return;
|
||||
|
||||
scalarField patchEjectedMasses
|
||||
(
|
||||
getModelProperty<scalarField>
|
||||
(
|
||||
"patchEjectedMasses",
|
||||
scalarField(patchEjectedMasses_.size(), 0)
|
||||
)
|
||||
);
|
||||
|
||||
scalarField patchEjectedMassTotals(patchEjectedMasses_);
|
||||
Pstream::listCombineGather(patchEjectedMassTotals, plusEqOp<scalar>());
|
||||
|
||||
forAll(patchIDs_, pidi)
|
||||
{
|
||||
label patchi = patchIDs_[pidi];
|
||||
patchMasses[patchi] +=
|
||||
patchEjectedMasses[pidi] + patchEjectedMassTotals[pidi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,122 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::patchEjection
|
||||
|
||||
Description
|
||||
Remove and eject the mass in the film as it passes over the selected
|
||||
patches.
|
||||
|
||||
SourceFiles
|
||||
patchEjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef patchEjection_H
|
||||
#define patchEjection_H
|
||||
|
||||
#include "ejectionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class patchEjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class patchEjection
|
||||
:
|
||||
public ejectionModel
|
||||
{
|
||||
protected:
|
||||
|
||||
//- Stable film thickness - mass only removed if thickness exceeds
|
||||
// this threshold value
|
||||
scalar deltaStable_;
|
||||
|
||||
//- List of patch IDs at which the film is removed
|
||||
labelList patchIDs_;
|
||||
|
||||
//- Ejected mass for each patch at which the film is removed
|
||||
scalarField patchEjectedMasses_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("patchEjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
patchEjection(surfaceFilm& film, const dictionary& dict);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
patchEjection(const patchEjection&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~patchEjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToEject,
|
||||
scalarField& diameterToEject
|
||||
);
|
||||
|
||||
//- Accumulate the total mass ejected for the patches into the
|
||||
// scalarField provided
|
||||
virtual void patchEjectedMassTotals
|
||||
(
|
||||
scalarField& patchMasses
|
||||
) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const patchEjection&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,73 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmMomentumTransportModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(momentumTransportModel, 0);
|
||||
defineRunTimeSelectionTable(momentumTransportModel, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
momentumTransportModel::momentumTransportModel
|
||||
(
|
||||
surfaceFilm& film
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film)
|
||||
{}
|
||||
|
||||
|
||||
momentumTransportModel::momentumTransportModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film, dict, typeName, modelType)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
momentumTransportModel::~momentumTransportModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,140 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::momentumTransportModel
|
||||
|
||||
Description
|
||||
Base class for film momentum transport models
|
||||
|
||||
SourceFiles
|
||||
filmMomentumTransportModel.C
|
||||
filmMomentumTransportModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef filmMomentumTransportModel_H
|
||||
#define filmMomentumTransportModel_H
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "fvMatricesFwd.H"
|
||||
#include "volFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class momentumTransportModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class momentumTransportModel
|
||||
:
|
||||
public filmSubModelBase
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("momentumTransport");
|
||||
|
||||
|
||||
// Declare runtime constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
momentumTransportModel,
|
||||
dictionary,
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
),
|
||||
(film, dict)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
momentumTransportModel(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
momentumTransportModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
momentumTransportModel(const momentumTransportModel&) = delete;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected ejection model
|
||||
static autoPtr<momentumTransportModel> New
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~momentumTransportModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Return the film surface velocity
|
||||
virtual tmp<volVectorField::Internal> Us() const = 0;
|
||||
|
||||
//- Correct/update the model
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Return the source for the film momentum equation
|
||||
virtual tmp<fvVectorMatrix> Su(volVectorField& U) const = 0;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const momentumTransportModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,90 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmMomentumTransportModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<momentumTransportModel> momentumTransportModel::New
|
||||
(
|
||||
surfaceFilm& model,
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
dict.lookupEntryBackwardsCompatible
|
||||
(
|
||||
{momentumTransportModel::typeName, "turbulence"},
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
const dictionary& momentumTransportDict
|
||||
(
|
||||
dict.found(momentumTransportModel::typeName)
|
||||
? dict.subDict(momentumTransportModel::typeName)
|
||||
: dict
|
||||
);
|
||||
|
||||
const word modelType
|
||||
(
|
||||
dict.found(momentumTransportModel::typeName)
|
||||
? momentumTransportDict.lookup("model")
|
||||
: momentumTransportDict.lookup("turbulence")
|
||||
);
|
||||
|
||||
Info<< " Selecting momentumTransportModel " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown momentumTransportModel type " << modelType
|
||||
<< nl << nl << "Valid momentumTransportModel types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<momentumTransportModel>
|
||||
(
|
||||
cstrIter()(model, momentumTransportDict)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,124 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "laminar.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvMesh.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "Time.H"
|
||||
#include "volFields.H"
|
||||
#include "fvmSup.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "extrapolatedCalculatedFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(laminar, 0);
|
||||
addToRunTimeSelectionTable(momentumTransportModel, laminar, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
laminar::laminar
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
momentumTransportModel(type(), film, dict),
|
||||
Cf_(coeffDict_.lookup<scalar>("Cf"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
laminar::~laminar()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volVectorField::Internal> laminar::Us() const
|
||||
{
|
||||
// Evaluate surface velocity assuming parabolic profile
|
||||
tmp<volVectorField::Internal> tUs
|
||||
(
|
||||
volVectorField::Internal::New
|
||||
(
|
||||
typedName("Us"),
|
||||
1.5*filmModel_.U()
|
||||
)
|
||||
);
|
||||
|
||||
return tUs;
|
||||
}
|
||||
|
||||
|
||||
void laminar::correct()
|
||||
{}
|
||||
|
||||
|
||||
tmp<fvVectorMatrix> laminar::Su(volVectorField& U) const
|
||||
{
|
||||
// local reference to film model
|
||||
const momentumSurfaceFilm& film =
|
||||
static_cast<const momentumSurfaceFilm&>(filmModel_);
|
||||
|
||||
// local references to film fields
|
||||
const volScalarField::Internal& mu = film.mu();
|
||||
const volScalarField::Internal& rho = film.rho();
|
||||
const volScalarField::Internal& delta = film.delta();
|
||||
const volVectorField::Internal& Up = film.UPrimary();
|
||||
const volScalarField::Internal& rhop = film.rhoPrimary();
|
||||
const volScalarField::Internal& VbyA = film.VbyA();
|
||||
|
||||
// Employ simple coeff-based model
|
||||
volScalarField::Internal Cs("Cs", Cf_*rhop*mag(Up - U)/VbyA);
|
||||
volScalarField::Internal Cw
|
||||
(
|
||||
"Cw",
|
||||
mu/((1.0/3.0)*VbyA*delta + 1e-5*mu*film.time().deltaT()/rho)
|
||||
);
|
||||
|
||||
return
|
||||
(
|
||||
- fvm::Sp(Cs, U) + Cs*Up // surface contribution
|
||||
- fvm::Sp(Cw, U) + Cw*film.Uw() // wall contribution
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,110 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::laminar
|
||||
|
||||
Description
|
||||
Film laminar momentum transport model.
|
||||
|
||||
SourceFiles
|
||||
laminar.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef laminar_H
|
||||
#define laminar_H
|
||||
|
||||
#include "filmMomentumTransportModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class laminar Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class laminar
|
||||
:
|
||||
public momentumTransportModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Surface roughness coefficient
|
||||
scalar Cf_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("laminar");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
laminar(surfaceFilm& film, const dictionary& dict);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
laminar(const laminar&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~laminar();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Return the film surface velocity
|
||||
virtual tmp<volVectorField::Internal> Us() const;
|
||||
|
||||
//- Correct/update the model
|
||||
virtual void correct();
|
||||
|
||||
//- Return the source for the film momentum equation
|
||||
virtual tmp<fvVectorMatrix> Su(volVectorField& U) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const laminar&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,90 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ArrheniusViscosity.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(ArrheniusViscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
ArrheniusViscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
ArrheniusViscosity::ArrheniusViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu),
|
||||
viscosity_(viscosityModel::New(film, coeffDict_, mu)),
|
||||
k1_("k1", dimTemperature, coeffDict_),
|
||||
k2_("k2", dimTemperature, coeffDict_),
|
||||
Tref_("Tref", dimTemperature, coeffDict_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
ArrheniusViscosity::~ArrheniusViscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void ArrheniusViscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
viscosity_->correct(p, T);
|
||||
mu_ *= exp(k1_*((1/(T + k2_)) - 1/(Tref_ + k2_)));
|
||||
mu_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,131 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::ArrheniusViscosity
|
||||
|
||||
Description
|
||||
The Arrhenius temperature-dependent viscosity model multiplies the viscosity
|
||||
of a base model by an Arrhenius-type temperature function:
|
||||
|
||||
mu = mu0*exp(k1*(1/(T + k2) - 1/(Tref + k2)))
|
||||
|
||||
Where:
|
||||
mu0 is the base-model viscosity
|
||||
k1 and k2 are Arrhenius coefficients
|
||||
T is the local temperature
|
||||
Tref is the reference temperature
|
||||
|
||||
SourceFiles
|
||||
ArrheniusViscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ArrheniusViscosity_H
|
||||
#define ArrheniusViscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ArrheniusViscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ArrheniusViscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Base viscosity model
|
||||
autoPtr<viscosityModel> viscosity_;
|
||||
|
||||
//- Coefficient k1
|
||||
dimensionedScalar k1_;
|
||||
|
||||
//- Coefficient k2
|
||||
dimensionedScalar k2_;
|
||||
|
||||
//- Reference temperature
|
||||
dimensionedScalar Tref_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Arrhenius");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
ArrheniusViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
ArrheniusViscosity(const ArrheniusViscosity&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ArrheniusViscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ArrheniusViscosity&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "NewtonianViscosity.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(NewtonianViscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
NewtonianViscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
NewtonianViscosity::NewtonianViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
NewtonianViscosity::~NewtonianViscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void NewtonianViscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
const thermoSurfaceFilm& film = filmType<thermoSurfaceFilm>();
|
||||
|
||||
mu_ = film.thermo().mu();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,108 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::NewtonianViscosity
|
||||
|
||||
Description
|
||||
Newtonian viscosity model
|
||||
with the viscosity obtain directly from the thermophysical properties.
|
||||
|
||||
SourceFiles
|
||||
NewtonianViscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef NewtonianViscosity_H
|
||||
#define NewtonianViscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class NewtonianViscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class NewtonianViscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Newtonian");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
NewtonianViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
NewtonianViscosity(const NewtonianViscosity&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~NewtonianViscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const NewtonianViscosity&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "constantViscosity.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(constantViscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
constantViscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
constantViscosity::constantViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu),
|
||||
mu0_("mu0", dimDynamicViscosity, coeffDict_)
|
||||
{
|
||||
mu_ == mu0_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
constantViscosity::~constantViscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void constantViscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
mu_ == mu0_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,116 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::constantViscosity
|
||||
|
||||
Description
|
||||
Constant viscosity model
|
||||
|
||||
SourceFiles
|
||||
constantViscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef constantViscosity_H
|
||||
#define constantViscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constantViscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class constantViscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Constant viscosity [Pa.s]
|
||||
dimensionedScalar mu0_;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("constant");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
constantViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
constantViscosity(const constantViscosity&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~constantViscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const constantViscosity&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,72 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(viscosityModel, 0);
|
||||
defineRunTimeSelectionTable(viscosityModel, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
viscosityModel::viscosityModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film, dict, typeName, modelType),
|
||||
mu_(mu)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
viscosityModel::~viscosityModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void viscosityModel::info(Ostream& os) const
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,151 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::viscosityModel
|
||||
|
||||
Description
|
||||
Base class for surface film viscosity models
|
||||
|
||||
SourceFiles
|
||||
filmViscosityModel.C
|
||||
filmViscosityModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef filmViscosityModel_H
|
||||
#define filmViscosityModel_H
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "scalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class viscosityModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class viscosityModel
|
||||
:
|
||||
public filmSubModelBase
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected Member Data
|
||||
|
||||
//- Reference to the viscosity field
|
||||
volScalarField& mu_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("viscosity");
|
||||
|
||||
|
||||
// Declare runtime constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
viscosityModel,
|
||||
dictionary,
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
),
|
||||
(film, dict, mu)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
viscosityModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
viscosityModel(const viscosityModel&) = delete;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected phase change model
|
||||
static autoPtr<viscosityModel> New
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~viscosityModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
) = 0;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Provide some feedback
|
||||
virtual void info(Ostream& os) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const viscosityModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,88 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<viscosityModel> viscosityModel::New
|
||||
(
|
||||
surfaceFilm& model,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
{
|
||||
dict.lookupEntryBackwardsCompatible
|
||||
(
|
||||
{viscosityModel::typeName, "filmViscosityModel"},
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
const dictionary& viscosityDict
|
||||
(
|
||||
dict.found(viscosityModel::typeName)
|
||||
? dict.subDict(viscosityModel::typeName)
|
||||
: dict
|
||||
);
|
||||
|
||||
const word modelType
|
||||
(
|
||||
dict.found(viscosityModel::typeName)
|
||||
? viscosityDict.lookup("model")
|
||||
: viscosityDict.lookup("filmViscosityModel")
|
||||
);
|
||||
|
||||
Info<< " Selecting viscosityModel " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown viscosityModel type " << modelType
|
||||
<< nl << nl << "Valid viscosityModel types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<viscosityModel>(cstrIter()(model, viscosityDict, mu));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,91 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "function1Viscosity.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(function1Viscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
function1Viscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
function1Viscosity::function1Viscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu),
|
||||
viscosity_(viscosityModel::New(film, coeffDict_, mu)),
|
||||
function_
|
||||
(
|
||||
Function1<scalar>::New("function", coeffDict_)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
function1Viscosity::~function1Viscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void function1Viscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
viscosity_->correct(p, T);
|
||||
mu_.primitiveFieldRef() *= function_->value(T)();
|
||||
mu_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,118 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::function1Viscosity
|
||||
|
||||
Description
|
||||
The Foam::Function1 temperature-dependent viscosity model multiplies the
|
||||
viscosity of a base model by a Function1 temperature function.
|
||||
|
||||
SourceFiles
|
||||
function1Viscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef function1Viscosity_H
|
||||
#define function1Viscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class function1Viscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class function1Viscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
function1Viscosity(const function1Viscosity&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const function1Viscosity&) = delete;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Base viscosity model
|
||||
autoPtr<viscosityModel> viscosity_;
|
||||
|
||||
//- Viscosity factor as a function of temperature
|
||||
autoPtr<Function1<scalar>> function_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("function1");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
function1Viscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~function1Viscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,186 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "thixotropicViscosity.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
#include "fvmDdt.H"
|
||||
#include "fvmDiv.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvmSup.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(thixotropicViscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
thixotropicViscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
thixotropicViscosity::thixotropicViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu),
|
||||
a_("a", dimless/dimTime, coeffDict_),
|
||||
b_("b", dimless, coeffDict_),
|
||||
d_("d", dimless, coeffDict_),
|
||||
c_("c", pow(dimTime, d_.value() - scalar(1)), coeffDict_),
|
||||
mu0_("mu0", dimPressure*dimTime, coeffDict_),
|
||||
muInf_("muInf", mu0_.dimensions(), coeffDict_),
|
||||
BinghamPlastic_(coeffDict_.found("tauy")),
|
||||
tauy_
|
||||
(
|
||||
BinghamPlastic_
|
||||
? dimensionedScalar("tauy", dimPressure, coeffDict_)
|
||||
: dimensionedScalar("tauy", dimPressure, 0)
|
||||
),
|
||||
K_(1 - sqrt(muInf_/mu0_)),
|
||||
lambda_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("lambda"),
|
||||
film.mesh().time().name(),
|
||||
film.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
film.mesh()
|
||||
)
|
||||
{
|
||||
lambda_.min(1);
|
||||
lambda_.max(0);
|
||||
|
||||
// Initialise viscosity to inf value because it cannot be evaluated yet
|
||||
mu_ = muInf_;
|
||||
mu_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
thixotropicViscosity::~thixotropicViscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void thixotropicViscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
const momentumSurfaceFilm& film = filmType<momentumSurfaceFilm>();
|
||||
|
||||
const volScalarField::Internal& delta = film.delta();
|
||||
const volScalarField::Internal alphaRho(film.alpha()()*film.rho()());
|
||||
const volScalarField::Internal& coverage = film.coverage();
|
||||
const surfaceScalarField& phiU = film.phiU();
|
||||
|
||||
// Shear rate
|
||||
const volScalarField::Internal gDot
|
||||
(
|
||||
"gDot",
|
||||
coverage*mag(film.Us() - film.Uw())/(delta + film.deltaSmall())
|
||||
);
|
||||
|
||||
const dimensionedScalar alphaRho0
|
||||
(
|
||||
"alphaRho0",
|
||||
alphaRho.dimensions(),
|
||||
rootVSmall
|
||||
);
|
||||
|
||||
fvScalarMatrix lambdaEqn
|
||||
(
|
||||
fvm::ddt(lambda_)
|
||||
+ fvm::div(phiU, lambda_)
|
||||
- fvm::Sp(fvc::div(phiU), lambda_)
|
||||
==
|
||||
a_*pow((1 - lambda_), b_)
|
||||
- fvm::Sp(c_*pow(gDot, d_), lambda_)
|
||||
|
||||
// Include the effect of the impinging droplets added with lambda = 0
|
||||
- fvm::Sp
|
||||
(
|
||||
max
|
||||
(
|
||||
-film.rhoSp(),
|
||||
dimensionedScalar(film.rhoSp().dimensions(), 0)
|
||||
)/(alphaRho + alphaRho0),
|
||||
lambda_
|
||||
)
|
||||
);
|
||||
|
||||
lambdaEqn.relax();
|
||||
lambdaEqn.solve();
|
||||
|
||||
lambda_.min(1);
|
||||
lambda_.max(0);
|
||||
|
||||
mu_ = muInf_/(sqr(1 - K_*lambda_) + rootVSmall);
|
||||
|
||||
// Add optional yield stress contribution to the viscosity
|
||||
if (BinghamPlastic_)
|
||||
{
|
||||
dimensionedScalar tauySmall("tauySmall", tauy_.dimensions(), small);
|
||||
dimensionedScalar muMax_("muMax", 100*mu0_);
|
||||
|
||||
mu_.ref() = min
|
||||
(
|
||||
tauy_/(gDot + 1.0e-4*(tauy_ + tauySmall)/mu0_) + mu_(),
|
||||
muMax_
|
||||
);
|
||||
}
|
||||
|
||||
mu_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,175 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::thixotropicViscosity
|
||||
|
||||
Description
|
||||
Thixotropic viscosity model based on the evolution of the structural
|
||||
parameter \f$ \lambda \f$:
|
||||
|
||||
\f[
|
||||
\frac{D\lambda}{Dt} = a(1 - \lambda)^b - c \lambda \dot{\gamma}^d
|
||||
\f]
|
||||
|
||||
The viscosity is then calculated using the expression
|
||||
|
||||
\f[
|
||||
\mu = \frac{\mu_{\infty}}{{1 - K \lambda}^2}
|
||||
\f]
|
||||
|
||||
Where the parameter K is given by:
|
||||
|
||||
\f[
|
||||
K = 1 - \sqrt{\frac{\mu_{\infty}}{\mu_{0}}}
|
||||
\f]
|
||||
|
||||
Here:
|
||||
\vartable
|
||||
\lambda | structural parameter
|
||||
a | model coefficient
|
||||
b | model coefficient
|
||||
c | model coefficient
|
||||
d | model coefficient
|
||||
\dot{\gamma} | stress rate [1/s]
|
||||
\mu_{0} | limiting viscosity when \f$ \lambda = 1 \f$
|
||||
\mu_{\infty} | limiting viscosity when \f$ \lambda = 0 \f$
|
||||
\endvartable
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Barnes H A, 1997. Thixotropy - a review. J. Non-Newtonian Fluid
|
||||
Mech 70, pp 1-33
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
thixotropicViscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef thixotropicViscosity_H
|
||||
#define thixotropicViscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class thixotropicViscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class thixotropicViscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Model `a' coefficient
|
||||
dimensionedScalar a_;
|
||||
|
||||
//- Model `b' coefficient
|
||||
dimensionedScalar b_;
|
||||
|
||||
//- Model `d' coefficient
|
||||
dimensionedScalar d_;
|
||||
|
||||
//- Model `c' coefficient (read after d since dims depend on d value)
|
||||
dimensionedScalar c_;
|
||||
|
||||
//- Limiting viscosity when lambda = 1
|
||||
dimensionedScalar mu0_;
|
||||
|
||||
//- Limiting viscosity when lambda = 0
|
||||
dimensionedScalar muInf_;
|
||||
|
||||
bool BinghamPlastic_;
|
||||
|
||||
dimensionedScalar tauy_;
|
||||
|
||||
//- Model coefficient
|
||||
dimensionedScalar K_;
|
||||
|
||||
//- Structural parameter
|
||||
// 0 = freestream value (most liquid)
|
||||
// 1 = fully built (most solid)
|
||||
volScalarField lambda_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("thixotropic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
thixotropicViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
thixotropicViscosity(const thixotropicViscosity&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~thixotropicViscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const thixotropicViscosity&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,188 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "waxSolventViscosity.H"
|
||||
#include "momentumSurfaceFilm.H"
|
||||
#include "waxSolventEvaporation.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(waxSolventViscosity, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
waxSolventViscosity,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void waxSolventViscosity::correctMu()
|
||||
{
|
||||
const momentumSurfaceFilm& film = filmType<momentumSurfaceFilm>();
|
||||
|
||||
const uniformDimensionedScalarField Wwax
|
||||
(
|
||||
film.mesh().lookupObject<uniformDimensionedScalarField>
|
||||
(
|
||||
Foam::typedName<waxSolventEvaporation>("Wwax")
|
||||
)
|
||||
);
|
||||
|
||||
const uniformDimensionedScalarField Wsolvent
|
||||
(
|
||||
film.mesh().lookupObject<uniformDimensionedScalarField>
|
||||
(
|
||||
Foam::typedName<waxSolventEvaporation>("Wsolvent")
|
||||
)
|
||||
);
|
||||
|
||||
const uniformDimensionedScalarField Ysolvent0
|
||||
(
|
||||
film.mesh().lookupObject<uniformDimensionedScalarField>
|
||||
(
|
||||
Foam::typedName<waxSolventEvaporation>("Ysolvent0")
|
||||
)
|
||||
);
|
||||
|
||||
const volScalarField& Ysolvent
|
||||
(
|
||||
film.mesh().lookupObject<volScalarField>
|
||||
(
|
||||
Foam::typedName<waxSolventEvaporation>("Ysolvent")
|
||||
)
|
||||
);
|
||||
|
||||
const volScalarField Xsolvent
|
||||
(
|
||||
Ysolvent*Wsolvent/((1 - Ysolvent)*Wwax + Ysolvent*Wsolvent)
|
||||
);
|
||||
|
||||
const dimensionedScalar Xsolvent0
|
||||
(
|
||||
Ysolvent0*Wsolvent/((1 - Ysolvent0)*Wwax + Ysolvent0*Wsolvent)
|
||||
);
|
||||
|
||||
mu_ = pow(muWax_/muSolvent_, (1 - Xsolvent)/(1 - Xsolvent0))*muSolvent_;
|
||||
mu_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
waxSolventViscosity::waxSolventViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
)
|
||||
:
|
||||
viscosityModel(typeName, film, dict, mu),
|
||||
muWax_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("muWax"),
|
||||
film.mesh().time().name(),
|
||||
film.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
film.mesh(),
|
||||
dimensionedScalar(dimDynamicViscosity, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
),
|
||||
muWaxModel_
|
||||
(
|
||||
viscosityModel::New
|
||||
(
|
||||
film,
|
||||
coeffDict_.subDict("muWax"),
|
||||
muWax_
|
||||
)
|
||||
),
|
||||
muSolvent_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("muSolvent"),
|
||||
film.mesh().time().name(),
|
||||
film.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
film.mesh(),
|
||||
dimensionedScalar(dimDynamicViscosity, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
),
|
||||
muSolventModel_
|
||||
(
|
||||
viscosityModel::New
|
||||
(
|
||||
film,
|
||||
coeffDict_.subDict("muSolvent"),
|
||||
muSolvent_
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
waxSolventViscosity::~waxSolventViscosity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void waxSolventViscosity::correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
)
|
||||
{
|
||||
muWaxModel_->correct(p, T);
|
||||
muSolventModel_->correct(p, T);
|
||||
|
||||
correctMu();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,128 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::waxSolventViscosity
|
||||
|
||||
Description
|
||||
Wax solvent mixture viscosity model.
|
||||
|
||||
SourceFiles
|
||||
waxSolventViscosity.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef waxSolventViscosity_H
|
||||
#define waxSolventViscosity_H
|
||||
|
||||
#include "filmViscosityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class waxSolventViscosity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class waxSolventViscosity
|
||||
:
|
||||
public viscosityModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Correct the mixture viscosity
|
||||
void correctMu();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Wax viscosity
|
||||
volScalarField muWax_;
|
||||
|
||||
//- Wax viscosity model
|
||||
autoPtr<viscosityModel> muWaxModel_;
|
||||
|
||||
//- Solvent viscosity
|
||||
volScalarField muSolvent_;
|
||||
|
||||
//- Solvent viscosity model
|
||||
autoPtr<viscosityModel> muSolventModel_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("waxSolvent");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
waxSolventViscosity
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
volScalarField& mu
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
waxSolventViscosity(const waxSolventViscosity&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~waxSolventViscosity();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual void correct
|
||||
(
|
||||
const volScalarField& p,
|
||||
const volScalarField& T
|
||||
);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const waxSolventViscosity&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,237 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "contactAngleForce.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "unitConversion.H"
|
||||
#include "meshWavePatchDistMethod.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(contactAngleForce, 0);
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void contactAngleForce::initialise()
|
||||
{
|
||||
const wordReList zeroForcePatches
|
||||
(
|
||||
coeffDict_.lookupOrDefault<wordReList>("zeroForcePatches", wordReList())
|
||||
);
|
||||
|
||||
if (zeroForcePatches.size())
|
||||
{
|
||||
const polyBoundaryMesh& pbm = filmModel_.mesh().boundaryMesh();
|
||||
scalar dLim = coeffDict_.lookup<scalar>("zeroForceDistance");
|
||||
|
||||
Info<< " Assigning zero contact force within " << dLim
|
||||
<< " of patches:" << endl;
|
||||
|
||||
labelHashSet patchIDs = pbm.patchSet(zeroForcePatches);
|
||||
|
||||
forAllConstIter(labelHashSet, patchIDs, iter)
|
||||
{
|
||||
label patchi = iter.key();
|
||||
Info<< " " << pbm[patchi].name() << endl;
|
||||
}
|
||||
|
||||
// Temporary implementation until run-time selection covers this case
|
||||
patchDistMethods::meshWave dist(filmModel_.mesh(), patchIDs);
|
||||
volScalarField y
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"y",
|
||||
filmModel_.mesh().time().name(),
|
||||
filmModel_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
filmModel_.mesh(),
|
||||
dimensionedScalar(dimLength, great)
|
||||
);
|
||||
dist.correct(y);
|
||||
|
||||
mask_ = pos0(y - dimensionedScalar(dimLength, dLim));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
contactAngleForce::contactAngleForce
|
||||
(
|
||||
const word& typeName,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
force(typeName, film, dict),
|
||||
Ccf_(coeffDict_.lookup<scalar>("Ccf")),
|
||||
mask_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("contactForceMask"),
|
||||
filmModel_.time().name(),
|
||||
filmModel_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
filmModel_.mesh(),
|
||||
dimensionedScalar(dimless, 1.0)
|
||||
)
|
||||
{
|
||||
initialise();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
contactAngleForce::~contactAngleForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
|
||||
{
|
||||
tmp<volVectorField> tForce
|
||||
(
|
||||
volVectorField::New
|
||||
(
|
||||
typedName("contactForce"),
|
||||
filmModel_.mesh(),
|
||||
dimensionedVector(dimForce/dimVolume, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
vectorField& force = tForce.ref().primitiveFieldRef();
|
||||
|
||||
const labelUList& own = filmModel_.mesh().owner();
|
||||
const labelUList& nbr = filmModel_.mesh().neighbour();
|
||||
const scalarField& V = filmModel_.mesh().V();
|
||||
|
||||
const volScalarField& coverage = filmModel_.coverage();
|
||||
|
||||
const tmp<volScalarField> tsigma = filmModel_.sigma();
|
||||
const volScalarField& sigma = tsigma();
|
||||
|
||||
const tmp<volScalarField> ttheta = theta();
|
||||
const volScalarField& theta = ttheta();
|
||||
|
||||
const volVectorField gradCoverage(fvc::grad(coverage));
|
||||
|
||||
forAll(nbr, facei)
|
||||
{
|
||||
const label cellO = own[facei];
|
||||
const label cellN = nbr[facei];
|
||||
|
||||
label celli = -1;
|
||||
if ((coverage[cellO] > 0.5) && (coverage[cellN] < 0.5))
|
||||
{
|
||||
celli = cellO;
|
||||
}
|
||||
else if ((coverage[cellO] < 0.5) && (coverage[cellN] > 0.5))
|
||||
{
|
||||
celli = cellN;
|
||||
}
|
||||
|
||||
if (celli != -1 && mask_[celli] > 0.5)
|
||||
{
|
||||
const scalar invDx = filmModel_.mesh().deltaCoeffs()[facei];
|
||||
const vector n =
|
||||
gradCoverage[celli]/(mag(gradCoverage[celli]) + rootVSmall);
|
||||
const scalar cosTheta = cos(degToRad(theta[celli]));
|
||||
force[celli] += Ccf_*n*sigma[celli]*(1 - cosTheta)/invDx;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(coverage.boundaryField(), patchi)
|
||||
{
|
||||
if (!filmModel_.isCoupledPatch(patchi))
|
||||
{
|
||||
const fvPatchField<scalar>& coveragePf =
|
||||
coverage.boundaryField()[patchi];
|
||||
const fvPatchField<scalar>& maskPf = mask_.boundaryField()[patchi];
|
||||
const fvPatchField<scalar>& sigmaPf = sigma.boundaryField()[patchi];
|
||||
const fvPatchField<scalar>& thetaPf = theta.boundaryField()[patchi];
|
||||
const scalarField& invDx = coveragePf.patch().deltaCoeffs();
|
||||
const labelUList& faceCells = coveragePf.patch().faceCells();
|
||||
|
||||
forAll(coveragePf, facei)
|
||||
{
|
||||
if (maskPf[facei] > 0.5)
|
||||
{
|
||||
const label cellO = faceCells[facei];
|
||||
|
||||
if ((coverage[cellO] > 0.5) && (coveragePf[facei] < 0.5))
|
||||
{
|
||||
const vector n =
|
||||
gradCoverage[cellO]
|
||||
/(mag(gradCoverage[cellO]) + rootVSmall);
|
||||
|
||||
const scalar cosTheta = cos(degToRad(thetaPf[facei]));
|
||||
force[cellO] +=
|
||||
Ccf_*n*sigmaPf[facei]*(1 - cosTheta)/invDx[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
force /= V;
|
||||
|
||||
if (filmModel_.mesh().time().writeTime())
|
||||
{
|
||||
tForce().write();
|
||||
}
|
||||
|
||||
tmp<fvVectorMatrix> tfvm
|
||||
(
|
||||
new fvVectorMatrix(U, dimForce)
|
||||
);
|
||||
|
||||
tfvm.ref() += tForce;
|
||||
|
||||
return tfvm;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,125 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::contactAngleForce
|
||||
|
||||
Description
|
||||
Base-class for film contact angle force models.
|
||||
|
||||
The effect of the contact angle force can be ignored over a specified
|
||||
distance from patches.
|
||||
|
||||
SourceFiles
|
||||
contactAngleForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef contactAngleForce_H
|
||||
#define contactAngleForce_H
|
||||
|
||||
#include "force.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class contactAngleForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class contactAngleForce
|
||||
:
|
||||
public force
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Coefficient applied to the contact angle force
|
||||
scalar Ccf_;
|
||||
|
||||
//- Mask over which force is applied
|
||||
volScalarField mask_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Initialise
|
||||
void initialise();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Return the contact angle field
|
||||
virtual tmp<volScalarField> theta() const = 0;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("contactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
contactAngleForce
|
||||
(
|
||||
const word& typeName,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
contactAngleForce(const contactAngleForce&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~contactAngleForce();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct
|
||||
virtual tmp<fvVectorMatrix> correct(volVectorField& U);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const contactAngleForce&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,118 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "distributionContactAngleForce.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(distributionContactAngleForce, 0);
|
||||
addToRunTimeSelectionTable(force, distributionContactAngleForce, dictionary);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
distributionContactAngleForce::distributionContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
contactAngleForce(typeName, film, dict),
|
||||
rndGen_(label(0)),
|
||||
distribution_
|
||||
(
|
||||
distribution::New
|
||||
(
|
||||
coeffDict_.subDict("distribution"),
|
||||
rndGen_,
|
||||
0
|
||||
)
|
||||
),
|
||||
theta_
|
||||
(
|
||||
volScalarField::New
|
||||
(
|
||||
typedName("theta"),
|
||||
filmModel_.mesh(),
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
),
|
||||
curTimeIndex_(-1)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
distributionContactAngleForce::~distributionContactAngleForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField> distributionContactAngleForce::theta() const
|
||||
{
|
||||
if (curTimeIndex_ != filmModel_.time().timeIndex())
|
||||
{
|
||||
volScalarField::Internal& thetai = theta_;
|
||||
|
||||
forAll(thetai, celli)
|
||||
{
|
||||
thetai[celli] = distribution_->sample();
|
||||
}
|
||||
|
||||
forAll(theta_.boundaryField(), patchi)
|
||||
{
|
||||
if (!filmModel_.isCoupledPatch(patchi))
|
||||
{
|
||||
scalarField& thetap = theta_.boundaryFieldRef()[patchi];
|
||||
|
||||
forAll(thetap, facei)
|
||||
{
|
||||
thetap[facei] = distribution_->sample();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
curTimeIndex_ = filmModel_.time().timeIndex();
|
||||
}
|
||||
|
||||
return theta_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,124 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::distributionContactAngleForce
|
||||
|
||||
Description
|
||||
PDF distribution based film contact angle force
|
||||
|
||||
See also
|
||||
Foam::surfaceFilmModels::contactAngleForce
|
||||
Foam::distribution
|
||||
|
||||
SourceFiles
|
||||
distributionContactAngleForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef distributionContactAngleForce_H
|
||||
#define distributionContactAngleForce_H
|
||||
|
||||
#include "contactAngleForce.H"
|
||||
#include "distribution.H"
|
||||
#include "Random.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class distributionContactAngleForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class distributionContactAngleForce
|
||||
:
|
||||
public contactAngleForce
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<distribution> distribution_;
|
||||
|
||||
//- Cached contact angle field
|
||||
mutable volScalarField theta_;
|
||||
|
||||
//- Current time index (used for updating)
|
||||
mutable label curTimeIndex_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Return the contact angle field
|
||||
virtual tmp<volScalarField> theta() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("distributionContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
distributionContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
distributionContactAngleForce
|
||||
(
|
||||
const distributionContactAngleForce&
|
||||
) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~distributionContactAngleForce();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const distributionContactAngleForce&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,135 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "perturbedTemperatureDependentContactAngleForce.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(perturbedTemperatureDependentContactAngleForce, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
force,
|
||||
perturbedTemperatureDependentContactAngleForce,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
perturbedTemperatureDependentContactAngleForce::
|
||||
perturbedTemperatureDependentContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
contactAngleForce(typeName, film, dict),
|
||||
thetaPtr_(Function1<scalar>::New("theta", coeffDict_)),
|
||||
rndGen_(label(0)),
|
||||
distribution_
|
||||
(
|
||||
distribution::New
|
||||
(
|
||||
coeffDict_.subDict("distribution"),
|
||||
rndGen_,
|
||||
0
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
perturbedTemperatureDependentContactAngleForce::
|
||||
~perturbedTemperatureDependentContactAngleForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField>
|
||||
perturbedTemperatureDependentContactAngleForce::theta() const
|
||||
{
|
||||
tmp<volScalarField> ttheta
|
||||
(
|
||||
volScalarField::New
|
||||
(
|
||||
typedName("theta"),
|
||||
filmModel_.mesh(),
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& theta = ttheta.ref();
|
||||
volScalarField::Internal& thetai = theta.ref();
|
||||
|
||||
const thermoSurfaceFilm& film = filmType<thermoSurfaceFilm>();
|
||||
|
||||
const volScalarField& T = film.thermo().T();
|
||||
|
||||
// Initialise with the function of temperature
|
||||
thetai.field() = thetaPtr_->value(T());
|
||||
|
||||
// Add the stochastic perturbation
|
||||
forAll(thetai, celli)
|
||||
{
|
||||
thetai[celli] += distribution_->sample();
|
||||
}
|
||||
|
||||
forAll(theta.boundaryField(), patchi)
|
||||
{
|
||||
if (!filmModel_.isCoupledPatch(patchi))
|
||||
{
|
||||
fvPatchField<scalar>& thetaf = theta.boundaryFieldRef()[patchi];
|
||||
|
||||
// Initialise with the function of temperature
|
||||
thetaf = thetaPtr_->value(T.boundaryField()[patchi]);
|
||||
|
||||
// Add the stochastic perturbation
|
||||
forAll(thetaf, facei)
|
||||
{
|
||||
thetaf[facei] += distribution_->sample();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ttheta;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,134 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::
|
||||
perturbedTemperatureDependentContactAngleForce
|
||||
|
||||
Description
|
||||
Temperature dependent contact angle force with a stochastic perturbation
|
||||
|
||||
The contact angle in degrees is specified as a Foam::Function1 type, to
|
||||
enable the use of, e.g. constant, polynomial, table values and the
|
||||
stochastic perturbation obtained from a Foam::distribution
|
||||
|
||||
See also
|
||||
Foam::surfaceFilmModels::contactAngleForce
|
||||
Foam::surfaceFilmModels::\\
|
||||
temperatureDependentContactAngleForce
|
||||
Foam::surfaceFilmModels::distributionContactAngleForce
|
||||
Foam::Function1s
|
||||
Foam::distribution
|
||||
|
||||
SourceFiles
|
||||
perturbedTemperatureDependentContactAngleForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef perturbedTemperatureDependentContactAngleForce_H
|
||||
#define perturbedTemperatureDependentContactAngleForce_H
|
||||
|
||||
#include "contactAngleForce.H"
|
||||
#include "Function1.H"
|
||||
#include "distribution.H"
|
||||
#include "Random.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class perturbedTemperatureDependentContactAngleForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class perturbedTemperatureDependentContactAngleForce
|
||||
:
|
||||
public contactAngleForce
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Contact angle function
|
||||
autoPtr<Function1<scalar>> thetaPtr_;
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<distribution> distribution_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Return the contact angle field
|
||||
virtual tmp<volScalarField> theta() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("perturbedTemperatureDependentContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
perturbedTemperatureDependentContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
perturbedTemperatureDependentContactAngleForce
|
||||
(
|
||||
const perturbedTemperatureDependentContactAngleForce&
|
||||
) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~perturbedTemperatureDependentContactAngleForce();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=
|
||||
(
|
||||
const perturbedTemperatureDependentContactAngleForce&
|
||||
) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,106 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "temperatureDependentContactAngleForce.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(temperatureDependentContactAngleForce, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
force,
|
||||
temperatureDependentContactAngleForce,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
temperatureDependentContactAngleForce::temperatureDependentContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
contactAngleForce(typeName, film, dict),
|
||||
thetaPtr_(Function1<scalar>::New("theta", coeffDict_))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
temperatureDependentContactAngleForce::~temperatureDependentContactAngleForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField> temperatureDependentContactAngleForce::theta() const
|
||||
{
|
||||
tmp<volScalarField> ttheta
|
||||
(
|
||||
volScalarField::New
|
||||
(
|
||||
typedName("theta"),
|
||||
filmModel_.mesh(),
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& theta = ttheta.ref();
|
||||
|
||||
const thermoSurfaceFilm& film = filmType<thermoSurfaceFilm>();
|
||||
|
||||
const volScalarField& T = film.thermo().T();
|
||||
|
||||
theta.ref().field() = thetaPtr_->value(T());
|
||||
|
||||
forAll(theta.boundaryField(), patchi)
|
||||
{
|
||||
if (!filmModel_.isCoupledPatch(patchi))
|
||||
{
|
||||
theta.boundaryFieldRef()[patchi] =
|
||||
thetaPtr_->value(T.boundaryField()[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
return ttheta;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,118 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::\\
|
||||
temperatureDependentContactAngleForce
|
||||
|
||||
Description
|
||||
Temperature dependent contact angle force
|
||||
|
||||
The contact angle in degrees is specified as a Foam::Function1 type, to
|
||||
enable the use of, e.g. constant, polynomial, table values.
|
||||
|
||||
See also
|
||||
Foam::surfaceFilmModels::contactAngleForce
|
||||
Foam::Function1s
|
||||
|
||||
SourceFiles
|
||||
temperatureDependentContactAngleForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef temperatureDependentContactAngleForce_H
|
||||
#define temperatureDependentContactAngleForce_H
|
||||
|
||||
#include "contactAngleForce.H"
|
||||
#include "Function1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class temperatureDependentContactAngleForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class temperatureDependentContactAngleForce
|
||||
:
|
||||
public contactAngleForce
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Contact angle function
|
||||
autoPtr<Function1<scalar>> thetaPtr_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//- Return the contact angle field
|
||||
virtual tmp<volScalarField> theta() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("temperatureDependentContactAngle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
temperatureDependentContactAngleForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
temperatureDependentContactAngleForce
|
||||
(
|
||||
const temperatureDependentContactAngleForce&
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~temperatureDependentContactAngleForce();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const temperatureDependentContactAngleForce&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,70 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "force.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(force, 0);
|
||||
defineRunTimeSelectionTable(force, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
force::force(surfaceFilm& film)
|
||||
:
|
||||
filmSubModelBase(film)
|
||||
{}
|
||||
|
||||
|
||||
force::force
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film, dict, typeName, modelType)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
force::~force()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,134 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::force
|
||||
|
||||
Description
|
||||
Base class for film (stress-based) force models
|
||||
|
||||
SourceFiles
|
||||
force.C
|
||||
forceNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef force_H
|
||||
#define force_H
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "fvMatrices.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class force Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class force
|
||||
:
|
||||
public filmSubModelBase
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("force");
|
||||
|
||||
|
||||
// Declare runtime constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
force,
|
||||
dictionary,
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
),
|
||||
(film, dict)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
force(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
force
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
force(const force&) = delete;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected force model
|
||||
static autoPtr<force> New
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& modelType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~force();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual tmp<fvVectorMatrix> correct(volVectorField& U) = 0;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const force&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "force.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<force> force::New
|
||||
(
|
||||
surfaceFilm& model,
|
||||
const dictionary& dict,
|
||||
const word& modelType
|
||||
)
|
||||
{
|
||||
Info<< " " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown force type " << modelType
|
||||
<< nl << nl << "Valid force types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<force>(cstrIter()(model, dict));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,123 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "forceList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
forceList::forceList(surfaceFilm& film)
|
||||
:
|
||||
PtrList<force>()
|
||||
{}
|
||||
|
||||
|
||||
forceList::forceList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
PtrList<force>()
|
||||
{
|
||||
Info<< " Selecting film force models" << endl;
|
||||
|
||||
if (dict.isDict("forces"))
|
||||
{
|
||||
const dictionary& forcesDict(dict.subDict("forces"));
|
||||
this->setSize(forcesDict.size());
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(dictionary, forcesDict, iter)
|
||||
{
|
||||
set
|
||||
(
|
||||
i++,
|
||||
force::New
|
||||
(
|
||||
film,
|
||||
forcesDict.isDict(iter().keyword())
|
||||
? forcesDict.subDict(iter().keyword())
|
||||
: dictionary::null,
|
||||
iter().keyword()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (dict.found("forces"))
|
||||
{
|
||||
const wordList models(dict.lookup("forces"));
|
||||
this->setSize(models.size());
|
||||
|
||||
forAll(models, i)
|
||||
{
|
||||
set(i, force::New(film, dict, models[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if (!size())
|
||||
{
|
||||
Info<< " none" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
forceList::~forceList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<fvVectorMatrix> forceList::correct(volVectorField& U)
|
||||
{
|
||||
tmp<fvVectorMatrix> tResult
|
||||
(
|
||||
new fvVectorMatrix(U, dimForce)
|
||||
);
|
||||
fvVectorMatrix& result = tResult.ref();
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
result += this->operator[](i).correct(U);
|
||||
}
|
||||
|
||||
return tResult;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,92 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::forceList
|
||||
|
||||
Description
|
||||
List container for film sources
|
||||
|
||||
SourceFiles
|
||||
forceList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef forceList_H
|
||||
#define forceList_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "force.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class forceList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class forceList
|
||||
:
|
||||
public PtrList<force>
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
forceList(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
forceList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~forceList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return (net) force system
|
||||
tmp<fvVectorMatrix> correct(volVectorField& U);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,78 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "thermocapillaryForce.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(thermocapillaryForce, 0);
|
||||
addToRunTimeSelectionTable(force, thermocapillaryForce, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
thermocapillaryForce::thermocapillaryForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
force(film)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
thermocapillaryForce::~thermocapillaryForce()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
tmp<fvVectorMatrix> thermocapillaryForce::correct(volVectorField& U)
|
||||
{
|
||||
tmp<fvVectorMatrix>
|
||||
tfvm(new fvVectorMatrix(U, dimForce));
|
||||
|
||||
tfvm.ref() += fvc::grad(filmModel_.sigma())/filmModel_.VbyA();
|
||||
|
||||
return tfvm;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,102 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::thermocapillaryForce
|
||||
|
||||
Description
|
||||
Thermocapillary force
|
||||
|
||||
SourceFiles
|
||||
thermocapillaryForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef thermocapillaryForce_H
|
||||
#define thermocapillaryForce_H
|
||||
|
||||
#include "force.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class thermocapillaryForce Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class thermocapillaryForce
|
||||
:
|
||||
public force
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("thermocapillary");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model
|
||||
thermocapillaryForce
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
thermocapillaryForce(const thermocapillaryForce&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~thermocapillaryForce();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual tmp<fvVectorMatrix> correct(volVectorField& U);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const thermocapillaryForce&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,102 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "transferModel.H"
|
||||
#include "thermoSurfaceFilm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(transferModel, 0);
|
||||
defineRunTimeSelectionTable(transferModel, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void transferModel::addToTransferredMass(const scalar dMass)
|
||||
{
|
||||
transferredMass_ += dMass;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
transferModel::transferModel(surfaceFilm& film)
|
||||
:
|
||||
filmSubModelBase(film),
|
||||
transferredMass_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
transferModel::transferModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
filmSubModelBase(film, dict, typeName, modelType),
|
||||
transferredMass_(0)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
transferModel::~transferModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void transferModel::correct()
|
||||
{
|
||||
if (writeTime())
|
||||
{
|
||||
scalar transferredMass0 = getModelProperty<scalar>("transferredMass");
|
||||
transferredMass0 += returnReduce(transferredMass_, sumOp<scalar>());
|
||||
setModelProperty<scalar>("transferredMass", transferredMass0);
|
||||
transferredMass_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scalar transferModel::transferredMassTotal() const
|
||||
{
|
||||
scalar transferredMass0 = getModelProperty<scalar>("transferredMass");
|
||||
return transferredMass0 + returnReduce(transferredMass_, sumOp<scalar>());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,173 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::transferModel
|
||||
|
||||
Description
|
||||
Base class for film transfer models, handling mass transfer between the
|
||||
film and the continuous phase.
|
||||
|
||||
SourceFiles
|
||||
transferModel.C
|
||||
transferModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transferModel_H
|
||||
#define transferModel_H
|
||||
|
||||
#include "filmSubModelBase.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "scalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class transferModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class transferModel
|
||||
:
|
||||
public filmSubModelBase
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Transferred mass
|
||||
scalar transferredMass_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Add to transferred mass
|
||||
void addToTransferredMass(const scalar dMass);
|
||||
|
||||
//- Correct
|
||||
void correct();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("transferModel");
|
||||
|
||||
|
||||
// Declare runtime constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
transferModel,
|
||||
dictionary,
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
),
|
||||
(film, dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for film
|
||||
transferModel(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
transferModel
|
||||
(
|
||||
const word& modelType,
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
transferModel(const transferModel&) = delete;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected ejection model
|
||||
static autoPtr<transferModel> New
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict,
|
||||
const word& modelType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~transferModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct kinematic transfers
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer
|
||||
) = 0;
|
||||
|
||||
//- Correct kinematic and thermodynamic transfers
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
scalarField& massToTransfer,
|
||||
vectorField& momentumToTransfer,
|
||||
scalarField& energyToTransfer
|
||||
) = 0;
|
||||
|
||||
//- Return the total mass transferred
|
||||
virtual scalar transferredMassTotal() const;
|
||||
|
||||
//- Accumulate the total mass transferred for the patches into the
|
||||
// scalarField provided
|
||||
virtual void patchTransferredMassTotals(scalarField& patchMasses) const
|
||||
{}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const transferModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "transferModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<transferModel> transferModel::New
|
||||
(
|
||||
surfaceFilm& model,
|
||||
const dictionary& dict,
|
||||
const word& modelType
|
||||
)
|
||||
{
|
||||
Info<< " " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown transferModel type " << modelType
|
||||
<< nl << nl << "Valid transferModel types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<transferModel>(cstrIter()(model, dict));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,232 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "transferModelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
transferModelList::transferModelList(surfaceFilm& film)
|
||||
:
|
||||
PtrList<transferModel>(),
|
||||
filmSubModelBase(film)
|
||||
{}
|
||||
|
||||
|
||||
transferModelList::transferModelList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
PtrList<transferModel>(),
|
||||
filmSubModelBase
|
||||
(
|
||||
"transferModelList",
|
||||
film,
|
||||
dict,
|
||||
"transferModelList",
|
||||
"transferModelList"
|
||||
),
|
||||
massTransferred_(film.intCoupledPatchIDs().size(), 0.0)
|
||||
{
|
||||
Info<< " Selecting film transfer" << endl;
|
||||
|
||||
if (dict.isDict("transfer"))
|
||||
{
|
||||
const dictionary& transferDict(dict.subDict("transfer"));
|
||||
this->setSize(transferDict.size());
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(dictionary, transferDict, iter)
|
||||
{
|
||||
set
|
||||
(
|
||||
i++,
|
||||
transferModel::New
|
||||
(
|
||||
film,
|
||||
transferDict.isDict(iter().keyword())
|
||||
? transferDict.subDict(iter().keyword())
|
||||
: dictionary::null,
|
||||
iter().keyword()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (dict.found("transferModels"))
|
||||
{
|
||||
const wordList models(dict.lookup("transferModels"));
|
||||
this->setSize(models.size());
|
||||
|
||||
forAll(models, i)
|
||||
{
|
||||
set(i, transferModel::New(film, dict, models[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
transferModelList::~transferModelList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void transferModelList::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToTransfer,
|
||||
volVectorField& momentumToTransfer
|
||||
)
|
||||
{
|
||||
// Correct models that accumulate mass and diameter transfers
|
||||
forAll(*this, i)
|
||||
{
|
||||
operator[](i).correct
|
||||
(
|
||||
availableMass,
|
||||
massToTransfer,
|
||||
momentumToTransfer
|
||||
);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToTransfer.correctBoundaryConditions();
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchi = patchIDs[i];
|
||||
massTransferred_[i] =
|
||||
massTransferred_[i] + sum(massToTransfer.boundaryField()[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void transferModelList::correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToTransfer,
|
||||
volVectorField& momentumToTransfer,
|
||||
volScalarField& energyToTransfer
|
||||
)
|
||||
{
|
||||
// Correct models that accumulate mass and diameter transfers
|
||||
forAll(*this, i)
|
||||
{
|
||||
operator[](i).correct
|
||||
(
|
||||
availableMass,
|
||||
massToTransfer,
|
||||
momentumToTransfer,
|
||||
energyToTransfer
|
||||
);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToTransfer.correctBoundaryConditions();
|
||||
momentumToTransfer.correctBoundaryConditions();
|
||||
energyToTransfer.correctBoundaryConditions();
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchi = patchIDs[i];
|
||||
massTransferred_[i] =
|
||||
massTransferred_[i] + sum(massToTransfer.boundaryField()[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void transferModelList::info(Ostream& os)
|
||||
{
|
||||
const polyBoundaryMesh& pbm = film().mesh().boundaryMesh();
|
||||
|
||||
scalar transferredMass = 0;
|
||||
scalarField patchTransferredMasses
|
||||
(
|
||||
pbm.size() - film().mesh().globalData().processorPatches().size(),
|
||||
0
|
||||
);
|
||||
|
||||
forAll(*this, i)
|
||||
{
|
||||
const transferModel& im = operator[](i);
|
||||
transferredMass += im.transferredMassTotal();
|
||||
im.patchTransferredMassTotals(patchTransferredMasses);
|
||||
}
|
||||
|
||||
os << indent << "transferred mass = " << transferredMass << nl;
|
||||
|
||||
forAll(patchTransferredMasses, patchi)
|
||||
{
|
||||
if (mag(patchTransferredMasses[patchi]) > vSmall)
|
||||
{
|
||||
os << indent << indent << "from patch " << pbm[patchi].name()
|
||||
<< " = " << patchTransferredMasses[patchi] << nl;
|
||||
}
|
||||
}
|
||||
|
||||
scalarField mass0(massTransferred_.size(), 0);
|
||||
this->getBaseProperty("massTransferred", mass0);
|
||||
|
||||
scalarField mass(massTransferred_);
|
||||
Pstream::listCombineGather(mass, plusEqOp<scalar>());
|
||||
mass += mass0;
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchi = patchIDs[i];
|
||||
Info<< indent << " - patch: " << pbm[patchi].name() << ": "
|
||||
<< mass[i] << endl;
|
||||
}
|
||||
|
||||
if (film().time().writeTime())
|
||||
{
|
||||
setBaseProperty("massTransferred", mass);
|
||||
massTransferred_ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,125 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::transferModelList
|
||||
|
||||
Description
|
||||
List container for film transfer models
|
||||
|
||||
SourceFiles
|
||||
transferModelList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transferModelList_H
|
||||
#define transferModelList_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "transferModel.H"
|
||||
#include "filmSubModelBase.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class transferModelList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class transferModelList
|
||||
:
|
||||
public PtrList<transferModel>,
|
||||
public filmSubModelBase
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- List of mass transferred per patch
|
||||
scalarField massTransferred_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
transferModelList(surfaceFilm& film);
|
||||
|
||||
//- Construct from type name, dictionary and surface film model
|
||||
transferModelList
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
transferModelList(const transferModelList&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~transferModelList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct kinematic transfers
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToTransfer,
|
||||
volVectorField& momentumToTransfer
|
||||
);
|
||||
|
||||
//- Correct kinematic and thermodynamic transfers
|
||||
virtual void correct
|
||||
(
|
||||
scalarField& availableMass,
|
||||
volScalarField& massToTransfer,
|
||||
volVectorField& momentumToTransfer,
|
||||
volScalarField& energyToTransfer
|
||||
);
|
||||
|
||||
//- Provide some info
|
||||
virtual void info(Ostream& os);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const transferModelList&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,130 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "constantRadiation.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(constantRadiation, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
radiationModel,
|
||||
constantRadiation,
|
||||
dictionary
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
constantRadiation::constantRadiation
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
radiationModel(typeName, film, dict),
|
||||
qrConst_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("qrConst"),
|
||||
film.time().name(),
|
||||
film.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
film.mesh()
|
||||
),
|
||||
mask_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
typedName("mask"),
|
||||
film.time().name(),
|
||||
film.mesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
film.mesh(),
|
||||
dimensionedScalar(dimless, 1.0)
|
||||
),
|
||||
absorptivity_(coeffDict_.lookup<scalar>("absorptivity")),
|
||||
timeStart_(coeffDict_.lookup<scalar>("timeStart")),
|
||||
duration_(coeffDict_.lookup<scalar>("duration"))
|
||||
{
|
||||
mask_ = pos0(mask_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
constantRadiation::~constantRadiation()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void constantRadiation::correct()
|
||||
{}
|
||||
|
||||
|
||||
tmp<volScalarField::Internal> constantRadiation::Shs()
|
||||
{
|
||||
const scalar time = film().time().userTimeValue();
|
||||
|
||||
if ((time >= timeStart_) && (time <= timeStart_ + duration_))
|
||||
{
|
||||
return volScalarField::Internal::New
|
||||
(
|
||||
typedName("Shs"),
|
||||
mask_*qrConst_*filmModel_.coverage()*absorptivity_
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return volScalarField::Internal::New
|
||||
(
|
||||
typedName("Shs"),
|
||||
film().mesh(),
|
||||
dimensionedScalar(dimMass/pow3(dimTime), 0)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,128 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::surfaceFilmModels::constantRadiation
|
||||
|
||||
Description
|
||||
Film constant radiation model. The constant radiative flux is specified
|
||||
by the user, and operated over a time interval defined by a start time and
|
||||
duration. In addition, a mask can be applied to shield the film from the
|
||||
radiation.
|
||||
|
||||
SourceFiles
|
||||
constantRadiation.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef constantRadiation_H
|
||||
#define constantRadiation_H
|
||||
|
||||
#include "filmRadiationModel.H"
|
||||
#include "volFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace surfaceFilmModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constantRadiation Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class constantRadiation
|
||||
:
|
||||
public radiationModel
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Constant radiative flux [kg/s^3]
|
||||
volScalarField qrConst_;
|
||||
|
||||
//- Radiation mask
|
||||
volScalarField mask_;
|
||||
|
||||
//- Absorptivity
|
||||
scalar absorptivity_;
|
||||
|
||||
//- Time start [s]
|
||||
const scalar timeStart_;
|
||||
|
||||
//- Duration [s]
|
||||
const scalar duration_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("constantRadiation");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from surface film model and dictionary
|
||||
constantRadiation
|
||||
(
|
||||
surfaceFilm& film,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
constantRadiation(const constantRadiation&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~constantRadiation();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Correct
|
||||
virtual void correct();
|
||||
|
||||
//- Return the radiation sensible enthalpy source
|
||||
// Also updates qrNet
|
||||
virtual tmp<volScalarField::Internal> Shs();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const constantRadiation&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace surfaceFilmModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user