Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2010-04-08 21:05:43 +01:00
216 changed files with 39943 additions and 37 deletions

View File

@ -16,6 +16,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
EXE_LIBS = \
@ -36,4 +37,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \
-lchemistryModel \
-lradiation \
-lsurfaceFilmModels \
-lODE

View File

@ -16,7 +16,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -35,4 +36,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \
-lchemistryModel \
-lradiation \
-lODE
-lODE \
-lsurfaceFilmModels

View File

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

View File

@ -0,0 +1,38 @@
DEV_PATH=./../..
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lsolids \
-lsolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lchemistryModel \
-lradiation \
-lsurfaceFilmModels \
-llagrangianIntermediate \
-lODE

View File

@ -0,0 +1,16 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
rho.dimensionedInternalField()*g
+ parcels.SU()
);
UEqn.relax();
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -0,0 +1,44 @@
tmp<fv::convectionScheme<scalar> > mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
label inertIndex = -1;
volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++)
{
if (Y[i].name() != inertSpecie)
{
volScalarField& Yi = Y[i];
solve
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
==
parcels.Srho(i)
+ kappa*chemistry.RR(i)().dimensionedInternalField(),
mesh.solver("Yi")
);
Yi.max(0.0);
Yt += Yi;
}
else
{
inertIndex = i;
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}

View File

@ -0,0 +1,27 @@
{
Info << "Solving chemistry" << endl;
chemistry.solve
(
runTime.value() - runTime.deltaTValue(),
runTime.deltaTValue()
);
// turbulent time scale
if (turbulentReaction)
{
DimensionedField<scalar, volMesh> tk =
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
DimensionedField<scalar, volMesh> tc =
chemistry.tc()().dimensionedInternalField();
// Chalmers PaSR model
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
}
else
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -0,0 +1,9 @@
Info<< "\nConstructing reacting cloud" << endl;
thermoReactingCloud parcels
(
"reactingCloud1",
rho,
U,
g,
thermo
);

View File

@ -0,0 +1,122 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiChemistryModel> pChemistry
(
psiChemistryModel::New(mesh)
);
psiChemistryModel& chemistry = pChemistry();
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
word inertSpecie(thermo.lookup("inertSpecie"));
volScalarField& p = thermo.p();
volScalarField& hs = thermo.hs();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
Info<< "Creating field rho\n" << endl;
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
Info<< "Creating field kappa\n" << endl;
DimensionedField<scalar, volMesh> kappa
(
IOobject
(
"kappa",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimless, 0.0)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
"DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll (Y, i)
{
fields.add(Y[i]);
}
fields.add(hs);
IOdictionary additionalControlsDict
(
IOobject
(
"additionalControls",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
Switch solvePrimaryRegion
(
additionalControlsDict.lookup("solvePrimaryRegion")
);
DimensionedField<scalar, volMesh> chemistrySh
(
IOobject
(
"chemistry::Sh",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);

View File

@ -0,0 +1,6 @@
Info<< "\nConstructing surface film model" << endl;
autoPtr<surfaceFilmModels::surfaceFilmModel>
tsurfaceFilm(surfaceFilmModels::surfaceFilmModel::New(mesh, g));
surfaceFilmModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();

View File

@ -0,0 +1,21 @@
{
fvScalarMatrix hsEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ parcels.Sh()
+ radiation->Shs(thermo)
+ chemistrySh
);
hsEqn.relax();
hsEqn.solve();
thermo.correct();
radiation->correct();
}

View File

@ -0,0 +1,72 @@
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
==
parcels.Srho()
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
==
parcels.Srho()
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
Application
reactingParcelFilmFoam
Description
Transient PISO solver for compressible, laminar or turbulent flow with
reacting Lagrangian parcels, and surface film modelling.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "hCombustionThermo.H"
#include "turbulenceModel.H"
#include "BasicReactingCloud.H"
#include "surfaceFilmModel.H"
#include "psiChemistryModel.H"
#include "chemistrySolver.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readChemistryProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createClouds.H"
#include "createRadiationModel.H"
#include "createSurfaceFilmModel.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
parcels.evolve();
surfaceFilm.evolve();
if (solvePrimaryRegion)
{
#include "chemistry.H"
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
{
#include "UEqn.H"
#include "YEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hsEqn.H"
#include "pEqn.H"
}
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
turbulence->correct();
rho = thermo.rho();
if (runTime.write())
{
chemistry.dQ()().write();
}
}
else
{
runTime.write();
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
Info<< "Reading chemistry properties\n" << endl;
IOdictionary chemistryProperties
(
IOobject
(
"chemistryProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction"));
dimensionedScalar Cmix("Cmix", dimless, 1.0);
if (turbulentReaction)
{
chemistryProperties.lookup("Cmix") >> Cmix;
}

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
solve
(
fvm::ddt(rho)
+ fvc::div(phi)
==
parcels.Srho()
);
}
// ************************************************************************* //

View File

@ -15,7 +15,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -34,4 +35,5 @@ EXE_LIBS = \
-lreactionThermophysicalModels \
-lchemistryModel \
-lradiation \
-lODE
-lODE \
-lsurfaceFilmModels

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
EXE_LIBS = \
-llagrangian \
@ -19,4 +20,5 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsurfaceFilmModels

View File

@ -53,6 +53,7 @@ wmake libso randomProcesses
thermophysicalModels/Allwmake
transportModels/Allwmake
turbulenceModels/Allwmake
wmake libso surfaceFilmModels
lagrangian/Allwmake
postProcessing/Allwmake
conversion/Allwmake

View File

@ -41,6 +41,9 @@ License
// Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
#include "makeReactingMultiphaseParcelSurfaceFilmModels.H"
// Coal specific
#include "makeCoalParcelSurfaceReactionModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,6 +66,7 @@ namespace Foam
// Reacting multiphase sub-models
makeReactingMultiphaseDevolatilisationModels(CoalParcel);
makeReactingMultiphaseSurfaceFilmModels(CoalParcel);
makeCoalSurfaceReactionModels(CoalParcel);
};

View File

@ -16,7 +16,8 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
LIB_LIBS = \
-lfiniteVolume \
@ -32,4 +33,5 @@ LIB_LIBS = \
-lsolidMixture \
-lreactionThermophysicalModels \
-lcompressibleRASModels \
-lcompressibleLESModels
-lcompressibleLESModels \
-lsurfaceFilmModels

View File

@ -49,6 +49,9 @@ RADIATION=submodels/addOns/radiation
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
$(RADIATION)/scatter/cloudScatter/cloudScatter.C
SURFACEFILM=submodels/addOns/surfaceFilmModel
$(SURFACEFILM)/injection/cloudInjection/cloudInjection.C
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C
KINEMATICINJECTION=submodels/Kinematic/InjectionModel

View File

@ -15,9 +15,11 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
LIB_LIBS = \
-lsurfaceFilmModels \
-lfiniteVolume \
-lmeshTools \
-llagrangian \

View File

@ -32,6 +32,7 @@ License
#include "InjectionModel.H"
#include "PatchInteractionModel.H"
#include "PostProcessingModel.H"
#include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -77,6 +78,8 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud()
g_.value()
);
this->surfaceFilm().inject(td);
this->injection().inject(td);
if (coupled_)
@ -185,6 +188,15 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
*this
)
),
surfaceFilmModel_
(
SurfaceFilmModel<KinematicCloud<ParcelType> >::New
(
this->particleProperties_,
*this,
g
)
),
UIntegrator_
(
vectorIntegrationScheme::New
@ -270,14 +282,12 @@ template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::info() const
{
Info<< "Cloud: " << this->name() << nl
<< " Total number of parcels added = "
<< this->injection().parcelsAddedTotal() << nl
<< " Total mass introduced = "
<< this->injection().massInjected() << nl
<< " Current number of parcels = "
<< returnReduce(this->size(), sumOp<label>()) << nl
<< " Current mass in system = "
<< returnReduce(massInSystem(), sumOp<scalar>()) << nl;
this->injection().info(Info);
this->surfaceFilm().info(Info);
}

View File

@ -31,7 +31,9 @@ Description
- Dispersion model
- Drag model
- Injection model
- Wall interaction model
- Patch interaction model
- Post-processing model
- Surface film model
SourceFiles
KinematicCloudI.H
@ -70,11 +72,15 @@ class DragModel;
template<class CloudType>
class InjectionModel;
template<class CloudType>
class PatchInteractionModel;
template<class CloudType>
class PostProcessingModel;
template<class CloudType>
class PatchInteractionModel;
class SurfaceFilmModel;
/*---------------------------------------------------------------------------*\
Class KinematicCloud Declaration
@ -173,6 +179,10 @@ protected:
autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > >
postProcessingModel_;
//- Surface film model
autoPtr<SurfaceFilmModel<KinematicCloud<ParcelType> > >
surfaceFilmModel_;
// Reference to the particle integration schemes
@ -315,6 +325,14 @@ public:
inline PostProcessingModel<KinematicCloud<ParcelType> >&
postProcessing();
//- Return const-access to the surface film model
inline const SurfaceFilmModel<KinematicCloud<ParcelType> >&
surfaceFilm() const;
//- Return reference to the surface film model
inline SurfaceFilmModel<KinematicCloud<ParcelType> >&
surfaceFilm();
// Integration schemes

View File

@ -181,6 +181,22 @@ Foam::KinematicCloud<ParcelType>::postProcessing()
}
template<class ParcelType>
inline const Foam::SurfaceFilmModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::surfaceFilm() const
{
return surfaceFilmModel_();
}
template<class ParcelType>
inline Foam::SurfaceFilmModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::surfaceFilm()
{
return surfaceFilmModel_();
}
template<class ParcelType>
inline const Foam::vectorIntegrationScheme&
Foam::KinematicCloud<ParcelType>::UIntegrator() const

View File

@ -120,6 +120,8 @@ void Foam::ReactingCloud<ParcelType>::evolveCloud()
this->g().value()
);
this->surfaceFilm().inject(td);
this->injection().inject(td);
if (this->coupled())

View File

@ -93,6 +93,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
this->g().value()
);
this->surfaceFilm().inject(td);
this->injection().inject(td);
if (this->coupled())

View File

@ -86,6 +86,8 @@ void Foam::ThermoCloud<ParcelType>::evolveCloud()
this->g().value()
);
this->surfaceFilm().inject(td);
this->injection().inject(td);
if (this->coupled())

View File

@ -283,15 +283,31 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
)
{
ParcelType& p = static_cast<ParcelType&>(*this);
// Invoke poost-processing mdoel
td.cloud().postProcessing().postPatch(p, patchI);
return td.cloud().patchInteraction().correct
(
pp,
this->face(),
td.keepParticle,
U_
);
// Invoke surface film model
if (td.cloud().surfaceFilm().transferParcel(p, patchI))
{
// Parcel transferred to the surface film
td.keepParticle = false;
// All interactions done
return true;
}
else
{
// Invoke patch interaction model
return
td.cloud().patchInteraction().correct
(
pp,
this->face(),
td.keepParticle,
U_
);
}
}

View File

@ -296,6 +296,9 @@ public:
//- Return const access to specific heat capacity
inline scalar cp() const;
//- Return the parcel sensible enthalpy
inline scalar hs() const;
// Edit

View File

@ -217,6 +217,13 @@ inline Foam::scalar Foam::ThermoParcel<ParcelType>::cp() const
}
template<class ParcelType>
inline Foam::scalar Foam::ThermoParcel<ParcelType>::hs() const
{
return cp_*(T_ - 298.15);
}
template<class ParcelType>
inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
{

View File

@ -41,6 +41,7 @@ License
// Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
#include "makeReactingMultiphaseParcelSurfaceFilmModels.H"
#include "makeReactingMultiphaseParcelSurfaceReactionModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,6 +67,10 @@ namespace Foam
(
BasicReactingMultiphaseParcel
);
makeReactingMultiphaseSurfaceFilmModels
(
BasicReactingMultiphaseParcel
);
makeReactingMultiphaseSurfaceReactionModels
(
BasicReactingMultiphaseParcel

View File

@ -38,6 +38,7 @@ License
// Reacting
#include "makeReactingParcelCompositionModels.H"
#include "makeReactingParcelPhaseChangeModels.H"
#include "makeReactingParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,6 +57,7 @@ namespace Foam
// Reacting sub-models
makeReactingCompositionModels(BasicReactingParcel);
makeReactingPhaseChangeModels(BasicReactingParcel);
makeReactingSurfaceFilmModels(BasicReactingParcel);
};

View File

@ -31,6 +31,7 @@ License
#include "makeParcelInjectionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
#include "makeKinematicParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,6 +43,7 @@ namespace Foam
makeParcelInjectionModels(basicKinematicParcel);
makeParcelPatchInteractionModels(basicKinematicParcel);
makeParcelPostProcessingModels(basicKinematicParcel);
makeKinematicParcelSurfaceFilmModels(basicKinematicParcel);
};

View File

@ -34,6 +34,7 @@ License
// Thermodynamic
#include "makeParcelHeatTransferModels.H"
#include "makeThermoParcelSurfaceFilmModels.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,6 +49,7 @@ namespace Foam
// Thermo sub-models
makeParcelHeatTransferModels(basicThermoParcel);
makeParcelSurfaceFilmModels(basicThermoParcel);
};

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeParcelSurfaceFilmModels_H
#define makeParcelSurfaceFilmModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KinematicCloud.H"
#include "NoSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeKinematicParcelSurfaceFilmModels(ParcelType) \
\
makeSurfaceFilmModel(KinematicCloud<ParcelType>); \
\
makeSurfaceFilmModelType \
( \
NoSurfaceFilm, \
KinematicCloud, \
ParcelType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeReactingMultiphaseParcelSurfaceFilmModels_H
#define makeReactingMultiphaseParcelSurfaceFilmModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "thermoPhysicsTypes.H"
#include "ReactingMultiphaseCloud.H"
#include "NoSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactingMultiphaseSurfaceFilmModels(ParcelType) \
\
makeReactingMultiphaseSurfaceFilmModelThermoType \
( \
ParcelType, \
constGasThermoPhysics \
); \
makeReactingMultiphaseSurfaceFilmModelThermoType \
( \
ParcelType, \
gasThermoPhysics \
); \
makeReactingMultiphaseSurfaceFilmModelThermoType \
( \
ParcelType, \
icoPoly8ThermoPhysics \
);
#define makeReactingMultiphaseSurfaceFilmModelThermoType(ParcelType, ThermoType)\
\
makeSurfaceFilmModel(KinematicCloud<ParcelType<ThermoType> >); \
\
makeSurfaceFilmModelThermoType \
( \
NoSurfaceFilm, \
KinematicCloud, \
ParcelType, \
ThermoType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeReactingParcelSurfaceFilmModels_H
#define makeReactingParcelSurfaceFilmModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "thermoPhysicsTypes.H"
#include "KinematicCloud.H"
#include "NoSurfaceFilm.H"
#include "ThermoSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactingSurfaceFilmModels(ParcelType) \
\
makeReactingSurfaceFilmModelThermoType \
( \
ParcelType, \
constGasThermoPhysics \
); \
\
makeReactingSurfaceFilmModelThermoType \
( \
ParcelType, \
gasThermoPhysics \
); \
\
makeReactingSurfaceFilmModelThermoType \
( \
ParcelType, \
icoPoly8ThermoPhysics \
);
#define makeReactingSurfaceFilmModelThermoType(ParcelType, ThermoType) \
\
makeSurfaceFilmModel(KinematicCloud<ParcelType<ThermoType> >); \
\
makeSurfaceFilmModelThermoType \
( \
NoSurfaceFilm, \
KinematicCloud, \
ParcelType, \
ThermoType \
); \
makeSurfaceFilmModelThermoType \
( \
ThermoSurfaceFilm, \
KinematicCloud, \
ParcelType, \
ThermoType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef makeThermoParcelSurfaceFilmModels_H
#define makeThermoParcelSurfaceFilmModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KinematicCloud.H"
#include "NoSurfaceFilm.H"
#include "ThermoSurfaceFilm.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelSurfaceFilmModels(ParcelType) \
\
makeSurfaceFilmModel(KinematicCloud<ParcelType>); \
\
makeSurfaceFilmModelType \
( \
NoSurfaceFilm, \
KinematicCloud, \
ParcelType \
); \
\
makeSurfaceFilmModelType \
( \
ThermoSurfaceFilm, \
KinematicCloud, \
ParcelType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -135,38 +135,46 @@ void Foam::InjectionModel<CloudType>::findCellAtPosition
vector& position
)
{
const vector p0 = position;
const volVectorField& cellCentres = owner_.mesh().C();
bool foundCell = false;
const vector p0 = position;
cellI = owner_.mesh().findCell(position);
label procI = -1;
if (cellI >= 0)
{
const vector& C = owner_.mesh().C()[cellI];
position += SMALL*(C - position);
foundCell = owner_.mesh().pointInCell(position, cellI);
procI = Pstream::myProcNo();
}
reduce(procI, maxOp<label>());
if (procI != Pstream::myProcNo())
{
cellI = -1;
}
reduce(foundCell, orOp<bool>());
// Last chance - find nearest cell and try that one
// - the point is probably on an edge
if (!foundCell)
if (procI == -1)
{
cellI = owner_.mesh().findNearestCell(position);
if (cellI >= 0)
{
const vector& C = owner_.mesh().C()[cellI];
position += SMALL*(C - position);
position += SMALL*(cellCentres[cellI] - position);
foundCell = owner_.mesh().pointInCell(position, cellI);
if (owner_.mesh().pointInCell(position, cellI))
{
procI = Pstream::myProcNo();
}
}
reduce(procI, maxOp<label>());
if (procI != Pstream::myProcNo())
{
cellI = -1;
}
reduce(foundCell, orOp<bool>());
}
if (!foundCell)
if (procI == -1)
{
FatalErrorIn
(
@ -436,6 +444,14 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
}
template<class CloudType>
void Foam::InjectionModel<CloudType>::info(Ostream& os) const
{
os << " Total number of parcels added = " << parcelsAddedTotal_ << nl
<< " Total mass introduced = " << massInjected_ << nl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewInjectionModel.C"

View File

@ -316,6 +316,12 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const = 0;
// I-O
//- Write surface film info to stream
virtual void info(Ostream& os) const;
};

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "NoSurfaceFilm.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NoSurfaceFilm<CloudType>::NoSurfaceFilm
(
const dictionary&,
CloudType& owner,
const dimensionedVector&
)
:
SurfaceFilmModel<CloudType>(owner)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NoSurfaceFilm<CloudType>::~NoSurfaceFilm()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::NoSurfaceFilm<CloudType>::active() const
{
return false;
}
template<class CloudType>
bool Foam::NoSurfaceFilm<CloudType>::transferParcel
(
const parcelType&,
const label
)
{
return false;
}
template<class CloudType>
void Foam::NoSurfaceFilm<CloudType>::setParcelProperties
(
parcelType&,
const label
)
{
// do nothing
}
template<class CloudType>
void Foam::NoSurfaceFilm<CloudType>::info(Ostream&) const
{
// do nothing
}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::NoSurfaceFilm
Description
Place holder for 'none' option
SourceFiles
NoSurfaceFilm.C
\*---------------------------------------------------------------------------*/
#ifndef NoSurfaceFilm_H
#define NoSurfaceFilm_H
#include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class NoSurfaceFilm Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class NoSurfaceFilm
:
public SurfaceFilmModel<CloudType>
{
protected:
// Protected data
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
NoSurfaceFilm
(
const dictionary&,
CloudType&,
const dimensionedVector&
);
//- Destructor
virtual ~NoSurfaceFilm();
// Member Functions
// Evaluation
//- Flag to indicate whether model activates the surface film model
virtual bool active() const;
//- Transfer parcel from cloud to surface film
// Returns true if parcel is to be transferred
virtual bool transferParcel
(
const parcelType& p,
const label patchI
);
//- Set parcel properties
virtual void setParcelProperties
(
parcelType& p,
const label filmCellI
);
// I-O
//- Write surface film info to stream
virtual void info(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "NoSurfaceFilm.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "SurfaceFilmModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::autoPtr<Foam::SurfaceFilmModel<CloudType> >
Foam::SurfaceFilmModel<CloudType>::New
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g
)
{
word SurfaceFilmModelType(dict.lookup("SurfaceFilmModel"));
Info<< "Selecting SurfaceFilmModel " << SurfaceFilmModelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(SurfaceFilmModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"SurfaceFilmModel<CloudType>::New"
"("
"const dictionary&, "
"CloudType&"
")"
) << "Unknown SurfaceFilmModel type "
<< SurfaceFilmModelType
<< ", constructor not in hash table" << nl << nl
<< " Valid SurfaceFilmModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
}
return autoPtr<SurfaceFilmModel<CloudType> >(cstrIter()(dict, owner, g));
}
// ************************************************************************* //

View File

@ -0,0 +1,184 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "SurfaceFilmModel.H"
#include "mathematicalConstants.H"
#include "surfaceFilmModel.H"
#include "directMappedWallPolyPatch.H"
using namespace Foam::constant;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel(CloudType& owner)
:
dict_(dictionary::null),
owner_(owner),
g_(dimensionedVector("zero", dimAcceleration, vector::zero)),
coeffDict_(dictionary::null),
injectorCellsPatch_(0),
massParcelPatch_(0),
diameterParcelPatch_(0),
UFilmPatch_(0),
rhoFilmPatch_(0),
nParcelsTransferred_(0),
nParcelsInjected_(0)
{}
template<class CloudType>
Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g,
const word& type
)
:
dict_(dict),
owner_(owner),
g_(g),
coeffDict_(dict.subDict(type + "Coeffs")),
injectorCellsPatch_(0),
massParcelPatch_(0),
diameterParcelPatch_(0),
UFilmPatch_(0),
rhoFilmPatch_(0),
nParcelsTransferred_(0),
nParcelsInjected_(0)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::SurfaceFilmModel<CloudType>::~SurfaceFilmModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
template<class TrackData>
void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
{
// Retrieve the film model from the owner database
const surfaceFilmModels::surfaceFilmModel& filmModel =
this->owner().db().objectRegistry::lookupObject
<surfaceFilmModels::surfaceFilmModel>
(
"surfaceFilmProperties"
);
const labelList& filmPatches = filmModel.filmBottomPatchIDs();
const labelList& primaryPatches = filmModel.primaryPatchIDs();
forAll(filmPatches, i)
{
const label primaryPatchI = primaryPatches[i];
const directMappedWallPolyPatch& wpp =
refCast<const directMappedWallPolyPatch>
(
this->owner().mesh().boundaryMesh()[primaryPatchI]
);
injectorCellsPatch_ = wpp.faceCells();
const label filmPatchI = filmPatches[i];
const mapDistribute& distMap = wpp.map();
cacheFilmFields(filmPatchI, distMap, filmModel);
forAll(injectorCellsPatch_, j)
{
if (diameterParcelPatch_[j] > 0)
{
const label cellI = injectorCellsPatch_[j];
const point& pos = this->owner().mesh().C()[cellI];
// Create a new parcel
typename CloudType::parcelType* pPtr =
new typename CloudType::parcelType(td.cloud(), pos, cellI);
setParcelProperties(*pPtr, j);
// Check new parcel properties
// td.cloud().checkParcelProperties(*pPtr, 0.0, true);
td.cloud().checkParcelProperties(*pPtr, 0.0, false);
// Add the new parcel to the cloud
td.cloud().addParticle(pPtr);
nParcelsInjected_++;
}
}
}
}
template<class CloudType>
void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
(
const label filmPatchI,
const mapDistribute& distMap,
const surfaceFilmModels::surfaceFilmModel& filmModel
)
{
massParcelPatch_ = filmModel.massForPrimary().boundaryField()[filmPatchI];
distMap.distribute(massParcelPatch_);
diameterParcelPatch_ =
filmModel.diametersForPrimary().boundaryField()[filmPatchI];
distMap.distribute(diameterParcelPatch_);
UFilmPatch_ = filmModel.U().boundaryField()[filmPatchI];
distMap.distribute(UFilmPatch_);
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
distMap.distribute(rhoFilmPatch_);
}
template<class CloudType>
void Foam::SurfaceFilmModel<CloudType>::setParcelProperties
(
parcelType& p,
const label filmFaceI
) const
{
// Set parcel properties
scalar vol = mathematical::pi/6.0*pow3(diameterParcelPatch_[filmFaceI]);
p.d() = diameterParcelPatch_[filmFaceI];
p.U() = UFilmPatch_[filmFaceI];
p.rho() = rhoFilmPatch_[filmFaceI];
p.nParticle() = massParcelPatch_[filmFaceI]/p.rho()/vol;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewSurfaceFilmModel.C"
// ************************************************************************* //

View File

@ -0,0 +1,292 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::SurfaceFilmModel
Description
Templated wall surface film model class.
SourceFiles
SurfaceFilmModel.C
NewSurfaceFilmModel.C
\*---------------------------------------------------------------------------*/
#ifndef SurfaceFilmModel_H
#define SurfaceFilmModel_H
#include "IOdictionary.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
namespace surfaceFilmModels
{
class surfaceFilmModel;
}
class mapDistribute;
/*---------------------------------------------------------------------------*\
Class SurfaceFilmModel Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class SurfaceFilmModel
{
protected:
// Protected data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
//- The cloud dictionary
const dictionary& dict_;
//- Reference to the owner cloud class
CloudType& owner_;
//- Gravitational acceleration constant
const dimensionedVector& g_;
//- The coefficients dictionary
const dictionary coeffDict_;
// Cached injector fields per film patch
//- Injector cell / patch face
labelList injectorCellsPatch_;
//- Parcel mass / patch face
scalarList massParcelPatch_;
//- Parcel diameter / patch face
scalarList diameterParcelPatch_;
//- Film velocity / patch face
List<vector> UFilmPatch_;
//- Film density / patch face
scalarList rhoFilmPatch_;
// Counters
//- Number of parcels transferred to the film model
label nParcelsTransferred_;
//- Number of parcels injected from the film model
label nParcelsInjected_;
// Protected functions
//- Cache the film fields in preparation for injection
virtual void cacheFilmFields
(
const label filmPatchI,
const mapDistribute& distMap,
const surfaceFilmModels::surfaceFilmModel& filmModel
);
//- Set the individual parcel properties
virtual void setParcelProperties
(
parcelType& p,
const label filmFaceI
) const;
public:
//- Runtime type information
TypeName("SurfaceFilmModel");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
SurfaceFilmModel,
dictionary,
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g
),
(dict, owner, g)
);
// Constructors
//- Construct null from owner
SurfaceFilmModel(CloudType& owner);
//- Construct from dictionary
SurfaceFilmModel
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g,
const word& type
);
//- Destructor
virtual ~SurfaceFilmModel();
//- Selector
static autoPtr<SurfaceFilmModel<CloudType> > New
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g
);
// Member Functions
// Access
//- Return the owner cloud dictionary
inline const dictionary& dict() const;
//- Return const access the owner cloud object
inline const CloudType& owner() const;
//- Return non-const access the owner cloud object for manipulation
inline CloudType& owner();
//- Return gravitational acceleration constant
inline const dimensionedVector& g() const;
//- Return the coefficients dictionary
inline const dictionary& coeffDict() const;
//- Return const access to the number of parcels transferred to the
// film model
inline label nParcelsTransferred() const;
//- Return non-const access to the number of parcels transferred to
// the film model
inline label& nParcelsTransferred();
//- Return const access to the number of parcels injected from the
// film model
inline label nParcelsInjected() const;
//- Return non-const access to the number of parcels injected from
// the film model
inline label& nParcelsInjected();
// Member Functions
//- Flag to indicate whether model activates the surface film model
virtual bool active() const = 0;
//- Transfer parcel from cloud to surface film
// Returns true if parcel is to be transferred
virtual bool transferParcel
(
const parcelType& p,
const label patchI
) = 0;
//- Inject parcels into the cloud
template<class TrackData>
void inject(TrackData& td);
// I-O
//- Write surface film info to stream
virtual void info(Ostream& os) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeSurfaceFilmModel(CloudType) \
\
defineNamedTemplateTypeNameAndDebug(SurfaceFilmModel<CloudType>, 0); \
\
defineTemplateRunTimeSelectionTable \
( \
SurfaceFilmModel<CloudType>, \
dictionary \
);
#define makeSurfaceFilmModelType(SS, CloudType, ParcelType) \
\
defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
\
SurfaceFilmModel<CloudType<ParcelType> >:: \
adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
add##SS##CloudType##ParcelType##ConstructorToTable_;
#define makeSurfaceFilmModelThermoType(SS, CloudType, ParcelType, ThermoType) \
\
defineNamedTemplateTypeNameAndDebug \
( \
SS<CloudType<ParcelType<ThermoType> > >, \
0 \
); \
\
SurfaceFilmModel<CloudType<ParcelType<ThermoType> > >:: \
adddictionaryConstructorToTable \
<SS<CloudType<ParcelType<ThermoType> > > > \
add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "SurfaceFilmModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "SurfaceFilmModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "SurfaceFilmModel.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
const Foam::dictionary& Foam::SurfaceFilmModel<CloudType>::dict() const
{
return dict_;
}
template<class CloudType>
const CloudType& Foam::SurfaceFilmModel<CloudType>::owner() const
{
return owner_;
}
template<class CloudType>
CloudType& Foam::SurfaceFilmModel<CloudType>::owner()
{
return owner_;
}
template<class CloudType>
const Foam::dimensionedVector& Foam::SurfaceFilmModel<CloudType>::g() const
{
return g_;
}
template<class CloudType>
const Foam::dictionary& Foam::SurfaceFilmModel<CloudType>::coeffDict() const
{
return coeffDict_;
}
template<class CloudType>
Foam::label& Foam::SurfaceFilmModel<CloudType>::nParcelsTransferred()
{
return nParcelsTransferred_;
}
template<class CloudType>
Foam::label Foam::SurfaceFilmModel<CloudType>::nParcelsTransferred() const
{
return nParcelsTransferred_;
}
template<class CloudType>
Foam::label& Foam::SurfaceFilmModel<CloudType>::nParcelsInjected()
{
return nParcelsInjected_;
}
template<class CloudType>
Foam::label Foam::SurfaceFilmModel<CloudType>::nParcelsInjected() const
{
return nParcelsInjected_;
}
// ************************************************************************* //

View File

@ -0,0 +1,173 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
(
const dictionary& dict,
CloudType& owner,
const dimensionedVector& g
)
:
SurfaceFilmModel<CloudType>(dict, owner, g, typeName),
TFilmPatch_(0),
cpFilmPatch_(0)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ThermoSurfaceFilm<CloudType>::~ThermoSurfaceFilm()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::ThermoSurfaceFilm<CloudType>::active() const
{
return true;
}
template<class CloudType>
bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
(
const parcelType& p,
const label patchI
)
{
// Retrieve the film model from the owner database
surfaceFilmModels::surfaceFilmModel& filmModel =
const_cast<surfaceFilmModels::surfaceFilmModel&>
(
this->owner().db().objectRegistry::
lookupObject<surfaceFilmModels::surfaceFilmModel>
(
"surfaceFilmProperties"
)
);
if (filmModel.isFilmPatch(patchI))
{
const polyPatch& pp = this->owner().mesh().boundaryMesh()[patchI];
label faceI = pp.whichFace(p.face());
// Patch face normal
const vector& nf = pp.faceNormals()[faceI];
// Relative parcel velocity
const vector Urel =
p.U() - this->owner().U().boundaryField()[patchI][faceI];
// Parcel mass
const scalar m = p.nParticle()*p.mass();
// Add the particle properties as sources to the film model
filmModel.addSources
(
patchI,
faceI,
m, // mass
m*(Urel - nf*(Urel & nf)), // tangential momentum
m*mag(Urel & nf), // impingement pressure
m*p.hs() // energy
);
if (debug)
{
Info<< "ThermoSurfaceFilm<CloudType>::transferParcel:" << nl
<< " Effective increase in film height = "
<< p.nParticle()*p.volume()/mag(pp.faceAreas()[faceI]) << endl;
}
this->nParcelsTransferred()++;
// Flag to remove parcel p from owner cloud
return true;
}
else
{
return false;
}
}
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
(
const label filmPatchI,
const mapDistribute& distMap,
const surfaceFilmModels::surfaceFilmModel& filmModel
)
{
SurfaceFilmModel<CloudType>::cacheFilmFields
(
filmPatchI,
distMap,
filmModel
);
TFilmPatch_ = filmModel.T().boundaryField()[filmPatchI];
distMap.distribute(TFilmPatch_);
cpFilmPatch_ = filmModel.cp().boundaryField()[filmPatchI];
distMap.distribute(cpFilmPatch_);
}
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::setParcelProperties
(
parcelType& p,
const label filmFaceI
) const
{
SurfaceFilmModel<CloudType>::setParcelProperties(p, filmFaceI);
// Set parcel properties
p.T() = TFilmPatch_[filmFaceI];
p.cp() = cpFilmPatch_[filmFaceI];
}
template<class CloudType>
void Foam::ThermoSurfaceFilm<CloudType>::info(Ostream& os) const
{
os << " Parcels transferred to film = "
<< returnReduce(this->nParcelsTransferred(), sumOp<label>()) << nl
<< " Number of film parcels added = "
<< returnReduce(this->nParcelsInjected(), sumOp<label>()) << nl;
}
// ************************************************************************* //

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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.
SourceFiles
ThermoSurfaceFilm.C
ThermoSurfaceFilmI.H
\*---------------------------------------------------------------------------*/
#ifndef ThermoSurfaceFilm_H
#define ThermoSurfaceFilm_H
#include "SurfaceFilmModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ThermoSurfaceFilm Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class ThermoSurfaceFilm
:
public SurfaceFilmModel<CloudType>
{
protected:
// Protected data
//- Convenience typedef to the cloud's parcel type
typedef typename CloudType::parcelType parcelType;
// Cached injector fields per film patch
//- Film temperature / patch face
scalarList TFilmPatch_;
//- Film specific heat capacity / patch face
scalarList cpFilmPatch_;
// Protected functions
//- Cache the film fields in preparation for injection
virtual void cacheFilmFields
(
const label filmPatchI,
const mapDistribute& distMap,
const surfaceFilmModels::surfaceFilmModel& filmModel
);
//- 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,
const dimensionedVector& g
);
//- Destructor
virtual ~ThermoSurfaceFilm();
// Member Functions
// Evaluation
//- Flag to indicate whether model activates surface film model
virtual bool active() const;
//- Transfer parcel from cloud to surface film
// Returns true if parcel is to be transferred
virtual bool transferParcel
(
const parcelType& p,
const label patchI
);
// I-O
//- Write surface film info to stream
virtual void info(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "ThermoSurfaceFilm.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "DimensionedFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
inline const Foam::word&
Foam::ThermoSurfaceFilm<CloudType>::filmRegionName() const
{
return filmRegionName_;
}
template<class CloudType>
inline const Foam::wordList&
Foam::ThermoSurfaceFilm<CloudType>::patchNames() const
{
return patchNames_;
}
template<class CloudType>
inline const Foam::polyMesh&
Foam::ThermoSurfaceFilm<CloudType>::filmRegion() const
{
return filmRegion_;
}
template<class CloudType>
inline const Foam::volScalarField&
Foam::ThermoSurfaceFilm<CloudType>::hf() const
{
return hf_;
}
template<class CloudType>
inline const Foam::volScalarField&
Foam::ThermoSurfaceFilm<CloudType>::rho() const
{
return rho_;
}
template<class CloudType>
inline const Foam::volVectorField&
Foam::ThermoSurfaceFilm<CloudType>::U() const
{
return U_;
}
template<class CloudType>
inline const Foam::volScalarField&
Foam::ThermoSurfaceFilm<CloudType>::p() const
{
return p_;
}
template<class CloudType>
inline const Foam::volScalarField&
Foam::ThermoSurfaceFilm<CloudType>::h() const
{
return h_;
}
template<class CloudType>
inline const Foam::volScalarField&
Foam::ThermoSurfaceFilm<CloudType>::mu() const
{
return mu_;
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ThermoSurfaceFilm<CloudType>::rhoSp()
{
return rhoSp_;
}
template<class CloudType>
inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
Foam::ThermoSurfaceFilm<CloudType>::USp()
{
return USp_;
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ThermoSurfaceFilm<CloudType>::hSp()
{
return hSp_;
}
template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ThermoSurfaceFilm<CloudType>::pSp()
{
return pSp_;
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "cloudInjection.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "Time.H"
#include "mathematicalConstants.H"
#include "Random.H"
#include "volFields.H"
using namespace Foam::constant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(cloudInjection, 0);
addToRunTimeSelectionTable(injectionModel, cloudInjection, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::cloudInjection::cloudInjection
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
injectionModel(type(), owner, dict),
cloudName_(coeffs_.lookup("cloudName")),
cloud_
(
const_cast<kinematicCloud&>
(
owner.mesh().lookupObject<kinematicCloud>(cloudName_)
)
),
particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))),
rndGen_(label(0)),
parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)),
diameter_(owner.film().nCells(), 0.0)
{
forAll(diameter_, faceI)
{
diameter_[faceI] = parcelPDF_->sample();
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::cloudInjection::~cloudInjection()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::cloudInjection::correct
(
scalarField& massToInject,
scalarField& diameterToInject
)
{
const scalarField& rhoFilm = owner().rho();
// Collect the data to be transferred
forAll(massToInject, cellI)
{
scalar rho = rhoFilm[cellI];
scalar diam = diameter_[cellI];
scalar minMass = particlesPerParcel_*rho*mathematical::pi/6*pow3(diam);
if (massToInject[cellI] > minMass)
{
// All mass can be injected - set particle diameter
diameterToInject[cellI] = diameter_[cellI];
// Retrieve new particle diameter sample
diameter_[cellI] = parcelPDF_->sample();
}
else
{
// Mass below minimum threshold - cannot be injected
massToInject[cellI] = 0.0;
diameterToInject[cellI] = -1.0;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,142 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::cloudInjection
Description
Cloud injection model
SourceFiles
cloudInjection.C
\*---------------------------------------------------------------------------*/
#ifndef cloudInjection_H
#define cloudInjection_H
#include "injectionModel.H"
#include "kinematicCloud.H"
#include "pdf.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class cloudInjection Declaration
\*---------------------------------------------------------------------------*/
class cloudInjection
:
public injectionModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
cloudInjection(const cloudInjection&);
//- Disallow default bitwise assignment
void operator=(const cloudInjection&);
protected:
// Protected data
//- Name of the cloud owner for newly ejected parcels
word cloudName_;
//- Reference to the cloud
kinematicCloud& cloud_;
//- Number of particles per parcel
scalar particlesPerParcel_;
//- Random number generator
Random rndGen_;
//- Parcel size PDF model
const autoPtr<pdfs::pdf> parcelPDF_;
//- Diameters of particles to inject into the cloud
scalarList diameter_;
public:
//- Runtime type information
TypeName("cloudInjection");
// Constructors
//- Construct from surface film model
cloudInjection(const surfaceFilmModel& owner, const dictionary& dict);
//- Destructor
virtual ~cloudInjection();
// Member Functions
// Access
//- Return the cloud name
inline const word& cloudName() const;
//- Return a reference to the cloud
inline const kinematicCloud& cloud() const;
// Evolution
//- Correct
virtual void correct
(
scalarField& massToInject,
scalarField& diameterToInject
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "cloudInjectionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "cloudInjection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::word&
Foam::surfaceFilmModels::cloudInjection::cloudName() const
{
return cloudName_;
}
inline const Foam::kinematicCloud&
Foam::surfaceFilmModels::cloudInjection::cloud() const
{
return cloud_;
}
// ************************************************************************* //

View File

@ -0,0 +1,26 @@
/* Surface film models */
surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C
surfaceFilmModel/surfaceFilmModel/newSurfaceFilmModel.C
surfaceFilmModel/noFilm/noFilm.C
surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C
surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C
/* Sub-models */
submodels/kinematic/injectionModel/injectionModel/injectionModel.C
submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C
submodels/kinematic/injectionModel/noInjection/noInjection.C
submodels/kinematic/injectionModel/removeInjection/removeInjection.C
submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C
submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C
submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C
/* Boundary conditions */
derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C
derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C
derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,162 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "directMappedFixedInternalValueFvPatchField.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(p, iF)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
directMappedFixedValueFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf
)
:
directMappedFixedValueFvPatchField<Type>(ptf)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
{
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
if (this->updated())
{
return;
}
// Retrieve the neighbour values and assign to this patch boundary field
directMappedFixedValueFvPatchField<Type>::updateCoeffs();
// Get the coupling information from the directMappedPatchBase
const directMappedPatchBase& mpp =
refCast<const directMappedPatchBase>(this->patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const fvPatch& nbrPatch =
refCast<const fvMesh>
(
nbrMesh
).boundary()[mpp.samplePolyPatch().index()];
// Force recalculation of mapping and schedule
const mapDistribute& distMap = mpp.map();
// Retrieve the neighbour field
const fvPatchField<Type>& nbrField =
nbrPatch.lookupPatchField<FieldType, Type>
(
this->dimensionedInternalField().name()
);
// Retrieve the neighbour patch internal field
Field<Type> nbrIntFld = nbrField.patchInternalField();
mapDistribute::distribute
(
Pstream::defaultCommsType,
distMap.schedule(),
distMap.constructSize(),
distMap.subMap(), // what to send
distMap.constructMap(), // what to receive
nbrIntFld
);
// Assign (this) patch internal field to its neighbour values
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
}
template<class Type>
void directMappedFixedInternalValueFvPatchField<Type>::write(Ostream& os) const
{
directMappedFixedValueFvPatchField<Type>::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::directMappedFixedInternalValueFvPatchField
Description
Recycles the boundary and internal values of a neighbour patch field to
the boundary and internal values of *this.
SourceFiles
directMappedFixedInternalValueFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedInternalValueFvPatchField_H
#define directMappedFixedInternalValueFvPatchField_H
#include "directMappedFixedValueFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directMappedFixedInternalValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class directMappedFixedInternalValueFvPatchField
:
public directMappedFixedValueFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("directMappedFixedInternalValue");
// Constructors
//- Construct from patch and internal field
directMappedFixedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
directMappedFixedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// directMappedFixedInternalValueFvPatchField onto a new patch
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedInternalValueFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedInternalValueFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "directMappedFixedInternalValueFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "directMappedFixedInternalValueFvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(directMappedFixedInternalValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedInternalValueFvPatchFields_H
#define directMappedFixedInternalValueFvPatchFields_H
#include "directMappedFixedInternalValueFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H
#define directMappedFixedInternalValueFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class directMappedFixedInternalValueFvPatchField;
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,133 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "directMappedFixedPushedInternalValueFvPatchField.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(p, iF)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
directMappedFixedValueFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf
)
:
directMappedFixedValueFvPatchField<Type>(ptf)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void directMappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
{
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
if (this->updated())
{
return;
}
// Retrieve the neighbour values and assign to this patch boundary field
directMappedFixedValueFvPatchField<Type>::updateCoeffs();
// Assign the patch internal field to its boundary value
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = *this;
}
template<class Type>
void directMappedFixedPushedInternalValueFvPatchField<Type>::write
(
Ostream& os
) const
{
directMappedFixedValueFvPatchField<Type>::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,157 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::directMappedFixedPushedInternalValueFvPatchField
Description
Recycles the boundary values of a neighbour patch field to the boundary
and internal values of *this.
SourceFiles
directMappedFixedPushedInternalValueFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedPushedInternalValueFvPatchField_H
#define directMappedFixedPushedInternalValueFvPatchField_H
#include "directMappedFixedValueFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directMappedFixedPushedInternalValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class directMappedFixedPushedInternalValueFvPatchField
:
public directMappedFixedValueFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("directMappedFixedPushedInternalValue");
// Constructors
//- Construct from patch and internal field
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given a
// directMappedFixedPushedInternalValueFvPatchField onto a new patch
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedPushedInternalValueFvPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedPushedInternalValueFvPatchField<Type>
(
*this,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "directMappedFixedPushedInternalValueFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "directMappedFixedPushedInternalValueFvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(directMappedFixedPushedInternalValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedPushedInternalValueFvPatchFields_H
#define directMappedFixedPushedInternalValueFvPatchFields_H
#include "directMappedFixedPushedInternalValueFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedPushedInternalValueFvPatchFieldsFwd_H
#define directMappedFixedPushedInternalValueFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class directMappedFixedPushedInternalValueFvPatchField;
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,167 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ 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_("deltaf")
{}
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 fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
deltafName_(dict.lookupOrDefault<word>("deltaf", "deltaf"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
Foam::filmHeightInletVelocityFvPatchVectorField::
filmHeightInletVelocityFvPatchVectorField
(
const filmHeightInletVelocityFvPatchVectorField& fhivpvf
)
:
fixedValueFvPatchVectorField(fhivpvf),
phiName_(fhivpvf.phiName_),
rhoName_(fhivpvf.rhoName_),
deltafName_(fhivpvf.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==(deltafp*n*phip/(rhop*magSf*sqr(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, "deltaf", "deltaf", deltafName_);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::filmHeightInletVelocityFvPatchVectorField::operator=
(
const fvPatchField<vector>& pvf
)
{
fvPatchField<vector>::operator=(patch().nf()*(patch().nf() & pvf));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
filmHeightInletVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,198 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ 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
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.
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&
);
//- Construct as copy
filmHeightInletVelocityFvPatchVectorField
(
const filmHeightInletVelocityFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new filmHeightInletVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy 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
// 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
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "injectionModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(injectionModel, 0);
defineRunTimeSelectionTable(injectionModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::injectionModel::injectionModel
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
owner_(owner),
coeffs_(dictionary::null)
{}
Foam::surfaceFilmModels::injectionModel::injectionModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
)
:
owner_(owner),
coeffs_(dict.subDict(type + "Coeffs"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::injectionModel::~injectionModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,160 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::injectionModel
Description
SourceFiles
injectionModelI.H
injectionModel.C
\*---------------------------------------------------------------------------*/
#ifndef injectionModel_H
#define injectionModel_H
#include "surfaceFilmModel.H"
#include "runTimeSelectionTables.H"
#include "scalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class injectionModel Declaration
\*---------------------------------------------------------------------------*/
class injectionModel
{
private:
// Private Member Functions
//- Disallow default bitwise copy construct
injectionModel(const injectionModel&);
//- Disallow default bitwise assignment
void operator=(const injectionModel&);
protected:
// Protected data
//- Reference to the owner surface film model
const surfaceFilmModel& owner_;
//- Model coefficients dictionary
dictionary coeffs_;
public:
//- Runtime type information
TypeName("injectionModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
injectionModel,
dictionary,
(
const surfaceFilmModel& owner,
const dictionary& dict
),
(owner, dict)
);
// Constructors
//- Construct null
injectionModel(const surfaceFilmModel& owner, const dictionary& dict);
//- Construct from type name, dictionary and surface film model
injectionModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
);
// Selectors
//- Return a reference to the selected phase change model
static autoPtr<injectionModel> New
(
const surfaceFilmModel& owner,
const dictionary& dict
);
//- Destructor
virtual ~injectionModel();
// Member Functions
// Access
//- Return the reference to the owner surface film model
inline const surfaceFilmModel& owner() const;
//- Return the model coefficients dictionary
inline const dictionary& coeffs() const;
// Evolution
//- Correct
virtual void correct
(
scalarField& massToInject,
scalarField& diameterToInject
) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "injectionModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "injectionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::surfaceFilmModels::surfaceFilmModel&
Foam::surfaceFilmModels::injectionModel::owner() const
{
return owner_;
}
inline const Foam::dictionary&
Foam::surfaceFilmModels::injectionModel::coeffs() const
{
return coeffs_;
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "injectionModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFilmModels::injectionModel>
Foam::surfaceFilmModels::injectionModel::New
(
const surfaceFilmModel& model,
const dictionary& dict
)
{
word modelType(dict.lookup("injectionModel"));
Info<< " Selecting injectionModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"injectionModel::New(const surfaceFilmModel&, const dictionary&)"
) << "Unknown injectionModel type " << modelType
<< nl << nl << "Valid injectionModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<injectionModel>(cstrIter()(model, dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "noInjection.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(noInjection, 0);
addToRunTimeSelectionTable(injectionModel, noInjection, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noInjection::noInjection
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
injectionModel(owner, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noInjection::~noInjection()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::noInjection::correct
(
scalarField& massToInject,
scalarField& diameterToInject
)
{
// no mass injected
massToInject = 0.0;
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::noInjection
Description
Dummy injection model for 'none'
SourceFiles
noInjection.C
\*---------------------------------------------------------------------------*/
#ifndef noInjection_H
#define noInjection_H
#include "injectionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class noInjection Declaration
\*---------------------------------------------------------------------------*/
class noInjection
:
public injectionModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
noInjection(const noInjection&);
//- Disallow default bitwise assignment
void operator=(const noInjection&);
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from surface film model
noInjection(const surfaceFilmModel& owner, const dictionary& dict);
//- Destructor
virtual ~noInjection();
// Member Functions
// Evolution
//- Correct
virtual void correct
(
scalarField& massToInject,
scalarField& diameterToInject
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ 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 "removeInjection.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(removeInjection, 0);
addToRunTimeSelectionTable(injectionModel, removeInjection, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::removeInjection::removeInjection
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
injectionModel(owner, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::removeInjection::~removeInjection()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::removeInjection::correct
(
scalarField&,
scalarField&
)
{
// do nothing - all mass available to be removed
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::removeInjection
Description
All mass available to be removed from the system is removed.
SourceFiles
removeInjection.C
\*---------------------------------------------------------------------------*/
#ifndef removeInjection_H
#define removeInjection_H
#include "injectionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class removeInjection Declaration
\*---------------------------------------------------------------------------*/
class removeInjection
:
public injectionModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
removeInjection(const removeInjection&);
//- Disallow default bitwise assignment
void operator=(const removeInjection&);
public:
//- Runtime type information
TypeName("remove");
// Constructors
//- Construct from surface film model
removeInjection(const surfaceFilmModel& owner, const dictionary& dict);
//- Destructor
virtual ~removeInjection();
// Member Functions
// Evolution
//- Correct
virtual void correct
(
scalarField& massToInject,
scalarField& diameterToInject
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "noPhaseChange.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(noPhaseChange, 0);
addToRunTimeSelectionTable(phaseChangeModel, noPhaseChange, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noPhaseChange::noPhaseChange
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
phaseChangeModel(owner, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noPhaseChange::~noPhaseChange()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::noPhaseChange::correct()
{
// do nothing
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::noPhaseChange
Description
Dummy phase change model for 'none'
SourceFiles
noPhaseChange.C
\*---------------------------------------------------------------------------*/
#ifndef noPhaseChange_H
#define noPhaseChange_H
#include "phaseChangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class noPhaseChange Declaration
\*---------------------------------------------------------------------------*/
class noPhaseChange
:
public phaseChangeModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
noPhaseChange(const noPhaseChange&);
//- Disallow default bitwise assignment
void operator=(const noPhaseChange&);
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from surface film model
noPhaseChange(const surfaceFilmModel& owner, const dictionary& dict);
//- Destructor
virtual ~noPhaseChange();
// Member Functions
// Evolution
//- Correct
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "phaseChangeModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFilmModels::phaseChangeModel>
Foam::surfaceFilmModels::phaseChangeModel::New
(
const surfaceFilmModel& model,
const dictionary& dict
)
{
word modelType(dict.lookup("phaseChangeModel"));
Info<< " Selecting phaseChangeModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"phaseChangeModel::New(const surfaceFilmModel&, const dictionary&)"
) << "Unknown phaseChangeModel type " << modelType
<< nl << nl << "Valid phaseChangeModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<phaseChangeModel>(cstrIter()(model, dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,81 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "phaseChangeModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(phaseChangeModel, 0);
defineRunTimeSelectionTable(phaseChangeModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
owner_(owner),
coeffs_(dictionary::null)
{}
Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
)
:
owner_(owner),
coeffs_(dict.subDict(type + "Coeffs"))
{
WarningIn
(
"phaseChangeModel::phaseChangeModel"
"("
"const word&, "
"const surfaceFilmModel&, "
"const dictionary&"
")"
) << "Phase change models not implemented!" << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::phaseChangeModel::~phaseChangeModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::phaseChangeModel
Description
SourceFiles
phaseChangeModelI.H
phaseChangeModel.C
\*---------------------------------------------------------------------------*/
#ifndef phaseChangeModel_H
#define phaseChangeModel_H
#include "surfaceFilmModel.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class phaseChangeModel Declaration
\*---------------------------------------------------------------------------*/
class phaseChangeModel
{
private:
// Private Member Functions
//- Disallow default bitwise copy construct
phaseChangeModel(const phaseChangeModel&);
//- Disallow default bitwise assignment
void operator=(const phaseChangeModel&);
protected:
// Protected data
//- Reference to the owner surface film model
const surfaceFilmModel& owner_;
//- Model coefficients dictionary
dictionary coeffs_;
public:
//- Runtime type information
TypeName("phaseChangeModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
phaseChangeModel,
dictionary,
(
const surfaceFilmModel& owner,
const dictionary& dict
),
(owner, dict)
);
// Constructors
//- Construct null
phaseChangeModel(const surfaceFilmModel& owner, const dictionary& dict);
//- Construct from type name, dictionary and surface film model
phaseChangeModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
);
// Selectors
//- Return a reference to the selected phase change model
static autoPtr<phaseChangeModel> New
(
const surfaceFilmModel& owner,
const dictionary& dict
);
//- Destructor
virtual ~phaseChangeModel();
// Member Functions
// Access
//- Return the reference to the owner surface film model
inline const surfaceFilmModel& owner() const;
//- Return the model coefficients dictionary
inline const dictionary& coeffs() const;
// Evolution
//- Correct // TODO
virtual void correct() = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "phaseChangeModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "phaseChangeModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::surfaceFilmModels::surfaceFilmModel&
Foam::surfaceFilmModels::phaseChangeModel::owner() const
{
return owner_;
}
inline const Foam::dictionary&
Foam::surfaceFilmModels::phaseChangeModel::coeffs() const
{
return coeffs_;
}
// ************************************************************************* //

View File

@ -0,0 +1,482 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::kinematicSingleLayer
Description
Kinematic form of single-cell layer surface film model
SourceFiles
kinematicSingleLayer.C
\*---------------------------------------------------------------------------*/
#ifndef kinematicSingleLayer_H
#define kinematicSingleLayer_H
#include "surfaceFilmModel.H"
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
// Forward declaration of classes
class injectionModel;
/*---------------------------------------------------------------------------*\
Class kinematicSingleLayer Declaration
\*---------------------------------------------------------------------------*/
class kinematicSingleLayer
:
public surfaceFilmModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
kinematicSingleLayer(const kinematicSingleLayer&);
//- Disallow default bitwise assignment
void operator=(const kinematicSingleLayer&);
protected:
// Protected data
// Mesh databases
//- Film region mesh database
fvMesh filmRegion_;
//- Patch normal vectors
volVectorField nHat_;
//- Face area magnitudes / [m2]
volScalarField magSf_;
//- List of patch IDs on the primary region coupled with the film
// region
labelList primaryPatchIDs_;
//- List of patch IDs on oppositte side of the film region
labelList filmTopPatchIDs_;
//- List of patch IDs on the film region coupled with the primary
// region
labelList filmBottomPatchIDs_;
// Solution parameters
//- Momentum predictor
Switch momentumPredictor_;
//- Number of outer correctors
label nOuterCorr_;
//- Number of PISO-like correctors
label nCorr_;
//- Number of non-orthogonal correctors
label nNonOrthCorr_;
//- Cumulative continuity error
scalar cumulativeContErr_;
// Model parameters
//- Skin frition coefficient for film/main region interface
scalar Cf_;
//- Stable film thickness - film cannot detach until this is reached
dimensionedScalar deltaStable_;
// Thermo properties
//- Density / [kg/m3]
volScalarField rho_;
//- Dynamic viscosity / [Pa.s]
volScalarField mu_;
//- Surface tension / [m/s2]
volScalarField sigma_;
// Fields
//- Film thickness / [m]
volScalarField delta_;
//- Velocity / [m/s]
volVectorField U_;
//- Film thickness*density (helper field) / [kg/m2]
volScalarField deltaRho_;
//- Mass flux (includes film thickness) / [kg.m/s]
surfaceScalarField phi_;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
volScalarField massForPrimary_;
//- Return the parcel diameters originating from film
volScalarField diametersForPrimary_;
// Source term fields
// Film region - registered to the film region mesh
// Note: need boundary value mapped from primary region, and then
// pushed into the patch internal field
//- Momementum / [kg/m/s2]
volVectorField USp_;
//- Pressure / [Pa]
volScalarField pSp_;
//- Mass / [kg/m2/s]
volScalarField rhoSp_;
// Primary region - registered to the primary region mesh
// Internal use only - not read-in
//- Momementum / [kg/m/s2]
volVectorField USpPrimary_;
//- Pressure / [Pa]
volScalarField pSpPrimary_;
//- Mass / [kg/m2/s]
volScalarField rhoSpPrimary_;
// Fields mapped from primary region - registered to the film region
// Note: need both boundary AND patch internal fields to be mapped
//- Velocity / [m/s]
volVectorField UPrimary_;
//- Pressure / [Pa]
volScalarField pPrimary_;
// Sub-models
//- Injection
autoPtr<injectionModel> injection_;
// Checks
//- Cumulative mass added via sources [kg]
scalar addedMass_;
// Detached surface properties
//- Cumulative mass detached [kg]
scalar detachedMass_;
// Protected member functions
//- Initialise the film model - called on construction
void initialise();
//- Read control parameters from dictionary
virtual bool read();
//- Reset source term fields
virtual void resetPrimaryRegionSourceTerms();
//- Transfer fields from the primary region to the film region
virtual void transferPrimaryRegionFields();
//- Correct the source terms for film that detaches from film region
virtual void correctDetachedFilm();
// Explicit pressure source contribution
virtual tmp<volScalarField> pu();
// Implicit pressure source coefficient
virtual tmp<volScalarField> pp();
//- Update the film sub-models
virtual void updateSubmodels();
//- Courant number evaluation
virtual scalar CourantNumber() const;
//- Continuity check
virtual void continuityCheck();
//- Return the stress term for the momentum equation
virtual tmp<fvVectorMatrix> tau(volVectorField& dU) const;
//- Constrain a film region master/slave boundaries of a field to a
// given value
template<class Type>
void constrainFilmField
(
Type& field,
const typename Type::cmptType& value
);
// Equations
//- Solve continuity equation
virtual void solveContinuity();
//- Solve for film velocity
virtual tmp<fvVectorMatrix> solveMomentum
(
const volScalarField& pu,
const volScalarField& pp
);
//- Solve coupled velocity-thickness equations
virtual void solveThickness
(
const volScalarField& pu,
const volScalarField& pp,
const fvVectorMatrix& UEqn
);
public:
//- Runtime type information
TypeName("kinematicSingleLayer");
// Constructors
//- Construct from components
kinematicSingleLayer
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~kinematicSingleLayer();
// Member Functions
// Access
//- Return the film mesh database
virtual const fvMesh& film() const;
//- Return the patch normal vectors
inline const volVectorField& nHat() const;
//- Return the face area magnitudes / [m2]
inline const volScalarField& magSf() const;
//- Return the list of coupled patches on the film region
virtual const labelList& filmBottomPatchIDs() const;
//- Return the list of patches oppositte coupled patches
virtual const labelList& filmTopPatchIDs() const;
//- Return the list of coupled patches on the primary region
virtual const labelList& primaryPatchIDs() const;
// Solution parameters
//- Return the momentum predictor
inline const Switch& momentumPredictor() const;
//- Return the number of outer correctors
inline label nOuterCorr() const;
//- Return the number of PISO correctors
inline label nCorr() const;
//- Return the number of non-orthogonal correctors
inline label nNonOrthCorr() const;
// Model parameters
//- Return the skin friction coefficient
inline scalar Cf() const;
// Thermo properties
//- Return const access to the dynamic viscosity / [Pa.s]
inline const volScalarField& mu() const;
//- Return const access to the surface tension / [m/s2]
inline const volScalarField& sigma() const;
// Fields
//- Return const access to the film thickness / [m]
inline const volScalarField& delta() const;
//- Return the film velocity [m/s]
virtual const volVectorField& U() const;
//- Return the film density [kg/m3]
virtual const volScalarField& rho() const;
//- Return the film temperature [K]
virtual const volScalarField& T() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
virtual const volScalarField& massForPrimary() const;
//- Return the parcel diameters originating from film
virtual const volScalarField& diametersForPrimary() const;
// External helper functions
//- Return true if patchI on the primary region is a coupled patch
// to the film region
virtual bool isFilmPatch(const label patchI) const;
//- External hook to add sources to the film
virtual void addSources
(
const label patchI, // patchI on primary region
const label faceI, // faceI of patchI
const scalar massSource, // [kg]
const vector& momentumSource, // [kg.m/s] (tangential momentum)
const scalar pressureSource, // [kg.m/s] (normal momentum)
const scalar energySource = 0 // [J]
);
// Source fields (read/write access)
// Primary region
//- Momementum / [kg/m/s2]
inline volVectorField& USpPrimary();
//- Pressure / [Pa]
inline volScalarField& pSpPrimary();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSpPrimary();
// Film region
//- Momementum / [kg/m/s2]
inline volVectorField& USp();
//- Pressure / [Pa]
inline volScalarField& pSp();
//- Mass / [kg/m2/s]
inline volScalarField& rhoSp();
// Sub-models
//- Injection
inline injectionModel& injection();
// Helper functions
//- Return the gravity tangential component contributions
inline tmp<volVectorField> gTan() const;
//- Return the gravity normal-to-patch component contribution
inline tmp<volScalarField> gNorm() const;
//- Return the gravity normal-to-patch component contribution
// Clipped so that only non-zero if g & nHat_ < 0
inline tmp<volScalarField> gNormClipped() const;
// Evolution
//- Evolve the film equations
virtual void evolveFilm();
// I-O
//- Provide some feedback
virtual void info() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "kinematicSingleLayerTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "kinematicSingleLayerI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,221 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "kinematicSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::volVectorField&
Foam::surfaceFilmModels::kinematicSingleLayer::nHat() const
{
return nHat_;
}
inline const Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::magSf() const
{
return magSf_;
}
inline const Foam::Switch&
Foam::surfaceFilmModels::kinematicSingleLayer::momentumPredictor() const
{
return momentumPredictor_;
}
inline Foam::label
Foam::surfaceFilmModels::kinematicSingleLayer::nOuterCorr() const
{
return nOuterCorr_;
}
inline Foam::label Foam::surfaceFilmModels::kinematicSingleLayer::nCorr() const
{
return nCorr_;
}
inline Foam::label
Foam::surfaceFilmModels::kinematicSingleLayer::nNonOrthCorr() const
{
return nNonOrthCorr_;
}
inline Foam::scalar Foam::surfaceFilmModels::kinematicSingleLayer::Cf() const
{
return Cf_;
}
inline const Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::mu() const
{
return mu_;
}
inline const Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::sigma() const
{
return sigma_;
}
inline const Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::delta() const
{
return delta_;
}
inline Foam::volVectorField&
Foam::surfaceFilmModels::kinematicSingleLayer::USpPrimary()
{
return USpPrimary_;
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::pSpPrimary()
{
return pSpPrimary_;
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::rhoSpPrimary()
{
return rhoSpPrimary_;
}
inline Foam::volVectorField&
Foam::surfaceFilmModels::kinematicSingleLayer::USp()
{
return USp_;
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::pSp()
{
return pSp_;
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::kinematicSingleLayer::rhoSp()
{
return rhoSp_;
}
inline Foam::surfaceFilmModels::injectionModel&
Foam::surfaceFilmModels::kinematicSingleLayer::injection()
{
return injection_();
}
inline Foam::tmp<Foam::volScalarField>
Foam::surfaceFilmModels::kinematicSingleLayer::gNorm() const
{
tmp<volScalarField> tgNorm
(
new volScalarField
(
IOobject
(
"gNorm",
filmRegion_.time().timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
g_ & nHat_,
zeroGradientFvPatchScalarField::typeName
)
);
return tgNorm;
}
inline Foam::tmp<Foam::volScalarField>
Foam::surfaceFilmModels::kinematicSingleLayer::gNormClipped() const
{
tmp<volScalarField> tgNormClipped
(
new volScalarField
(
IOobject
(
"gNormClipped",
filmRegion_.time().timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
g_ & nHat_,
zeroGradientFvPatchScalarField::typeName
)
);
volScalarField& gNormClipped = tgNormClipped();
gNormClipped.min(0.0);
return tgNormClipped;
}
inline Foam::tmp<Foam::volVectorField>
Foam::surfaceFilmModels::kinematicSingleLayer::gTan() const
{
tmp<volVectorField> tgTan
(
new volVectorField
(
IOobject
(
"gTan",
filmRegion_.time().timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
g_ - nHat_*gNorm(),
zeroGradientFvPatchVectorField::typeName
)
);
return tgTan;
}
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ 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 "kinematicSingleLayer.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::surfaceFilmModels::kinematicSingleLayer::constrainFilmField
(
Type& field,
const typename Type::cmptType& value
)
{
forAll(filmBottomPatchIDs_, i)
{
label patchI = filmBottomPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
forAll(filmTopPatchIDs_, i)
{
label patchI = filmTopPatchIDs_[i];
field.boundaryField()[patchI] = value;
if (debug)
{
Info<< "Constraining " << field.name()
<< " boundary " << field.boundaryField()[patchI].patch().name()
<< " to " << value << endl;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,209 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "noFilm.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(noFilm, 0);
addToRunTimeSelectionTable(surfaceFilmModel, noFilm, mesh);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::surfaceFilmModels::noFilm::read()
{
if (surfaceFilmModel::read())
{
// no additional info to read
return true;
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noFilm::noFilm
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
)
:
surfaceFilmModel(modelType, mesh, g)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::noFilm::~noFilm()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::noFilm::evolveFilm()
{
// do nothing
}
const Foam::fvMesh& Foam::surfaceFilmModels::noFilm::film() const
{
FatalErrorIn("const fvMesh& noFilm::film() const")
<< "Cannot return film for noFilm model" << abort(FatalError);
return reinterpret_cast<const fvMesh&>(null);
}
const Foam::labelList&
Foam::surfaceFilmModels::noFilm::filmBottomPatchIDs() const
{
return labelList::null();
}
const Foam::labelList& Foam::surfaceFilmModels::noFilm::filmTopPatchIDs() const
{
return labelList::null();
}
const Foam::labelList& Foam::surfaceFilmModels::noFilm::primaryPatchIDs() const
{
return labelList::null();
}
bool Foam::surfaceFilmModels::noFilm::isFilmPatch(const label) const
{
return false;
}
void Foam::surfaceFilmModels::noFilm::addSources
(
const label,
const label,
const scalar,
const vector&,
const scalar,
const scalar
)
{
// do nothing
}
const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::U() const
{
FatalErrorIn
(
"const volScalarField& noFilm::U() const"
) << "U field not available for " << type() << abort(FatalError);
return reinterpret_cast<const volVectorField&>(null);
}
const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::rho() const
{
FatalErrorIn
(
"const volScalarField& noFilm::rho() const"
) << "rho field not available for " << type() << abort(FatalError);
return reinterpret_cast<const volScalarField&>(null);
}
const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::T() const
{
FatalErrorIn
(
"const Foam::volScalarField& Foam::noFilm::T() const"
) << "T field not available for " << type() << abort(FatalError);
return reinterpret_cast<const volScalarField&>(null);
}
const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::cp() const
{
FatalErrorIn
(
"const volScalarField& noFilm::cp() const"
) << "cp field not available for " << type() << abort(FatalError);
return reinterpret_cast<const volScalarField&>(null);
}
const Foam::volScalarField&
Foam::surfaceFilmModels::noFilm::massForPrimary() const
{
FatalErrorIn
(
"const volScalarField& noFilm::massForPrimary() const"
) << "massForPrimary field not available for " << type()
<< abort(FatalError);
return reinterpret_cast<const volScalarField&>(null);
}
const Foam::volScalarField&
Foam::surfaceFilmModels::noFilm::diametersForPrimary() const
{
FatalErrorIn
(
"const volScalarField& noFilm::diametersForPrimary() const"
) << "diametersForPrimary field not available for " << type()
<< abort(FatalError);
return reinterpret_cast<const volScalarField&>(null);
}
void Foam::surfaceFilmModels::noFilm::info() const
{
// do nothing
}
// ************************************************************************* //

View File

@ -0,0 +1,173 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::noFilm
Description
Dummy surface film model for 'none'
SourceFiles
noFilm.C
\*---------------------------------------------------------------------------*/
#ifndef noFilm_H
#define noFilm_H
#include "surfaceFilmModel.H"
#include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class noFilm Declaration
\*---------------------------------------------------------------------------*/
class noFilm
:
public surfaceFilmModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
noFilm(const noFilm&);
//- Disallow default bitwise assignment
void operator=(const noFilm&);
protected:
// Protected member functions
//- Read control parameters from dictionary
virtual bool read();
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
noFilm
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~noFilm();
// Member Functions
// Access
//- Return the film mesh database
virtual const fvMesh& film() const;
//- Return the list of coupled patches on the film region
virtual const labelList& filmBottomPatchIDs() const;
//- Return the list of patches oppositte coupled patches
virtual const labelList& filmTopPatchIDs() const;
//- Return the list of coupled patches on the primary region
virtual const labelList& primaryPatchIDs() const;
//- Return true if patchI is a coupled patch to the film region
virtual bool isFilmPatch(const label patchI) const;
//- External hook to add sources to the film
virtual void addSources
(
const label patchI,
const label faceI,
const scalar massSource,
const vector& momentumSource,
const scalar pressureSource,
const scalar energySource
);
// Fields
//- Return the film velocity [m/s]
virtual const volVectorField& U() const;
//- Return the film density [kg/m3]
virtual const volScalarField& rho() const;
//- Return the film temperature [K]
virtual const volScalarField& T() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
virtual const volScalarField& massForPrimary() const;
//- Return the parcel diameters originating from film
virtual const volScalarField& diametersForPrimary() const;
// Evolution
//- Evolve the film equations
virtual void evolveFilm();
// I-O
//- Provide some feedback
virtual void info() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "surfaceFilmModel.H"
#include "fvMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceFilmModels::surfaceFilmModel>
Foam::surfaceFilmModels::surfaceFilmModel::New
(
const fvMesh& mesh,
const dimensionedVector& g
)
{
word modelType;
{
IOdictionary surfaceFilmPropertiesDict
(
IOobject
(
"surfaceFilmProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
surfaceFilmPropertiesDict.lookup("surfaceFilmModel") >> modelType;
}
Info<< "Selecting surfaceFilmModel " << modelType << endl;
meshConstructorTable::iterator cstrIter =
meshConstructorTablePtr_->find(modelType);
if (cstrIter == meshConstructorTablePtr_->end())
{
FatalErrorIn
(
"surfaceFilmModel::New(const fvMesh&, const dimensionedVector&)"
) << "Unknown surfaceFilmModel type " << modelType
<< nl << nl << "Valid surfaceFilmModel types are:" << nl
<< meshConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<surfaceFilmModel>(cstrIter()(modelType, mesh, g));
}
// ************************************************************************* //

View File

@ -0,0 +1,166 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "surfaceFilmModel.H"
#include "fvc.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(surfaceFilmModel, 0);
defineRunTimeSelectionTable(surfaceFilmModel, mesh);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::surfaceFilmModels::surfaceFilmModel::read()
{
if (regIOobject::read())
{
active_.readIfPresent("active", *this);
if (const dictionary* dictPtr = subDictPtr(type() + "Coeffs"))
{
coeffs_ <<= *dictPtr;
}
return true;
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::surfaceFilmModel::surfaceFilmModel
(
const fvMesh& mesh,
const dimensionedVector& g
)
:
IOdictionary
(
IOobject
(
"surfaceFilmProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
mesh_(mesh),
time_(mesh.time()),
active_(false),
g_(g),
filmRegionName_("none"),
coeffs_(dictionary::null)
{}
Foam::surfaceFilmModels::surfaceFilmModel::surfaceFilmModel
(
const word& type,
const fvMesh& mesh,
const dimensionedVector& g
)
:
IOdictionary
(
IOobject
(
"surfaceFilmProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
mesh_(mesh),
time_(mesh.time()),
active_(lookup("active")),
g_(g),
filmRegionName_(lookup("filmRegionName")),
coeffs_(subDict(type + "Coeffs"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::surfaceFilmModel::~surfaceFilmModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::fvMesh& Foam::surfaceFilmModels::surfaceFilmModel::mesh() const
{
return mesh_;
}
const Foam::Time& Foam::surfaceFilmModels::surfaceFilmModel::time() const
{
return time_;
}
void Foam::surfaceFilmModels::surfaceFilmModel::evolve()
{
if (active_)
{
if (mesh_.changing())
{
FatalErrorIn("surfaceFilmModel::evolveFilm()")
<< "Currently not possible to apply surface film model to "
<< "moving mesh cases" << nl << abort(FatalError);
}
Info<< "\nEvolving surface film for region " << filmRegionName_
<< endl;
// Update any input information
read();
// Increment the film equations up to the new time level
evolveFilm();
// Provide some feedback
Info<< incrIndent;
info();
Info<< endl << decrIndent;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,250 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::surfaceFilmModel
Description
SourceFiles
surfaceFilmModelI.H
surfaceFilmModel.C
\*---------------------------------------------------------------------------*/
#ifndef surfaceFilmModel_H
#define surfaceFilmModel_H
#include "IOdictionary.H"
#include "Switch.H"
#include "dimensionedVector.H"
#include "runTimeSelectionTables.H"
#include "volFieldsFwd.H"
#include "labelList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class fvMesh;
class Time;
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class surfaceFilmModel Declaration
\*---------------------------------------------------------------------------*/
class surfaceFilmModel
:
public IOdictionary
{
private:
// Private Member Functions
//- Disallow default bitwise copy construct
surfaceFilmModel(const surfaceFilmModel&);
//- Disallow default bitwise assignment
void operator=(const surfaceFilmModel&);
protected:
// Protected data
//- Reference to the mesh database
const fvMesh& mesh_;
//- Reference to the time database
const Time& time_;
//- Active flag
Switch active_;
//- Acceleration due to gravity [m/s2]
const dimensionedVector& g_;
//- Name of film region
word filmRegionName_;
//- Model coefficients dictionary
dictionary coeffs_;
// Protected member functions
//- Read control parameters from dictionary
virtual bool read();
//- Evolve the film
virtual void evolveFilm() = 0;
public:
//- Runtime type information
TypeName("surfaceFilmModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
surfaceFilmModel,
mesh,
(
const word& type,
const fvMesh& mesh,
const dimensionedVector& g
),
(type, mesh, g)
);
// Constructors
//- Construct null
surfaceFilmModel(const fvMesh& mesh, const dimensionedVector& g);
//- Construct from type name and fvMesh
surfaceFilmModel
(
const word& type,
const fvMesh& mesh,
const dimensionedVector& g
);
// Selectors
//- Return a reference to the selected surface film model
static autoPtr<surfaceFilmModel> New
(
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~surfaceFilmModel();
// Member Functions
// Access
//- Return the reference to the primary mesh database
const fvMesh& mesh() const;
//- Return the reference to the time database
const Time& time() const;
//- Return the active flag
inline const Switch& active() const;
//- Return the model coefficients dictionary
inline const dictionary& coeffs() const;
//- Return the film mesh database
virtual const fvMesh& film() const = 0;
//- Return the list of coupled patches on the film region
virtual const labelList& filmBottomPatchIDs() const = 0;
//- Return the list of patches oppositte coupled patches
virtual const labelList& filmTopPatchIDs() const = 0;
//- Return the list of coupled patches on the primary region
virtual const labelList& primaryPatchIDs() const = 0;
//- Return true if primary patchI is coupled to the film region
virtual bool isFilmPatch(const label patchI) const = 0;
//- External hook to add sources to the film
virtual void addSources
(
const label patchI,
const label faceI,
const scalar massSource,
const vector& momentumSource,
const scalar pressureSource,
const scalar energySource
) = 0;
// Fields
//- Return the film velocity [m/s]
virtual const volVectorField& U() const = 0;
//- Return the film density [kg/m3]
virtual const volScalarField& rho() const = 0;
//- Return the film temperature [K]
virtual const volScalarField& T() const = 0;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const = 0;
// Transfer fields - to the primary region
//- Return the film mass available for transfer
virtual const volScalarField& massForPrimary() const = 0;
//- Return the parcel diameters originating from film
virtual const volScalarField& diametersForPrimary() const = 0;
// Evolution
//- Evolve the film
virtual void evolve();
// I-O
//- Provide some feedback
virtual void info() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "surfaceFilmModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "surfaceFilmModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::Switch&
Foam::surfaceFilmModels::surfaceFilmModel::active() const
{
return active_;
}
inline const Foam::dictionary&
Foam::surfaceFilmModels::surfaceFilmModel::coeffs() const
{
return coeffs_;
}
// ************************************************************************* //

View File

@ -0,0 +1,394 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "thermoSingleLayer.H"
#include "fvcDiv.H"
#include "fvcLaplacian.H"
#include "fvm.H"
#include "phaseChangeModel.H"
#include "addToRunTimeSelectionTable.H"
// Sub-models
#include "injectionModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
defineTypeNameAndDebug(thermoSingleLayer, 0);
addToRunTimeSelectionTable(surfaceFilmModel, thermoSingleLayer, mesh);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::surfaceFilmModels::thermoSingleLayer::read()
{
if (kinematicSingleLayer::read())
{
coeffs_.lookup("htcw") >> htcw_;
coeffs_.lookup("htcs") >> htcs_;
return true;
}
else
{
return false;
}
}
void Foam::surfaceFilmModels::thermoSingleLayer::initialise()
{
if (debug)
{
Pout<< "thermoSingleLayer::initialise()" << endl;
}
kinematicSingleLayer::initialise();
hs_ == hs(T_);
}
void Foam::surfaceFilmModels::thermoSingleLayer::resetPrimaryRegionSourceTerms()
{
kinematicSingleLayer::resetPrimaryRegionSourceTerms();
hsSpPrimary_ == dimensionedScalar("zero", hsSp_.dimensions(), 0.0);
}
void Foam::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionFields()
{
kinematicSingleLayer::transferPrimaryRegionFields();
// Update temperature from primary region via direct mapped (coupled)
// boundary conditions
TPrimary_.correctBoundaryConditions();
// Retrieve the source fields from the primary region via direct mapped
// (coupled) boundary conditions
// - fields require transfer of values for both patch AND to push the
// values into the first layer of internal cells
hsSp_.correctBoundaryConditions();
// Convert accummulated source terms into per unit area per unit time
// Note: boundary values will still have original (neat) values
const scalar deltaT = filmRegion_.time().deltaTValue();
hsSp_.field() /= magSf_*deltaT;
}
void Foam::surfaceFilmModels::thermoSingleLayer::updateSubmodels()
{
kinematicSingleLayer::updateSubmodels();
const dimensionedScalar deltaT = filmRegion_.time().deltaT();
hsSp_ -= massForPrimary_*hs_/magSf_/deltaT;
// Update the sub-models
phaseChange_->correct();
}
Foam::tmp<Foam::fvScalarMatrix> Foam::surfaceFilmModels::thermoSingleLayer::q
(
volScalarField& hs
) const
{
DimensionedField<scalar, volMesh> Tw
(
IOobject
(
"Tw",
time_.timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
filmRegion_,
dimensionedScalar("zero", dimTemperature, 0.0)
);
for (label i=0; i<filmBottomPatchIDs_.size(); i++)
{
label patchI = filmBottomPatchIDs_[i];
const polyPatch& pp = filmRegion_.boundaryMesh()[patchI];
UIndirectList<scalar>(Tw, pp.faceCells()) =
TPrimary_.boundaryField()[patchI];
}
// TODO: Use T at film thickness instead of cell value
DimensionedField<scalar, volMesh> Ts =
TPrimary_.dimensionedInternalField();
return
(
- fvm::Sp(htcs_/cp_, hs)
+ htcs_*(dimensionedScalar("Tstd", dimTemperature, 298.15) - Ts)
- fvm::Sp(htcw_/cp_, hs)
+ htcw_*(dimensionedScalar("Tstd", dimTemperature, 298.15) - Tw)
);
}
void Foam::surfaceFilmModels::thermoSingleLayer::solveEnergy()
{
if (debug)
{
Info<< "thermoSingleLayer::solveEnergy()" << endl;
}
solve
(
fvm::ddt(deltaRho_, hs_)
+ fvm::div(phi_, hs_)
==
hsSp_
+ q(hs_)
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::thermoSingleLayer::thermoSingleLayer
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
)
:
kinematicSingleLayer(modelType, mesh, g),
cp_
(
IOobject
(
"cp",
time_.timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
filmRegion_,
dimensionedScalar(coeffs_.lookup("cp"))
),
htcw_
(
dimensionedScalar("htc", dimEnergy/dimTime/dimArea/dimTemperature, 0.0)
),
htcs_
(
dimensionedScalar("htc", dimEnergy/dimTime/dimArea/dimTemperature, 0.0)
),
T_
(
IOobject
(
"Tf",
time_.timeName(),
filmRegion_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
filmRegion_
),
hs_
(
IOobject
(
"hsf",
time_.timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
filmRegion_,
dimensionedScalar("zero", dimEnergy/dimMass, 0.0),
T_.boundaryField().types()
),
hsSp_
(
IOobject
(
"hsSp",
time_.timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
filmRegion_,
dimensionedScalar("zero", dimEnergy/dimArea/dimTime, 0.0),
pSp_.boundaryField().types()
),
hsSpPrimary_
(
IOobject
(
hsSp_.name(), // must have same name as hSp_ to enable mapping
time_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", hsSp_.dimensions(), 0.0)
),
TPrimary_
(
IOobject
(
"T", // must have same name as T on primary region to enable mapping
time_.timeName(),
filmRegion_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
filmRegion_
),
phaseChange_(phaseChangeModel::New(*this, coeffs_)),
hsSpDetach_(filmRegion_.nCells(), 0.0)
{
read();
initialise();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceFilmModels::thermoSingleLayer::~thermoSingleLayer()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::surfaceFilmModels::thermoSingleLayer::addSources
(
const label patchI,
const label faceI,
const scalar massSource,
const vector& momentumSource,
const scalar pressureSource,
const scalar energySource
)
{
kinematicSingleLayer::addSources
(
patchI,
faceI,
massSource,
momentumSource,
pressureSource,
energySource
);
if (debug)
{
Info<< " energy = " << energySource << nl << endl;
}
hsSpPrimary_.boundaryField()[patchI][faceI] += energySource;
}
void Foam::surfaceFilmModels::thermoSingleLayer::evolveFilm()
{
transferPrimaryRegionFields();
updateSubmodels();
// Solve continuity for deltaRho_
solveContinuity();
for (int oCorr=0; oCorr<nOuterCorr_; oCorr++)
{
// Explicit pressure source contribution
tmp<volScalarField> pu = this->pu();
// Implicit pressure source coefficient
tmp<volScalarField> pp = this->pp();
// Solve for momentum for U_
tmp<fvVectorMatrix> UEqn = solveMomentum(pu(), pp());
// Film thickness correction loop
for (int corr=1; corr<=nCorr_; corr++)
{
// Solve energy for hs_
solveEnergy();
// Solve thickness for delta_
solveThickness(pu(), pp(), UEqn());
}
}
// Update deltaRho_ with new delta_
deltaRho_ == delta_*rho_;
// Update temperature using latest hs_
T_ == T(hs_);
// Reset source terms for next time integration
resetPrimaryRegionSourceTerms();
}
const Foam::volScalarField&
Foam::surfaceFilmModels::thermoSingleLayer::T() const
{
return T_;
}
const Foam::volScalarField&
Foam::surfaceFilmModels::thermoSingleLayer::cp() const
{
return cp_;
}
void Foam::surfaceFilmModels::thermoSingleLayer::info() const
{
kinematicSingleLayer::info();
Info<< indent<< "min/max(T) = " << min(T_).value() << ", "
<< max(T_).value() << nl;
}
// ************************************************************************* //

View File

@ -0,0 +1,280 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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::thermoSingleLayer
Description
Thermodynamic form of single-cell layer surface film model
Note: defining enthalpy as cp(T - Tstd) - when using liquids from the
thermophysical library, their enthalpies are calculated similarly, where
Tstd = 298.15 K
SourceFiles
thermoSingleLayer.C
\*---------------------------------------------------------------------------*/
#ifndef thermoSingleLayer_H
#define thermoSingleLayer_H
#include "kinematicSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceFilmModels
{
// Forward declaration of classes
class phaseChangeModel;
/*---------------------------------------------------------------------------*\
Class thermoSingleLayer Declaration
\*---------------------------------------------------------------------------*/
class thermoSingleLayer
:
public kinematicSingleLayer
{
private:
// Private member functions
//- Disallow default bitwise copy construct
thermoSingleLayer(const thermoSingleLayer&);
//- Disallow default bitwise assignment
void operator=(const thermoSingleLayer&);
protected:
// Protected data
// Thermo properties TODO: currently read from coeffs dictionary
//- Specific heat capacity / [J/kg/K]
volScalarField cp_;
// Model parameters
//- Heat transfer coefficient bewteen wall and film [W/m2/K]
dimensionedScalar htcw_;
//- Heat transfer coefficient bewteen film surface and primary
// region [W/m2/K]
dimensionedScalar htcs_;
// Fields
//- Temperature / [K]
volScalarField T_;
//- Sensible)enthalpy / [J/kg]
volScalarField hs_;
// Source term fields
// Film region - registered to the film region mesh
// Note: need boundary value mapped from primary region, and then
// pushed into the patch internal field
//- Energy / [J/m2/s]
volScalarField hsSp_;
// Primary region - registered to the primary region mesh
// Internal use only - not read-in
//- Energy / [J/m2/s]
volScalarField hsSpPrimary_;
// Fields mapped from primary region - registered to the film region
// Note: need both boundary AND patch internal fields to be mapped
//- Temperature / [K]
volScalarField TPrimary_;
// Sub-models
//- Phase change
autoPtr<phaseChangeModel> phaseChange_;
// Detached surface properties
//- Energy sink from film to carrier phase [kg]
scalarField hsSpDetach_;
// Protected member functions
//- Initialise the film model - called on construction
void initialise();
//- Read control parameters from dictionary
virtual bool read();
//- Reset source term fields
virtual void resetPrimaryRegionSourceTerms();
//- Transfer fields from the primary region to the film region
virtual void transferPrimaryRegionFields();
//- Update the film sub-models
virtual void updateSubmodels();
//- Return the wall/surface heat transfer term for the enthalpy equation
virtual tmp<fvScalarMatrix> q(volScalarField& h) const;
// Equations
//- Solve energy equation
virtual void solveEnergy();
public:
//- Runtime type information
TypeName("thermoSingleLayer");
// Constructors
//- Construct from components
thermoSingleLayer
(
const word& modelType,
const fvMesh& mesh,
const dimensionedVector& g
);
//- Destructor
virtual ~thermoSingleLayer();
// Member Functions
// Model parameters
//- Return the heat transfer coefficient bewteen wall and film
inline const dimensionedScalar& htcw() const;
//- Return the Heat transfer coefficient bewteen film surface and
// primary region
inline const dimensionedScalar& htcs() const;
// Thermo properties
//- Return sensible enthalpy as a function of temperature
inline tmp<Foam::volScalarField> hs
(
const volScalarField& T
) const;
//- Return temperature as a function of sensible enthalpy
inline tmp<Foam::volScalarField> T
(
const volScalarField& hs
) const;
// Fields
//- Return the film temperature [K]
virtual const volScalarField& T() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& cp() const;
// Source fields (read/write access)
//- External hook to add sources to the film
virtual void addSources
(
const label patchI, // patchI on primary region
const label faceI, // faceI of patchI
const scalar massSource, // [kg]
const vector& momentumSource, // [kg.m/s] (tangential momentum)
const scalar pressureSource, // [kg.m/s] (normal momentum)
const scalar energySource // [J]
);
// Primary region
//- Energy / [J/m2/s]
inline volScalarField& hsSpPrimary();
// Film region
//- Energy / [J/m2/s]
inline volScalarField& hsSp();
// Sub-models
//- Phase change
inline phaseChangeModel& phaseChange();
// Evolution
//- Evolve the film equations
virtual void evolveFilm();
// I-O
//- Provide some feedback
virtual void info() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "thermoSingleLayerI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,113 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ 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 "thermoSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::dimensionedScalar&
Foam::surfaceFilmModels::thermoSingleLayer::htcw() const
{
return htcw_;
}
inline const Foam::dimensionedScalar&
Foam::surfaceFilmModels::thermoSingleLayer::htcs() const
{
return htcs_;
}
inline Foam::tmp<Foam::volScalarField>
Foam::surfaceFilmModels::thermoSingleLayer::hs
(
const volScalarField& T
) const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"hs(" + T.name() + ")",
filmRegion_.time().timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
cp_*(T - (dimensionedScalar("Tstd", dimTemperature, 298.15)))
)
);
}
inline Foam::tmp<Foam::volScalarField>
Foam::surfaceFilmModels::thermoSingleLayer::T
(
const volScalarField& hs
) const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"T(" + hs.name() + ")",
filmRegion_.time().timeName(),
filmRegion_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
hs/cp_ + dimensionedScalar("Tstd", dimTemperature, 298.15)
)
);
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::thermoSingleLayer::hsSpPrimary()
{
return hsSpPrimary_;
}
inline Foam::volScalarField&
Foam::surfaceFilmModels::thermoSingleLayer::hsSp()
{
return hsSp_;
}
inline Foam::surfaceFilmModels::phaseChangeModel&
Foam::surfaceFilmModels::thermoSingleLayer::phaseChange()
{
return phaseChange_();
}
// ************************************************************************* //

View File

@ -37,6 +37,8 @@ SurfaceReactionModel COxidationDiffusionLimitedRate;
PostProcessingModel none;
SurfaceFilmModel none;
radiation on;
coupled true;

View File

@ -29,6 +29,8 @@ HeatTransferModel RanzMarshall;
PostProcessingModel none;
SurfaceFilmModel none;
radiation on;
coupled true;

View File

@ -38,6 +38,8 @@ DevolatilisationModel none;
SurfaceReactionModel none;
SurfaceFilmModel none;
radiation off;
coupled true;

View File

@ -37,6 +37,8 @@ SurfaceReactionModel none;
PostProcessingModel none;
SurfaceFilmModel none;
radiation off;
coupled false;

View File

@ -37,6 +37,8 @@ SurfaceReactionModel none;
PostProcessingModel PatchPostProcessing;
SurfaceFilmModel none;
radiation off;
coupled true;

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object H2O;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
wallFilm
{
type zeroGradient;
}
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More