mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
Conflicts: src/lagrangian/dieselSpray/spray/findInjectorCell.H
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
dieselEngineFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/dieselEngineFoam
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
fvVectorMatrix UEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, U)
|
|
||||||
+ fvm::div(phi, U)
|
|
||||||
+ turbulence->divDevRhoReff(U)
|
|
||||||
==
|
|
||||||
rho*g
|
|
||||||
+ dieselSpray.momentumSource()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
|
||||||
{
|
|
||||||
solve(UEqn == -fvc::grad(p));
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
|
||||||
(
|
|
||||||
fv::convectionScheme<scalar>::New
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
fields,
|
|
||||||
phi,
|
|
||||||
mesh.divScheme("div(phi,Yi_h)")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
{
|
|
||||||
combustion->correct();
|
|
||||||
dQ = combustion->dQ();
|
|
||||||
label inertIndex = -1;
|
|
||||||
volScalarField Yt(0.0*Y[0]);
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
if (Y[i].name() != inertSpecie)
|
|
||||||
{
|
|
||||||
volScalarField& Yi = Y[i];
|
|
||||||
|
|
||||||
fvScalarMatrix YiEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, Yi)
|
|
||||||
+ mvConvection->fvmDiv(phi, Yi)
|
|
||||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
|
||||||
==
|
|
||||||
dieselSpray.evaporationSource(i)
|
|
||||||
+ combustion->R(Yi)
|
|
||||||
);
|
|
||||||
|
|
||||||
YiEqn.relax();
|
|
||||||
YiEqn.solve(mesh.solver("Yi"));
|
|
||||||
|
|
||||||
Yi.max(0.0);
|
|
||||||
Yt += Yi;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inertIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
|
||||||
Y[inertIndex].max(0.0);
|
|
||||||
}
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
Info<< "Creating combustion model\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<combustionModels::psiChemistryCombustionModel> combustion
|
|
||||||
(
|
|
||||||
combustionModels::psiChemistryCombustionModel::New
|
|
||||||
(
|
|
||||||
mesh
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
psiChemistryModel& chemistry = combustion->pChemistry();
|
|
||||||
|
|
||||||
hsCombustionThermo& thermo = chemistry.thermo();
|
|
||||||
|
|
||||||
basicMultiComponentMixture& composition = thermo.composition();
|
|
||||||
PtrList<volScalarField>& Y = composition.Y();
|
|
||||||
|
|
||||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
|
||||||
|
|
||||||
if (!composition.contains(inertSpecie))
|
|
||||||
{
|
|
||||||
FatalErrorIn(args.executable())
|
|
||||||
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
|
||||||
<< "species list. Available species:" << composition.species()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
thermo.rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Reading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
volScalarField& hs = thermo.hs();
|
|
||||||
|
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
|
||||||
|
|
||||||
Info << "Creating turbulence model.\n" << nl;
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the turbulence into the combustion model
|
|
||||||
combustion->setTurbulence(turbulence());
|
|
||||||
|
|
||||||
Info<< "Creating field DpDt\n" << endl;
|
|
||||||
volScalarField DpDt
|
|
||||||
(
|
|
||||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
fields.add(Y[i]);
|
|
||||||
}
|
|
||||||
fields.add(hs);
|
|
||||||
|
|
||||||
volScalarField dQ
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dQ",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
|
||||||
);
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
Info << "Constructing Spray" << endl;
|
|
||||||
|
|
||||||
PtrList<gasThermoPhysics> gasProperties(Y.size());
|
|
||||||
forAll(gasProperties, i)
|
|
||||||
{
|
|
||||||
gasProperties.set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
new gasThermoPhysics
|
|
||||||
(
|
|
||||||
dynamic_cast<const reactingMixture<gasThermoPhysics>&>
|
|
||||||
(thermo).speciesData()[i]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
spray dieselSpray
|
|
||||||
(
|
|
||||||
U,
|
|
||||||
rho,
|
|
||||||
p,
|
|
||||||
T,
|
|
||||||
composition,
|
|
||||||
gasProperties,
|
|
||||||
thermo,
|
|
||||||
g
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar gasMass0 = fvc::domainIntegrate(rho).value();
|
|
||||||
|
|
||||||
if (dieselSpray.twoD())
|
|
||||||
{
|
|
||||||
gasMass0 *= constant::mathematical::twoPi/dieselSpray.angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
gasMass0 -=
|
|
||||||
dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass();
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
fvScalarMatrix hsEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, hs)
|
|
||||||
+ mvConvection->fvmDiv(phi, hs)
|
|
||||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
|
||||||
==
|
|
||||||
DpDt
|
|
||||||
+ combustion->Sh()
|
|
||||||
+ dieselSpray.heatTransferSource()()
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
hsEqn.relax();
|
|
||||||
hsEqn.solve();
|
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
|
|
||||||
Info<< "min/max(T) = "
|
|
||||||
<< min(T).value() << ", " << max(T).value() << endl;
|
|
||||||
}
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
volScalarField A(UEqn.A());
|
|
||||||
U = UEqn.H()/A;
|
|
||||||
|
|
||||||
if (pimple.transonic())
|
|
||||||
{
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
fvc::interpolate(psi)
|
|
||||||
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(psi, p)
|
|
||||||
+ fvm::div(phid, p)
|
|
||||||
- fvm::laplacian(rho/A, p)
|
|
||||||
==
|
|
||||||
Sevap
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi == pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
phi = fvc::interpolate(rho)
|
|
||||||
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(psi, p)
|
|
||||||
+ fvc::div(phi)
|
|
||||||
- fvm::laplacian(rho/A, p)
|
|
||||||
==
|
|
||||||
Sevap
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi += pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U -= fvc::grad(p)/A;
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
|
|
||||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Global
|
|
||||||
rhoEqn
|
|
||||||
|
|
||||||
Description
|
|
||||||
Solve the continuity for density.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
volScalarField Sevap
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Sevap",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
if (dieselSpray.isLiquidFuel()[i])
|
|
||||||
{
|
|
||||||
Sevap += dieselSpray.evaporationSource(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
fvm::ddt(rho)
|
|
||||||
+ fvc::div(phi)
|
|
||||||
==
|
|
||||||
Sevap
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
label Nparcels = dieselSpray.size();
|
|
||||||
reduce(Nparcels, sumOp<label>());
|
|
||||||
|
|
||||||
Info<< "\nNumber of parcels in system.... | "
|
|
||||||
<< Nparcels << endl
|
|
||||||
<< "Injected liquid mass........... | "
|
|
||||||
<< 1e6*dieselSpray.injectedMass(runTime.value()) << " mg" << endl
|
|
||||||
<< "Liquid Mass in system.......... | "
|
|
||||||
<< 1e6*dieselSpray.liquidMass() << " mg" << endl
|
|
||||||
<< "SMD, Dmax...................... | "
|
|
||||||
<< dieselSpray.smd()*1e6 << " mu, "
|
|
||||||
<< dieselSpray.maxD()*1e6 << " mu"
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
scalar evapMass =
|
|
||||||
dieselSpray.injectedMass(runTime.value())
|
|
||||||
- dieselSpray.liquidMass();
|
|
||||||
|
|
||||||
scalar gasMass = fvc::domainIntegrate(rho).value();
|
|
||||||
|
|
||||||
if (dieselSpray.twoD())
|
|
||||||
{
|
|
||||||
gasMass *= constant::mathematical::twoPi/dieselSpray.angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar addedMass = gasMass - gasMass0;
|
|
||||||
|
|
||||||
Info<< "Added gas mass................. | " << 1e6*addedMass << " mg"
|
|
||||||
<< nl << "Evaporation Continuity Error... | "
|
|
||||||
<< 1e6*(addedMass - evapMass) << " mg" << endl;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
dieselFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/dieselFoam
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I../dieselEngineFoam \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
|
||||||
-I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lcompressibleTurbulenceModel \
|
|
||||||
-lcompressibleRASModels \
|
|
||||||
-lcompressibleLESModels \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-llagrangian \
|
|
||||||
-lmeshTools \
|
|
||||||
-ldieselSpray \
|
|
||||||
-lliquidProperties \
|
|
||||||
-lliquidMixtureProperties \
|
|
||||||
-lthermophysicalFunctions \
|
|
||||||
-lspecie \
|
|
||||||
-lbasicThermophysicalModels \
|
|
||||||
-llaminarFlameSpeedModels \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lODE \
|
|
||||||
-ldistributionModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lcombustionModels
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
dieselFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Solver for diesel spray and combustion.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "psiChemistryCombustionModel.H"
|
|
||||||
#include "turbulenceModel.H"
|
|
||||||
#include "psiChemistryModel.H"
|
|
||||||
#include "chemistrySolver.H"
|
|
||||||
#include "spray.H"
|
|
||||||
#include "multivariateScheme.H"
|
|
||||||
#include "IFstream.H"
|
|
||||||
#include "OFstream.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
#include "pimpleControl.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
#include "createSpray.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
#include "readTimeControls.H"
|
|
||||||
#include "compressibleCourantNo.H"
|
|
||||||
#include "setInitialDeltaT.H"
|
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (runTime.run())
|
|
||||||
{
|
|
||||||
#include "compressibleCourantNo.H"
|
|
||||||
#include "setDeltaT.H"
|
|
||||||
|
|
||||||
runTime++;
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
Info<< "Evolving Spray" << endl;
|
|
||||||
|
|
||||||
dieselSpray.evolve();
|
|
||||||
|
|
||||||
Info<< "Solving chemistry" << endl;
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
|
|
||||||
// --- Pressure-velocity PIMPLE corrector loop
|
|
||||||
while (pimple.loop())
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "YEqn.H"
|
|
||||||
#include "hsEqn.H"
|
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
|
||||||
while (pimple.correct())
|
|
||||||
{
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pimple.turbCorr())
|
|
||||||
{
|
|
||||||
turbulence->correct();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "spraySummary.H"
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
|
||||||
U = rAU*UEqn.H();
|
|
||||||
|
|
||||||
if (pimple.transonic())
|
|
||||||
{
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
fvc::interpolate(psi)
|
|
||||||
*(
|
|
||||||
(fvc::interpolate(U) & mesh.Sf())
|
|
||||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(psi, p)
|
|
||||||
+ fvm::div(phid, p)
|
|
||||||
- fvm::laplacian(rho*rAU, p)
|
|
||||||
==
|
|
||||||
Sevap
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi == pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
phi =
|
|
||||||
fvc::interpolate(rho)
|
|
||||||
*(
|
|
||||||
(fvc::interpolate(U) & mesh.Sf())
|
|
||||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(psi, p)
|
|
||||||
+ fvc::div(phi)
|
|
||||||
- fvm::laplacian(rho*rAU, p)
|
|
||||||
==
|
|
||||||
Sevap
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi == pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U -= rAU*fvc::grad(p);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
|
|
||||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
buoyantBaffleSimpleFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/buoyantBaffleSimpleFoam
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/thermoBaffleModels/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lmeshTools \
|
|
||||||
-lbasicThermophysicalModels \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTurbulenceModel \
|
|
||||||
-lcompressibleRASModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lthermoBaffleModels \
|
|
||||||
-lregionModels
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
// Solve the Momentum equation
|
|
||||||
|
|
||||||
tmp<fvVectorMatrix> UEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, U)
|
|
||||||
+ turbulence->divDevRhoReff(U)
|
|
||||||
);
|
|
||||||
|
|
||||||
UEqn().relax();
|
|
||||||
|
|
||||||
if (simple.momentumPredictor())
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
UEqn()
|
|
||||||
==
|
|
||||||
fvc::reconstruct
|
|
||||||
(
|
|
||||||
(
|
|
||||||
- ghf*fvc::snGrad(rho)
|
|
||||||
- fvc::snGrad(p_rgh)
|
|
||||||
)*mesh.magSf()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
buoyantBaffleSimpleFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Steady-state solver for buoyant, turbulent flow of compressible fluids
|
|
||||||
using thermal baffles
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "basicPsiThermo.H"
|
|
||||||
#include "RASModel.H"
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
|
||||||
#include "simpleControl.H"
|
|
||||||
#include "thermoBaffleModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (simple.loop())
|
|
||||||
{
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
// Pressure-velocity SIMPLE corrector
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "hEqn.H"
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
Info<< "Reading thermophysical properties\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<basicPsiThermo> pThermo
|
|
||||||
(
|
|
||||||
basicPsiThermo::New(mesh)
|
|
||||||
);
|
|
||||||
basicPsiThermo& thermo = pThermo();
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
thermo.rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
|
||||||
volScalarField& h = thermo.h();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
|
||||||
Info<< "Reading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::RASModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::RASModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
|
||||||
volScalarField gh("gh", g & mesh.C());
|
|
||||||
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
|
||||||
|
|
||||||
Info<< "Reading field p_rgh\n" << endl;
|
|
||||||
volScalarField p_rgh
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"p_rgh",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
// Force p_rgh to be consistent with p
|
|
||||||
p_rgh = p - rho*gh;
|
|
||||||
|
|
||||||
|
|
||||||
label pRefCell = 0;
|
|
||||||
scalar pRefValue = 0.0;
|
|
||||||
setRefCell
|
|
||||||
(
|
|
||||||
p,
|
|
||||||
p_rgh,
|
|
||||||
mesh.solutionDict().subDict("SIMPLE"),
|
|
||||||
pRefCell,
|
|
||||||
pRefValue
|
|
||||||
);
|
|
||||||
|
|
||||||
autoPtr<regionModels::thermoBaffleModels::thermoBaffleModel> baffles
|
|
||||||
(
|
|
||||||
regionModels::thermoBaffleModels::thermoBaffleModel::New(mesh)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
|
||||||
dimensionedScalar totalVolume = sum(mesh.V());
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
fvScalarMatrix hEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, h)
|
|
||||||
- fvm::Sp(fvc::div(phi), h)
|
|
||||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
|
||||||
==
|
|
||||||
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
|
|
||||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
|
||||||
);
|
|
||||||
|
|
||||||
hEqn.relax();
|
|
||||||
hEqn.solve();
|
|
||||||
|
|
||||||
baffles->evolve();
|
|
||||||
thermo.correct();
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn().A());
|
|
||||||
surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU));
|
|
||||||
|
|
||||||
U = rAU*UEqn().H();
|
|
||||||
UEqn.clear();
|
|
||||||
|
|
||||||
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
|
||||||
bool closedVolume = adjustPhi(phi, U, p_rgh);
|
|
||||||
|
|
||||||
surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
|
||||||
phi -= buoyancyPhi;
|
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix p_rghEqn
|
|
||||||
(
|
|
||||||
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phi)
|
|
||||||
);
|
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
|
||||||
p_rghEqn.solve();
|
|
||||||
|
|
||||||
if (simple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
// Calculate the conservative fluxes
|
|
||||||
phi -= p_rghEqn.flux();
|
|
||||||
|
|
||||||
// Explicitly relax pressure for momentum corrector
|
|
||||||
p_rgh.relax();
|
|
||||||
|
|
||||||
// Correct the momentum source with the pressure gradient flux
|
|
||||||
// calculated from the relaxed pressure
|
|
||||||
U -= rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorAUf);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
|
|
||||||
p = p_rgh + rho*gh;
|
|
||||||
|
|
||||||
// For closed-volume cases adjust the pressure level
|
|
||||||
// to obey overall mass continuity
|
|
||||||
if (closedVolume)
|
|
||||||
{
|
|
||||||
p += (initialMass - fvc::domainIntegrate(psi*p))
|
|
||||||
/fvc::domainIntegrate(psi);
|
|
||||||
p_rgh = p - rho*gh;
|
|
||||||
}
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho.relax();
|
|
||||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
sprayEngineFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/sprayEngineFoam
|
||||||
@ -1,40 +1,53 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../engineFoam \
|
-I$(FOAM_SOLVERS)/lagrangian/sprayFoam \
|
||||||
|
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
|
-I$(LIB_SRC)/lagrangian/spray/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
|
||||||
-I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
-I$(LIB_SRC)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/engine/lnInclude \
|
-I$(LIB_SRC)/engine/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lengine \
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lmeshTools \
|
-llagrangianIntermediate \
|
||||||
-ldieselSpray \
|
-llagrangianSpray \
|
||||||
-lliquidProperties \
|
|
||||||
-lliquidMixtureProperties \
|
|
||||||
-lthermophysicalFunctions \
|
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-llaminarFlameSpeedModels \
|
-lliquidProperties \
|
||||||
|
-lliquidMixtureProperties \
|
||||||
|
-lsolidProperties \
|
||||||
|
-lsolidMixtureProperties \
|
||||||
|
-lthermophysicalFunctions \
|
||||||
|
-lreactionThermophysicalModels \
|
||||||
|
-lSLGThermo \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
|
-lradiationModels \
|
||||||
-lODE \
|
-lODE \
|
||||||
-ldistributionModels \
|
-lengine \
|
||||||
|
-lregionModels \
|
||||||
|
-lsurfaceFilmModels \
|
||||||
-lcombustionModels
|
-lcombustionModels
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
|
basicSprayCloud parcels
|
||||||
|
(
|
||||||
|
"sprayCloud",
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
g,
|
||||||
|
slgThermo
|
||||||
|
);
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
#include "readTimeControls.H"
|
||||||
|
|
||||||
|
maxDeltaT = runTime.userTimeToTime(maxDeltaT);
|
||||||
@ -22,10 +22,11 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Application
|
Application
|
||||||
dieselEngineFoam
|
sprayEngineFoam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Solver for diesel engine spray and combustion.
|
Transient PIMPLE solver for compressible, laminar or turbulent engine
|
||||||
|
flow swith spray parcels.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -33,16 +34,10 @@ Description
|
|||||||
#include "engineTime.H"
|
#include "engineTime.H"
|
||||||
#include "engineMesh.H"
|
#include "engineMesh.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
|
#include "basicSprayCloud.H"
|
||||||
#include "psiChemistryCombustionModel.H"
|
#include "psiChemistryCombustionModel.H"
|
||||||
#include "spray.H"
|
#include "radiationModel.H"
|
||||||
#include "psiChemistryModel.H"
|
#include "SLGThermo.H"
|
||||||
#include "chemistrySolver.H"
|
|
||||||
#include "multivariateScheme.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "OFstream.H"
|
|
||||||
#include "volPointInterpolation.H"
|
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -50,11 +45,13 @@ Description
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
#include "createEngineTime.H"
|
#include "createEngineTime.H"
|
||||||
#include "createEngineMesh.H"
|
#include "createEngineMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "createSpray.H"
|
#include "createFields.H"
|
||||||
|
#include "createClouds.H"
|
||||||
|
#include "createRadiationModel.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "readEngineTimeControls.H"
|
#include "readEngineTimeControls.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
@ -77,12 +74,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
||||||
|
|
||||||
mesh.move();
|
parcels.evolve();
|
||||||
|
|
||||||
dieselSpray.evolve();
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
|
|
||||||
|
// --- Pressure-velocity PIMPLE corrector loop
|
||||||
while (pimple.loop())
|
while (pimple.loop())
|
||||||
{
|
{
|
||||||
#include "UEqn.H"
|
#include "UEqn.H"
|
||||||
@ -102,11 +98,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include "logSummary.H"
|
#include "logSummary.H"
|
||||||
#include "spraySummary.H"
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
runTime.write();
|
if (runTime.write())
|
||||||
|
{
|
||||||
|
chemistry.dQ()().write();
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
@ -115,7 +113,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ EXE_LIBS = \
|
|||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lconversion \
|
-lconversion \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-ldieselSpray \
|
|
||||||
-ldistributed \
|
-ldistributed \
|
||||||
-ldistributionModels \
|
-ldistributionModels \
|
||||||
-ldsmc \
|
-ldsmc \
|
||||||
|
|||||||
@ -10,8 +10,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/browser/lnInclude \
|
-I$(LIB_SRC)/browser/lnInclude \
|
||||||
-I$(LIB_SRC)/foam/lnInclude \
|
-I$(LIB_SRC)/foam/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||||
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|||||||
@ -8,7 +8,6 @@ wmake $makeType basic
|
|||||||
wmake $makeType solidParticle
|
wmake $makeType solidParticle
|
||||||
wmake $makeType intermediate
|
wmake $makeType intermediate
|
||||||
wmake $makeType spray
|
wmake $makeType spray
|
||||||
wmake $makeType dieselSpray
|
|
||||||
wmake $makeType dsmc
|
wmake $makeType dsmc
|
||||||
wmake $makeType coalCombustion
|
wmake $makeType coalCombustion
|
||||||
|
|
||||||
|
|||||||
@ -1,95 +0,0 @@
|
|||||||
parcel = parcel
|
|
||||||
spray = spray
|
|
||||||
injector = injector
|
|
||||||
|
|
||||||
atomizationModels = spraySubModels/atomizationModel
|
|
||||||
breakupModels = spraySubModels/breakupModel
|
|
||||||
dragModels = spraySubModels/dragModel
|
|
||||||
evaporationModels = spraySubModels/evaporationModel
|
|
||||||
heatTransferModels = spraySubModels/heatTransferModel
|
|
||||||
wallModels = spraySubModels/wallModel
|
|
||||||
collisionModels = spraySubModels/collisionModel
|
|
||||||
dispersionModels = spraySubModels/dispersionModel
|
|
||||||
injectorModels = spraySubModels/injectorModel
|
|
||||||
|
|
||||||
$(parcel)/parcel.C
|
|
||||||
$(parcel)/parcelFunctions.C
|
|
||||||
$(parcel)/parcelIO.C
|
|
||||||
$(parcel)/setRelaxationTimes.C
|
|
||||||
|
|
||||||
$(spray)/spray.C
|
|
||||||
$(spray)/sprayOps.C
|
|
||||||
$(spray)/sprayInject.C
|
|
||||||
$(spray)/sprayFunctions.C
|
|
||||||
|
|
||||||
$(injector)/injector/injector.C
|
|
||||||
$(injector)/injector/injectorIO.C
|
|
||||||
$(injector)/injectorType/injectorType.C
|
|
||||||
$(injector)/unitInjector/unitInjector.C
|
|
||||||
$(injector)/multiHoleInjector/multiHoleInjector.C
|
|
||||||
$(injector)/commonRailInjector/commonRailInjector.C
|
|
||||||
$(injector)/swirlInjector/swirlInjector.C
|
|
||||||
$(injector)/definedInjector/definedInjector.C
|
|
||||||
|
|
||||||
$(atomizationModels)/atomizationModel/atomizationModel.C
|
|
||||||
$(atomizationModels)/atomizationModel/atomizationModelNew.C
|
|
||||||
$(atomizationModels)/LISA/LISA.C
|
|
||||||
$(atomizationModels)/noAtomization/noAtomization.C
|
|
||||||
$(atomizationModels)/blobsSheetAtomization/blobsSheetAtomization.C
|
|
||||||
|
|
||||||
$(breakupModels)/breakupModel/breakupModelNew.C
|
|
||||||
$(breakupModels)/breakupModel/breakupModel.C
|
|
||||||
$(breakupModels)/noBreakup/noBreakup.C
|
|
||||||
$(breakupModels)/reitzDiwakar/reitzDiwakar.C
|
|
||||||
$(breakupModels)/reitzKHRT/reitzKHRT.C
|
|
||||||
$(breakupModels)/SHF/SHF.C
|
|
||||||
$(breakupModels)/TAB/TAB.C
|
|
||||||
$(breakupModels)/ETAB/ETAB.C
|
|
||||||
|
|
||||||
$(dragModels)/dragModel/dragModelNew.C
|
|
||||||
$(dragModels)/dragModel/dragModel.C
|
|
||||||
$(dragModels)/noDragModel/noDragModel.C
|
|
||||||
$(dragModels)/standardDragModel/standardDragModel.C
|
|
||||||
|
|
||||||
$(evaporationModels)/evaporationModel/evaporationModelNew.C
|
|
||||||
$(evaporationModels)/evaporationModel/evaporationModel.C
|
|
||||||
$(evaporationModels)/noEvaporation/noEvaporation.C
|
|
||||||
$(evaporationModels)/RutlandFlashBoil/RutlandFlashBoil.C
|
|
||||||
$(evaporationModels)/standardEvaporationModel/standardEvaporationModel.C
|
|
||||||
$(evaporationModels)/saturateEvaporationModel/saturateEvaporationModel.C
|
|
||||||
|
|
||||||
$(heatTransferModels)/heatTransferModel/heatTransferModelNew.C
|
|
||||||
$(heatTransferModels)/heatTransferModel/heatTransferModel.C
|
|
||||||
$(heatTransferModels)/noHeatTransfer/noHeatTransfer.C
|
|
||||||
$(heatTransferModels)/RanzMarshall/RanzMarshall.C
|
|
||||||
|
|
||||||
$(injectorModels)/injectorModel/injectorModelNew.C
|
|
||||||
$(injectorModels)/injectorModel/injectorModel.C
|
|
||||||
$(injectorModels)/constant/constInjector.C
|
|
||||||
$(injectorModels)/Chomiak/Chomiak.C
|
|
||||||
$(injectorModels)/hollowCone/hollowCone.C
|
|
||||||
$(injectorModels)/pressureSwirl/pressureSwirlInjector.C
|
|
||||||
$(injectorModels)/definedHollowCone/definedHollowCone.C
|
|
||||||
$(injectorModels)/definedPressureSwirl/definedPressureSwirl.C
|
|
||||||
$(injectorModels)/blobsSwirl/blobsSwirlInjector.C
|
|
||||||
|
|
||||||
$(wallModels)/wallModel/wallModelNew.C
|
|
||||||
$(wallModels)/wallModel/wallModel.C
|
|
||||||
$(wallModels)/removeParcel/removeParcel.C
|
|
||||||
$(wallModels)/reflectParcel/reflectParcel.C
|
|
||||||
|
|
||||||
$(collisionModels)/collisionModel/collisionModel.C
|
|
||||||
$(collisionModels)/collisionModel/collisionModelNew.C
|
|
||||||
$(collisionModels)/noCollision/noCollision.C
|
|
||||||
$(collisionModels)/ORourke/ORourkeCollisionModel.C
|
|
||||||
$(collisionModels)/trajectoryModel/trajectoryModel.C
|
|
||||||
|
|
||||||
$(dispersionModels)/dispersionModel/dispersionModel.C
|
|
||||||
$(dispersionModels)/dispersionModel/dispersionModelNew.C
|
|
||||||
$(dispersionModels)/dispersionRASModel/dispersionRASModel.C
|
|
||||||
$(dispersionModels)/dispersionLESModel/dispersionLESModel.C
|
|
||||||
$(dispersionModels)/noDispersion/noDispersion.C
|
|
||||||
$(dispersionModels)/gradientDispersionRAS/gradientDispersionRAS.C
|
|
||||||
$(dispersionModels)/stochasticDispersionRAS/stochasticDispersionRAS.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libdieselSpray
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
|
||||||
-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)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-llagrangian \
|
|
||||||
-lmeshTools \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lcompressibleRASModels \
|
|
||||||
-lcompressibleLESModels \
|
|
||||||
-lLESdeltas \
|
|
||||||
-lliquidProperties \
|
|
||||||
-lliquidMixtureProperties \
|
|
||||||
-lthermophysicalFunctions \
|
|
||||||
-lspecie \
|
|
||||||
-ldistributionModels
|
|
||||||
@ -1,436 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "commonRailInjector.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(commonRailInjector, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
injectorType,
|
|
||||||
commonRailInjector,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::commonRailInjector::commonRailInjector
|
|
||||||
(
|
|
||||||
const Foam::Time& t,
|
|
||||||
const Foam::dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectorType(t, dict),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
position_(propsDict_.lookup("position")),
|
|
||||||
direction_(propsDict_.lookup("direction")),
|
|
||||||
d_(readScalar(propsDict_.lookup("diameter"))),
|
|
||||||
mass_(readScalar(propsDict_.lookup("mass"))),
|
|
||||||
injectionPressure_(readScalar(propsDict_.lookup("injectionPressure"))),
|
|
||||||
T_(readScalar(propsDict_.lookup("temperature"))),
|
|
||||||
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
|
|
||||||
X_(propsDict_.lookup("X")),
|
|
||||||
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
|
|
||||||
velocityProfile_(massFlowRateProfile_),
|
|
||||||
injectionPressureProfile_(propsDict_.lookup("injectionPressureProfile")),
|
|
||||||
CdProfile_(massFlowRateProfile_),
|
|
||||||
TProfile_(massFlowRateProfile_),
|
|
||||||
averageParcelMass_(mass_/nParcels_),
|
|
||||||
pressureIndependentVelocity_(false)
|
|
||||||
{
|
|
||||||
// convert CA to real time
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][0] =
|
|
||||||
t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
velocityProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(injectionPressureProfile_, i)
|
|
||||||
{
|
|
||||||
injectionPressureProfile_[i][0] =
|
|
||||||
t.userTimeToTime(injectionPressureProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(injectionPressureProfile_[0][0] - massFlowRateProfile_[0][0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"commonRailInjector::commonRailInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << " start-time entries for injectionPressureProfile and "
|
|
||||||
<< "massFlowRateProfile do no match"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
Info<< "injectionPressureProfile_.size() = "
|
|
||||||
<< injectionPressureProfile_.size()
|
|
||||||
<< ", massFlowRateProfile_.size() = " << massFlowRateProfile_.size()
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(injectionPressureProfile_.last()[0]
|
|
||||||
- massFlowRateProfile_.last()[0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"commonRailInjector::commonRailInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "End-time entries for injectionPressureProfile and "
|
|
||||||
<< "massFlowRateProfile do no match"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar integratedMFR = integrateTable(massFlowRateProfile_);
|
|
||||||
scalar integratedP =
|
|
||||||
integrateTable(injectionPressureProfile_)/(teoi() - tsoi());
|
|
||||||
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
// correct the massFlowRateProfile to match the injected mass
|
|
||||||
massFlowRateProfile_[i][1] *= mass_/integratedMFR;
|
|
||||||
|
|
||||||
TProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
TProfile_[i][1] = T_;
|
|
||||||
|
|
||||||
CdProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(injectionPressureProfile_, i)
|
|
||||||
{
|
|
||||||
injectionPressureProfile_[i][1] *= injectionPressure_/integratedP;
|
|
||||||
}
|
|
||||||
// Normalize the direction vector
|
|
||||||
direction_ /= mag(direction_);
|
|
||||||
|
|
||||||
setTangentialVectors();
|
|
||||||
|
|
||||||
// check molar fractions
|
|
||||||
scalar Xsum = 0.0;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
Xsum += X_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(Xsum - 1.0) > SMALL)
|
|
||||||
{
|
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"commonRailInjector::commonRailInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "X does not add up to 1.0, correcting molar fractions."
|
|
||||||
<< endl;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
X_[i] /= Xsum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "end constructor. in commonRail" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::commonRailInjector::~commonRailInjector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::commonRailInjector::setTangentialVectors()
|
|
||||||
{
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
|
||||||
scalar magV = 0.0;
|
|
||||||
vector tangent;
|
|
||||||
|
|
||||||
while (magV < SMALL)
|
|
||||||
{
|
|
||||||
vector testThis = rndGen.sample01<vector>();
|
|
||||||
|
|
||||||
tangent = testThis - (testThis & direction_)*direction_;
|
|
||||||
magV = mag(tangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
tangentialInjectionVector1_ = tangent/magV;
|
|
||||||
tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::commonRailInjector::nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
label nParcels = label(mInj/averageParcelMass_ + 0.49);
|
|
||||||
|
|
||||||
return nParcels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector Foam::commonRailInjector::position(const label n) const
|
|
||||||
{
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::commonRailInjector::position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
scalar is = position_ & axisOfSymmetry;
|
|
||||||
scalar magInj = mag(position_ - is*axisOfSymmetry);
|
|
||||||
|
|
||||||
vector halfWedge =
|
|
||||||
axisOfWedge*cos(0.5*angleOfWedge)
|
|
||||||
+ axisOfWedgeNormal*sin(0.5*angleOfWedge);
|
|
||||||
halfWedge /= mag(halfWedge);
|
|
||||||
|
|
||||||
return (is*axisOfSymmetry + magInj*halfWedge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// otherwise, disc injection
|
|
||||||
scalar iRadius = d_*rndGen.sample01<scalar>();
|
|
||||||
scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>();
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
position_
|
|
||||||
+ iRadius
|
|
||||||
*(
|
|
||||||
tangentialInjectionVector1_*cos(iAngle)
|
|
||||||
+ tangentialInjectionVector2_*sin(iAngle)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::commonRailInjector::nHoles() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector& Foam::commonRailInjector::direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return direction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
|
|
||||||
// correct mass if calculation is 2D
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
mInj *= 0.5*angleOfWedge/constant::mathematical::pi;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mInj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::mass() const
|
|
||||||
{
|
|
||||||
return mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::scalarField& Foam::commonRailInjector::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::T() const
|
|
||||||
{
|
|
||||||
return TProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::T(const scalar time) const
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::tsoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.first()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::teoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.last()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::massFlowRate
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(massFlowRateProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::injectionPressure
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(injectionPressureProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::velocity
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(velocityProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::CdProfile()
|
|
||||||
const
|
|
||||||
{
|
|
||||||
return CdProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::Cd
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(CdProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::fractionOfInjection
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return integrateTable(massFlowRateProfile_, time)/mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::commonRailInjector::injectedMass
|
|
||||||
(
|
|
||||||
const scalar t
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mass_*fractionOfInjection(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::commonRailInjector::correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar A = 0.25*constant::mathematical::pi*sqr(d_);
|
|
||||||
scalar pDummy = 1.0e+5;
|
|
||||||
scalar rho = fuel.rho(pDummy, T_, X_);
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
scalar Pinj =
|
|
||||||
getTableValue(injectionPressureProfile_, velocityProfile_[i][0]);
|
|
||||||
scalar Vinj = sqrt(2.0*(Pinj - referencePressure)/rho);
|
|
||||||
scalar mfr = massFlowRateProfile_[i][1]/(rho*A);
|
|
||||||
scalar Cd = mfr/Vinj;
|
|
||||||
velocityProfile_[i][1] = Vinj;
|
|
||||||
CdProfile_[i][1] = Cd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::commonRailInjector::tan1(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::commonRailInjector::tan2(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,235 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::commonRailInjector
|
|
||||||
|
|
||||||
Description
|
|
||||||
Common-rail injector
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
commonRailInjectorI.H
|
|
||||||
commonRailInjector.C
|
|
||||||
commonRailInjectorIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef commonRailInjector_H
|
|
||||||
#define commonRailInjector_H
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
#include "vector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class commonRailInjector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class commonRailInjector
|
|
||||||
:
|
|
||||||
public injectorType
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
vector position_;
|
|
||||||
vector direction_;
|
|
||||||
scalar d_;
|
|
||||||
scalar mass_;
|
|
||||||
scalar injectionPressure_;
|
|
||||||
scalar T_;
|
|
||||||
label nParcels_;
|
|
||||||
scalarField X_;
|
|
||||||
List<pair> massFlowRateProfile_;
|
|
||||||
List<pair> velocityProfile_;
|
|
||||||
List<pair> injectionPressureProfile_;
|
|
||||||
List<pair> CdProfile_;
|
|
||||||
List<pair> TProfile_;
|
|
||||||
scalar averageParcelMass_;
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity_;
|
|
||||||
|
|
||||||
//- two orthogonal vectors that are also orthogonal
|
|
||||||
// to the injection direction
|
|
||||||
vector tangentialInjectionVector1_, tangentialInjectionVector2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
commonRailInjector(const commonRailInjector&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const commonRailInjector&);
|
|
||||||
|
|
||||||
//- Create two vectors orthonoal to each other
|
|
||||||
// and the injection vector
|
|
||||||
void setTangentialVectors();
|
|
||||||
|
|
||||||
//- Return the fraction of the total injected liquid
|
|
||||||
scalar fractionOfInjection(const scalar time) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("commonRailInjector");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
commonRailInjector(const Time& t, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~commonRailInjector();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
const vector position(const label n) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
label nHoles() const;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
scalar d() const;
|
|
||||||
|
|
||||||
//- Return the injection direction
|
|
||||||
const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass of the injected particle
|
|
||||||
scalar mass
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
scalar mass() const;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the temperature profile of the injected particle
|
|
||||||
List<pair> T() const;
|
|
||||||
|
|
||||||
//- Return the temperature of the injected particle
|
|
||||||
scalar T(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
scalar tsoi() const;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
scalar teoi() const;
|
|
||||||
|
|
||||||
//- Return the injected liquid mass
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
List<pair> massFlowRateProfile() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar massFlowRate(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> injectionPressureProfile() const
|
|
||||||
{
|
|
||||||
return injectionPressureProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar injectionPressure(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> velocityProfile() const
|
|
||||||
{
|
|
||||||
return velocityProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar velocity(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> CdProfile() const;
|
|
||||||
scalar Cd(const scalar time) const;
|
|
||||||
|
|
||||||
vector tan1(const label n) const;
|
|
||||||
vector tan2(const label n) const;
|
|
||||||
|
|
||||||
void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
);
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity() const
|
|
||||||
{
|
|
||||||
return pressureIndependentVelocity_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,399 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "definedInjector.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(definedInjector, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
injectorType,
|
|
||||||
definedInjector,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::definedInjector::definedInjector
|
|
||||||
(
|
|
||||||
const Time& t,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectorType(t, dict),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
position_(propsDict_.lookup("position")),
|
|
||||||
direction_(propsDict_.lookup("direction")),
|
|
||||||
d_(readScalar(propsDict_.lookup("diameter"))),
|
|
||||||
mass_(readScalar(propsDict_.lookup("mass"))),
|
|
||||||
T_(readScalar(propsDict_.lookup("temperature"))),
|
|
||||||
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
|
|
||||||
X_(propsDict_.lookup("X")),
|
|
||||||
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
|
|
||||||
velocityProfile_(propsDict_.lookup("velocityProfile")),
|
|
||||||
injectionPressureProfile_(massFlowRateProfile_),
|
|
||||||
CdProfile_(massFlowRateProfile_),
|
|
||||||
averageParcelMass_(mass_/nParcels_),
|
|
||||||
pressureIndependentVelocity_(true)
|
|
||||||
{
|
|
||||||
// convert CA to real time - mass flow rate profile
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][0] =
|
|
||||||
t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
// dummy
|
|
||||||
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
injectionPressureProfile_[i][1] = 0.0;
|
|
||||||
CdProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
CdProfile_[i][1] = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
velocityProfile_[i][0] = t.userTimeToTime(velocityProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if time entries match
|
|
||||||
if (mag(massFlowRateProfile_[0][0]-velocityProfile_[0][0]) > SMALL)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"definedInjector::definedInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "Start-times do not match for velocityProfile and "
|
|
||||||
<< "massFlowRateProfile." << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(massFlowRateProfile_.last()[0] - velocityProfile_.last()[0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"definedInjector::definedInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "End-times do not match for velocityProfile and "
|
|
||||||
<< "massFlowRateProfile."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate integral of mass flow rate profile
|
|
||||||
scalar integratedMFR = integrateTable(massFlowRateProfile_);
|
|
||||||
|
|
||||||
// correct the massFlowRate profile to match the injector
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][1] *= mass_/integratedMFR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normalize the direction vector
|
|
||||||
direction_ /= mag(direction_);
|
|
||||||
|
|
||||||
setTangentialVectors();
|
|
||||||
|
|
||||||
// check molar fractions
|
|
||||||
scalar Xsum = 0.0;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
Xsum += X_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(Xsum - 1.0) > SMALL)
|
|
||||||
{
|
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"definedInjector::definedInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "X does not add up to 1.0, correcting molar fractions."
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
X_[i] /= Xsum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::definedInjector::~definedInjector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::definedInjector::setTangentialVectors()
|
|
||||||
{
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
|
||||||
scalar magV = 0.0;
|
|
||||||
vector tangent;
|
|
||||||
|
|
||||||
while (magV < SMALL)
|
|
||||||
{
|
|
||||||
vector testThis = rndGen.sample01<vector>();
|
|
||||||
|
|
||||||
tangent = testThis - (testThis & direction_)*direction_;
|
|
||||||
magV = mag(tangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
tangentialInjectionVector1_ = tangent/magV;
|
|
||||||
tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::definedInjector::nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0));
|
|
||||||
label nParcels = label(mInj/averageParcelMass_ + 0.49);
|
|
||||||
|
|
||||||
return nParcels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector Foam::definedInjector::position(const label n) const
|
|
||||||
{
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::definedInjector::position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
scalar is = position_ & axisOfSymmetry;
|
|
||||||
scalar magInj = mag(position_ - is*axisOfSymmetry);
|
|
||||||
|
|
||||||
vector halfWedge =
|
|
||||||
axisOfWedge*cos(0.5*angleOfWedge)
|
|
||||||
+ axisOfWedgeNormal*sin(0.5*angleOfWedge);
|
|
||||||
halfWedge /= mag(halfWedge);
|
|
||||||
|
|
||||||
return (is*axisOfSymmetry + magInj*halfWedge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// otherwise, disc injection
|
|
||||||
scalar iRadius = d_*rndGen.sample01<scalar>();
|
|
||||||
scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>();
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
position_
|
|
||||||
+ iRadius
|
|
||||||
* (
|
|
||||||
tangentialInjectionVector1_*cos(iAngle)
|
|
||||||
+ tangentialInjectionVector2_*sin(iAngle)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::definedInjector::nHoles() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector& Foam::definedInjector::direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return direction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
|
|
||||||
// correct mass if calculation is 2D
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
mInj *= 0.5*angleOfWedge/constant::mathematical::pi;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mInj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::mass() const
|
|
||||||
{
|
|
||||||
return mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::massFlowRate(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(massFlowRateProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::injectionPressure(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(injectionPressureProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::Cd(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(CdProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::scalarField& Foam::definedInjector::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::definedInjector::pair> Foam::definedInjector::T() const
|
|
||||||
{
|
|
||||||
return TProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::T(const scalar time) const
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::tsoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.first()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::teoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.last()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::fractionOfInjection
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return integrateTable(massFlowRateProfile_, time)/mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::velocity
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(velocityProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::definedInjector::injectedMass
|
|
||||||
(
|
|
||||||
const scalar t
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mass_*fractionOfInjection(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::definedInjector::correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar A = 0.25*constant::mathematical::pi*sqr(d_);
|
|
||||||
scalar pDummy = 1.0e+5;
|
|
||||||
scalar rho = fuel.rho(pDummy, T_, X_);
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
scalar mfr = massFlowRateProfile_[i][1];
|
|
||||||
scalar v = velocityProfile_[i][1];
|
|
||||||
injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v;
|
|
||||||
CdProfile_[i][1] = mfr/(v*rho*A);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::definedInjector::tan1(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::definedInjector::tan2(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,240 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::definedInjector
|
|
||||||
|
|
||||||
Description
|
|
||||||
User specified MFR vs time and velocity vs time
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
definedInjectorI.H
|
|
||||||
definedInjector.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef definedInjector_H
|
|
||||||
#define definedInjector_H
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
#include "vector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class definedInjector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class definedInjector
|
|
||||||
:
|
|
||||||
public injectorType
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
vector position_;
|
|
||||||
vector direction_;
|
|
||||||
scalar d_;
|
|
||||||
scalar mass_;
|
|
||||||
scalar T_;
|
|
||||||
label nParcels_;
|
|
||||||
scalarField X_;
|
|
||||||
List<pair> massFlowRateProfile_;
|
|
||||||
List<pair> velocityProfile_;
|
|
||||||
List<pair> injectionPressureProfile_;
|
|
||||||
List<pair> CdProfile_;
|
|
||||||
List<pair> TProfile_;
|
|
||||||
scalar averageParcelMass_;
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity_;
|
|
||||||
|
|
||||||
//- two orthogonal vectors that are also orthogonal
|
|
||||||
// to the injection direction
|
|
||||||
vector tangentialInjectionVector1_, tangentialInjectionVector2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
definedInjector(const definedInjector&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const definedInjector&);
|
|
||||||
|
|
||||||
//- Create two vectors orthonoal to each other
|
|
||||||
// and the injection vector
|
|
||||||
void setTangentialVectors();
|
|
||||||
|
|
||||||
//- Return the fraction of the total injected liquid
|
|
||||||
scalar fractionOfInjection(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the instantaneous injection velocity
|
|
||||||
scalar injectionVelocity(const scalar) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("definedInjector");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
definedInjector(const Time& t, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~definedInjector();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
const vector position(const label n) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
label nHoles() const;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
scalar d() const;
|
|
||||||
|
|
||||||
//- Return the injection direction
|
|
||||||
const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass of the injected particle
|
|
||||||
scalar mass
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
scalar mass() const;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the temperature profile of the injected particle
|
|
||||||
List<pair> T() const;
|
|
||||||
|
|
||||||
//- Return the temperature of the injected particle
|
|
||||||
scalar T(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
scalar tsoi() const;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
scalar teoi() const;
|
|
||||||
|
|
||||||
//- Return the injected liquid mass
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
List<pair> massFlowRateProfile() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar massFlowRate(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> injectionPressureProfile() const
|
|
||||||
{
|
|
||||||
return injectionPressureProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar injectionPressure(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> velocityProfile() const
|
|
||||||
{
|
|
||||||
return velocityProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar velocity(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> CdProfile() const
|
|
||||||
{
|
|
||||||
return CdProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar Cd(const scalar time) const;
|
|
||||||
|
|
||||||
vector tan1(const label n) const;
|
|
||||||
vector tan2(const label n) const;
|
|
||||||
|
|
||||||
void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
);
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity() const
|
|
||||||
{
|
|
||||||
return pressureIndependentVelocity_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "injector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// No code
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::injector
|
|
||||||
|
|
||||||
Description
|
|
||||||
Spray injector
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef injector_H
|
|
||||||
#define injector_H
|
|
||||||
|
|
||||||
#include "vector.H"
|
|
||||||
#include "List.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "Time.H"
|
|
||||||
#include "injectorType.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class injector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class injector
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary injectorDict_;
|
|
||||||
|
|
||||||
autoPtr<injectorType> properties_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Constructor from Istream
|
|
||||||
injector(const Time&, Istream&);
|
|
||||||
|
|
||||||
//- Return clone
|
|
||||||
inline autoPtr<injector> clone() const;
|
|
||||||
|
|
||||||
//- Return a pointer to a new injector created on freestore
|
|
||||||
// from Istream
|
|
||||||
class iNew
|
|
||||||
{
|
|
||||||
const Time& time_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
iNew(const Time& t)
|
|
||||||
:
|
|
||||||
time_(t)
|
|
||||||
{}
|
|
||||||
|
|
||||||
autoPtr<injector> operator()(Istream& is) const
|
|
||||||
{
|
|
||||||
return autoPtr<injector>(new injector(time_, is));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
inline autoPtr<injectorType>& properties();
|
|
||||||
inline const autoPtr<injectorType>& properties() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const injector&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "injectorI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline Foam::autoPtr<Foam::injector>
|
|
||||||
Foam::injector::clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<injector>(new injector(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Foam::autoPtr<Foam::injectorType>&
|
|
||||||
Foam::injector::properties()
|
|
||||||
{
|
|
||||||
return properties_;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const Foam::autoPtr<Foam::injectorType>&
|
|
||||||
Foam::injector::properties() const
|
|
||||||
{
|
|
||||||
return properties_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "injector.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::injector::injector(const Time& t, Istream& is)
|
|
||||||
:
|
|
||||||
injectorDict_(is),
|
|
||||||
properties_(injectorType::New(t, injectorDict_))
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check("Istream& operator>>(Istream&, injector&)");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const injector& injector)
|
|
||||||
{
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check("Ostream& operator<<(Ostream&, const injector&)");
|
|
||||||
|
|
||||||
os << injector.injectorDict_ << endl;
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,176 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(injectorType, 0);
|
|
||||||
defineRunTimeSelectionTable(injectorType, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::injectorType::injectorType
|
|
||||||
(
|
|
||||||
const Foam::Time&,
|
|
||||||
const Foam::dictionary&
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::injectorType> Foam::injectorType::New
|
|
||||||
(
|
|
||||||
const Time& t,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word modelType(dict.lookup("injectorType"));
|
|
||||||
|
|
||||||
Info<< "Selecting injectorType " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn("injectorType::New(const dictionary&)")
|
|
||||||
<< "Unknown injectorType type "
|
|
||||||
<< modelType << nl << nl
|
|
||||||
<< "Valid injectorTypes are:" << nl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<injectorType>(cstrIter()(t, dict));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::injectorType::~injectorType()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::injectorType::getTableValue
|
|
||||||
(
|
|
||||||
const List<pair>& table,
|
|
||||||
const scalar value
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// iterator
|
|
||||||
label i = 0;
|
|
||||||
|
|
||||||
// max items
|
|
||||||
label maxRow = table.size() - 1;
|
|
||||||
|
|
||||||
// check lower bound
|
|
||||||
if (value < table[0][0])
|
|
||||||
{
|
|
||||||
return table[0][1];
|
|
||||||
}
|
|
||||||
// check upper bound
|
|
||||||
else if (value > table[maxRow][0])
|
|
||||||
{
|
|
||||||
return table[maxRow][1];
|
|
||||||
}
|
|
||||||
// interpolate intermediate value
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while
|
|
||||||
(
|
|
||||||
(i < maxRow-1) && (table[i+1][0] < value)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
// value sits bewteen table[i][0] and table[i+1][0]
|
|
||||||
return table[i][1]
|
|
||||||
+ (value-table[i][0])/(table[i+1][0]-table[i][0])
|
|
||||||
* (table[i+1][1]-table[i][1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::injectorType::integrateTable
|
|
||||||
(
|
|
||||||
const List<pair>& table,
|
|
||||||
const scalar value
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
label N = table.size() - 1;
|
|
||||||
scalar sum = 0.0;
|
|
||||||
scalar t = max(table[0][0], min(value, table[N][0]));
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
while
|
|
||||||
(
|
|
||||||
(i < N - 1)
|
|
||||||
&& (table[i+1][0] < t)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar deltaH = table[i+1][1] + table[i][1];
|
|
||||||
scalar deltaT = table[i+1][0] - table[i][0];
|
|
||||||
sum += 0.5*deltaH*deltaT;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar interpolatedValue =
|
|
||||||
table[i][1]
|
|
||||||
+ (t - table[i][0])
|
|
||||||
* (table[i+1][1] - table[i][1])
|
|
||||||
/ (table[i+1][0] - table[i][0]);
|
|
||||||
|
|
||||||
sum +=
|
|
||||||
0.5*(interpolatedValue + table[i][1])
|
|
||||||
*(t - table[i][0]);
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::injectorType::integrateTable
|
|
||||||
(
|
|
||||||
const List<pair>& table
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar integratedTable = 0.0;
|
|
||||||
for (label i=0; i < table.size() - 1; i++)
|
|
||||||
{
|
|
||||||
scalar deltaH = table[i+1][1] + table[i][1];
|
|
||||||
scalar deltaT = table[i+1][0] - table[i][0];
|
|
||||||
integratedTable += 0.5*deltaH*deltaT;
|
|
||||||
}
|
|
||||||
|
|
||||||
return integratedTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,235 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::injectorType
|
|
||||||
|
|
||||||
Description
|
|
||||||
Base class for injectors
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
injectorTypeI.H
|
|
||||||
injectorType.C
|
|
||||||
injectorTypeIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef injectorType_H
|
|
||||||
#define injectorType_H
|
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
|
||||||
#include "Time.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "vector.H"
|
|
||||||
#include "scalarField.H"
|
|
||||||
#include "cachedRandom.H"
|
|
||||||
#include "liquidMixtureProperties.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class injectorType Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class injectorType
|
|
||||||
{
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("injectorType");
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
injectorType,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const Time& t,
|
|
||||||
const dictionary& dict
|
|
||||||
),
|
|
||||||
(t, dict)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
injectorType(const Time& t, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<injectorType> New
|
|
||||||
(
|
|
||||||
const Time& t,
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~injectorType();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
virtual label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
virtual const vector position(const label n) const = 0;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
virtual vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
virtual label nHoles() const = 0;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
virtual scalar d() const = 0;
|
|
||||||
|
|
||||||
//- Return the injection direction for hole i
|
|
||||||
virtual const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the mass of the injected liquid between times
|
|
||||||
virtual scalar mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
virtual scalar mass() const = 0;
|
|
||||||
|
|
||||||
//- Return the mass flow rate profile
|
|
||||||
virtual List<pair> massFlowRateProfile() const = 0;
|
|
||||||
|
|
||||||
//- Return the instantaneous mass flow rate profile
|
|
||||||
virtual scalar massFlowRate(const scalar time) const = 0;
|
|
||||||
|
|
||||||
//- Return the pressure injection profile
|
|
||||||
virtual List<pair> injectionPressureProfile() const = 0;
|
|
||||||
|
|
||||||
//- Return the instantaneous injection pressure
|
|
||||||
virtual scalar injectionPressure(const scalar time) const = 0;
|
|
||||||
|
|
||||||
//- Return the velocity injection profile
|
|
||||||
virtual List<pair> velocityProfile() const = 0;
|
|
||||||
|
|
||||||
//- Return the instantaneous velocity
|
|
||||||
virtual scalar velocity(const scalar time) const = 0;
|
|
||||||
|
|
||||||
//- Return the discharge coefficient
|
|
||||||
virtual List<pair> CdProfile() const = 0;
|
|
||||||
|
|
||||||
//- Return the instantaneous discharge coefficient
|
|
||||||
virtual scalar Cd(const scalar time) const = 0;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
virtual const scalarField& X() const = 0;
|
|
||||||
|
|
||||||
//- Return the temperatue profile of the injected parcel
|
|
||||||
virtual List<pair> T() const = 0;
|
|
||||||
|
|
||||||
//- Return the temperatue of the injected parcel
|
|
||||||
virtual scalar T(const scalar time) const = 0;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
virtual scalar tsoi() const = 0;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
virtual scalar teoi() const = 0;
|
|
||||||
|
|
||||||
virtual scalar injectedMass(const scalar t) const = 0;
|
|
||||||
|
|
||||||
virtual bool pressureIndependentVelocity() const = 0;
|
|
||||||
|
|
||||||
//- Return a vector perpendicular to the injection direction and tan2
|
|
||||||
// for hole n
|
|
||||||
virtual vector tan1(const label n) const = 0;
|
|
||||||
|
|
||||||
//- Return a vector perpendicular to the injection direction and tan1
|
|
||||||
// for hole n
|
|
||||||
virtual vector tan2(const label n) const = 0;
|
|
||||||
|
|
||||||
scalar getTableValue
|
|
||||||
(
|
|
||||||
const List<pair>& table,
|
|
||||||
const scalar value
|
|
||||||
) const;
|
|
||||||
|
|
||||||
scalar integrateTable
|
|
||||||
(
|
|
||||||
const List<pair>& table,
|
|
||||||
const scalar value
|
|
||||||
) const;
|
|
||||||
|
|
||||||
scalar integrateTable
|
|
||||||
(
|
|
||||||
const List<pair>& table
|
|
||||||
) const;
|
|
||||||
|
|
||||||
virtual void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,452 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "multiHoleInjector.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "unitConversion.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(multiHoleInjector, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
injectorType,
|
|
||||||
multiHoleInjector,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::multiHoleInjector::multiHoleInjector
|
|
||||||
(
|
|
||||||
const Foam::Time& t,
|
|
||||||
const Foam::dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectorType(t, dict),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
centerPosition_(propsDict_.lookup("position")),
|
|
||||||
xyAngle_(readScalar(propsDict_.lookup("xyAngle"))),
|
|
||||||
zAngle_(readScalar(propsDict_.lookup("zAngle"))),
|
|
||||||
nHoles_(readLabel(propsDict_.lookup("nHoles"))),
|
|
||||||
umbrellaAngle_(readScalar(propsDict_.lookup("umbrellaAngle"))),
|
|
||||||
nozzleTipDiameter_(readScalar(propsDict_.lookup("nozzleTipDiameter"))),
|
|
||||||
angleSpacing_(propsDict_.lookup("angleSpacing")),
|
|
||||||
d_(readScalar(propsDict_.lookup("diameter"))),
|
|
||||||
Cd_(readScalar(propsDict_.lookup("Cd"))),
|
|
||||||
mass_(readScalar(propsDict_.lookup("mass"))),
|
|
||||||
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
|
|
||||||
X_(propsDict_.lookup("X")),
|
|
||||||
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
|
|
||||||
velocityProfile_(massFlowRateProfile_),
|
|
||||||
injectionPressureProfile_(massFlowRateProfile_),
|
|
||||||
CdProfile_(massFlowRateProfile_),
|
|
||||||
TProfile_(propsDict_.lookup("temperatureProfile")),
|
|
||||||
averageParcelMass_(nHoles_*mass_/nParcels_),
|
|
||||||
direction_(nHoles_),
|
|
||||||
position_(nHoles_),
|
|
||||||
pressureIndependentVelocity_(true),
|
|
||||||
tangentialInjectionVector1_(nHoles_),
|
|
||||||
tangentialInjectionVector2_(nHoles_)
|
|
||||||
{
|
|
||||||
// check if time entries for soi and eoi match
|
|
||||||
if (mag(massFlowRateProfile_[0][0] - TProfile_[0][0]) > SMALL)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"multiHoleInjector::multiHoleInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "Start-times do not match for TemperatureProfile and "
|
|
||||||
<< "massFlowRateProfile."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(massFlowRateProfile_.last()[0] - TProfile_.last()[0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"multiHoleInjector::multiHoleInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "End-times do not match for TemperatureProfile and "
|
|
||||||
<< "massFlowRateProfile."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert CA to real time
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][0] =
|
|
||||||
t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
velocityProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(TProfile_, i)
|
|
||||||
{
|
|
||||||
TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar integratedMFR = integrateTable(massFlowRateProfile_);
|
|
||||||
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
// correct the massFlowRateProfile to match the injected mass
|
|
||||||
massFlowRateProfile_[i][1] *= mass_/integratedMFR;
|
|
||||||
|
|
||||||
CdProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
CdProfile_[i][1] = Cd_;
|
|
||||||
}
|
|
||||||
|
|
||||||
setTangentialVectors();
|
|
||||||
|
|
||||||
// check molar fractions
|
|
||||||
scalar Xsum = 0.0;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
Xsum += X_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(Xsum - 1.0) > SMALL)
|
|
||||||
{
|
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"multiHoleInjector::multiHoleInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "X does not add up to 1.0, correcting molar fractions."
|
|
||||||
<< endl;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
X_[i] /= Xsum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::multiHoleInjector::~multiHoleInjector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::multiHoleInjector::setTangentialVectors()
|
|
||||||
{
|
|
||||||
scalar alpha = degToRad(xyAngle_);
|
|
||||||
scalar phi = degToRad(zAngle_);
|
|
||||||
|
|
||||||
vector xp(cos(alpha), sin(alpha), 0.0);
|
|
||||||
vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi));
|
|
||||||
if (mag(zp-xp) < 1.0e-15)
|
|
||||||
{
|
|
||||||
xp = vector(0.0, 0.0, -1.0);
|
|
||||||
xp -= (xp & zp)*zp;
|
|
||||||
xp /= mag(xp);
|
|
||||||
}
|
|
||||||
vector yp = zp^xp;
|
|
||||||
|
|
||||||
// Info<< "xp = " << xp << endl;
|
|
||||||
// Info<< "yp = " << yp << endl;
|
|
||||||
// Info<< "zp = " << zp << endl;
|
|
||||||
|
|
||||||
scalar angle = 0.0;
|
|
||||||
scalar u = degToRad(umbrellaAngle_/2.0);
|
|
||||||
for (label i=0; i<nHoles_; i++)
|
|
||||||
{
|
|
||||||
angle += angleSpacing_[i];
|
|
||||||
scalar v = degToRad(angle);
|
|
||||||
direction_[i] = cos(v)*sin(u)*xp + sin(v)*sin(u)*yp + cos(u)*zp;
|
|
||||||
vector dp = direction_[i] - (direction_[i] & zp)*direction_[i];
|
|
||||||
if (mag(dp) > SMALL)
|
|
||||||
{
|
|
||||||
dp /= mag(dp);
|
|
||||||
}
|
|
||||||
position_[i] = centerPosition_ + 0.5*nozzleTipDiameter_*dp;
|
|
||||||
}
|
|
||||||
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
|
||||||
|
|
||||||
for (label i=0; i<nHoles_; i++)
|
|
||||||
{
|
|
||||||
vector tangent(vector::zero);
|
|
||||||
scalar magV = 0;
|
|
||||||
while (magV < SMALL)
|
|
||||||
{
|
|
||||||
vector testThis = rndGen.sample01<vector>();
|
|
||||||
|
|
||||||
tangent = testThis - (testThis & direction_[i])*direction_[i];
|
|
||||||
magV = mag(tangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
tangentialInjectionVector1_[i] = tangent/magV;
|
|
||||||
tangentialInjectionVector2_[i] =
|
|
||||||
direction_[i] ^ tangentialInjectionVector1_[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::multiHoleInjector::nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
label nParcels = label(mInj/averageParcelMass_ + 0.49);
|
|
||||||
|
|
||||||
return nParcels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector Foam::multiHoleInjector::position(const label n) const
|
|
||||||
{
|
|
||||||
return position_[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::multiHoleInjector::position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
scalar is = position_[n] & axisOfSymmetry;
|
|
||||||
scalar magInj = mag(position_[n] - is*axisOfSymmetry);
|
|
||||||
|
|
||||||
vector halfWedge =
|
|
||||||
axisOfWedge*cos(0.5*angleOfWedge)
|
|
||||||
+ axisOfWedgeNormal*sin(0.5*angleOfWedge);
|
|
||||||
halfWedge /= mag(halfWedge);
|
|
||||||
|
|
||||||
return (is*axisOfSymmetry + magInj*halfWedge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// otherwise, disc injection
|
|
||||||
scalar iRadius = d_*rndGen.sample01<scalar>();
|
|
||||||
scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>();
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
position_[n]
|
|
||||||
+ iRadius
|
|
||||||
* (
|
|
||||||
tangentialInjectionVector1_[n]*cos(iAngle)
|
|
||||||
+ tangentialInjectionVector2_[n]*sin(iAngle)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return position_[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::multiHoleInjector::nHoles() const
|
|
||||||
{
|
|
||||||
return nHoles_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector& Foam::multiHoleInjector::direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return direction_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
|
|
||||||
// correct mass if calculation is 2D
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
mInj *= 0.5*angleOfWedge/constant::mathematical::pi;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mInj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::mass() const
|
|
||||||
{
|
|
||||||
return mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::scalarField& Foam::multiHoleInjector::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::T() const
|
|
||||||
{
|
|
||||||
return TProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::T(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(TProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::tsoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.first()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::teoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.last()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::massFlowRate
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(massFlowRateProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::injectionPressure
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(injectionPressureProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::velocity
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return getTableValue(velocityProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::CdProfile()
|
|
||||||
const
|
|
||||||
{
|
|
||||||
return CdProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::Cd
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return Cd_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::fractionOfInjection
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return integrateTable(massFlowRateProfile_, time)/mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::multiHoleInjector::injectedMass
|
|
||||||
(
|
|
||||||
const scalar t
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mass_*fractionOfInjection(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::multiHoleInjector::correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar A = nHoles_*0.25*constant::mathematical::pi*sqr(d_);
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
scalar time = velocityProfile_[i][0];
|
|
||||||
scalar rho = fuel.rho(referencePressure, T(time), X_);
|
|
||||||
scalar v = massFlowRateProfile_[i][1]/(Cd_*rho*A);
|
|
||||||
velocityProfile_[i][1] = v;
|
|
||||||
injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::multiHoleInjector::tan1(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector1_[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::multiHoleInjector::tan2(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector2_[n];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,245 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::multiHoleInjector
|
|
||||||
|
|
||||||
Description
|
|
||||||
The unit injector
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
multiHoleInjectorI.H
|
|
||||||
multiHoleInjector.C
|
|
||||||
multiHoleInjectorIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef multiHoleInjector_H
|
|
||||||
#define multiHoleInjector_H
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
#include "vector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class multiHoleInjector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class multiHoleInjector
|
|
||||||
:
|
|
||||||
public injectorType
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
vector centerPosition_;
|
|
||||||
scalar xyAngle_;
|
|
||||||
scalar zAngle_;
|
|
||||||
label nHoles_;
|
|
||||||
scalar umbrellaAngle_;
|
|
||||||
scalar nozzleTipDiameter_;
|
|
||||||
List<scalar> angleSpacing_;
|
|
||||||
scalar d_;
|
|
||||||
scalar Cd_;
|
|
||||||
scalar mass_;
|
|
||||||
label nParcels_;
|
|
||||||
scalarField X_;
|
|
||||||
List<pair> massFlowRateProfile_;
|
|
||||||
List<pair> velocityProfile_;
|
|
||||||
List<pair> injectionPressureProfile_;
|
|
||||||
List<pair> CdProfile_;
|
|
||||||
List<pair> TProfile_;
|
|
||||||
scalar averageParcelMass_;
|
|
||||||
List<vector> direction_;
|
|
||||||
List<vector> position_;
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity_;
|
|
||||||
|
|
||||||
//- two orthogonal vectors that are also orthogonal
|
|
||||||
// to the injection direction
|
|
||||||
List<vector> tangentialInjectionVector1_, tangentialInjectionVector2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
multiHoleInjector(const multiHoleInjector&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const multiHoleInjector&);
|
|
||||||
|
|
||||||
//- Create two vectors orthonoal to each other
|
|
||||||
// and the injection vector
|
|
||||||
void setTangentialVectors();
|
|
||||||
|
|
||||||
//- Return the fraction of the total injected liquid
|
|
||||||
scalar fractionOfInjection(const scalar time) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("multiHoleInjector");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
multiHoleInjector
|
|
||||||
(
|
|
||||||
const Time& t,
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~multiHoleInjector();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
const vector position(const label n) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
label nHoles() const;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
scalar d() const;
|
|
||||||
|
|
||||||
//- Return the injection direction
|
|
||||||
const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass of the injected particle
|
|
||||||
scalar mass
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
scalar mass() const;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the temperature profile of the injected particle
|
|
||||||
List<pair> T() const;
|
|
||||||
|
|
||||||
//- Return the temperature of the injected particle
|
|
||||||
scalar T(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
scalar tsoi() const;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
scalar teoi() const;
|
|
||||||
|
|
||||||
//- Return the injected liquid mass
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
List<pair> massFlowRateProfile() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar massFlowRate(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> injectionPressureProfile() const
|
|
||||||
{
|
|
||||||
return injectionPressureProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar injectionPressure(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> velocityProfile() const
|
|
||||||
{
|
|
||||||
return velocityProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar velocity(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> CdProfile() const;
|
|
||||||
scalar Cd(const scalar time) const;
|
|
||||||
|
|
||||||
vector tan1(const label n) const;
|
|
||||||
vector tan2(const label n) const;
|
|
||||||
|
|
||||||
void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
);
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity() const
|
|
||||||
{
|
|
||||||
return pressureIndependentVelocity_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,447 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "swirlInjector.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(swirlInjector, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
injectorType,
|
|
||||||
swirlInjector,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::swirlInjector::swirlInjector
|
|
||||||
(
|
|
||||||
const Foam::Time& t,
|
|
||||||
const Foam::dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectorType(t, dict),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
position_(propsDict_.lookup("position")),
|
|
||||||
direction_(propsDict_.lookup("direction")),
|
|
||||||
d_(readScalar(propsDict_.lookup("diameter"))),
|
|
||||||
mass_(readScalar(propsDict_.lookup("mass"))),
|
|
||||||
injectionPressure_(readScalar(propsDict_.lookup("injectionPressure"))),
|
|
||||||
T_(readScalar(propsDict_.lookup("temperature"))),
|
|
||||||
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
|
|
||||||
X_(propsDict_.lookup("X")),
|
|
||||||
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
|
|
||||||
injectionPressureProfile_(propsDict_.lookup("injectionPressureProfile")),
|
|
||||||
velocityProfile_(massFlowRateProfile_),
|
|
||||||
CdProfile_(massFlowRateProfile_),
|
|
||||||
TProfile_(massFlowRateProfile_),
|
|
||||||
averageParcelMass_(mass_/nParcels_),
|
|
||||||
pressureIndependentVelocity_(false)
|
|
||||||
{
|
|
||||||
// convert CA to real time
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][0] =
|
|
||||||
t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
}
|
|
||||||
forAll(injectionPressureProfile_, i)
|
|
||||||
{
|
|
||||||
injectionPressureProfile_[i][0] =
|
|
||||||
t.userTimeToTime(injectionPressureProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if time entries match
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(massFlowRateProfile_[0][0] - injectionPressureProfile_[0][0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"swirlInjector::swirlInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "Start-times do not match for "
|
|
||||||
<< "injectionPressureProfile and massFlowRateProfile."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if time entries match
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag
|
|
||||||
(
|
|
||||||
massFlowRateProfile_.last()[0]
|
|
||||||
- injectionPressureProfile_.last()[0]
|
|
||||||
) > SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"swirlInjector::swirlInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "End-times do not match for "
|
|
||||||
<< "injectionPressureProfile and massFlowRateProfile."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar integratedMFR = integrateTable(massFlowRateProfile_);
|
|
||||||
scalar integratedPressure =
|
|
||||||
integrateTable(injectionPressureProfile_)/(teoi()-tsoi());
|
|
||||||
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
// correct the massFlowRateProfile to match the injected mass
|
|
||||||
massFlowRateProfile_[i][1] *= mass_/integratedMFR;
|
|
||||||
|
|
||||||
velocityProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
|
|
||||||
TProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
TProfile_[i][1] = T_;
|
|
||||||
|
|
||||||
CdProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(injectionPressureProfile_, i)
|
|
||||||
{
|
|
||||||
// correct the pressureProfile to match the injection pressure
|
|
||||||
injectionPressureProfile_[i][1] *=
|
|
||||||
injectionPressure_/integratedPressure;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normalize the direction vector
|
|
||||||
direction_ /= mag(direction_);
|
|
||||||
|
|
||||||
setTangentialVectors();
|
|
||||||
|
|
||||||
// check molar fractions
|
|
||||||
scalar Xsum = 0.0;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
Xsum += X_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(Xsum - 1.0) > SMALL)
|
|
||||||
{
|
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"swirlInjector::swirlInjector"
|
|
||||||
"(const time& t, const dictionary dict)"
|
|
||||||
) << "X does not add up to 1.0, correcting molar fractions." << endl;
|
|
||||||
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
X_[i] /= Xsum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::swirlInjector::~swirlInjector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::swirlInjector::setTangentialVectors()
|
|
||||||
{
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
|
||||||
scalar magV = 0.0;
|
|
||||||
vector tangent;
|
|
||||||
|
|
||||||
while (magV < SMALL)
|
|
||||||
{
|
|
||||||
vector testThis = rndGen.sample01<vector>();
|
|
||||||
|
|
||||||
tangent = testThis - (testThis & direction_)*direction_;
|
|
||||||
magV = mag(tangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
tangentialInjectionVector1_ = tangent/magV;
|
|
||||||
tangentialInjectionVector2_ = direction_^tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::swirlInjector::nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
label nParcels = label(mInj/averageParcelMass_ + 0.49);
|
|
||||||
|
|
||||||
return nParcels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector Foam::swirlInjector::position(const label n) const
|
|
||||||
{
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::swirlInjector::position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
scalar is = position_ & axisOfSymmetry;
|
|
||||||
scalar magInj = mag(position_ - is*axisOfSymmetry);
|
|
||||||
|
|
||||||
vector halfWedge =
|
|
||||||
axisOfWedge*cos(0.5*angleOfWedge)
|
|
||||||
+ axisOfWedgeNormal*sin(0.5*angleOfWedge);
|
|
||||||
halfWedge /= mag(halfWedge);
|
|
||||||
|
|
||||||
return (is*axisOfSymmetry + magInj*halfWedge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// otherwise, disc injection
|
|
||||||
scalar iRadius = d_*rndGen.sample01<scalar>();
|
|
||||||
scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>();
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
position_
|
|
||||||
+ iRadius
|
|
||||||
* (
|
|
||||||
tangentialInjectionVector1_*cos(iAngle)
|
|
||||||
+ tangentialInjectionVector2_*sin(iAngle)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::swirlInjector::nHoles() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector& Foam::swirlInjector::direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return direction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
|
|
||||||
// correct mass if calculation is 2D
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
mInj *= 0.5*angleOfWedge/constant::mathematical::pi;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mInj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::mass() const
|
|
||||||
{
|
|
||||||
return mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::swirlInjector::pair>
|
|
||||||
Foam::swirlInjector::massFlowRateProfile() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::massFlowRate(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(massFlowRateProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::swirlInjector::pair>
|
|
||||||
Foam::swirlInjector::injectionPressureProfile() const
|
|
||||||
{
|
|
||||||
return injectionPressureProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::injectionPressure(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(injectionPressureProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::swirlInjector::pair>
|
|
||||||
Foam::swirlInjector::velocityProfile() const
|
|
||||||
{
|
|
||||||
return velocityProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::velocity(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(velocityProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::CdProfile() const
|
|
||||||
{
|
|
||||||
return CdProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::Cd(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(CdProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::scalarField& Foam::swirlInjector::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::T() const
|
|
||||||
{
|
|
||||||
return TProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::T(const scalar time) const
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::tsoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.first()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::teoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.last()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::fractionOfInjection(const scalar time) const
|
|
||||||
{
|
|
||||||
return integrateTable(massFlowRateProfile_, time)/mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::swirlInjector::injectedMass
|
|
||||||
(
|
|
||||||
const scalar t
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mass_*fractionOfInjection(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::swirlInjector::correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar A = 0.25*constant::mathematical::pi*sqr(d_);
|
|
||||||
scalar pDummy = 1.0e+5;
|
|
||||||
scalar rho = fuel.rho(pDummy, T_, X_);
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
scalar Pinj = getTableValue
|
|
||||||
(
|
|
||||||
injectionPressureProfile_,
|
|
||||||
massFlowRateProfile_[i][0]
|
|
||||||
);
|
|
||||||
scalar mfr = massFlowRateProfile_[i][1]/(rho*A);
|
|
||||||
scalar v = sqrt(2.0*(Pinj - referencePressure)/rho);
|
|
||||||
velocityProfile_[i][1] = v;
|
|
||||||
CdProfile_[i][1] = mfr/v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::swirlInjector::tan1(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::swirlInjector::tan2(const label n) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,254 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::swirlInjector
|
|
||||||
|
|
||||||
Description
|
|
||||||
The swirl injector
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
swirlInjectorI.H
|
|
||||||
swirlInjector.C
|
|
||||||
swirlInjectorIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef swirlInjector_H
|
|
||||||
#define swirlInjector_H
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
#include "vector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class swirlInjector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class swirlInjector
|
|
||||||
:
|
|
||||||
public injectorType
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
vector position_;
|
|
||||||
vector direction_;
|
|
||||||
scalar d_;
|
|
||||||
scalar mass_;
|
|
||||||
scalar injectionPressure_;
|
|
||||||
scalar T_;
|
|
||||||
label nParcels_;
|
|
||||||
scalarField X_;
|
|
||||||
List<pair> massFlowRateProfile_;
|
|
||||||
List<pair> injectionPressureProfile_;
|
|
||||||
List<pair> velocityProfile_;
|
|
||||||
List<pair> CdProfile_;
|
|
||||||
List<pair> TProfile_;
|
|
||||||
scalar averageParcelMass_;
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity_;
|
|
||||||
|
|
||||||
//- two orthogonal vectors that are also orthogonal
|
|
||||||
// to the injection direction
|
|
||||||
vector tangentialInjectionVector1_, tangentialInjectionVector2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
swirlInjector(const swirlInjector&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const swirlInjector&);
|
|
||||||
|
|
||||||
//- Integrate the mass-flow profile and set
|
|
||||||
// the integral value
|
|
||||||
void setIntegralProfileValue();
|
|
||||||
|
|
||||||
//- Create two vectors orthonoal to each other
|
|
||||||
// and the injection vector
|
|
||||||
void setTangentialVectors();
|
|
||||||
|
|
||||||
//- Return the fraction of the total injected liquid
|
|
||||||
scalar fractionOfInjection(const scalar time) const;
|
|
||||||
|
|
||||||
|
|
||||||
// //- Return the average injection velocity
|
|
||||||
// scalar averageInjectionVelocityTime
|
|
||||||
// (
|
|
||||||
// const scalar liquidDensity
|
|
||||||
// ) const;
|
|
||||||
|
|
||||||
// //- Return the instantaneous injection velocity
|
|
||||||
// scalar injectionVelocity
|
|
||||||
// (
|
|
||||||
// const scalar,
|
|
||||||
// const scalar liquidDensity
|
|
||||||
// ) const;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("swirlInjector");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
swirlInjector(const Time& t, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~swirlInjector();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
const vector position(const label n) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
label nHoles() const;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
scalar d() const;
|
|
||||||
|
|
||||||
//- Return the injection direction
|
|
||||||
const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass of the injected particle
|
|
||||||
scalar mass
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
scalar mass() const;
|
|
||||||
|
|
||||||
//- Return the mass flow rate profile
|
|
||||||
List<pair> massFlowRateProfile() const;
|
|
||||||
|
|
||||||
//- Return the instantaneous mass flow rate profile
|
|
||||||
scalar massFlowRate(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the pressure injection profile
|
|
||||||
List<pair> injectionPressureProfile() const;
|
|
||||||
|
|
||||||
//- Return the instantaneous injection pressure
|
|
||||||
scalar injectionPressure(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the velocity injection profile
|
|
||||||
List<pair> velocityProfile() const;
|
|
||||||
|
|
||||||
//- Return the instantaneous velocity
|
|
||||||
scalar velocity(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the discharge coefficient
|
|
||||||
List<pair> CdProfile() const;
|
|
||||||
|
|
||||||
//- Return the instantaneous discharge coefficient
|
|
||||||
scalar Cd(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the temperatue profile of the injected parcel
|
|
||||||
List<pair> T() const;
|
|
||||||
|
|
||||||
//- Return the temperatue of the injected parcel
|
|
||||||
scalar T(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
scalar tsoi() const;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
scalar teoi() const;
|
|
||||||
|
|
||||||
//- Return the injected liquid mass
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
vector tan1(const label n) const;
|
|
||||||
vector tan2(const label n) const;
|
|
||||||
|
|
||||||
void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
);
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity() const
|
|
||||||
{
|
|
||||||
return pressureIndependentVelocity_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,390 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "unitInjector.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(unitInjector, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
injectorType,
|
|
||||||
unitInjector,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::unitInjector::unitInjector
|
|
||||||
(
|
|
||||||
const Foam::Time& t,
|
|
||||||
const Foam::dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
injectorType(t, dict),
|
|
||||||
propsDict_(dict.subDict(typeName + "Props")),
|
|
||||||
position_(propsDict_.lookup("position")),
|
|
||||||
direction_(propsDict_.lookup("direction")),
|
|
||||||
d_(readScalar(propsDict_.lookup("diameter"))),
|
|
||||||
Cd_(readScalar(propsDict_.lookup("Cd"))),
|
|
||||||
mass_(readScalar(propsDict_.lookup("mass"))),
|
|
||||||
nParcels_(readLabel(propsDict_.lookup("nParcels"))),
|
|
||||||
X_(propsDict_.lookup("X")),
|
|
||||||
massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
|
|
||||||
velocityProfile_(massFlowRateProfile_),
|
|
||||||
injectionPressureProfile_(massFlowRateProfile_),
|
|
||||||
CdProfile_(massFlowRateProfile_),
|
|
||||||
TProfile_(propsDict_.lookup("temperatureProfile")),
|
|
||||||
averageParcelMass_(mass_/nParcels_),
|
|
||||||
pressureIndependentVelocity_(true)
|
|
||||||
{
|
|
||||||
|
|
||||||
// check if time entries for soi and eoi match
|
|
||||||
if (mag(massFlowRateProfile_[0][0]-TProfile_[0][0]) > SMALL)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"unitInjector::unitInjector(const time& t, const dictionary dict)"
|
|
||||||
) << "start-times do not match for TemperatureProfile and "
|
|
||||||
<< " massFlowRateProfile." << nl << exit (FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
mag(massFlowRateProfile_.last()[0]
|
|
||||||
- TProfile_.last()[0])
|
|
||||||
> SMALL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"unitInjector::unitInjector(const time& t, const dictionary dict)"
|
|
||||||
) << "end-times do not match for TemperatureProfile and "
|
|
||||||
<< "massFlowRateProfile." << nl << exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert CA to real time
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
massFlowRateProfile_[i][0] =
|
|
||||||
t.userTimeToTime(massFlowRateProfile_[i][0]);
|
|
||||||
velocityProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(TProfile_, i)
|
|
||||||
{
|
|
||||||
TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar integratedMFR = integrateTable(massFlowRateProfile_);
|
|
||||||
|
|
||||||
forAll(massFlowRateProfile_, i)
|
|
||||||
{
|
|
||||||
// correct the massFlowRateProfile to match the injected mass
|
|
||||||
massFlowRateProfile_[i][1] *= mass_/integratedMFR;
|
|
||||||
|
|
||||||
CdProfile_[i][0] = massFlowRateProfile_[i][0];
|
|
||||||
CdProfile_[i][1] = Cd_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normalize the direction vector
|
|
||||||
direction_ /= mag(direction_);
|
|
||||||
|
|
||||||
setTangentialVectors();
|
|
||||||
|
|
||||||
// check molar fractions
|
|
||||||
scalar Xsum = 0.0;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
Xsum += X_[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(Xsum - 1.0) > SMALL)
|
|
||||||
{
|
|
||||||
WarningIn("unitInjector::unitInjector(const time& t, Istream& is)")
|
|
||||||
<< "X does not sum to 1.0, correcting molar fractions."
|
|
||||||
<< nl << endl;
|
|
||||||
forAll(X_, i)
|
|
||||||
{
|
|
||||||
X_[i] /= Xsum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::unitInjector::~unitInjector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::unitInjector::setTangentialVectors()
|
|
||||||
{
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
|
||||||
scalar magV = 0.0;
|
|
||||||
vector tangent;
|
|
||||||
|
|
||||||
while (magV < SMALL)
|
|
||||||
{
|
|
||||||
vector testThis = rndGen.sample01<vector>();
|
|
||||||
|
|
||||||
tangent = testThis - (testThis & direction_)*direction_;
|
|
||||||
magV = mag(tangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
tangentialInjectionVector1_ = tangent/magV;
|
|
||||||
tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::unitInjector::nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
label nParcels = label(mInj/averageParcelMass_ + 0.49);
|
|
||||||
return nParcels;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector Foam::unitInjector::position(const label n) const
|
|
||||||
{
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::unitInjector::position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
scalar is = position_ & axisOfSymmetry;
|
|
||||||
scalar magInj = mag(position_ - is*axisOfSymmetry);
|
|
||||||
|
|
||||||
vector halfWedge =
|
|
||||||
axisOfWedge*cos(0.5*angleOfWedge)
|
|
||||||
+ axisOfWedgeNormal*sin(0.5*angleOfWedge);
|
|
||||||
halfWedge /= mag(halfWedge);
|
|
||||||
|
|
||||||
return (is*axisOfSymmetry + magInj*halfWedge);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// otherwise, disc injection
|
|
||||||
scalar iRadius = d_*rndGen.sample01<scalar>();
|
|
||||||
scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>();
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
position_
|
|
||||||
+ iRadius
|
|
||||||
* (
|
|
||||||
tangentialInjectionVector1_*cos(iAngle)
|
|
||||||
+ tangentialInjectionVector2_*sin(iAngle)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return position_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::unitInjector::nHoles() const
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::vector& Foam::unitInjector::direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return direction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::mass
|
|
||||||
(
|
|
||||||
const scalar time0,
|
|
||||||
const scalar time1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar mInj =
|
|
||||||
mass_*(fractionOfInjection(time1) - fractionOfInjection(time0));
|
|
||||||
|
|
||||||
// correct mass if calculation is 2D
|
|
||||||
if (twoD)
|
|
||||||
{
|
|
||||||
mInj *= 0.5*angleOfWedge/constant::mathematical::pi;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mInj;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::mass() const
|
|
||||||
{
|
|
||||||
return mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::scalarField& Foam::unitInjector::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::unitInjector::pair> Foam::unitInjector::T() const
|
|
||||||
{
|
|
||||||
return TProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::T(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(TProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::tsoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.first()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::teoi() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_.last()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::massFlowRate(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(massFlowRateProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::injectionPressure(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(injectionPressureProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::velocity(const scalar time) const
|
|
||||||
{
|
|
||||||
return getTableValue(velocityProfile_, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::unitInjector::pair> Foam::unitInjector::CdProfile() const
|
|
||||||
{
|
|
||||||
return CdProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::Cd(const scalar time) const
|
|
||||||
{
|
|
||||||
return Cd_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::fractionOfInjection(const scalar time) const
|
|
||||||
{
|
|
||||||
return integrateTable(massFlowRateProfile_, time)/mass_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::unitInjector::injectedMass(const scalar t) const
|
|
||||||
{
|
|
||||||
return mass_*fractionOfInjection(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::unitInjector::correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar A = 0.25*constant::mathematical::pi*sqr(d_);
|
|
||||||
scalar pDummy = 1.0e+5;
|
|
||||||
|
|
||||||
forAll(velocityProfile_, i)
|
|
||||||
{
|
|
||||||
scalar time = velocityProfile_[i][0];
|
|
||||||
scalar rho = fuel.rho(pDummy, T(time), X_);
|
|
||||||
scalar v = massFlowRateProfile_[i][1]/(Cd_*rho*A);
|
|
||||||
velocityProfile_[i][1] = v;
|
|
||||||
injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::unitInjector::tan1(const label) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::vector Foam::unitInjector::tan2(const label) const
|
|
||||||
{
|
|
||||||
return tangentialInjectionVector2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,234 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::unitInjector
|
|
||||||
|
|
||||||
Description
|
|
||||||
The unit injector
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
unitInjectorI.H
|
|
||||||
unitInjector.C
|
|
||||||
unitInjectorIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef unitInjector_H
|
|
||||||
#define unitInjector_H
|
|
||||||
|
|
||||||
#include "injectorType.H"
|
|
||||||
#include "vector.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class unitInjector Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class unitInjector
|
|
||||||
:
|
|
||||||
public injectorType
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary propsDict_;
|
|
||||||
|
|
||||||
vector position_;
|
|
||||||
vector direction_;
|
|
||||||
scalar d_;
|
|
||||||
scalar Cd_;
|
|
||||||
scalar mass_;
|
|
||||||
label nParcels_;
|
|
||||||
scalarField X_;
|
|
||||||
List<pair> massFlowRateProfile_;
|
|
||||||
List<pair> velocityProfile_;
|
|
||||||
List<pair> injectionPressureProfile_;
|
|
||||||
List<pair> CdProfile_;
|
|
||||||
List<pair> TProfile_;
|
|
||||||
scalar averageParcelMass_;
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity_;
|
|
||||||
|
|
||||||
//- two orthogonal vectors that are also orthogonal
|
|
||||||
// to the injection direction
|
|
||||||
vector tangentialInjectionVector1_, tangentialInjectionVector2_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
unitInjector(const unitInjector&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const unitInjector&);
|
|
||||||
|
|
||||||
//- Create two vectors orthonoal to each other
|
|
||||||
// and the injection vector
|
|
||||||
void setTangentialVectors();
|
|
||||||
|
|
||||||
//- Return the fraction of the total injected liquid
|
|
||||||
scalar fractionOfInjection(const scalar time) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("unitInjector");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
unitInjector(const Time& t, const dictionary& dict);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~unitInjector();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return number of particles to inject
|
|
||||||
label nParcelsToInject
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
const vector position(const label n) const;
|
|
||||||
|
|
||||||
//- Return the injection position
|
|
||||||
vector position
|
|
||||||
(
|
|
||||||
const label n,
|
|
||||||
const scalar time,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge,
|
|
||||||
const vector& axisOfSymmetry,
|
|
||||||
const vector& axisOfWedge,
|
|
||||||
const vector& axisOfWedgeNormal,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the number of holes
|
|
||||||
label nHoles() const;
|
|
||||||
|
|
||||||
//- Return the injector diameter
|
|
||||||
scalar d() const;
|
|
||||||
|
|
||||||
//- Return the injection direction
|
|
||||||
const vector& direction
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const scalar time
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass of the injected particle
|
|
||||||
scalar mass
|
|
||||||
(
|
|
||||||
const scalar t0,
|
|
||||||
const scalar t1,
|
|
||||||
const bool twoD,
|
|
||||||
const scalar angleOfWedge
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Return the mass injected by the injector
|
|
||||||
scalar mass() const;
|
|
||||||
|
|
||||||
//- Return the fuel mass fractions of the injected particle
|
|
||||||
const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the temperature profile of the injected particle
|
|
||||||
List<pair> T() const;
|
|
||||||
|
|
||||||
//- Return the temperature of the injected particle
|
|
||||||
scalar T(const scalar time) const;
|
|
||||||
|
|
||||||
//- Return the start-of-injection time
|
|
||||||
scalar tsoi() const;
|
|
||||||
|
|
||||||
//- Return the end-of-injection time
|
|
||||||
scalar teoi() const;
|
|
||||||
|
|
||||||
//- Return the injected liquid mass
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
List<pair> massFlowRateProfile() const
|
|
||||||
{
|
|
||||||
return massFlowRateProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar massFlowRate(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> injectionPressureProfile() const
|
|
||||||
{
|
|
||||||
return injectionPressureProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar injectionPressure(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> velocityProfile() const
|
|
||||||
{
|
|
||||||
return velocityProfile_;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar velocity(const scalar time) const;
|
|
||||||
|
|
||||||
List<pair> CdProfile() const;
|
|
||||||
scalar Cd(const scalar time) const;
|
|
||||||
|
|
||||||
vector tan1(const label n) const;
|
|
||||||
vector tan2(const label n) const;
|
|
||||||
|
|
||||||
void correctProfiles
|
|
||||||
(
|
|
||||||
const liquidMixtureProperties& fuel,
|
|
||||||
const scalar referencePressure
|
|
||||||
);
|
|
||||||
|
|
||||||
bool pressureIndependentVelocity() const
|
|
||||||
{
|
|
||||||
return pressureIndependentVelocity_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
if (isA<wallPolyPatch>(pbMesh[patch(face())]))
|
|
||||||
{
|
|
||||||
td.keepParticle = sDB.wall().wallTreatment(*this, face());
|
|
||||||
|
|
||||||
if (sDB.twoD())
|
|
||||||
{
|
|
||||||
scalar vs = U() & sDB.axisOfSymmetry();
|
|
||||||
vector Us = U() - (vs * sDB.axisOfSymmetry());
|
|
||||||
scalar magUs = mag(Us);
|
|
||||||
scalar v1 = Us & n();
|
|
||||||
scalar magV1 = mag(v1);
|
|
||||||
U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isA<wedgePolyPatch>(pbMesh[patch(face())]))
|
|
||||||
{
|
|
||||||
// check if parcel is trying to move out of the domain
|
|
||||||
|
|
||||||
vector nf = normal();
|
|
||||||
|
|
||||||
scalar Un = U() & nf;
|
|
||||||
|
|
||||||
if (Un > 0)
|
|
||||||
{
|
|
||||||
scalar Un2 = U() & n();
|
|
||||||
U() -= 2.0*Un2*n();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isA<symmetryPolyPatch>(pbMesh[patch(face())]))
|
|
||||||
{
|
|
||||||
// check if parcel is trying to move out of the domain
|
|
||||||
|
|
||||||
vector nf = normal();
|
|
||||||
|
|
||||||
scalar Un = U() & nf;
|
|
||||||
|
|
||||||
if (Un > 0)
|
|
||||||
{
|
|
||||||
if (sDB.twoD())
|
|
||||||
{
|
|
||||||
U() -= 2.0*(U() & n())*n();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nf /= mag(nf);
|
|
||||||
U() -= 2.0*(U() & nf)*nf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isType<polyPatch>(pbMesh[patch(face())]))
|
|
||||||
{
|
|
||||||
// Parcel has hit an inlet or outlet or some such so throw it away
|
|
||||||
td.keepParticle = false;
|
|
||||||
}
|
|
||||||
@ -1,685 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "parcel.H"
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
#include "dragModel.H"
|
|
||||||
#include "evaporationModel.H"
|
|
||||||
#include "heatTransferModel.H"
|
|
||||||
#include "wallModel.H"
|
|
||||||
#include "wallPolyPatch.H"
|
|
||||||
#include "wedgePolyPatch.H"
|
|
||||||
#include "processorPolyPatch.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::parcel::parcel
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const vector& position,
|
|
||||||
const label cellI,
|
|
||||||
const label tetFaceI,
|
|
||||||
const label tetPtI,
|
|
||||||
const vector& n,
|
|
||||||
const scalar d,
|
|
||||||
const scalar T,
|
|
||||||
const scalar m,
|
|
||||||
const scalar y,
|
|
||||||
const scalar yDot,
|
|
||||||
const scalar ct,
|
|
||||||
const scalar ms,
|
|
||||||
const scalar tTurb,
|
|
||||||
const scalar liquidCore,
|
|
||||||
const scalar injector,
|
|
||||||
const vector& U,
|
|
||||||
const vector& Uturb,
|
|
||||||
const scalarField& X,
|
|
||||||
const List<word>& liquidNames
|
|
||||||
)
|
|
||||||
:
|
|
||||||
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
|
||||||
liquidComponents_(liquidNames),
|
|
||||||
d_(d),
|
|
||||||
T_(T),
|
|
||||||
m_(m),
|
|
||||||
y_(y),
|
|
||||||
yDot_(yDot),
|
|
||||||
ct_(ct),
|
|
||||||
ms_(ms),
|
|
||||||
tTurb_(tTurb),
|
|
||||||
liquidCore_(liquidCore),
|
|
||||||
injector_(injector),
|
|
||||||
U_(U),
|
|
||||||
Uturb_(Uturb),
|
|
||||||
n_(n),
|
|
||||||
X_(X),
|
|
||||||
tMom_(GREAT)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::parcel::move(trackingData& td, const scalar trackTime)
|
|
||||||
{
|
|
||||||
td.switchProcessor = false;
|
|
||||||
td.keepParticle = true;
|
|
||||||
|
|
||||||
const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh();
|
|
||||||
|
|
||||||
spray& sDB = td.cloud();
|
|
||||||
const liquidMixtureProperties& fuels = sDB.fuels();
|
|
||||||
|
|
||||||
label Nf = fuels.components().size();
|
|
||||||
label Ns = sDB.composition().Y().size();
|
|
||||||
|
|
||||||
tetIndices tetIs = this->currentTetIndices();
|
|
||||||
|
|
||||||
// Calculate the interpolated gas properties at the position of the parcel
|
|
||||||
vector Up = sDB.UInterpolator().interpolate(position(), tetIs) + Uturb();
|
|
||||||
scalar rhog = sDB.rhoInterpolator().interpolate(position(), tetIs);
|
|
||||||
scalar pg = sDB.pInterpolator().interpolate(position(), tetIs);
|
|
||||||
scalar Tg = sDB.TInterpolator().interpolate(position(), tetIs);
|
|
||||||
|
|
||||||
scalarField Yfg(Nf, 0.0);
|
|
||||||
|
|
||||||
scalar cpMixture = 0.0;
|
|
||||||
for (label i=0; i<Ns; i++)
|
|
||||||
{
|
|
||||||
const volScalarField& Yi = sDB.composition().Y()[i];
|
|
||||||
if (sDB.isLiquidFuel()[i])
|
|
||||||
{
|
|
||||||
label j = sDB.gasToLiquidIndex()[i];
|
|
||||||
scalar YicellI = Yi[cell()];
|
|
||||||
Yfg[j] = YicellI;
|
|
||||||
}
|
|
||||||
cpMixture += Yi[cell()]*sDB.gasProperties()[i].Cp(Tg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// correct the gaseous temperature for evaporated fuel
|
|
||||||
|
|
||||||
scalar cellV = sDB.mesh().V()[cell()];
|
|
||||||
scalar cellMass = rhog*cellV;
|
|
||||||
Tg += sDB.shs()[cell()]/(cpMixture*cellMass);
|
|
||||||
Tg = max(200.0, Tg);
|
|
||||||
|
|
||||||
scalar tauMomentum = GREAT;
|
|
||||||
scalar tauHeatTransfer = GREAT;
|
|
||||||
scalarField tauEvaporation(Nf, GREAT);
|
|
||||||
scalarField tauBoiling(Nf, GREAT);
|
|
||||||
|
|
||||||
setRelaxationTimes
|
|
||||||
(
|
|
||||||
cell(),
|
|
||||||
tauMomentum,
|
|
||||||
tauEvaporation,
|
|
||||||
tauHeatTransfer,
|
|
||||||
tauBoiling,
|
|
||||||
sDB,
|
|
||||||
rhog,
|
|
||||||
Up,
|
|
||||||
Tg,
|
|
||||||
pg,
|
|
||||||
Yfg,
|
|
||||||
m()*fuels.Y(X()),
|
|
||||||
trackTime
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// set the end-time for the track
|
|
||||||
scalar tEnd = (1.0 - stepFraction())*trackTime;
|
|
||||||
|
|
||||||
// set the maximum time step for this parcel
|
|
||||||
scalar dtMax = min
|
|
||||||
(
|
|
||||||
tEnd,
|
|
||||||
min
|
|
||||||
(
|
|
||||||
tauMomentum,
|
|
||||||
min
|
|
||||||
(
|
|
||||||
1.0e+10*mag(min(tauEvaporation)), // evaporation is not an issue
|
|
||||||
min
|
|
||||||
(
|
|
||||||
mag(tauHeatTransfer),
|
|
||||||
mag(min(tauBoiling))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)/sDB.subCycles();
|
|
||||||
|
|
||||||
// prevent the number of subcycles from being too many
|
|
||||||
// (10 000 seems high enough)
|
|
||||||
dtMax = max(dtMax, 1.0e-4*tEnd);
|
|
||||||
|
|
||||||
vector planeNormal = vector::zero;
|
|
||||||
if (sDB.twoD())
|
|
||||||
{
|
|
||||||
planeNormal = n() ^ sDB.axisOfSymmetry();
|
|
||||||
planeNormal /= mag(planeNormal);
|
|
||||||
}
|
|
||||||
|
|
||||||
// move the parcel until there is no 'timeLeft'
|
|
||||||
while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
|
|
||||||
{
|
|
||||||
// set the lagrangian time-step
|
|
||||||
scalar dt = min(dtMax, tEnd);
|
|
||||||
|
|
||||||
// remember which cell the parcel is in
|
|
||||||
// since this will change if a face is hit
|
|
||||||
label cellI = cell();
|
|
||||||
scalar p = sDB.p()[cellI];
|
|
||||||
|
|
||||||
// track parcel to face, or end of trajectory
|
|
||||||
if (td.keepParticle)
|
|
||||||
{
|
|
||||||
// Track and adjust the time step if the trajectory is not completed
|
|
||||||
dt *= trackToFace(position() + dt*U_, td);
|
|
||||||
|
|
||||||
// Decrement the end-time acording to how much time the track took
|
|
||||||
tEnd -= dt;
|
|
||||||
|
|
||||||
// Set the current time-step fraction.
|
|
||||||
stepFraction() = 1.0 - tEnd/trackTime;
|
|
||||||
|
|
||||||
if (onBoundary()) // hit face
|
|
||||||
{
|
|
||||||
#include "boundaryTreatment.H"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (td.keepParticle && sDB.twoD())
|
|
||||||
{
|
|
||||||
scalar z = position() & sDB.axisOfSymmetry();
|
|
||||||
vector r = position() - z*sDB.axisOfSymmetry();
|
|
||||||
if (mag(r) > SMALL)
|
|
||||||
{
|
|
||||||
correctNormal(sDB.axisOfSymmetry());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// **** calculate the lagrangian source terms ****
|
|
||||||
// First we get the 'old' properties.
|
|
||||||
// and then 'update' them to get the 'new'
|
|
||||||
// properties.
|
|
||||||
// The difference is then added to the source terms.
|
|
||||||
|
|
||||||
scalar oRho = fuels.rho(p, T(), X());
|
|
||||||
scalarField oMass(Nf, 0.0);
|
|
||||||
scalar oHg = 0.0;
|
|
||||||
scalar oTotMass = m();
|
|
||||||
scalarField oYf(fuels.Y(X()));
|
|
||||||
|
|
||||||
forAll(oMass, i)
|
|
||||||
{
|
|
||||||
oMass[i] = m()*oYf[i];
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
oHg += oYf[i]*sDB.gasProperties()[j].Hs(T());
|
|
||||||
}
|
|
||||||
|
|
||||||
vector oMom = m()*U();
|
|
||||||
scalar oHv = fuels.hl(p, T(), X());
|
|
||||||
scalar oH = oHg - oHv;
|
|
||||||
scalar oPE = (p - fuels.pv(p, T(), X()))/oRho;
|
|
||||||
|
|
||||||
// update the parcel properties (U, T, D)
|
|
||||||
updateParcelProperties
|
|
||||||
(
|
|
||||||
dt,
|
|
||||||
sDB,
|
|
||||||
cellI,
|
|
||||||
face()
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar nRho = fuels.rho(p, T(), X());
|
|
||||||
scalar nHg = 0.0;
|
|
||||||
scalarField nMass(Nf, 0.0);
|
|
||||||
scalarField nYf(fuels.Y(X()));
|
|
||||||
|
|
||||||
forAll(nMass, i)
|
|
||||||
{
|
|
||||||
nMass[i] = m()*nYf[i];
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
nHg += nYf[i]*sDB.gasProperties()[j].Hs(T());
|
|
||||||
}
|
|
||||||
|
|
||||||
vector nMom = m()*U();
|
|
||||||
scalar nHv = fuels.hl(p, T(), X());
|
|
||||||
scalar nH = nHg - nHv;
|
|
||||||
scalar nPE = (p - fuels.pv(p, T(), X()))/nRho;
|
|
||||||
|
|
||||||
// Update the Spray Source Terms
|
|
||||||
forAll(nMass, i)
|
|
||||||
{
|
|
||||||
sDB.srhos()[i][cellI] += oMass[i] - nMass[i];
|
|
||||||
}
|
|
||||||
sDB.sms()[cellI] += oMom - nMom;
|
|
||||||
|
|
||||||
sDB.shs()[cellI] += oTotMass*(oH + oPE) - m()*(nH + nPE);
|
|
||||||
|
|
||||||
// Remove evaporated mass from stripped mass
|
|
||||||
ms() -= ms()*(oTotMass - m())/oTotMass;
|
|
||||||
|
|
||||||
// remove parcel if it is 'small'
|
|
||||||
if (m() < 1.0e-12)
|
|
||||||
{
|
|
||||||
td.keepParticle = false;
|
|
||||||
|
|
||||||
// ... and add the removed 'stuff' to the gas
|
|
||||||
forAll(nMass, i)
|
|
||||||
{
|
|
||||||
sDB.srhos()[i][cellI] += nMass[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
sDB.sms()[cellI] += nMom;
|
|
||||||
sDB.shs()[cellI] += m()*(nH + nPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (onBoundary() && td.keepParticle)
|
|
||||||
{
|
|
||||||
if (face() > -1)
|
|
||||||
{
|
|
||||||
if (isA<processorPolyPatch>(pbMesh[patch(face())]))
|
|
||||||
{
|
|
||||||
td.switchProcessor = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return td.keepParticle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::parcel::updateParcelProperties
|
|
||||||
(
|
|
||||||
const scalar dt,
|
|
||||||
spray& sDB,
|
|
||||||
const label cellI,
|
|
||||||
const label faceI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const liquidMixtureProperties& fuels = sDB.fuels();
|
|
||||||
|
|
||||||
label Nf = sDB.fuels().components().size();
|
|
||||||
label Ns = sDB.composition().Y().size();
|
|
||||||
|
|
||||||
// calculate mean molecular weight
|
|
||||||
scalar W = 0.0;
|
|
||||||
for (label i=0; i<Ns; i++)
|
|
||||||
{
|
|
||||||
W += sDB.composition().Y()[i][cellI]/sDB.gasProperties()[i].W();
|
|
||||||
|
|
||||||
}
|
|
||||||
W = 1.0/W;
|
|
||||||
|
|
||||||
// Calculate the interpolated gas properties at the position of the parcel
|
|
||||||
vector Up = sDB.UInterpolator().interpolate(position(), cellI, faceI)
|
|
||||||
+ Uturb();
|
|
||||||
scalar rhog = sDB.rhoInterpolator().interpolate(position(), cellI, faceI);
|
|
||||||
scalar pg = sDB.pInterpolator().interpolate(position(), cellI, faceI);
|
|
||||||
scalar Tg0 = sDB.TInterpolator().interpolate(position(), cellI, faceI);
|
|
||||||
|
|
||||||
// correct the gaseous temperature for evaporated fuel
|
|
||||||
scalar cpMix = 0.0;
|
|
||||||
for (label i=0; i<Ns; i++)
|
|
||||||
{
|
|
||||||
cpMix += sDB.composition().Y()[i][cellI]
|
|
||||||
*sDB.gasProperties()[i].Cp(T());
|
|
||||||
}
|
|
||||||
scalar cellV = sDB.mesh().V()[cellI];
|
|
||||||
scalar rho = sDB.rho()[cellI];
|
|
||||||
scalar cellMass = rho*cellV;
|
|
||||||
scalar dh = sDB.shs()[cellI];
|
|
||||||
scalarField addedMass(Nf, 0.0);
|
|
||||||
|
|
||||||
forAll(addedMass, i)
|
|
||||||
{
|
|
||||||
addedMass[i] += sDB.srhos()[i][cellI]*cellV;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar Tg = Tg0 + dh/(cpMix*cellMass);
|
|
||||||
Tg = max(200.0, Tg);
|
|
||||||
|
|
||||||
scalarField Yfg(Nf, 0.0);
|
|
||||||
forAll(Yfg, i)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
const volScalarField& Yj = sDB.composition().Y()[j];
|
|
||||||
scalar Yfg0 = Yj[cellI];
|
|
||||||
Yfg[i] = (Yfg0*cellMass + addedMass[i])/(addedMass[i] + cellMass);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar tauMomentum = GREAT;
|
|
||||||
scalar tauHeatTransfer = GREAT;
|
|
||||||
scalarField tauEvaporation(Nf, GREAT);
|
|
||||||
scalarField tauBoiling(Nf, GREAT);
|
|
||||||
|
|
||||||
setRelaxationTimes
|
|
||||||
(
|
|
||||||
cellI,
|
|
||||||
tauMomentum,
|
|
||||||
tauEvaporation,
|
|
||||||
tauHeatTransfer,
|
|
||||||
tauBoiling,
|
|
||||||
sDB,
|
|
||||||
rhog,
|
|
||||||
Up,
|
|
||||||
Tg,
|
|
||||||
pg,
|
|
||||||
Yfg,
|
|
||||||
m()*fuels.Y(X()),
|
|
||||||
dt
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar timeRatio = dt/tauMomentum;
|
|
||||||
|
|
||||||
vector Ucorr = Up;
|
|
||||||
vector gcorr = sDB.g();
|
|
||||||
|
|
||||||
if (sDB.twoD())
|
|
||||||
{
|
|
||||||
// remove the tangential velocity component
|
|
||||||
scalar v1 = Up & sDB.axisOfSymmetry();
|
|
||||||
scalar v2 = Up & n();
|
|
||||||
Ucorr = v1*sDB.axisOfSymmetry() + v2*n();
|
|
||||||
|
|
||||||
// Remove the tangential gravity component
|
|
||||||
scalar g1 = gcorr & sDB.axisOfSymmetry();
|
|
||||||
scalar g2 = gcorr & n();
|
|
||||||
gcorr = g1*sDB.axisOfSymmetry() + g2*n();
|
|
||||||
}
|
|
||||||
|
|
||||||
U() = (U() + timeRatio*Ucorr + gcorr*dt)/(1.0 + timeRatio);
|
|
||||||
|
|
||||||
if (sDB.twoD())
|
|
||||||
{
|
|
||||||
vector normal = n() ^ sDB.axisOfSymmetry();
|
|
||||||
normal /= mag(normal);
|
|
||||||
scalar dU = U() & normal;
|
|
||||||
U() -= dU*normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar TDroplet = T();
|
|
||||||
scalar oldDensity = fuels.rho(pg, T(), X());
|
|
||||||
scalar oldMass = m();
|
|
||||||
scalarField Yf0(fuels.Y(X()));
|
|
||||||
scalarField mi0(m()*Yf0);
|
|
||||||
scalarField mi(mi0);
|
|
||||||
|
|
||||||
scalar oldhg = 0.0;
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
oldhg += Yf0[i]*sDB.gasProperties()[j].Hs(T());
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar oldhv = fuels.hl(pg, T(), X());
|
|
||||||
scalar Np = N(oldDensity);
|
|
||||||
|
|
||||||
scalar newMass = oldMass;
|
|
||||||
scalar newhg = oldhg;
|
|
||||||
scalar newhv = oldhv;
|
|
||||||
|
|
||||||
scalar Tnew = T();
|
|
||||||
|
|
||||||
// first calculate the new temperature and droplet mass,
|
|
||||||
// then calculate the energy source and correct the
|
|
||||||
// gaseous temperature, Tg, and mass fraction, Yfg,
|
|
||||||
// to calculate the new properties for the parcel
|
|
||||||
// This procedure seems to be more stable
|
|
||||||
label n = 0;
|
|
||||||
while ((n < sDB.evaporation().nEvapIter()) && (m() > VSMALL))
|
|
||||||
{
|
|
||||||
n++;
|
|
||||||
// new characteristic times does not need to be calculated the
|
|
||||||
// first time
|
|
||||||
if (n > 1)
|
|
||||||
{
|
|
||||||
newMass = m();
|
|
||||||
newhg = 0.0;
|
|
||||||
scalarField Ynew(fuels.Y(X()));
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
newhg += Ynew[i]*sDB.gasProperties()[j].Hs(Tnew);
|
|
||||||
}
|
|
||||||
|
|
||||||
newhv = fuels.hl(pg, Tnew, X());
|
|
||||||
|
|
||||||
scalar dm = oldMass - newMass;
|
|
||||||
scalar dhNew = oldMass*(oldhg-oldhv) - newMass*(newhg-newhv);
|
|
||||||
|
|
||||||
// Prediction of new gaseous temperature and fuel mass fraction
|
|
||||||
Tg = Tg0 + (dh+dhNew)/(cpMix*cellMass);
|
|
||||||
Tg = max(200.0, Tg);
|
|
||||||
|
|
||||||
forAll(Yfg, i)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
const volScalarField& Yj = sDB.composition().Y()[j];
|
|
||||||
scalar Yfg0 = Yj[cellI];
|
|
||||||
Yfg[i] = (Yfg0*cellMass + addedMass[i] + dm)
|
|
||||||
/(addedMass[i] + cellMass + dm);
|
|
||||||
}
|
|
||||||
|
|
||||||
setRelaxationTimes
|
|
||||||
(
|
|
||||||
cellI,
|
|
||||||
tauMomentum,
|
|
||||||
tauEvaporation,
|
|
||||||
tauHeatTransfer,
|
|
||||||
tauBoiling,
|
|
||||||
sDB,
|
|
||||||
rhog,
|
|
||||||
Up,
|
|
||||||
Tg,
|
|
||||||
pg,
|
|
||||||
Yfg,
|
|
||||||
m()*fuels.Y(X()),
|
|
||||||
dt
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar Taverage = TDroplet + (Tg - TDroplet)/3.0;
|
|
||||||
// for a liquid Cl \approx Cp
|
|
||||||
scalar liquidcL = sDB.fuels().Cp(pg, TDroplet, X());
|
|
||||||
|
|
||||||
cpMix = 0.0;
|
|
||||||
for (label i=0; i<Ns; i++)
|
|
||||||
{
|
|
||||||
if (sDB.isLiquidFuel()[i])
|
|
||||||
{
|
|
||||||
label j = sDB.gasToLiquidIndex()[i];
|
|
||||||
cpMix += Yfg[j]*sDB.gasProperties()[i].Cp(Taverage);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar Y = sDB.composition().Y()[i][cellI];
|
|
||||||
cpMix += Y*sDB.gasProperties()[i].Cp(Taverage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar evaporationSource = 0.0;
|
|
||||||
scalar z = 0.0;
|
|
||||||
scalar tauEvap = 0.0;
|
|
||||||
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
tauEvap += X()[i]*fuels.properties()[i].W()/tauEvaporation[i];
|
|
||||||
}
|
|
||||||
tauEvap = fuels.W(X())/tauEvap;
|
|
||||||
|
|
||||||
|
|
||||||
if (sDB.evaporation().evaporation())
|
|
||||||
{
|
|
||||||
scalar hv = fuels.hl(pg, TDroplet, X());
|
|
||||||
evaporationSource =
|
|
||||||
hv/liquidcL/tauEvap;
|
|
||||||
|
|
||||||
z = cpMix*tauHeatTransfer/liquidcL/tauEvap;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sDB.heatTransfer().heatTransfer())
|
|
||||||
{
|
|
||||||
scalar fCorrect =
|
|
||||||
sDB.heatTransfer().fCorrection(z)/tauHeatTransfer;
|
|
||||||
|
|
||||||
Tnew =
|
|
||||||
(TDroplet + dt*(fCorrect * Tg - evaporationSource))
|
|
||||||
/(1.0 + dt*fCorrect);
|
|
||||||
|
|
||||||
// Prevent droplet temperature to go above critial value
|
|
||||||
Tnew = min(Tnew, fuels.Tc(X()));
|
|
||||||
|
|
||||||
// Prevent droplet temperature to go too low
|
|
||||||
// Mainly a numerical stability issue
|
|
||||||
Tnew = max(200.0, Tnew);
|
|
||||||
scalar Td = Tnew;
|
|
||||||
|
|
||||||
scalar pAtSurface = fuels.pv(pg, Td, X());
|
|
||||||
scalar pCompare = 0.999*pg;
|
|
||||||
scalar boiling = pAtSurface >= pCompare;
|
|
||||||
if (boiling)
|
|
||||||
{
|
|
||||||
// can not go above boiling temperature
|
|
||||||
scalar Terr = 1.0e-3;
|
|
||||||
label n = 0;
|
|
||||||
scalar dT = 1.0;
|
|
||||||
scalar pOld = pAtSurface;
|
|
||||||
while (dT > Terr)
|
|
||||||
{
|
|
||||||
n++;
|
|
||||||
pAtSurface = fuels.pv(pg, Td, X());
|
|
||||||
if ((pAtSurface < pCompare) && (pOld < pCompare))
|
|
||||||
{
|
|
||||||
Td += dT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((pAtSurface > pCompare) && (pOld > pCompare))
|
|
||||||
{
|
|
||||||
Td -= dT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dT *= 0.5;
|
|
||||||
if ((pAtSurface > pCompare) && (pOld < pCompare))
|
|
||||||
{
|
|
||||||
Td -= dT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Td += dT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pOld = pAtSurface;
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
if (n>100)
|
|
||||||
{
|
|
||||||
Info<< "n = " << n << ", T = " << Td << ", pv = "
|
|
||||||
<< pAtSurface << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Tnew = Td;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Evaporate droplet!
|
|
||||||
// if the droplet is NOT boiling use implicit scheme.
|
|
||||||
if (sDB.evaporation().evaporation())
|
|
||||||
{
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
// immediately evaporate mass that has reached critical
|
|
||||||
// condition
|
|
||||||
if (mag(Tnew - fuels.Tc(X())) < SMALL)
|
|
||||||
{
|
|
||||||
mi[i] = 0.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar Td = min(Tnew, 0.999*fuels.properties()[i].Tc());
|
|
||||||
|
|
||||||
scalar pAtSurface = fuels.properties()[i].pv(pg, Td);
|
|
||||||
scalar boiling = pAtSurface >= 0.999*pg;
|
|
||||||
|
|
||||||
if (!boiling)
|
|
||||||
{
|
|
||||||
scalar fr = dt/tauEvaporation[i];
|
|
||||||
mi[i] = mi0[i]/(1.0 + fr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar fr = dt/tauBoiling[i];
|
|
||||||
mi[i] = mi0[i]/(1.0 + fr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar mTot = sum(mi);
|
|
||||||
if (mTot > VSMALL)
|
|
||||||
{
|
|
||||||
scalarField Ynew(mi/mTot);
|
|
||||||
scalarField Xnew(sDB.fuels().X(Ynew));
|
|
||||||
forAll(Xnew, i)
|
|
||||||
{
|
|
||||||
X()[i] = Xnew[i];
|
|
||||||
}
|
|
||||||
m() = mTot;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
T() = Tnew;
|
|
||||||
scalar rhod = fuels.rho(pg, T(), X());
|
|
||||||
d() = cbrt(6.0*m()/(Np*rhod*M_PI));
|
|
||||||
}
|
|
||||||
|
|
||||||
T() = Tnew;
|
|
||||||
scalar rhod = fuels.rho(pg, T(), X());
|
|
||||||
m() = sum(mi);
|
|
||||||
d() = cbrt(6.0*m()/(Np*rhod*M_PI));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::parcel::transformProperties(const tensor& T)
|
|
||||||
{
|
|
||||||
U_ = transform(T, U_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::parcel::transformProperties(const vector&)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,432 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::parcel
|
|
||||||
|
|
||||||
Description
|
|
||||||
A parcel of particles
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef parcel_H
|
|
||||||
#define parcel_H
|
|
||||||
|
|
||||||
#include "particle.H"
|
|
||||||
#include "contiguous.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
class spray;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class parcel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class parcel
|
|
||||||
:
|
|
||||||
public particle
|
|
||||||
{
|
|
||||||
// Private member data
|
|
||||||
|
|
||||||
//- Reference to the names of the liquid components
|
|
||||||
List<word> liquidComponents_;
|
|
||||||
|
|
||||||
|
|
||||||
// Defining data (read and written to field files)
|
|
||||||
|
|
||||||
//- Diameter of droplets in parcel
|
|
||||||
scalar d_;
|
|
||||||
|
|
||||||
//- Temperature of droplets in parcel
|
|
||||||
scalar T_;
|
|
||||||
|
|
||||||
//- Total parcel mass
|
|
||||||
scalar m_;
|
|
||||||
|
|
||||||
//- Spherical deviation of droplets in parcel
|
|
||||||
scalar y_;
|
|
||||||
|
|
||||||
//- Rate of change of spherical deviation of droplets in parcel
|
|
||||||
scalar yDot_;
|
|
||||||
|
|
||||||
//- Characteristic time of droplets in parcel
|
|
||||||
scalar ct_;
|
|
||||||
|
|
||||||
//- Stripped mass of droplets in parcel
|
|
||||||
scalar ms_;
|
|
||||||
|
|
||||||
//- Time spent in turbulent eddy
|
|
||||||
scalar tTurb_;
|
|
||||||
|
|
||||||
//- Part of liquid core (1-fully liquid, 0-droplet)
|
|
||||||
scalar liquidCore_;
|
|
||||||
|
|
||||||
//- injected from injector
|
|
||||||
// Should really be a label, but is scalar due to
|
|
||||||
// post-processing reasons
|
|
||||||
scalar injector_;
|
|
||||||
|
|
||||||
//- Velocity of parcel
|
|
||||||
vector U_;
|
|
||||||
|
|
||||||
//- Turbulent velocity fluctuation
|
|
||||||
vector Uturb_;
|
|
||||||
|
|
||||||
//- Normal n_ and axis describe the 2D plane
|
|
||||||
// in which the particle moves
|
|
||||||
vector n_;
|
|
||||||
|
|
||||||
//- Liquid components molar fractions
|
|
||||||
scalarField X_;
|
|
||||||
|
|
||||||
// Derived state information (not read or written)
|
|
||||||
|
|
||||||
//- Momentum relaxation time of droplets in parcel
|
|
||||||
scalar tMom_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Set the relaxation times
|
|
||||||
void setRelaxationTimes
|
|
||||||
(
|
|
||||||
label cellI,
|
|
||||||
scalar& tauMomentum,
|
|
||||||
scalarField& tauEvaporation,
|
|
||||||
scalar& tauHeatTransfer,
|
|
||||||
scalarField& tauBoiling,
|
|
||||||
const spray& sprayDatabase,
|
|
||||||
const scalar rho,
|
|
||||||
const vector& Up,
|
|
||||||
const scalar temperature,
|
|
||||||
const scalar pressure,
|
|
||||||
const scalarField& Yf,
|
|
||||||
const scalarField& m0,
|
|
||||||
const scalar dt
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
void updateParcelProperties
|
|
||||||
(
|
|
||||||
const scalar dt,
|
|
||||||
spray& sprayData,
|
|
||||||
const label cellI,
|
|
||||||
const label faceI
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
friend class Cloud<parcel>;
|
|
||||||
|
|
||||||
//- Class used to pass tracking data to the trackToFace function
|
|
||||||
class trackingData
|
|
||||||
:
|
|
||||||
public particle::TrackingData<spray>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
trackingData(spray& cloud)
|
|
||||||
:
|
|
||||||
particle::TrackingData<spray>(cloud)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
parcel
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const vector& position,
|
|
||||||
const label cellI,
|
|
||||||
const label tetFaceI,
|
|
||||||
const label tetPtI,
|
|
||||||
const vector& n,
|
|
||||||
const scalar d,
|
|
||||||
const scalar T,
|
|
||||||
const scalar m,
|
|
||||||
const scalar y,
|
|
||||||
const scalar yDot,
|
|
||||||
const scalar ct,
|
|
||||||
const scalar ms,
|
|
||||||
const scalar tTurb,
|
|
||||||
const scalar liquidCore,
|
|
||||||
const scalar injector,
|
|
||||||
const vector& U,
|
|
||||||
const vector& Uturb,
|
|
||||||
const scalarField& X,
|
|
||||||
const List<word>& liquidNames
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from Istream reading field values if required
|
|
||||||
parcel
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
Istream& is,
|
|
||||||
bool readFields = true
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Factory class to read-construct particles used for
|
|
||||||
// parallel transfer
|
|
||||||
class iNew
|
|
||||||
{
|
|
||||||
const polyMesh& mesh_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
iNew(const polyMesh& mesh)
|
|
||||||
:
|
|
||||||
mesh_(mesh)
|
|
||||||
{}
|
|
||||||
|
|
||||||
autoPtr<parcel> operator()(Istream& is) const
|
|
||||||
{
|
|
||||||
return autoPtr<parcel>(new parcel(mesh_, is, true));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return the names of the liquid components
|
|
||||||
inline const List<word>& liquidNames() const;
|
|
||||||
|
|
||||||
//- Return the names of the liquid fuel components
|
|
||||||
// - identical with liquidNames
|
|
||||||
inline const List<word>& fuelNames() const;
|
|
||||||
|
|
||||||
//- Return diameter of droplets in parcel
|
|
||||||
inline scalar d() const;
|
|
||||||
|
|
||||||
//- Return diameter of droplets in parcel
|
|
||||||
inline scalar& d();
|
|
||||||
|
|
||||||
//- Return temperature of droplets in parcel
|
|
||||||
inline scalar T() const;
|
|
||||||
|
|
||||||
//- Return temperature of droplets in parcel
|
|
||||||
inline scalar& T();
|
|
||||||
|
|
||||||
//- Return total parcel mass
|
|
||||||
inline scalar m() const;
|
|
||||||
|
|
||||||
//- Return total parcel mass
|
|
||||||
inline scalar& m();
|
|
||||||
|
|
||||||
//- Return spherical deviation of droplets in parcel
|
|
||||||
inline scalar dev() const;
|
|
||||||
|
|
||||||
//- Return spherical deviation of droplets in parcel
|
|
||||||
inline scalar& dev();
|
|
||||||
|
|
||||||
//- Return rate of change of spherical deviation of
|
|
||||||
// droplets in parcel
|
|
||||||
inline scalar ddev() const;
|
|
||||||
|
|
||||||
//- Return rate of change of spherical deviation of
|
|
||||||
// droplets in parcel
|
|
||||||
inline scalar& ddev();
|
|
||||||
|
|
||||||
//- Return characteristic time of droplets in parcel
|
|
||||||
inline scalar ct() const;
|
|
||||||
|
|
||||||
//- Return characteristic time of droplets in parcel
|
|
||||||
inline scalar& ct();
|
|
||||||
|
|
||||||
//- Return stripped mass of droplets in parcel
|
|
||||||
inline scalar& ms();
|
|
||||||
|
|
||||||
//- Return stripped mass of droplets in parcel
|
|
||||||
inline scalar ms() const;
|
|
||||||
|
|
||||||
//- Return time spent in turbulent eddy
|
|
||||||
inline scalar& tTurb();
|
|
||||||
|
|
||||||
//- Return time spent in turbulent eddy
|
|
||||||
inline scalar tTurb() const;
|
|
||||||
|
|
||||||
//- Return part of liquid liquidCore
|
|
||||||
inline scalar& liquidCore();
|
|
||||||
|
|
||||||
//- Return part of liquid liquidCore
|
|
||||||
inline scalar liquidCore() const;
|
|
||||||
|
|
||||||
//- Return the injector from which is injected
|
|
||||||
inline scalar& injector();
|
|
||||||
|
|
||||||
//- Return the injector from which is injected
|
|
||||||
inline scalar injector() const;
|
|
||||||
|
|
||||||
//- Return velocity of parcel
|
|
||||||
inline const vector& U() const;
|
|
||||||
|
|
||||||
//- Return velocity of parcel
|
|
||||||
inline vector& U();
|
|
||||||
|
|
||||||
//- Return turbulent velocity fluctuation
|
|
||||||
inline const vector& Uturb() const;
|
|
||||||
|
|
||||||
//- Return turbulent velocity fluctuation
|
|
||||||
inline vector& Uturb();
|
|
||||||
|
|
||||||
//- Return the normal used for 2D purposes
|
|
||||||
inline const vector& n() const;
|
|
||||||
|
|
||||||
//- Return the normal used for 2D purposes
|
|
||||||
inline vector& n();
|
|
||||||
|
|
||||||
//- Return the liquid components molar fractions
|
|
||||||
inline const scalarField& X() const;
|
|
||||||
|
|
||||||
//- Return the liquid components molar fractions
|
|
||||||
inline scalarField& X();
|
|
||||||
|
|
||||||
//- Return the momentum relaxation time of droplets in parcel
|
|
||||||
inline scalar& tMom();
|
|
||||||
|
|
||||||
//- Return the momentum relaxation time of droplets in parcel
|
|
||||||
inline scalar tMom() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Derived information
|
|
||||||
|
|
||||||
//- Return statistical number of drops in parcel
|
|
||||||
scalar N(const scalar rho) const;
|
|
||||||
|
|
||||||
//- Return relative velocity between given vector and parcel
|
|
||||||
inline vector Urel(const vector&) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Dimensionless Numbers
|
|
||||||
|
|
||||||
//- Reynolds number based on rho an dynamic viscosity
|
|
||||||
scalar Re
|
|
||||||
(
|
|
||||||
const scalar rho,
|
|
||||||
const vector& U,
|
|
||||||
const scalar mu
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Reynolds number based on kinematic viscosity
|
|
||||||
scalar Re
|
|
||||||
(
|
|
||||||
const vector& U,
|
|
||||||
const scalar nu
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Weber number
|
|
||||||
scalar We
|
|
||||||
(
|
|
||||||
const vector& U,
|
|
||||||
const scalar rho,
|
|
||||||
const scalar sigma
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Schmidt number based on dynamic viscosity and rho
|
|
||||||
scalar Sc
|
|
||||||
(
|
|
||||||
const scalar mu,
|
|
||||||
const scalar rho,
|
|
||||||
const scalar massDiffusion
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Schmidt number based on kinematic viscosity
|
|
||||||
scalar Sc
|
|
||||||
(
|
|
||||||
const scalar nu,
|
|
||||||
const scalar massDiffusion
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Prandtl number
|
|
||||||
scalar Pr
|
|
||||||
(
|
|
||||||
const scalar cp,
|
|
||||||
const scalar mu,
|
|
||||||
const scalar kappa
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Volume of one droplet in the parcel
|
|
||||||
scalar Vd() const;
|
|
||||||
|
|
||||||
//- Volume of all droplets in parcel
|
|
||||||
scalar V(const scalar rho) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Parcel operations
|
|
||||||
|
|
||||||
bool move(trackingData& td, const scalar trackTime);
|
|
||||||
|
|
||||||
//- Transform the position and physical properties of the particle
|
|
||||||
// according to the given transformation tensor
|
|
||||||
virtual void transformProperties(const tensor& T);
|
|
||||||
|
|
||||||
//- Transform the position and physical properties of the particle
|
|
||||||
// according to the given separation vector
|
|
||||||
virtual void transformProperties(const vector& separation);
|
|
||||||
|
|
||||||
//- fix the 2D plane normal,
|
|
||||||
// when particle hits a face it is slightly perturbed
|
|
||||||
// towards the face centre and n_ will no longer be valid
|
|
||||||
inline void correctNormal(const vector& sym);
|
|
||||||
|
|
||||||
|
|
||||||
// I/O
|
|
||||||
|
|
||||||
static void readFields(Cloud<parcel>& c);
|
|
||||||
|
|
||||||
static void writeFields(const Cloud<parcel>& c);
|
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const parcel&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline bool contiguous<parcel>()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "parcelI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "parcel.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// The diameter based Reynolds number
|
|
||||||
Foam::scalar Foam::parcel::Re
|
|
||||||
(
|
|
||||||
const vector& U,
|
|
||||||
const scalar nu
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mag(Urel(U))*d_/nu;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The diameter based Reynolds number
|
|
||||||
Foam::scalar Foam::parcel::Re
|
|
||||||
(
|
|
||||||
const scalar rho,
|
|
||||||
const vector& U,
|
|
||||||
const scalar mu
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
return rho*mag(Urel(U))*d_/mu;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The diameter based Weber number
|
|
||||||
Foam::scalar Foam::parcel::We
|
|
||||||
(
|
|
||||||
const vector& U,
|
|
||||||
const scalar rho,
|
|
||||||
const scalar sigma
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return 0.5*rho*pow(mag(Urel(U)),2)*d_/sigma;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::Sc
|
|
||||||
(
|
|
||||||
const scalar mu,
|
|
||||||
const scalar rho,
|
|
||||||
const scalar massDiffusion
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return mu/(rho*massDiffusion);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::Sc
|
|
||||||
(
|
|
||||||
const scalar nu,
|
|
||||||
const scalar massDiffusion
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return nu/massDiffusion;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::Pr
|
|
||||||
(
|
|
||||||
const scalar cp,
|
|
||||||
const scalar mu,
|
|
||||||
const scalar kappa
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return cp*mu/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::N(const scalar rho) const
|
|
||||||
{
|
|
||||||
return 6.0*m_/(rho*pow3(d_)*constant::mathematical::pi);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::Vd() const
|
|
||||||
{
|
|
||||||
return pow3(d_)*constant::mathematical::pi/6.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::parcel::V(const scalar rho) const
|
|
||||||
{
|
|
||||||
return m_/rho;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,232 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
inline const Foam::List<Foam::word>& Foam::parcel::liquidNames() const
|
|
||||||
{
|
|
||||||
return liquidComponents_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::List<Foam::word>& Foam::parcel::fuelNames() const
|
|
||||||
{
|
|
||||||
return liquidComponents_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::d() const
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::d()
|
|
||||||
{
|
|
||||||
return d_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::T() const
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::T()
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::m() const
|
|
||||||
{
|
|
||||||
return m_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::m()
|
|
||||||
{
|
|
||||||
return m_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::dev() const
|
|
||||||
{
|
|
||||||
return y_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::dev()
|
|
||||||
{
|
|
||||||
return y_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::ddev() const
|
|
||||||
{
|
|
||||||
return yDot_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::ddev()
|
|
||||||
{
|
|
||||||
return yDot_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::ct() const
|
|
||||||
{
|
|
||||||
return ct_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::ct()
|
|
||||||
{
|
|
||||||
return ct_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::ms()
|
|
||||||
{
|
|
||||||
return ms_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::ms() const
|
|
||||||
{
|
|
||||||
return ms_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::tTurb()
|
|
||||||
{
|
|
||||||
return tTurb_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::tTurb() const
|
|
||||||
{
|
|
||||||
return tTurb_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::liquidCore()
|
|
||||||
{
|
|
||||||
return liquidCore_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::liquidCore() const
|
|
||||||
{
|
|
||||||
return liquidCore_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::injector()
|
|
||||||
{
|
|
||||||
return injector_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::injector() const
|
|
||||||
{
|
|
||||||
return injector_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::parcel::U() const
|
|
||||||
{
|
|
||||||
return U_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::vector& Foam::parcel::U()
|
|
||||||
{
|
|
||||||
return U_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::parcel::Uturb() const
|
|
||||||
{
|
|
||||||
return Uturb_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::vector& Foam::parcel::Uturb()
|
|
||||||
{
|
|
||||||
return Uturb_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::parcel::n() const
|
|
||||||
{
|
|
||||||
return n_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::vector& Foam::parcel::n()
|
|
||||||
{
|
|
||||||
return n_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::scalarField& Foam::parcel::X() const
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalarField& Foam::parcel::X()
|
|
||||||
{
|
|
||||||
return X_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar& Foam::parcel::tMom()
|
|
||||||
{
|
|
||||||
return tMom_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::parcel::tMom() const
|
|
||||||
{
|
|
||||||
return tMom_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::vector Foam::parcel::Urel(const vector& U) const
|
|
||||||
{
|
|
||||||
return U_ - U;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::parcel::correctNormal(const vector& sym)
|
|
||||||
{
|
|
||||||
scalar d = position() & sym;
|
|
||||||
n_ = position() - d*sym;
|
|
||||||
n_ /= mag(n_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,337 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "parcel.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::parcel::parcel
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
Istream& is,
|
|
||||||
bool readFields
|
|
||||||
)
|
|
||||||
:
|
|
||||||
particle(mesh, is, readFields),
|
|
||||||
|
|
||||||
liquidComponents_
|
|
||||||
(
|
|
||||||
(
|
|
||||||
mesh.lookupObject<dictionary>("thermophysicalProperties")
|
|
||||||
).lookup("liquidComponents")
|
|
||||||
),
|
|
||||||
X_(liquidComponents_.size(), 0.0),
|
|
||||||
|
|
||||||
tMom_(GREAT)
|
|
||||||
{
|
|
||||||
|
|
||||||
label nX = X_.size();
|
|
||||||
|
|
||||||
if (readFields)
|
|
||||||
{
|
|
||||||
if (is.format() == IOstream::ASCII)
|
|
||||||
{
|
|
||||||
d_ = readScalar(is);
|
|
||||||
T_ = readScalar(is);
|
|
||||||
m_ = readScalar(is);
|
|
||||||
y_ = readScalar(is);
|
|
||||||
yDot_ = readScalar(is);
|
|
||||||
ct_ = readScalar(is);
|
|
||||||
ms_ = readScalar(is);
|
|
||||||
tTurb_ = readScalar(is);
|
|
||||||
liquidCore_ = readScalar(is);
|
|
||||||
injector_ = readScalar(is);
|
|
||||||
is >> U_;
|
|
||||||
is >> Uturb_;
|
|
||||||
is >> n_;
|
|
||||||
for (label j=0; j<nX; j++)
|
|
||||||
{
|
|
||||||
X_[j] = readScalar(is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
is.read
|
|
||||||
(
|
|
||||||
reinterpret_cast<char*>(&d_),
|
|
||||||
sizeof(d_) + sizeof(T_) + sizeof(m_) + sizeof(y_)
|
|
||||||
+ sizeof(yDot_) + sizeof(ct_) + sizeof(ms_) + sizeof(tTurb_)
|
|
||||||
+ sizeof(liquidCore_) + sizeof(injector_)
|
|
||||||
+ sizeof(U_) + sizeof(Uturb_) + sizeof(n_)
|
|
||||||
);
|
|
||||||
|
|
||||||
is.read
|
|
||||||
(
|
|
||||||
reinterpret_cast<char*>(X_.begin()),
|
|
||||||
X_.size()*sizeof(scalar)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check state of Istream
|
|
||||||
is.check("parcel::parcel(Istream&)");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::parcel::readFields(Cloud<parcel>& c)
|
|
||||||
{
|
|
||||||
if (!c.size())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
particle::readFields(c);
|
|
||||||
|
|
||||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, d);
|
|
||||||
|
|
||||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, T);
|
|
||||||
|
|
||||||
IOField<scalar> m(c.fieldIOobject("m", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, m);
|
|
||||||
|
|
||||||
IOField<scalar> y(c.fieldIOobject("y", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, y);
|
|
||||||
|
|
||||||
IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, yDot);
|
|
||||||
|
|
||||||
IOField<scalar> ct(c.fieldIOobject("ct", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, ct);
|
|
||||||
|
|
||||||
IOField<scalar> ms(c.fieldIOobject("ms", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, ms);
|
|
||||||
|
|
||||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, tTurb);
|
|
||||||
|
|
||||||
IOField<scalar> liquidCore
|
|
||||||
(
|
|
||||||
c.fieldIOobject("liquidCore", IOobject::MUST_READ)
|
|
||||||
);
|
|
||||||
c.checkFieldIOobject(c, liquidCore);
|
|
||||||
|
|
||||||
IOField<scalar> injector(c.fieldIOobject("injector", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, injector);
|
|
||||||
|
|
||||||
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, U);
|
|
||||||
|
|
||||||
IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, Uturb);
|
|
||||||
|
|
||||||
IOField<vector> n(c.fieldIOobject("n", IOobject::MUST_READ));
|
|
||||||
c.checkFieldIOobject(c, n);
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllIter(Cloud<parcel>, c, iter)
|
|
||||||
{
|
|
||||||
parcel& p = iter();
|
|
||||||
|
|
||||||
p.d_ = d[i];
|
|
||||||
p.T_ = T[i];
|
|
||||||
p.m_ = m[i];
|
|
||||||
p.y_ = y[i];
|
|
||||||
p.yDot_ = yDot[i];
|
|
||||||
p.ct_ = ct[i];
|
|
||||||
p.ms_ = ms[i];
|
|
||||||
p.tTurb_ = tTurb[i];
|
|
||||||
p.liquidCore_ = liquidCore[i];
|
|
||||||
p.injector_ = injector[i];
|
|
||||||
|
|
||||||
p.U_ = U[i];
|
|
||||||
p.Uturb_ = Uturb[i];
|
|
||||||
p.n_ = n[i];
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// read the liquid molar fractions
|
|
||||||
if (c.size())
|
|
||||||
{
|
|
||||||
Cloud<parcel>::const_iterator iter = c.begin();
|
|
||||||
const parcel& p0 = iter();
|
|
||||||
|
|
||||||
label nX = p0.X().size();
|
|
||||||
const List<word>& names = p0.liquidNames();
|
|
||||||
|
|
||||||
for (label j=0; j<nX; j++)
|
|
||||||
{
|
|
||||||
IOField<scalar> X(c.fieldIOobject(names[j], IOobject::MUST_READ));
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllIter(Cloud<parcel>, c, iter)
|
|
||||||
{
|
|
||||||
parcel& p = iter();
|
|
||||||
p.X_[j] = X[i++];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::parcel::writeFields(const Cloud<parcel>& c)
|
|
||||||
{
|
|
||||||
particle::writeFields(c);
|
|
||||||
|
|
||||||
label np = c.size();
|
|
||||||
|
|
||||||
IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> T(c.fieldIOobject("T", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> m(c.fieldIOobject("m", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> y(c.fieldIOobject("y", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> ct(c.fieldIOobject("ct", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> ms(c.fieldIOobject("ms", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np);
|
|
||||||
IOField<scalar> liquidCore
|
|
||||||
(
|
|
||||||
c.fieldIOobject("liquidCore", IOobject::NO_READ),
|
|
||||||
np
|
|
||||||
);
|
|
||||||
IOField<scalar> injector
|
|
||||||
(
|
|
||||||
c.fieldIOobject("injector", IOobject::NO_READ),
|
|
||||||
np
|
|
||||||
);
|
|
||||||
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np);
|
|
||||||
IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::NO_READ), np);
|
|
||||||
IOField<vector> n(c.fieldIOobject("n", IOobject::NO_READ), np);
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(Cloud<parcel>, c, iter)
|
|
||||||
{
|
|
||||||
const parcel& p = iter();
|
|
||||||
|
|
||||||
d[i] = p.d_;
|
|
||||||
T[i] = p.T_;
|
|
||||||
m[i] = p.m_;
|
|
||||||
y[i] = p.y_;
|
|
||||||
yDot[i] = p.yDot_;
|
|
||||||
ct[i] = p.ct_;
|
|
||||||
ms[i] = p.ms_;
|
|
||||||
tTurb[i] = p.tTurb_;
|
|
||||||
liquidCore[i] = p.liquidCore_;
|
|
||||||
injector[i] = p.injector_;
|
|
||||||
|
|
||||||
U[i] = p.U_;
|
|
||||||
Uturb[i] = p.Uturb_;
|
|
||||||
n[i] = p.n_;
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
d.write();
|
|
||||||
T.write();
|
|
||||||
m.write();
|
|
||||||
y.write();
|
|
||||||
yDot.write();
|
|
||||||
ct.write();
|
|
||||||
ms.write();
|
|
||||||
tTurb.write();
|
|
||||||
liquidCore.write();
|
|
||||||
injector.write();
|
|
||||||
|
|
||||||
U.write();
|
|
||||||
Uturb.write();
|
|
||||||
n.write();
|
|
||||||
|
|
||||||
// write the liquid molar fractions
|
|
||||||
if (np > 0)
|
|
||||||
{
|
|
||||||
Cloud<parcel>::const_iterator iter = c.begin();
|
|
||||||
const parcel& p0 = iter();
|
|
||||||
|
|
||||||
label nX = p0.X().size();
|
|
||||||
const List<word>& names = p0.liquidNames();
|
|
||||||
|
|
||||||
for (label j=0; j<nX; j++)
|
|
||||||
{
|
|
||||||
IOField<scalar> X(c.fieldIOobject(names[j], IOobject::NO_READ), np);
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(Cloud<parcel>, c, iter)
|
|
||||||
{
|
|
||||||
const parcel& p = iter();
|
|
||||||
X[i++] = p.X()[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
X.write();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const parcel& p)
|
|
||||||
{
|
|
||||||
if (os.format() == IOstream::ASCII)
|
|
||||||
{
|
|
||||||
os << static_cast<const particle&>(p)
|
|
||||||
<< token::SPACE << p.d_
|
|
||||||
<< token::SPACE << p.T_
|
|
||||||
<< token::SPACE << p.m_
|
|
||||||
<< token::SPACE << p.y_
|
|
||||||
<< token::SPACE << p.yDot_
|
|
||||||
<< token::SPACE << p.ct_
|
|
||||||
<< token::SPACE << p.ms_
|
|
||||||
<< token::SPACE << p.tTurb_
|
|
||||||
<< token::SPACE << p.liquidCore_
|
|
||||||
<< token::SPACE << p.injector_
|
|
||||||
<< token::SPACE << p.U_
|
|
||||||
<< token::SPACE << p.Uturb_
|
|
||||||
<< token::SPACE << p.n_
|
|
||||||
<< token::SPACE << p.X_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
os << static_cast<const particle>(p);
|
|
||||||
os.write
|
|
||||||
(
|
|
||||||
reinterpret_cast<const char*>(&p.d_),
|
|
||||||
sizeof(p.d_) + sizeof(p.T_) + sizeof(p.m_) + sizeof(p.y_)
|
|
||||||
+ sizeof(p.yDot_) + sizeof(p.ct_) + sizeof(p.ms_) + sizeof(p.tTurb_)
|
|
||||||
+ sizeof(p.liquidCore_) + sizeof(p.injector_)
|
|
||||||
+ sizeof(p.U_) + sizeof(p.Uturb_) + sizeof(p.n_)
|
|
||||||
);
|
|
||||||
|
|
||||||
os.write
|
|
||||||
(
|
|
||||||
reinterpret_cast<const char*>(p.X_.begin()),
|
|
||||||
p.X_.size()*sizeof(scalar)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check("Ostream& operator<<(Ostream&, const parcel&)");
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,306 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "parcel.H"
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
#include "dragModel.H"
|
|
||||||
#include "evaporationModel.H"
|
|
||||||
#include "heatTransferModel.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::parcel::setRelaxationTimes
|
|
||||||
(
|
|
||||||
label cellI,
|
|
||||||
scalar& tauMomentum,
|
|
||||||
scalarField& tauEvaporation,
|
|
||||||
scalar& tauHeatTransfer,
|
|
||||||
scalarField& tauBoiling,
|
|
||||||
const spray& sDB,
|
|
||||||
const scalar rho,
|
|
||||||
const vector& Up,
|
|
||||||
const scalar temperature,
|
|
||||||
const scalar pressure,
|
|
||||||
const scalarField& Yfg,
|
|
||||||
const scalarField& m0,
|
|
||||||
const scalar dt
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const liquidMixtureProperties& fuels = sDB.fuels();
|
|
||||||
|
|
||||||
scalar mCell = rho*sDB.mesh().V()[cell()];
|
|
||||||
scalarField mfg(Yfg*mCell);
|
|
||||||
|
|
||||||
label Ns = sDB.composition().Y().size();
|
|
||||||
label Nf = fuels.components().size();
|
|
||||||
|
|
||||||
// Tf is based on the 1/3 rule
|
|
||||||
scalar Tf = T() + (temperature - T())/3.0;
|
|
||||||
|
|
||||||
// calculate mixture properties
|
|
||||||
scalar W = 0.0;
|
|
||||||
scalar kMixture = 0.0;
|
|
||||||
scalar CpMixture = 0.0;
|
|
||||||
scalar muf = 0.0;
|
|
||||||
|
|
||||||
for (label i=0; i<Ns; i++)
|
|
||||||
{
|
|
||||||
scalar Y = sDB.composition().Y()[i][cellI];
|
|
||||||
W += Y/sDB.gasProperties()[i].W();
|
|
||||||
// Using mass-fractions to average...
|
|
||||||
kMixture += Y*sDB.gasProperties()[i].kappa(Tf);
|
|
||||||
CpMixture += Y*sDB.gasProperties()[i].Cp(Tf);
|
|
||||||
muf += Y*sDB.gasProperties()[i].mu(Tf);
|
|
||||||
}
|
|
||||||
W = 1.0/W;
|
|
||||||
|
|
||||||
scalarField Xf(Nf, 0.0);
|
|
||||||
scalarField Yf(Nf, 0.0);
|
|
||||||
scalarField psat(Nf, 0.0);
|
|
||||||
scalarField msat(Nf, 0.0);
|
|
||||||
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
scalar Y = sDB.composition().Y()[j][cellI];
|
|
||||||
scalar Wi = sDB.gasProperties()[j].W();
|
|
||||||
Yf[i] = Y;
|
|
||||||
Xf[i] = Y*W/Wi;
|
|
||||||
psat[i] = fuels.properties()[i].pv(pressure, temperature);
|
|
||||||
msat[i] = min(1.0, psat[i]/pressure)*Wi/W;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar nuf = muf/rho;
|
|
||||||
|
|
||||||
scalar liquidDensity = fuels.rho(pressure, T(), X());
|
|
||||||
scalar liquidcL = fuels.Cp(pressure, T(), X());
|
|
||||||
scalar heatOfVapour = fuels.hl(pressure, T(), X());
|
|
||||||
|
|
||||||
// calculate the partial rho of the fuel vapour
|
|
||||||
// alternative is to use the mass fraction
|
|
||||||
// however, if rhoFuelVap is small (zero)
|
|
||||||
// d(mass)/dt = 0 => no evaporation... hmmm... is that good? NO!
|
|
||||||
|
|
||||||
// Assume equilibrium at drop-surface => pressure @ surface
|
|
||||||
// = vapour pressure to calculate fuel-vapour density @ surface
|
|
||||||
scalar pressureAtSurface = fuels.pv(pressure, T(), X());
|
|
||||||
scalar rhoFuelVap = pressureAtSurface*fuels.W(X())/(specie::RR*Tf);
|
|
||||||
|
|
||||||
scalarField Xs(sDB.fuels().Xs(pressure, temperature, T(), Xf, X()));
|
|
||||||
scalarField Ys(Nf, 0.0);
|
|
||||||
scalar Wliq = 0.0;
|
|
||||||
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
scalar Wi = sDB.gasProperties()[j].W();
|
|
||||||
Wliq += Xs[i]*Wi;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
label j = sDB.liquidToGasIndex()[i];
|
|
||||||
scalar Wi = sDB.gasProperties()[j].W();
|
|
||||||
Ys[i] = Xs[i]*Wi/Wliq;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar Reynolds = Re(Up, nuf);
|
|
||||||
scalar Prandtl = Pr(CpMixture, muf, kMixture);
|
|
||||||
|
|
||||||
// calculate the characteritic times
|
|
||||||
|
|
||||||
if (liquidCore_> 0.5)
|
|
||||||
{
|
|
||||||
// no drag for parcels in the liquid core.
|
|
||||||
tauMomentum = GREAT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tauMomentum = sDB.drag().relaxationTime
|
|
||||||
(
|
|
||||||
Urel(Up),
|
|
||||||
d(),
|
|
||||||
rho,
|
|
||||||
liquidDensity,
|
|
||||||
nuf,
|
|
||||||
dev()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// store the relaxationTime since it is needed in some breakup models.
|
|
||||||
tMom_ = tauMomentum;
|
|
||||||
|
|
||||||
tauHeatTransfer = sDB.heatTransfer().relaxationTime
|
|
||||||
(
|
|
||||||
liquidDensity,
|
|
||||||
d(),
|
|
||||||
liquidcL,
|
|
||||||
kMixture,
|
|
||||||
Reynolds,
|
|
||||||
Prandtl
|
|
||||||
);
|
|
||||||
|
|
||||||
// evaporation-properties are evaluated at averaged temperature
|
|
||||||
// set the boiling conditions true if pressure @ surface is 99.9%
|
|
||||||
// of the pressure
|
|
||||||
// this is mainly to put a limit on the evaporation time,
|
|
||||||
// since tauEvaporation is very very small close to the boiling point.
|
|
||||||
|
|
||||||
for (label i=0; i<Nf; i++)
|
|
||||||
{
|
|
||||||
scalar Td = min(T(), 0.999*fuels.properties()[i].Tc());
|
|
||||||
bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure;
|
|
||||||
scalar Di = fuels.properties()[i].D(pressure, Td);
|
|
||||||
scalar Schmidt = Sc(nuf, Di);
|
|
||||||
|
|
||||||
scalar partialPressure = Xf[i]*pressure;
|
|
||||||
|
|
||||||
// saturated vapour
|
|
||||||
if (partialPressure > psat[i])
|
|
||||||
{
|
|
||||||
tauEvaporation[i] = GREAT;
|
|
||||||
}
|
|
||||||
// not saturated vapour
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!boiling)
|
|
||||||
{
|
|
||||||
// for saturation evaporation, only use 99.99% for
|
|
||||||
// numerical robustness
|
|
||||||
scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]);
|
|
||||||
|
|
||||||
tauEvaporation[i] = sDB.evaporation().relaxationTime
|
|
||||||
(
|
|
||||||
d(),
|
|
||||||
fuels.properties()[i].rho(pressure, Td),
|
|
||||||
rhoFuelVap,
|
|
||||||
Di,
|
|
||||||
Reynolds,
|
|
||||||
Schmidt,
|
|
||||||
Xs[i],
|
|
||||||
Xf[i],
|
|
||||||
m0[i],
|
|
||||||
dm,
|
|
||||||
dt
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar Nusselt =
|
|
||||||
sDB.heatTransfer().Nu(Reynolds, Prandtl);
|
|
||||||
|
|
||||||
// calculating the boiling temperature of the liquid
|
|
||||||
// at ambient pressure
|
|
||||||
scalar tBoilingSurface = Td;
|
|
||||||
|
|
||||||
label Niter = 0;
|
|
||||||
scalar deltaT = 10.0;
|
|
||||||
scalar dp0 =
|
|
||||||
fuels.properties()[i].pv(pressure, tBoilingSurface)
|
|
||||||
- pressure;
|
|
||||||
while ((Niter < 200) && (mag(deltaT) > 1.0e-3))
|
|
||||||
{
|
|
||||||
Niter++;
|
|
||||||
scalar pBoil = fuels.properties()[i].pv
|
|
||||||
(
|
|
||||||
pressure,
|
|
||||||
tBoilingSurface
|
|
||||||
);
|
|
||||||
scalar dp = pBoil - pressure;
|
|
||||||
if ((dp > 0.0) && (dp0 > 0.0))
|
|
||||||
{
|
|
||||||
tBoilingSurface -= deltaT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((dp < 0.0) && (dp0 < 0.0))
|
|
||||||
{
|
|
||||||
tBoilingSurface += deltaT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
deltaT *= 0.5;
|
|
||||||
if ((dp > 0.0) && (dp0 < 0.0))
|
|
||||||
{
|
|
||||||
tBoilingSurface -= deltaT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tBoilingSurface += deltaT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dp0 = dp;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar vapourSurfaceEnthalpy = 0.0;
|
|
||||||
scalar vapourFarEnthalpy = 0.0;
|
|
||||||
|
|
||||||
forAll(sDB.gasProperties(), k)
|
|
||||||
{
|
|
||||||
vapourSurfaceEnthalpy +=
|
|
||||||
sDB.composition().Y()[k][cellI]
|
|
||||||
*sDB.gasProperties()[k].H(tBoilingSurface);
|
|
||||||
vapourFarEnthalpy +=
|
|
||||||
sDB.composition().Y()[k][cellI]
|
|
||||||
*sDB.gasProperties()[k].H(temperature);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar kLiquid = fuels.properties()[i].K
|
|
||||||
(
|
|
||||||
pressure,
|
|
||||||
0.5*(tBoilingSurface+T())
|
|
||||||
);
|
|
||||||
|
|
||||||
tauBoiling[i] = sDB.evaporation().boilingTime
|
|
||||||
(
|
|
||||||
fuels.properties()[i].rho(pressure, Td),
|
|
||||||
fuels.properties()[i].Cp(pressure, Td),
|
|
||||||
heatOfVapour,
|
|
||||||
kMixture,
|
|
||||||
Nusselt,
|
|
||||||
temperature - T(),
|
|
||||||
d(),
|
|
||||||
liquidCore(),
|
|
||||||
sDB.runTime().value() - ct(),
|
|
||||||
Td,
|
|
||||||
tBoilingSurface,
|
|
||||||
vapourSurfaceEnthalpy,
|
|
||||||
vapourFarEnthalpy,
|
|
||||||
CpMixture,
|
|
||||||
temperature,
|
|
||||||
kLiquid
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
bool foundCell = false;
|
|
||||||
if (injectorCell >= 0)
|
|
||||||
{
|
|
||||||
const vector& C = mesh_.C()[injectorCell];
|
|
||||||
injectionPosition += 1.0e-9*(C - injectionPosition);
|
|
||||||
|
|
||||||
foundCell = mesh_.pointInCell(injectionPosition, injectorCell);
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(foundCell, orOp<bool>());
|
|
||||||
|
|
||||||
// Due to the disc injection, the injectionPosition
|
|
||||||
// can be moved outside the domain.
|
|
||||||
// try point injection
|
|
||||||
|
|
||||||
if (!foundCell)
|
|
||||||
{
|
|
||||||
injectionPosition = it->position(n);
|
|
||||||
|
|
||||||
mesh_.findCellFacePt
|
|
||||||
(
|
|
||||||
injectionPosition,
|
|
||||||
injectorCell,
|
|
||||||
injectorTetFaceI,
|
|
||||||
injectorTetPtI
|
|
||||||
);
|
|
||||||
|
|
||||||
if (injectorCell >= 0)
|
|
||||||
{
|
|
||||||
const vector& C = mesh_.C()[injectorCell];
|
|
||||||
injectionPosition += 1.0e-6*(C - injectionPosition);
|
|
||||||
|
|
||||||
foundCell = mesh_.pointInCell(injectionPosition, injectorCell);
|
|
||||||
}
|
|
||||||
reduce(foundCell, orOp<bool>());
|
|
||||||
|
|
||||||
// if point injection also failed then
|
|
||||||
// find nearest cell and try that one
|
|
||||||
// the point is probably on an edge
|
|
||||||
if (!foundCell)
|
|
||||||
{
|
|
||||||
injectorCell =
|
|
||||||
mesh_.findNearestCell(injectionPosition);
|
|
||||||
|
|
||||||
if (injectorCell >= 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
const vector& C = mesh_.C()[injectorCell];
|
|
||||||
injectionPosition += 1.0e-9*(C - injectionPosition);
|
|
||||||
|
|
||||||
foundCell = mesh_.pointInCell(injectionPosition, injectorCell);
|
|
||||||
}
|
|
||||||
reduce(foundCell, orOp<bool>());
|
|
||||||
|
|
||||||
if (!foundCell)
|
|
||||||
{
|
|
||||||
FatalError
|
|
||||||
<< "Cannot find injection position "
|
|
||||||
<< injectionPosition
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,364 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
#include "breakupModel.H"
|
|
||||||
#include "collisionModel.H"
|
|
||||||
#include "dispersionModel.H"
|
|
||||||
#include "dragModel.H"
|
|
||||||
#include "evaporationModel.H"
|
|
||||||
#include "heatTransferModel.H"
|
|
||||||
#include "injectorModel.H"
|
|
||||||
#include "wallModel.H"
|
|
||||||
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
|
|
||||||
#include "symmetryPolyPatch.H"
|
|
||||||
#include "wedgePolyPatch.H"
|
|
||||||
|
|
||||||
#include "unitConversion.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTemplateTypeNameAndDebug(Cloud<parcel>, 0);
|
|
||||||
defineTemplateTypeNameAndDebug(IOPtrList<injector>, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::spray::spray
|
|
||||||
(
|
|
||||||
const volVectorField& U,
|
|
||||||
const volScalarField& rho,
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T,
|
|
||||||
const basicMultiComponentMixture& composition,
|
|
||||||
const PtrList<gasThermoPhysics>& gasProperties,
|
|
||||||
const dictionary&,
|
|
||||||
const dimensionedVector& g,
|
|
||||||
bool readFields
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Cloud<parcel>(U.mesh(), false), // suppress className checking on positions
|
|
||||||
runTime_(U.time()),
|
|
||||||
time0_(runTime_.value()),
|
|
||||||
mesh_(U.mesh()),
|
|
||||||
rndGen_(label(0), -1),
|
|
||||||
g_(g.value()),
|
|
||||||
|
|
||||||
U_(U),
|
|
||||||
rho_(rho),
|
|
||||||
p_(p),
|
|
||||||
T_(T),
|
|
||||||
|
|
||||||
sprayProperties_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"sprayProperties",
|
|
||||||
U.time().constant(),
|
|
||||||
U.db(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
ambientPressure_(p_.average().value()),
|
|
||||||
ambientTemperature_(T_.average().value()),
|
|
||||||
|
|
||||||
injectors_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"injectorProperties",
|
|
||||||
U.time().constant(),
|
|
||||||
U.db(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
injector::iNew(U.time())
|
|
||||||
),
|
|
||||||
atomization_
|
|
||||||
(
|
|
||||||
atomizationModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
),
|
|
||||||
drag_
|
|
||||||
(
|
|
||||||
dragModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_
|
|
||||||
)
|
|
||||||
),
|
|
||||||
evaporation_
|
|
||||||
(
|
|
||||||
evaporationModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_
|
|
||||||
)
|
|
||||||
),
|
|
||||||
heatTransfer_
|
|
||||||
(
|
|
||||||
heatTransferModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_
|
|
||||||
)
|
|
||||||
),
|
|
||||||
wall_
|
|
||||||
(
|
|
||||||
wallModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
U,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
),
|
|
||||||
breakupModel_
|
|
||||||
(
|
|
||||||
breakupModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
),
|
|
||||||
collisionModel_
|
|
||||||
(
|
|
||||||
collisionModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
*this,
|
|
||||||
rndGen_
|
|
||||||
)
|
|
||||||
),
|
|
||||||
dispersionModel_
|
|
||||||
(
|
|
||||||
dispersionModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
fuels_
|
|
||||||
(
|
|
||||||
liquidMixtureProperties::New
|
|
||||||
(
|
|
||||||
mesh_.lookupObject<dictionary>("thermophysicalProperties")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
injectorModel_
|
|
||||||
(
|
|
||||||
injectorModel::New
|
|
||||||
(
|
|
||||||
sprayProperties_,
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
subCycles_(readLabel(sprayProperties_.lookup("subCycles"))),
|
|
||||||
|
|
||||||
gasProperties_(gasProperties),
|
|
||||||
composition_(composition),
|
|
||||||
|
|
||||||
liquidToGasIndex_(fuels_->components().size(), -1),
|
|
||||||
gasToLiquidIndex_(composition.Y().size(), -1),
|
|
||||||
isLiquidFuel_(composition.Y().size(), false),
|
|
||||||
|
|
||||||
twoD_(0),
|
|
||||||
axisOfSymmetry_(vector::zero),
|
|
||||||
axisOfWedge_(vector(0,0,0)),
|
|
||||||
axisOfWedgeNormal_(vector(0,0,0)),
|
|
||||||
angleOfWedge_(0.0),
|
|
||||||
|
|
||||||
interpolationSchemes_(sprayProperties_.subDict("interpolationSchemes")),
|
|
||||||
UInterpolator_(NULL),
|
|
||||||
rhoInterpolator_(NULL),
|
|
||||||
pInterpolator_(NULL),
|
|
||||||
TInterpolator_(NULL),
|
|
||||||
|
|
||||||
sms_(mesh_.nCells(), vector::zero),
|
|
||||||
shs_(mesh_.nCells(), 0.0),
|
|
||||||
srhos_(fuels_->components().size()),
|
|
||||||
|
|
||||||
totalInjectedLiquidMass_(0.0),
|
|
||||||
injectedLiquidKE_(0.0)
|
|
||||||
|
|
||||||
{
|
|
||||||
// create the evaporation source fields
|
|
||||||
forAll(srhos_, i)
|
|
||||||
{
|
|
||||||
srhos_.set(i, new scalarField(mesh_.nCells(), 0.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write some information about injection parameters
|
|
||||||
forAll(injectors_, i)
|
|
||||||
{
|
|
||||||
const injectorType& it = injectors_[i].properties();
|
|
||||||
|
|
||||||
scalar v = injection().averageVelocity(i);
|
|
||||||
|
|
||||||
scalar ip = it.integrateTable(it.injectionPressureProfile());
|
|
||||||
scalar dt = it.teoi() - it.tsoi();
|
|
||||||
Info<< "Average Velocity for injector " << i << ": " << v << " m/s"
|
|
||||||
<< ", injection pressure = "
|
|
||||||
<< 1.0e-5*ip/dt << " bar"
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the case is 2D wedge
|
|
||||||
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
|
|
||||||
bool symPlaneExist = false;
|
|
||||||
bool wedgeExist = false;
|
|
||||||
label patches[2];
|
|
||||||
label n=0;
|
|
||||||
|
|
||||||
// check for the type of boundary condition
|
|
||||||
forAll(bMesh, patchI)
|
|
||||||
{
|
|
||||||
if (isA<symmetryPolyPatch>(bMesh[patchI]))
|
|
||||||
{
|
|
||||||
symPlaneExist = true;
|
|
||||||
}
|
|
||||||
else if (isA<wedgePolyPatch>(bMesh[patchI]))
|
|
||||||
{
|
|
||||||
wedgeExist = true;
|
|
||||||
patches[n++] = patchI;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if wedge exist we assume that this is a 2D run.
|
|
||||||
twoD_ = wedgeExist;
|
|
||||||
|
|
||||||
if (twoD_)
|
|
||||||
{
|
|
||||||
if (n<2)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"spray::spray(const volVectorField& U, "
|
|
||||||
"const volScalarField& rho, const volScalarField& p, "
|
|
||||||
"const volScalarField& T, const combustionMixture& composition,"
|
|
||||||
"const PtrList<gasThermoPhsyics>& gaseousFuelProperties, "
|
|
||||||
"const dictionary& thermophysicalProperties, "
|
|
||||||
"const dimensionedScalar& g)"
|
|
||||||
) << "spray::(...) only one wedgePolyPatch found. "
|
|
||||||
"Please check you BC-setup."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Constructing two dimensional spray injection.";
|
|
||||||
|
|
||||||
vector v1 = bMesh[patches[0]].faceAreas()[0];
|
|
||||||
vector v2 = bMesh[patches[1]].faceAreas()[0];
|
|
||||||
v1 /= mag(v1);
|
|
||||||
v2 /= mag(v2);
|
|
||||||
axisOfSymmetry_ = v1 ^ v2;
|
|
||||||
axisOfSymmetry_ /= mag(axisOfSymmetry_);
|
|
||||||
|
|
||||||
// assuming that 'v2' is the 'front' face
|
|
||||||
axisOfWedge_ = axisOfSymmetry_ ^ v2;
|
|
||||||
axisOfWedge_ /= mag(axisOfWedge_);
|
|
||||||
|
|
||||||
axisOfWedgeNormal_ = axisOfSymmetry_ ^ axisOfWedge_;
|
|
||||||
axisOfWedgeNormal_ /= mag(axisOfWedgeNormal_);
|
|
||||||
|
|
||||||
scalar arcCos = (v1 & v2)/mag(v1);
|
|
||||||
angleOfWedge_ = constant::mathematical::pi - acos(arcCos);
|
|
||||||
|
|
||||||
Info<< "Calculated angle of wedge is "
|
|
||||||
<< radToDeg(angleOfWedge_) << " deg."
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (symPlaneExist)
|
|
||||||
{
|
|
||||||
angleOfWedge_ = constant::mathematical::pi;
|
|
||||||
Info<< "Constructing 180 deg three dimensional spray injection."
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "Constructing three dimensional spray injection." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// find index mapping between liquid indeces and gas indeces
|
|
||||||
label Ns = composition_.Y().size();
|
|
||||||
|
|
||||||
forAll(fuels_->components(), i)
|
|
||||||
{
|
|
||||||
word liquidName(fuels_->components()[i]);
|
|
||||||
|
|
||||||
for (label j=0; j<Ns; j++)
|
|
||||||
{
|
|
||||||
word specieName(composition_.Y()[j].name());
|
|
||||||
|
|
||||||
if (specieName == liquidName)
|
|
||||||
{
|
|
||||||
liquidToGasIndex_[i] = j;
|
|
||||||
gasToLiquidIndex_[j] = i;
|
|
||||||
isLiquidFuel_[j] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (liquidToGasIndex_[i] == -1)
|
|
||||||
{
|
|
||||||
Info<< "In composition:" << endl;
|
|
||||||
for (label k=0; k<Ns; k++)
|
|
||||||
{
|
|
||||||
word specieName(composition_.Y()[k].name());
|
|
||||||
Info<< specieName << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
FatalError
|
|
||||||
<< "The liquid component " << liquidName
|
|
||||||
<< " does not exist in the species composition.Y() list.\n"
|
|
||||||
<< "(Probably not defined in <chem.inp>)"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (readFields)
|
|
||||||
{
|
|
||||||
parcel::readFields(*this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::spray::~spray()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,356 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::spray
|
|
||||||
|
|
||||||
Description
|
|
||||||
A spray is a cloud of parcels
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef spray_H
|
|
||||||
#define spray_H
|
|
||||||
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "parcel.H"
|
|
||||||
#include "injector.H"
|
|
||||||
#include "IOPtrList.H"
|
|
||||||
#include "interpolation.H"
|
|
||||||
#include "liquidProperties.H"
|
|
||||||
#include "liquidMixtureProperties.H"
|
|
||||||
#include "cachedRandom.H"
|
|
||||||
#include "thermoPhysicsTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
class atomizationModel;
|
|
||||||
class breakupModel;
|
|
||||||
class collisionModel;
|
|
||||||
class dispersionModel;
|
|
||||||
class dragModel;
|
|
||||||
class evaporationModel;
|
|
||||||
class injectorModel;
|
|
||||||
class heatTransferModel;
|
|
||||||
class wallModel;
|
|
||||||
|
|
||||||
class basicMultiComponentMixture;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class spray Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class spray
|
|
||||||
:
|
|
||||||
public Cloud<parcel>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
// References to the database and meshes
|
|
||||||
|
|
||||||
const Time& runTime_;
|
|
||||||
scalar time0_;
|
|
||||||
const fvMesh& mesh_;
|
|
||||||
|
|
||||||
//- Random number generator
|
|
||||||
cachedRandom rndGen_;
|
|
||||||
|
|
||||||
//- Acceleration due to gravity
|
|
||||||
const vector& g_;
|
|
||||||
|
|
||||||
|
|
||||||
// References to the physical fields
|
|
||||||
|
|
||||||
const volVectorField& U_;
|
|
||||||
const volScalarField& rho_;
|
|
||||||
const volScalarField& p_;
|
|
||||||
const volScalarField& T_;
|
|
||||||
|
|
||||||
|
|
||||||
//- The spray properties
|
|
||||||
IOdictionary sprayProperties_;
|
|
||||||
|
|
||||||
|
|
||||||
//- Ambient Pressure
|
|
||||||
scalar ambientPressure_;
|
|
||||||
|
|
||||||
//- Ambient Temperature
|
|
||||||
scalar ambientTemperature_;
|
|
||||||
|
|
||||||
|
|
||||||
//- The injectors
|
|
||||||
IOPtrList<injector> injectors_;
|
|
||||||
|
|
||||||
|
|
||||||
// References to the spray sub-models
|
|
||||||
|
|
||||||
autoPtr<atomizationModel> atomization_;
|
|
||||||
autoPtr<dragModel> drag_;
|
|
||||||
autoPtr<evaporationModel> evaporation_;
|
|
||||||
autoPtr<heatTransferModel> heatTransfer_;
|
|
||||||
autoPtr<wallModel> wall_;
|
|
||||||
autoPtr<breakupModel> breakupModel_;
|
|
||||||
autoPtr<collisionModel> collisionModel_;
|
|
||||||
autoPtr<dispersionModel> dispersionModel_;
|
|
||||||
autoPtr<liquidMixtureProperties> fuels_;
|
|
||||||
autoPtr<injectorModel> injectorModel_;
|
|
||||||
|
|
||||||
|
|
||||||
//- Minimum number of lagrangian subcycles
|
|
||||||
const label subCycles_;
|
|
||||||
|
|
||||||
|
|
||||||
// Composition properties
|
|
||||||
|
|
||||||
const PtrList<gasThermoPhysics>& gasProperties_;
|
|
||||||
const basicMultiComponentMixture& composition_;
|
|
||||||
|
|
||||||
List<label> liquidToGasIndex_;
|
|
||||||
List<label> gasToLiquidIndex_;
|
|
||||||
List<bool> isLiquidFuel_;
|
|
||||||
|
|
||||||
|
|
||||||
// Necessary 2D-information
|
|
||||||
|
|
||||||
bool twoD_;
|
|
||||||
vector axisOfSymmetry_;
|
|
||||||
vector axisOfWedge_;
|
|
||||||
vector axisOfWedgeNormal_;
|
|
||||||
scalar angleOfWedge_;
|
|
||||||
|
|
||||||
|
|
||||||
// Interpolation
|
|
||||||
|
|
||||||
dictionary interpolationSchemes_;
|
|
||||||
|
|
||||||
autoPtr<interpolation<vector> > UInterpolator_;
|
|
||||||
autoPtr<interpolation<scalar> > rhoInterpolator_;
|
|
||||||
autoPtr<interpolation<scalar> > pInterpolator_;
|
|
||||||
autoPtr<interpolation<scalar> > TInterpolator_;
|
|
||||||
|
|
||||||
|
|
||||||
// Spray Source Terms
|
|
||||||
|
|
||||||
//- Momentum
|
|
||||||
vectorField sms_;
|
|
||||||
|
|
||||||
//- Enthalpy
|
|
||||||
scalarField shs_;
|
|
||||||
|
|
||||||
//- Mass
|
|
||||||
PtrList<scalarField> srhos_;
|
|
||||||
|
|
||||||
//- The total mass of the injected liquid
|
|
||||||
scalar totalInjectedLiquidMass_;
|
|
||||||
|
|
||||||
//- The (total added) injected kinetic energy of the liquid
|
|
||||||
scalar injectedLiquidKE_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
spray(const spray&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const spray&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
spray
|
|
||||||
(
|
|
||||||
const volVectorField& U,
|
|
||||||
const volScalarField& rho,
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T,
|
|
||||||
const basicMultiComponentMixture& composition,
|
|
||||||
const PtrList<gasThermoPhysics>& gasProperties,
|
|
||||||
const dictionary& thermophysicalProperties,
|
|
||||||
const dimensionedVector& g,
|
|
||||||
bool readFields = true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~spray();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Spray tracking and evolution functions
|
|
||||||
|
|
||||||
//- Evolve the spray (move, inject and breakup)
|
|
||||||
void evolve();
|
|
||||||
|
|
||||||
//- Move the spray parcels
|
|
||||||
void move();
|
|
||||||
|
|
||||||
//- Inject more parcels
|
|
||||||
void inject();
|
|
||||||
|
|
||||||
//- Primary breakup droplets
|
|
||||||
void atomizationLoop();
|
|
||||||
|
|
||||||
|
|
||||||
//- Secondary breakup droplets
|
|
||||||
void breakupLoop();
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
inline const Time& runTime() const;
|
|
||||||
inline const fvMesh& mesh() const;
|
|
||||||
|
|
||||||
inline const volVectorField& U() const;
|
|
||||||
inline const volScalarField& rho() const;
|
|
||||||
inline const volScalarField& p() const;
|
|
||||||
inline const volScalarField& T() const;
|
|
||||||
|
|
||||||
inline PtrList<injector>& injectors();
|
|
||||||
inline const PtrList<injector>& injectors() const;
|
|
||||||
|
|
||||||
inline const atomizationModel& atomization() const;
|
|
||||||
inline const breakupModel& breakup() const;
|
|
||||||
inline const collisionModel& collisions() const;
|
|
||||||
inline const dispersionModel& dispersion() const;
|
|
||||||
inline const dragModel& drag() const;
|
|
||||||
inline const evaporationModel& evaporation() const;
|
|
||||||
inline const heatTransferModel& heatTransfer() const;
|
|
||||||
inline const injectorModel& injection() const;
|
|
||||||
inline const wallModel& wall() const;
|
|
||||||
|
|
||||||
inline tmp<volVectorField> momentumSource() const;
|
|
||||||
inline tmp<volScalarField> evaporationSource(const label i) const;
|
|
||||||
inline tmp<volScalarField> heatTransferSource() const;
|
|
||||||
|
|
||||||
inline cachedRandom& rndGen();
|
|
||||||
inline label subCycles() const;
|
|
||||||
inline const vector& g() const;
|
|
||||||
|
|
||||||
inline const liquidMixtureProperties& fuels() const;
|
|
||||||
inline const PtrList<gasThermoPhysics>& gasProperties() const;
|
|
||||||
inline const basicMultiComponentMixture& composition() const;
|
|
||||||
|
|
||||||
inline const List<label>& liquidToGasIndex() const;
|
|
||||||
inline const List<label>& gasToLiquidIndex() const;
|
|
||||||
inline const List<bool>& isLiquidFuel() const;
|
|
||||||
|
|
||||||
inline bool twoD() const;
|
|
||||||
inline const vector& axisOfSymmetry() const;
|
|
||||||
inline const vector& axisOfWedge() const;
|
|
||||||
inline const vector& axisOfWedgeNormal() const;
|
|
||||||
inline scalar angleOfWedge() const;
|
|
||||||
|
|
||||||
inline const interpolation<vector>& UInterpolator() const;
|
|
||||||
inline const interpolation<scalar>& rhoInterpolator() const;
|
|
||||||
inline const interpolation<scalar>& pInterpolator() const;
|
|
||||||
inline const interpolation<scalar>& TInterpolator() const;
|
|
||||||
|
|
||||||
inline vectorField& sms();
|
|
||||||
inline const vectorField& sms() const;
|
|
||||||
|
|
||||||
inline scalarField& shs();
|
|
||||||
inline const scalarField& shs() const;
|
|
||||||
|
|
||||||
inline PtrList<scalarField>& srhos();
|
|
||||||
inline const PtrList<scalarField>& srhos() const;
|
|
||||||
|
|
||||||
inline scalar ambientPressure() const;
|
|
||||||
|
|
||||||
inline scalar ambientTemperature() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
//- Returns the liquid mass that has been injected
|
|
||||||
scalar injectedMass(const scalar t) const;
|
|
||||||
|
|
||||||
//- Returns the liquid mass that will be injected by the injectors
|
|
||||||
scalar totalMassToInject() const;
|
|
||||||
|
|
||||||
//- Returns the injected enthalpy
|
|
||||||
scalar injectedEnthalpy(const scalar t) const;
|
|
||||||
|
|
||||||
//- Returns current total liquid mass in the domain
|
|
||||||
scalar liquidMass() const;
|
|
||||||
|
|
||||||
//- Returns the enthalpy of all the liquid in the domain
|
|
||||||
// Hdrop = Hgas - Hlat
|
|
||||||
scalar liquidEnthalpy() const;
|
|
||||||
|
|
||||||
//- Returns the enthalpy (total) of all the liquid in the domain
|
|
||||||
// Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop;
|
|
||||||
scalar liquidTotalEnthalpy() const;
|
|
||||||
|
|
||||||
//- Returns the kinetic energy of the liquid phase
|
|
||||||
scalar liquidKineticEnergy() const;
|
|
||||||
|
|
||||||
//- Returns the injected kinetic energy of the liquid phase
|
|
||||||
scalar injectedLiquidKineticEnergy() const;
|
|
||||||
|
|
||||||
//- Returns the droplet penetration for 'prc' percent of the
|
|
||||||
// liquid from nozzle 'nozzlei'
|
|
||||||
scalar liquidPenetration
|
|
||||||
(
|
|
||||||
const label nozzlei,
|
|
||||||
const scalar prc
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Returns the droplet penetration for 'prc' percent of the
|
|
||||||
// liquid from nozzle 0
|
|
||||||
scalar liquidPenetration(const scalar prc) const;
|
|
||||||
|
|
||||||
//- Return Sauter Mean Diameter
|
|
||||||
scalar smd() const;
|
|
||||||
|
|
||||||
//- Return Maximum Diameter
|
|
||||||
scalar maxD() const;
|
|
||||||
|
|
||||||
//- Return Ambient Pressure
|
|
||||||
void calculateAmbientPressure();
|
|
||||||
|
|
||||||
//- Return Ambient Temperature
|
|
||||||
void calculateAmbientTemperature();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "sprayI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,398 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::injectedMass(const scalar t) const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
|
|
||||||
forAll(injectors_, i)
|
|
||||||
{
|
|
||||||
sum += injectors_[i].properties()->injectedMass(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::totalMassToInject() const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
|
|
||||||
forAll(injectors_, i)
|
|
||||||
{
|
|
||||||
sum += injectors_[i].properties()->mass();
|
|
||||||
}
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::injectedEnthalpy
|
|
||||||
(
|
|
||||||
const scalar time
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
label Nf = fuels_->components().size();
|
|
||||||
|
|
||||||
forAll(injectors_, i)
|
|
||||||
{
|
|
||||||
scalar T = injectors_[i].properties()->T(time);
|
|
||||||
scalarField X(injectors_[i].properties()->X());
|
|
||||||
scalar pi = 1.0e+5;
|
|
||||||
scalar hl = fuels_->hl(pi, T, X);
|
|
||||||
scalar Wl = fuels_->W(X);
|
|
||||||
scalar hg = 0.0;
|
|
||||||
|
|
||||||
for (label j=0; j<Nf; j++)
|
|
||||||
{
|
|
||||||
label k = liquidToGasIndex_[j];
|
|
||||||
hg += gasProperties()[k].H(T)*gasProperties()[k].W()*X[j]/Wl;
|
|
||||||
}
|
|
||||||
|
|
||||||
sum += injectors_[i].properties()->injectedMass(time)*(hg-hl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidMass() const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
sum += iter().m();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (twoD())
|
|
||||||
{
|
|
||||||
sum *= constant::mathematical::twoPi/angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(sum, sumOp<scalar>());
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidEnthalpy() const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
label Nf = fuels().components().size();
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
scalar T = iter().T();
|
|
||||||
scalar pc = p()[iter().cell()];
|
|
||||||
scalar hlat = fuels().hl(pc, T, iter().X());
|
|
||||||
scalar hg = 0.0;
|
|
||||||
scalar Wl = fuels().W(iter().X());
|
|
||||||
|
|
||||||
for (label j=0; j<Nf; j++)
|
|
||||||
{
|
|
||||||
label k = liquidToGasIndex_[j];
|
|
||||||
|
|
||||||
hg +=
|
|
||||||
gasProperties()[k].H(T)*gasProperties()[k].W()*iter().X()[j]
|
|
||||||
/Wl;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar h = hg - hlat;
|
|
||||||
sum += iter().m()*h;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (twoD())
|
|
||||||
{
|
|
||||||
sum *= constant::mathematical::twoPi/angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(sum, sumOp<scalar>());
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidTotalEnthalpy() const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
label Nf = fuels().components().size();
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
label cellI = iter().cell();
|
|
||||||
scalar T = iter().T();
|
|
||||||
scalar pc = p()[cellI];
|
|
||||||
scalar rho = fuels().rho(pc, T, iter().X());
|
|
||||||
scalar hlat = fuels().hl(pc, T, iter().X());
|
|
||||||
scalar hg = 0.0;
|
|
||||||
scalar Wl = fuels().W(iter().X());
|
|
||||||
|
|
||||||
for (label j=0; j<Nf; j++)
|
|
||||||
{
|
|
||||||
label k = liquidToGasIndex_[j];
|
|
||||||
hg +=
|
|
||||||
gasProperties()[k].H(T)*gasProperties()[k].W()*iter().X()[j]
|
|
||||||
/Wl;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar psat = fuels().pv(pc, T, iter().X());
|
|
||||||
|
|
||||||
scalar h = hg - hlat + (pc - psat)/rho;
|
|
||||||
sum += iter().m()*h;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (twoD())
|
|
||||||
{
|
|
||||||
sum *= constant::mathematical::twoPi/angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(sum, sumOp<scalar>());
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidKineticEnergy() const
|
|
||||||
{
|
|
||||||
scalar sum = 0.0;
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
const scalar ke = pow(mag(iter().U()), 2.0);
|
|
||||||
sum += iter().m()*ke;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (twoD())
|
|
||||||
{
|
|
||||||
sum *= constant::mathematical::twoPi/angleOfWedge();
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(sum, sumOp<scalar>());
|
|
||||||
|
|
||||||
return 0.5*sum;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::injectedLiquidKineticEnergy() const
|
|
||||||
{
|
|
||||||
return injectedLiquidKE_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidPenetration(const scalar prc) const
|
|
||||||
{
|
|
||||||
return liquidPenetration(0, prc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::liquidPenetration
|
|
||||||
(
|
|
||||||
const label nozzlei,
|
|
||||||
const scalar prc
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
|
|
||||||
label nHoles = injectors_[nozzlei].properties()->nHoles();
|
|
||||||
vector ip(vector::zero);
|
|
||||||
if (nHoles > 1)
|
|
||||||
{
|
|
||||||
for (label i=0;i<nHoles;i++)
|
|
||||||
{
|
|
||||||
ip += injectors_[nozzlei].properties()->position(i);
|
|
||||||
}
|
|
||||||
ip /= nHoles;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ip = injectors_[nozzlei].properties()->position(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// vector ip = injectors_[nozzlei].properties()->position();
|
|
||||||
scalar d = 0.0;
|
|
||||||
scalar mTot = 0.0;
|
|
||||||
|
|
||||||
label Np = size();
|
|
||||||
|
|
||||||
// arrays containing the parcels mass and
|
|
||||||
// distance from injector in ascending order
|
|
||||||
scalarField m(Np);
|
|
||||||
scalarField dist(Np);
|
|
||||||
label n = 0;
|
|
||||||
|
|
||||||
if (Np > 1)
|
|
||||||
{
|
|
||||||
// first arrange the parcels in ascending order
|
|
||||||
// the first parcel is closest to injector
|
|
||||||
// and the last one is most far away.
|
|
||||||
spray::const_iterator first = begin();
|
|
||||||
m[n] = first().m();
|
|
||||||
dist[n] = mag(first().position() - ip);
|
|
||||||
|
|
||||||
mTot += m[n];
|
|
||||||
|
|
||||||
for
|
|
||||||
(
|
|
||||||
spray::const_iterator iter = ++first;
|
|
||||||
iter != end();
|
|
||||||
++iter
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar de = mag(iter().position() - ip);
|
|
||||||
scalar me = iter().m();
|
|
||||||
mTot += me;
|
|
||||||
|
|
||||||
n++;
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
// insert the parcel in the correct place
|
|
||||||
// and move the others
|
|
||||||
while ( ( i < n-1 ) && ( !found ) )
|
|
||||||
{
|
|
||||||
if (de < dist[i])
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
for (label j=n; j>i; j--)
|
|
||||||
{
|
|
||||||
m[j] = m[j-1];
|
|
||||||
dist[j] = dist[j-1];
|
|
||||||
}
|
|
||||||
m[i] = me;
|
|
||||||
dist[i] = de;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found)
|
|
||||||
{
|
|
||||||
m[n] = me;
|
|
||||||
dist[n] = de;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(mTot, sumOp<scalar>());
|
|
||||||
|
|
||||||
if (Np > 1)
|
|
||||||
{
|
|
||||||
scalar mLimit = prc*mTot;
|
|
||||||
scalar mOff = (1.0 - prc)*mTot;
|
|
||||||
|
|
||||||
// 'prc' is large enough that the parcel most far
|
|
||||||
// away will be used, no need to loop...
|
|
||||||
if (mLimit > mTot - m[Np-1])
|
|
||||||
{
|
|
||||||
d = dist[Np-1];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar mOffSum = 0.0;
|
|
||||||
label i = Np;
|
|
||||||
|
|
||||||
while ((mOffSum < mOff) && (i>0))
|
|
||||||
{
|
|
||||||
i--;
|
|
||||||
mOffSum += m[i];
|
|
||||||
}
|
|
||||||
d = dist[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Np > 0)
|
|
||||||
{
|
|
||||||
spray::const_iterator iter = begin();
|
|
||||||
d = mag(iter().position() - ip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(d, maxOp<scalar>());
|
|
||||||
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::smd() const
|
|
||||||
{
|
|
||||||
scalar numerator = 0.0, denominator = VSMALL;
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
label cellI = iter().cell();
|
|
||||||
scalar Pc = p()[cellI];
|
|
||||||
scalar T = iter().T();
|
|
||||||
scalar rho = fuels_->rho(Pc, T, iter().X());
|
|
||||||
|
|
||||||
scalar tmp = iter().N(rho)*pow(iter().d(), 2.0);
|
|
||||||
numerator += tmp*iter().d();
|
|
||||||
denominator += tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(numerator, sumOp<scalar>());
|
|
||||||
reduce(denominator, sumOp<scalar>());
|
|
||||||
|
|
||||||
return numerator/denominator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::spray::maxD() const
|
|
||||||
{
|
|
||||||
scalar maxD = 0.0;
|
|
||||||
|
|
||||||
forAllConstIter(spray, *this, iter)
|
|
||||||
{
|
|
||||||
maxD = max(maxD, iter().d());
|
|
||||||
}
|
|
||||||
|
|
||||||
reduce(maxD, maxOp<scalar>());
|
|
||||||
|
|
||||||
return maxD;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::spray::calculateAmbientPressure()
|
|
||||||
{
|
|
||||||
ambientPressure_ = p_.average().value();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::spray::calculateAmbientTemperature()
|
|
||||||
{
|
|
||||||
ambientTemperature_ = T_.average().value();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,382 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
inline const Foam::Time& Foam::spray::runTime() const
|
|
||||||
{
|
|
||||||
return runTime_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::fvMesh& Foam::spray::mesh() const
|
|
||||||
{
|
|
||||||
return mesh_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volVectorField& Foam::spray::U() const
|
|
||||||
{
|
|
||||||
return U_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::spray::rho() const
|
|
||||||
{
|
|
||||||
return rho_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::spray::p() const
|
|
||||||
{
|
|
||||||
return p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::spray::T() const
|
|
||||||
{
|
|
||||||
return T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::PtrList<Foam::injector>& Foam::spray::injectors()
|
|
||||||
{
|
|
||||||
return injectors_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::PtrList<Foam::injector>& Foam::spray::injectors() const
|
|
||||||
{
|
|
||||||
return injectors_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::atomizationModel& Foam::spray::atomization() const
|
|
||||||
{
|
|
||||||
return atomization_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::breakupModel& Foam::spray::breakup() const
|
|
||||||
{
|
|
||||||
return breakupModel_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::collisionModel& Foam::spray::collisions() const
|
|
||||||
{
|
|
||||||
return collisionModel_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::dispersionModel& Foam::spray::dispersion() const
|
|
||||||
{
|
|
||||||
return dispersionModel_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::dragModel& Foam::spray::drag() const
|
|
||||||
{
|
|
||||||
return drag_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::evaporationModel& Foam::spray::evaporation() const
|
|
||||||
{
|
|
||||||
return evaporation_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::heatTransferModel& Foam::spray::heatTransfer() const
|
|
||||||
{
|
|
||||||
return heatTransfer_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::injectorModel& Foam::spray::injection() const
|
|
||||||
{
|
|
||||||
return injectorModel_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::wallModel& Foam::spray::wall() const
|
|
||||||
{
|
|
||||||
return wall_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::tmp<Foam::volVectorField> Foam::spray::momentumSource() const
|
|
||||||
{
|
|
||||||
tmp<volVectorField> tsource
|
|
||||||
(
|
|
||||||
new volVectorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"sms",
|
|
||||||
runTime_.timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedVector
|
|
||||||
(
|
|
||||||
"zero",
|
|
||||||
dimensionSet(1, -2, -2, 0, 0),
|
|
||||||
vector::zero
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
tsource().internalField() = sms_/runTime_.deltaTValue()/mesh_.V();
|
|
||||||
|
|
||||||
return tsource;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::spray::evaporationSource(const label si) const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tsource
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"srhos",
|
|
||||||
runTime_.timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isLiquidFuel_[si])
|
|
||||||
{
|
|
||||||
label fi = gasToLiquidIndex_[si];
|
|
||||||
tsource().internalField() = srhos_[fi]/runTime_.deltaTValue()/mesh_.V();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalarField s(mesh_.nCells(), 0.0);
|
|
||||||
tsource().internalField() = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tsource;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::tmp<Foam::volScalarField> Foam::spray::heatTransferSource() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tsource
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"shs",
|
|
||||||
runTime_.timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedScalar("zero", dimensionSet(1, -1, -3, 0, 0), 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
tsource().internalField() = shs_/runTime_.deltaTValue()/mesh_.V();
|
|
||||||
|
|
||||||
return tsource;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::cachedRandom& Foam::spray::rndGen()
|
|
||||||
{
|
|
||||||
return rndGen_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::label Foam::spray::subCycles() const
|
|
||||||
{
|
|
||||||
return subCycles_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::spray::g() const
|
|
||||||
{
|
|
||||||
return g_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::liquidMixtureProperties& Foam::spray::fuels() const
|
|
||||||
{
|
|
||||||
return fuels_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::PtrList<Foam::gasThermoPhysics>&
|
|
||||||
Foam::spray::gasProperties() const
|
|
||||||
{
|
|
||||||
return gasProperties_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::basicMultiComponentMixture& Foam::spray::composition() const
|
|
||||||
{
|
|
||||||
return composition_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::List<Foam::label>& Foam::spray::liquidToGasIndex() const
|
|
||||||
{
|
|
||||||
return liquidToGasIndex_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::List<Foam::label>& Foam::spray::gasToLiquidIndex() const
|
|
||||||
{
|
|
||||||
return gasToLiquidIndex_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::List<bool>& Foam::spray::isLiquidFuel() const
|
|
||||||
{
|
|
||||||
return isLiquidFuel_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::spray::twoD() const
|
|
||||||
{
|
|
||||||
return twoD_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::spray::axisOfSymmetry() const
|
|
||||||
{
|
|
||||||
return axisOfSymmetry_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::spray::axisOfWedge() const
|
|
||||||
{
|
|
||||||
return axisOfWedge_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vector& Foam::spray::axisOfWedgeNormal() const
|
|
||||||
{
|
|
||||||
return axisOfWedgeNormal_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::spray::angleOfWedge() const
|
|
||||||
{
|
|
||||||
return angleOfWedge_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::interpolation<Foam::vector>&
|
|
||||||
Foam::spray::UInterpolator() const
|
|
||||||
{
|
|
||||||
return UInterpolator_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::interpolation<Foam::scalar>&
|
|
||||||
Foam::spray::rhoInterpolator() const
|
|
||||||
{
|
|
||||||
return rhoInterpolator_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::interpolation<Foam::scalar>&
|
|
||||||
Foam::spray::pInterpolator() const
|
|
||||||
{
|
|
||||||
return pInterpolator_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::interpolation<Foam::scalar>&
|
|
||||||
Foam::spray::TInterpolator() const
|
|
||||||
{
|
|
||||||
return TInterpolator_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::vectorField& Foam::spray::sms()
|
|
||||||
{
|
|
||||||
return sms_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::vectorField& Foam::spray::sms() const
|
|
||||||
{
|
|
||||||
return sms_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalarField& Foam::spray::shs()
|
|
||||||
{
|
|
||||||
return shs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::scalarField& Foam::spray::shs() const
|
|
||||||
{
|
|
||||||
return shs_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::PtrList<Foam::scalarField>& Foam::spray::srhos()
|
|
||||||
{
|
|
||||||
return srhos_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::PtrList<Foam::scalarField>& Foam::spray::srhos() const
|
|
||||||
{
|
|
||||||
return srhos_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::spray::ambientPressure() const
|
|
||||||
{
|
|
||||||
return ambientPressure_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::spray::ambientTemperature() const
|
|
||||||
{
|
|
||||||
return ambientTemperature_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,185 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
#include "breakupModel.H"
|
|
||||||
#include "collisionModel.H"
|
|
||||||
#include "dispersionModel.H"
|
|
||||||
#include "injectorModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::spray::inject()
|
|
||||||
{
|
|
||||||
scalar time = runTime_.value();
|
|
||||||
scalar time0 = time0_;
|
|
||||||
|
|
||||||
parcel::trackingData td(*this);
|
|
||||||
|
|
||||||
// Inject the parcels for each injector sequentially
|
|
||||||
forAll(injectors_, i)
|
|
||||||
{
|
|
||||||
autoPtr<injectorType>& it = injectors()[i].properties();
|
|
||||||
if (!it->pressureIndependentVelocity())
|
|
||||||
{
|
|
||||||
scalar referencePressure = p().average().value();
|
|
||||||
it->correctProfiles(fuels(), referencePressure);
|
|
||||||
}
|
|
||||||
|
|
||||||
const label nHoles = it->nHoles();
|
|
||||||
|
|
||||||
// parcels have the same mass during a timestep
|
|
||||||
scalar mass = it->mass(time0, time, twoD_, angleOfWedge_);
|
|
||||||
|
|
||||||
label Np = it->nParcelsToInject(time0, time);
|
|
||||||
|
|
||||||
if (mass > 0)
|
|
||||||
{
|
|
||||||
Np = max(1, Np);
|
|
||||||
scalar mp = mass/Np/nHoles;
|
|
||||||
|
|
||||||
// constT is only larger than zero for the first
|
|
||||||
// part of the injection
|
|
||||||
scalar constT = max(0.0, it->tsoi() - time0);
|
|
||||||
|
|
||||||
// deltaT is the duration of injection during this timestep
|
|
||||||
scalar deltaT = min
|
|
||||||
(
|
|
||||||
runTime_.deltaTValue(),
|
|
||||||
min
|
|
||||||
(
|
|
||||||
time - it->tsoi(),
|
|
||||||
it->teoi() - time0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
for (label j=0; j<Np; j++)
|
|
||||||
{
|
|
||||||
// calculate the time of injection for parcel 'j'
|
|
||||||
scalar toi = time0 + constT + deltaT*j/scalar(Np);
|
|
||||||
|
|
||||||
for (label n=0; n<nHoles; n++)
|
|
||||||
{
|
|
||||||
|
|
||||||
// calculate the velocity of the injected parcel
|
|
||||||
vector injectionPosition = it->position
|
|
||||||
(
|
|
||||||
n,
|
|
||||||
toi,
|
|
||||||
twoD_,
|
|
||||||
angleOfWedge_,
|
|
||||||
axisOfSymmetry_,
|
|
||||||
axisOfWedge_,
|
|
||||||
axisOfWedgeNormal_,
|
|
||||||
rndGen_
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar diameter = injection().d0(i, toi);
|
|
||||||
vector direction =
|
|
||||||
injection().direction(i, n, toi, diameter);
|
|
||||||
vector U = injection().velocity(i, toi)*direction;
|
|
||||||
|
|
||||||
scalar symComponent = direction & axisOfSymmetry_;
|
|
||||||
vector normal = direction - symComponent*axisOfSymmetry_;
|
|
||||||
normal /= mag(normal);
|
|
||||||
|
|
||||||
// should be set from dict or model
|
|
||||||
scalar deviation = breakup().y0();
|
|
||||||
scalar ddev = breakup().yDot0();
|
|
||||||
|
|
||||||
label injectorCell = -1;
|
|
||||||
label injectorTetFaceI = -1;
|
|
||||||
label injectorTetPtI = -1;
|
|
||||||
|
|
||||||
mesh_.findCellFacePt
|
|
||||||
(
|
|
||||||
injectionPosition,
|
|
||||||
injectorCell,
|
|
||||||
injectorTetFaceI,
|
|
||||||
injectorTetPtI
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "findInjectorCell.H"
|
|
||||||
|
|
||||||
if (injectorCell >= 0)
|
|
||||||
{
|
|
||||||
scalar liquidCore = 1.0;
|
|
||||||
|
|
||||||
// construct the parcel that is to be injected
|
|
||||||
|
|
||||||
parcel* pPtr = new parcel
|
|
||||||
(
|
|
||||||
mesh_,
|
|
||||||
injectionPosition,
|
|
||||||
injectorCell,
|
|
||||||
injectorTetFaceI,
|
|
||||||
injectorTetPtI,
|
|
||||||
normal,
|
|
||||||
diameter,
|
|
||||||
it->T(toi),
|
|
||||||
mp,
|
|
||||||
deviation,
|
|
||||||
ddev,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
liquidCore,
|
|
||||||
scalar(i),
|
|
||||||
U,
|
|
||||||
vector::zero,
|
|
||||||
it->X(),
|
|
||||||
fuels_->components()
|
|
||||||
);
|
|
||||||
|
|
||||||
injectedLiquidKE_ += 0.5*pPtr->m()*magSqr(U);
|
|
||||||
|
|
||||||
scalar dt = time - toi;
|
|
||||||
|
|
||||||
pPtr->stepFraction() =
|
|
||||||
(runTime_.deltaTValue() - dt)
|
|
||||||
/runTime_.deltaTValue();
|
|
||||||
|
|
||||||
bool keepParcel =
|
|
||||||
pPtr->move(td, runTime_.deltaTValue());
|
|
||||||
|
|
||||||
if (keepParcel)
|
|
||||||
{
|
|
||||||
addParticle(pPtr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
delete pPtr;
|
|
||||||
}
|
|
||||||
} // if (injectorCell....
|
|
||||||
} // for (label n=0...
|
|
||||||
} // for (label j=0....
|
|
||||||
} // if (mass>0)...
|
|
||||||
} // forAll(injectors)...
|
|
||||||
|
|
||||||
time0_ = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "spray.H"
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
#include "breakupModel.H"
|
|
||||||
#include "collisionModel.H"
|
|
||||||
#include "dispersionModel.H"
|
|
||||||
#include "interpolation.H"
|
|
||||||
#include "processorPolyPatch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::spray::evolve()
|
|
||||||
{
|
|
||||||
sms_.setSize(rho_.size());
|
|
||||||
shs_.setSize(rho_.size());
|
|
||||||
forAll(srhos_, i)
|
|
||||||
{
|
|
||||||
srhos_[i].setSize(rho_.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_);
|
|
||||||
|
|
||||||
rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_);
|
|
||||||
|
|
||||||
pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_);
|
|
||||||
|
|
||||||
TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_);
|
|
||||||
|
|
||||||
calculateAmbientPressure();
|
|
||||||
calculateAmbientTemperature();
|
|
||||||
collisions().collideParcels(runTime_.deltaTValue());
|
|
||||||
move();
|
|
||||||
dispersion().disperseParcels();
|
|
||||||
inject();
|
|
||||||
atomizationLoop();
|
|
||||||
breakupLoop();
|
|
||||||
|
|
||||||
UInterpolator_.clear();
|
|
||||||
rhoInterpolator_.clear();
|
|
||||||
pInterpolator_.clear();
|
|
||||||
TInterpolator_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::spray::move()
|
|
||||||
{
|
|
||||||
// Reset Spray Source Terms
|
|
||||||
sms_ = vector::zero;
|
|
||||||
shs_ = 0.0;
|
|
||||||
forAll(srhos_, i)
|
|
||||||
{
|
|
||||||
srhos_[i] = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
parcel::trackingData td(*this);
|
|
||||||
Cloud<parcel>::move(td, runTime_.deltaTValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::spray::breakupLoop()
|
|
||||||
{
|
|
||||||
forAllIter(spray, *this, elmnt)
|
|
||||||
{
|
|
||||||
// interpolate...
|
|
||||||
vector velocity = UInterpolator().interpolate
|
|
||||||
(
|
|
||||||
elmnt().position(),
|
|
||||||
elmnt().currentTetIndices()
|
|
||||||
);
|
|
||||||
|
|
||||||
// liquidCore < 0.5 indicates discrete drops
|
|
||||||
if (elmnt().liquidCore() <= 0.5)
|
|
||||||
{
|
|
||||||
breakup().updateParcelProperties
|
|
||||||
(
|
|
||||||
elmnt(),
|
|
||||||
runTime_.deltaTValue(),
|
|
||||||
velocity,
|
|
||||||
fuels_
|
|
||||||
);
|
|
||||||
|
|
||||||
breakup().breakupParcel
|
|
||||||
(
|
|
||||||
elmnt(),
|
|
||||||
runTime_.deltaTValue(),
|
|
||||||
velocity,
|
|
||||||
fuels_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::spray::atomizationLoop()
|
|
||||||
{
|
|
||||||
forAllIter(spray, *this, elmnt)
|
|
||||||
{
|
|
||||||
// interpolate...
|
|
||||||
vector velocity = UInterpolator().interpolate
|
|
||||||
(
|
|
||||||
elmnt().position(),
|
|
||||||
elmnt().currentTetIndices()
|
|
||||||
);
|
|
||||||
|
|
||||||
// liquidCore > 0.5 indicates a liquid core
|
|
||||||
if (elmnt().liquidCore() > 0.5)
|
|
||||||
{
|
|
||||||
atomization().atomizeParcel
|
|
||||||
(
|
|
||||||
elmnt(),
|
|
||||||
runTime_.deltaTValue(),
|
|
||||||
velocity,
|
|
||||||
fuels_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,375 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "LISA.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
#include "RosinRammler.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(LISA, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
atomizationModel,
|
|
||||||
LISA,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::LISA::LISA
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
atomizationModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
Cl_(readScalar(coeffsDict_.lookup("Cl"))),
|
|
||||||
cTau_(readScalar(coeffsDict_.lookup("cTau"))),
|
|
||||||
Q_(readScalar(coeffsDict_.lookup("Q"))),
|
|
||||||
J_(readScalar(coeffsDict_.lookup("J")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::LISA::~LISA()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::LISA::atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const PtrList<volScalarField>& Y = spray_.composition().Y();
|
|
||||||
|
|
||||||
label cellI = p.cell();
|
|
||||||
scalar pressure = spray_.p()[cellI];
|
|
||||||
scalar temperature = spray_.T()[cellI];
|
|
||||||
scalar Taverage = p.T() + (temperature - p.T())/3.0;
|
|
||||||
scalar Winv = 0.0;
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar R = specie::RR*Winv;
|
|
||||||
|
|
||||||
// ideal gas law to evaluate density
|
|
||||||
scalar rhoAverage = pressure/R/Taverage;
|
|
||||||
//scalar nuAverage = muAverage/rhoAverage;
|
|
||||||
scalar sigma = fuels.sigma(pressure, p.T(), p.X());
|
|
||||||
|
|
||||||
|
|
||||||
// The We and Re numbers are to be evaluated using the 1/3 rule.
|
|
||||||
|
|
||||||
scalar WeberNumber = p.We(vel, rhoAverage, sigma);
|
|
||||||
|
|
||||||
scalar tau = 0.0;
|
|
||||||
scalar dL = 0.0;
|
|
||||||
scalar k = 0.0;
|
|
||||||
scalar muFuel = fuels.mu(pressure, p.T(), p.X());
|
|
||||||
scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X());
|
|
||||||
scalar nuFuel = muFuel/rhoFuel;
|
|
||||||
|
|
||||||
// Might be the relative velocity between Liquid and Gas, but using the
|
|
||||||
// absolute velocity of the parcel as suggested by the authors
|
|
||||||
// scalar U = mag(p.Urel(vel));
|
|
||||||
scalar U = mag(p.U());
|
|
||||||
|
|
||||||
p.ct() += deltaT;
|
|
||||||
|
|
||||||
scalar Q = rhoAverage/rhoFuel;
|
|
||||||
|
|
||||||
const injectorType& it =
|
|
||||||
spray_.injectors()[label(p.injector())].properties();
|
|
||||||
|
|
||||||
if (it.nHoles() > 1)
|
|
||||||
{
|
|
||||||
Info<< "Warning: This atomization model is not suitable for "
|
|
||||||
<< "multihole injectors. "
|
|
||||||
<< "Only the first hole will be used." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const vector itPosition = it.position(0);
|
|
||||||
scalar pWalk = mag(p.position() - itPosition);
|
|
||||||
|
|
||||||
|
|
||||||
// Updating liquid sheet tickness... that is the droplet diameter
|
|
||||||
|
|
||||||
const vector direction = it.direction(0, spray_.runTime().value());
|
|
||||||
|
|
||||||
scalar h = (p.position() - itPosition) & direction;
|
|
||||||
|
|
||||||
scalar d = sqrt(sqr(pWalk)-sqr(h));
|
|
||||||
|
|
||||||
scalar time = pWalk/mag(p.U());
|
|
||||||
|
|
||||||
scalar elapsedTime = spray_.runTime().value();
|
|
||||||
|
|
||||||
scalar massFlow = it.massFlowRate(max(0.0,elapsedTime-time));
|
|
||||||
|
|
||||||
scalar hSheet = massFlow/(constant::mathematical::pi*d*rhoFuel*mag(p.U()));
|
|
||||||
|
|
||||||
p.d() = min(hSheet,p.d());
|
|
||||||
|
|
||||||
if (WeberNumber > 27.0/16.0)
|
|
||||||
{
|
|
||||||
scalar kPos = 0.0;
|
|
||||||
scalar kNeg = Q*sqr(U)*rhoFuel/sigma;
|
|
||||||
|
|
||||||
scalar derivativePos = sqrt(Q*pow(U,2.0));
|
|
||||||
|
|
||||||
scalar derivativeNeg =
|
|
||||||
(
|
|
||||||
8.0*sqr(nuFuel)*pow3(kNeg)
|
|
||||||
+ Q*sqr(U)*kNeg
|
|
||||||
- 3.0*sigma/2.0/rhoFuel*sqr(kNeg)
|
|
||||||
)
|
|
||||||
/sqrt
|
|
||||||
(
|
|
||||||
4.0*sqr(nuFuel)*pow4(kNeg)
|
|
||||||
+ Q*sqr(U)*sqr(kNeg)
|
|
||||||
- sigma*pow3(kNeg)/rhoFuel
|
|
||||||
)
|
|
||||||
- 4.0*nuFuel*kNeg;
|
|
||||||
|
|
||||||
scalar kOld = 0.0;
|
|
||||||
|
|
||||||
|
|
||||||
for (label i=0; i<40; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
k = kPos
|
|
||||||
- (derivativePos/((derivativeNeg - derivativePos)/(kNeg - kPos)));
|
|
||||||
|
|
||||||
scalar derivativek =
|
|
||||||
(
|
|
||||||
8.0*sqr(nuFuel)*pow3(k)
|
|
||||||
+ Q*sqr(U)*k
|
|
||||||
- 3.0*sigma/2.0/rhoFuel*sqr(k)
|
|
||||||
)
|
|
||||||
/sqrt
|
|
||||||
(
|
|
||||||
4.0*sqr(nuFuel)*pow4(k)
|
|
||||||
+ Q*sqr(U)*sqr(k)
|
|
||||||
- sigma*pow3(k)/rhoFuel
|
|
||||||
)
|
|
||||||
- 4.0*nuFuel*k;
|
|
||||||
|
|
||||||
if (derivativek > 0)
|
|
||||||
{
|
|
||||||
derivativePos = derivativek;
|
|
||||||
kPos = k;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
derivativeNeg = derivativek;
|
|
||||||
kNeg = k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mag(k - kOld)/k < 1e-4)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
kOld = k;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar omegaS =
|
|
||||||
- 2.0 * nuFuel * pow(k, 2.0)
|
|
||||||
+ sqrt
|
|
||||||
(
|
|
||||||
4.0*sqr(nuFuel)*pow4(k)
|
|
||||||
+ Q*sqr(U)*sqr(k)
|
|
||||||
- sigma*pow3(k)/rhoFuel
|
|
||||||
);
|
|
||||||
|
|
||||||
tau = cTau_/omegaS;
|
|
||||||
|
|
||||||
dL = sqrt(8.0*p.d()/k);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
k = rhoAverage*pow(U, 2.0)/2.0*sigma;
|
|
||||||
|
|
||||||
scalar J = pWalk*p.d()/2.0;
|
|
||||||
|
|
||||||
tau = pow(3.0*cTau_, 2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow4(U)*rhoFuel));
|
|
||||||
|
|
||||||
dL = sqrt(4.0*p.d()/k);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar kL = 1.0/(dL*sqrt(0.5 + 1.5*muFuel/sqrt(rhoFuel*sigma*dL)));
|
|
||||||
|
|
||||||
scalar dD = cbrt(3.0*constant::mathematical::pi*sqr(dL)/kL);
|
|
||||||
|
|
||||||
scalar lisaExp = 0.27;
|
|
||||||
scalar ambientPressure = 1.0e+5;
|
|
||||||
|
|
||||||
scalar pRatio = spray_.ambientPressure()/ambientPressure;
|
|
||||||
|
|
||||||
dD = dD*pow(pRatio,lisaExp);
|
|
||||||
|
|
||||||
|
|
||||||
// modifications to take account of the flash boiling on primary breakUp
|
|
||||||
|
|
||||||
scalar pExp = 0.135;
|
|
||||||
|
|
||||||
scalar chi = 0.0;
|
|
||||||
|
|
||||||
label Nf = fuels.components().size();
|
|
||||||
|
|
||||||
scalar Td = p.T();
|
|
||||||
|
|
||||||
for (label i = 0; i < Nf; i++)
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fuels.properties()[i].pv(spray_.ambientPressure(), Td)
|
|
||||||
>= 0.999*spray_.ambientPressure()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// The fuel is boiling.....
|
|
||||||
// Calculation of the boiling temperature
|
|
||||||
|
|
||||||
scalar tBoilingSurface = Td;
|
|
||||||
|
|
||||||
label Niter = 200;
|
|
||||||
|
|
||||||
for (label k=0; k< Niter ; k++)
|
|
||||||
{
|
|
||||||
scalar pBoil =
|
|
||||||
fuels.properties()[i].pv(pressure, tBoilingSurface);
|
|
||||||
|
|
||||||
if (pBoil > pressure)
|
|
||||||
{
|
|
||||||
tBoilingSurface =
|
|
||||||
tBoilingSurface - (Td - temperature)/Niter;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar hl =
|
|
||||||
fuels.properties()[i].hl
|
|
||||||
(
|
|
||||||
spray_.ambientPressure(),
|
|
||||||
tBoilingSurface
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar iTp =
|
|
||||||
fuels.properties()[i].h(spray_.ambientPressure(), Td)
|
|
||||||
- spray_.ambientPressure()
|
|
||||||
/fuels.properties()[i].rho(spray_.ambientPressure(), Td);
|
|
||||||
|
|
||||||
scalar iTb =
|
|
||||||
fuels.properties()[i].h
|
|
||||||
(
|
|
||||||
spray_.ambientPressure(),
|
|
||||||
tBoilingSurface
|
|
||||||
)
|
|
||||||
- spray_.ambientPressure()
|
|
||||||
/fuels.properties()[i].rho
|
|
||||||
(
|
|
||||||
spray_.ambientPressure(),
|
|
||||||
tBoilingSurface
|
|
||||||
);
|
|
||||||
|
|
||||||
chi += p.X()[i]*(iTp - iTb)/hl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// bounding chi
|
|
||||||
|
|
||||||
chi = max(chi, 0.0);
|
|
||||||
chi = min(chi, 1.0);
|
|
||||||
|
|
||||||
// modifing dD to take account of flash boiling
|
|
||||||
|
|
||||||
dD = dD*(1.0 - chi*pow(pRatio, -pExp));
|
|
||||||
|
|
||||||
scalar lBU = Cl_ * mag(p.U())*tau;
|
|
||||||
|
|
||||||
if (pWalk > lBU)
|
|
||||||
{
|
|
||||||
p.liquidCore() = 0.0;
|
|
||||||
|
|
||||||
// calculate the new diameter with a Rosin Rammler distribution
|
|
||||||
|
|
||||||
scalar minValue = min(p.d(), dD/10.0);
|
|
||||||
|
|
||||||
scalar maxValue = dD;
|
|
||||||
|
|
||||||
if (maxValue - minValue < SMALL)
|
|
||||||
{
|
|
||||||
minValue = p.d()/10.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar range = maxValue - minValue;
|
|
||||||
|
|
||||||
scalar y = 0;
|
|
||||||
scalar x = 0;
|
|
||||||
scalar px = 0.0;
|
|
||||||
scalar nExp = 1;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
x = minValue + range*rndGen_.sample01<scalar>();
|
|
||||||
y = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
scalar xx = pow(x/dD, nExp);
|
|
||||||
|
|
||||||
px = xx*exp(-xx);
|
|
||||||
|
|
||||||
} while (y >= px);
|
|
||||||
|
|
||||||
// New droplet diameter
|
|
||||||
|
|
||||||
p.d() = x;
|
|
||||||
p.ct() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::LISA
|
|
||||||
|
|
||||||
Description
|
|
||||||
Primary Breakup Model for pressure swirl atomizers.
|
|
||||||
|
|
||||||
Accurate description in
|
|
||||||
\verbatim
|
|
||||||
P.K. Senecal, D.P. Shmidt, I. Nouar, C.J. Rutland, R.D. Reitz, M. Corradini
|
|
||||||
"Modeling high-speed viscous liquid sheet atomization"
|
|
||||||
International Journal of Multiphase Flow 25 (1999) pags. 1073-1097
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
and
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
D.P. Schmidt, I. Nouar, P.K. Senecal, C.J. Rutland, J.K. Martin, R.D. Reitz
|
|
||||||
"Pressure-Swirl Atomization in the Near Field"
|
|
||||||
SAE Techical Paper Series 1999-01-0496
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef LISA_H
|
|
||||||
#define LISA_H
|
|
||||||
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class LISA Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class LISA
|
|
||||||
:
|
|
||||||
public atomizationModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
scalar Cl_;
|
|
||||||
scalar cTau_;
|
|
||||||
scalar Q_;
|
|
||||||
scalar J_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("LISA");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
LISA(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~LISA();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(atomizationModel, 0);
|
|
||||||
defineRunTimeSelectionTable(atomizationModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::atomizationModel::atomizationModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dict_(dict),
|
|
||||||
spray_(sm),
|
|
||||||
rndGen_(sm.rndGen())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::atomizationModel::~atomizationModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::atomizationModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Base class for selecting the atomization model
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef atomizationModel_H
|
|
||||||
#define atomizationModel_H
|
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
|
||||||
#include "spray.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class atomizationModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class atomizationModel
|
|
||||||
{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
const dictionary& dict_;
|
|
||||||
spray& spray_;
|
|
||||||
cachedRandom& rndGen_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("atomizationModel");
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
atomizationModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
),
|
|
||||||
(dict, sm)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
atomizationModel(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~atomizationModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
|
||||||
|
|
||||||
static autoPtr<atomizationModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
virtual void atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
#include "LISA.H"
|
|
||||||
#include "noAtomization.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::atomizationModel> Foam::atomizationModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word modelType(dict.lookup("atomizationModel"));
|
|
||||||
|
|
||||||
Info<< "Selecting atomizationModel " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"atomizationModel::New(const dictionary&, const spray&)"
|
|
||||||
) << "Unknown atomizationModel type "
|
|
||||||
<< modelType << nl << nl
|
|
||||||
<< "Valid atomizationModel types are :" << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<atomizationModel>(cstrIter()(dict, sm));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,140 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "blobsSheetAtomization.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
#include "RosinRammler.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(blobsSheetAtomization, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
atomizationModel,
|
|
||||||
blobsSheetAtomization,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blobsSheetAtomization::blobsSheetAtomization
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
atomizationModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
B_(readScalar(coeffsDict_.lookup("B"))),
|
|
||||||
angle_(readScalar(coeffsDict_.lookup("angle")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blobsSheetAtomization::~blobsSheetAtomization()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::blobsSheetAtomization::atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const PtrList<volScalarField>& Y = spray_.composition().Y();
|
|
||||||
|
|
||||||
label cellI = p.cell();
|
|
||||||
scalar pressure = spray_.p()[cellI];
|
|
||||||
scalar temperature = spray_.T()[cellI];
|
|
||||||
scalar Taverage = p.T() + (temperature - p.T())/3.0;
|
|
||||||
|
|
||||||
scalar Winv = 0.0;
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
|
|
||||||
}
|
|
||||||
scalar R = specie::RR*Winv;
|
|
||||||
|
|
||||||
// ideal gas law to evaluate density
|
|
||||||
scalar rhoAverage = pressure/R/Taverage;
|
|
||||||
scalar sigma = fuels.sigma(pressure, p.T(), p.X());
|
|
||||||
|
|
||||||
|
|
||||||
// The We and Re numbers are to be evaluated using the 1/3 rule.
|
|
||||||
|
|
||||||
scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X());
|
|
||||||
|
|
||||||
scalar U = mag(p.Urel(vel));
|
|
||||||
|
|
||||||
const injectorType& it =
|
|
||||||
spray_.injectors()[label(p.injector())].properties();
|
|
||||||
|
|
||||||
vector itPosition(vector::zero);
|
|
||||||
label nHoles = it.nHoles();
|
|
||||||
if (nHoles > 1)
|
|
||||||
{
|
|
||||||
for (label i=0; i<nHoles;i++)
|
|
||||||
{
|
|
||||||
itPosition += it.position(i);
|
|
||||||
}
|
|
||||||
itPosition /= nHoles;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
itPosition = it.position(0);
|
|
||||||
}
|
|
||||||
// const vector itPosition = it.position();
|
|
||||||
|
|
||||||
|
|
||||||
scalar lBU =
|
|
||||||
B_*sqrt
|
|
||||||
(
|
|
||||||
rhoFuel*sigma*p.d()*cos(angle_*constant::mathematical::pi/360.0)
|
|
||||||
/sqr(rhoAverage*U)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar pWalk = mag(p.position() - itPosition);
|
|
||||||
|
|
||||||
if (pWalk > lBU && p.liquidCore() == 1.0)
|
|
||||||
{
|
|
||||||
p.liquidCore() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::blobsSheetAtomization
|
|
||||||
|
|
||||||
Description
|
|
||||||
Primary Breakup Model for pressure swirl atomizers.
|
|
||||||
|
|
||||||
Accurate description in
|
|
||||||
\verbatim
|
|
||||||
Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz
|
|
||||||
"Modeling Atomization Processes Of Pressure Swirl Hollow-Cone Fuel Sprays"
|
|
||||||
Atomization and Sprays, vol. 7, pp. 663-684, 1997
|
|
||||||
|
|
||||||
and
|
|
||||||
|
|
||||||
L. Allocca, G. Bella, A. De Vita, L. Di Angelo
|
|
||||||
"Experimental Validation of a GDI Spray Model"
|
|
||||||
SAE Technical Paper Series, 2002-01-1137
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef blobsSheetAtomization_H
|
|
||||||
#define blobsSheetAtomization_H
|
|
||||||
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class blobsSheetAtomization Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class blobsSheetAtomization
|
|
||||||
:
|
|
||||||
public atomizationModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
scalar B_;
|
|
||||||
scalar angle_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("blobsSheetAtomization");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
blobsSheetAtomization(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~blobsSheetAtomization();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "noAtomization.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(noAtomization, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
atomizationModel,
|
|
||||||
noAtomization,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noAtomization::noAtomization
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
atomizationModel(dict, sm)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noAtomization::~noAtomization()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::noAtomization::atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
p.liquidCore() = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::noAtomization
|
|
||||||
|
|
||||||
Description
|
|
||||||
secondary atomization model for the spray
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef noAtomization_H
|
|
||||||
#define noAtomization_H
|
|
||||||
|
|
||||||
#include "atomizationModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class noAtomization Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class noAtomization
|
|
||||||
:
|
|
||||||
public atomizationModel
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("off");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
noAtomization(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~noAtomization();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void atomizeParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,191 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "ETAB.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(ETAB, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
ETAB,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::ETAB::ETAB
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
Cmu_(readScalar(coeffsDict_.lookup("Cmu"))),
|
|
||||||
Comega_(readScalar(coeffsDict_.lookup("Comega"))),
|
|
||||||
k1_(readScalar(coeffsDict_.lookup("k1"))),
|
|
||||||
k2_(readScalar(coeffsDict_.lookup("k2"))),
|
|
||||||
WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))),
|
|
||||||
WeTransition_(readScalar(coeffsDict_.lookup("WeTransition"))),
|
|
||||||
AWe_(0.0)
|
|
||||||
{
|
|
||||||
scalar k21 = k2_/k1_;
|
|
||||||
AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow4(WeTransition_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::ETAB::~ETAB()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::ETAB::breakupParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar T = p.T();
|
|
||||||
scalar pc = spray_.p()[p.cell()];
|
|
||||||
scalar r = 0.5*p.d();
|
|
||||||
scalar r2 = r*r;
|
|
||||||
scalar r3 = r*r2;
|
|
||||||
|
|
||||||
scalar rho = fuels.rho(pc, T, p.X());
|
|
||||||
scalar sigma = fuels.sigma(pc, T, p.X());
|
|
||||||
scalar mu = fuels.mu(pc, T, p.X());
|
|
||||||
|
|
||||||
// inverse of characteristic viscous damping time
|
|
||||||
scalar rtd = 0.5*Cmu_*mu/(rho*r2);
|
|
||||||
|
|
||||||
// oscillation frequency (squared)
|
|
||||||
scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
|
|
||||||
|
|
||||||
if (omega2 > 0)
|
|
||||||
{
|
|
||||||
scalar omega = sqrt(omega2);
|
|
||||||
scalar romega = 1.0/omega;
|
|
||||||
|
|
||||||
scalar rhog = spray_.rho()[p.cell()];
|
|
||||||
scalar We = p.We(Ug, rhog, sigma);
|
|
||||||
scalar Wetmp = We/WeCrit_;
|
|
||||||
|
|
||||||
scalar y1 = p.dev() - Wetmp;
|
|
||||||
scalar y2 = p.ddev()*romega;
|
|
||||||
|
|
||||||
scalar a = sqrt(y1*y1 + y2*y2);
|
|
||||||
|
|
||||||
// scotty we may have break-up
|
|
||||||
if (a + Wetmp > 1.0)
|
|
||||||
{
|
|
||||||
scalar phic = y1/a;
|
|
||||||
|
|
||||||
// constrain phic within -1 to 1
|
|
||||||
phic = max(min(phic, 1), -1);
|
|
||||||
|
|
||||||
scalar phit = acos(phic);
|
|
||||||
scalar phi = phit;
|
|
||||||
scalar quad = -y2/a;
|
|
||||||
if (quad < 0)
|
|
||||||
{
|
|
||||||
phi = constant::mathematical::twoPi - phit;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar tb = 0;
|
|
||||||
|
|
||||||
if (mag(p.dev()) < 1.0)
|
|
||||||
{
|
|
||||||
scalar theta = acos((1.0 - Wetmp)/a);
|
|
||||||
|
|
||||||
if (theta < phi)
|
|
||||||
{
|
|
||||||
if (constant::mathematical::twoPi - theta >= phi)
|
|
||||||
{
|
|
||||||
theta = -theta;
|
|
||||||
}
|
|
||||||
theta += constant::mathematical::twoPi;
|
|
||||||
}
|
|
||||||
tb = (theta-phi)*romega;
|
|
||||||
|
|
||||||
// breakup occurs
|
|
||||||
if (deltaT > tb)
|
|
||||||
{
|
|
||||||
p.dev() = 1.0;
|
|
||||||
p.ddev() = -a*omega*sin(omega*tb + phi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// update droplet size
|
|
||||||
if (deltaT > tb)
|
|
||||||
{
|
|
||||||
scalar sqrtWe = AWe_*pow4(We) + 1.0;
|
|
||||||
scalar Kbr = k1_*omega*sqrtWe;
|
|
||||||
|
|
||||||
if (We > WeTransition_)
|
|
||||||
{
|
|
||||||
sqrtWe = sqrt(We);
|
|
||||||
Kbr = k2_*omega*sqrtWe;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar rWetmp = 1.0/Wetmp;
|
|
||||||
scalar cosdtbu = max(-1.0, min(1.0, 1.0 - rWetmp));
|
|
||||||
scalar dtbu = romega*acos(cosdtbu);
|
|
||||||
scalar decay = exp(-Kbr*dtbu);
|
|
||||||
|
|
||||||
scalar rNew = decay*r;
|
|
||||||
if (rNew < r)
|
|
||||||
{
|
|
||||||
p.d() = 2*rNew;
|
|
||||||
p.dev() = 0;
|
|
||||||
p.ddev() = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// reset droplet distortion parameters
|
|
||||||
p.dev() = 0;
|
|
||||||
p.ddev() = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::ETAB
|
|
||||||
|
|
||||||
Description
|
|
||||||
The Enhanced %TAB model.
|
|
||||||
|
|
||||||
Described in the papers below.
|
|
||||||
\verbatim
|
|
||||||
F.X. Tanner
|
|
||||||
"Liquid Jet Atomization and Droplet Breakup Modeling of
|
|
||||||
Non-Evaporating Diesel Fuel Sprays"
|
|
||||||
SAE 970050,
|
|
||||||
SAE Transactions: Journal of Engines, Vol 106, Sec 3 pp 127-140
|
|
||||||
|
|
||||||
F.X. Tanner and G. Weisser
|
|
||||||
"Simulation of Liquid Jet Atomization for
|
|
||||||
Fuel Sprays by Means of Cascade Drop Breakup Model"
|
|
||||||
SAE 980808
|
|
||||||
SAE Technical Paper Series
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
See Also
|
|
||||||
The TAB model
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
ETAB.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ETAB_H
|
|
||||||
#define ETAB_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ETAB Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class ETAB
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
|
|
||||||
// model constants
|
|
||||||
|
|
||||||
// Cmu_ and Comega_ are the same as in the TAB model
|
|
||||||
scalar Cmu_;
|
|
||||||
scalar Comega_;
|
|
||||||
|
|
||||||
scalar k1_;
|
|
||||||
scalar k2_;
|
|
||||||
scalar WeCrit_;
|
|
||||||
scalar WeTransition_;
|
|
||||||
scalar AWe_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ETAB");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
ETAB(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~ETAB();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,262 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "SHF.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(SHF, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
SHF,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::SHF::SHF
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
g_(sm.g()),
|
|
||||||
weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))),
|
|
||||||
weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))),
|
|
||||||
weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))),
|
|
||||||
weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))),
|
|
||||||
ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))),
|
|
||||||
ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))),
|
|
||||||
ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))),
|
|
||||||
ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))),
|
|
||||||
ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))),
|
|
||||||
ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))),
|
|
||||||
cInit_(readScalar(coeffsDict_.lookup("Cinit"))),
|
|
||||||
c1_(readScalar(coeffsDict_.lookup("C1"))),
|
|
||||||
c2_(readScalar(coeffsDict_.lookup("C2"))),
|
|
||||||
c3_(readScalar(coeffsDict_.lookup("C3"))),
|
|
||||||
cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))),
|
|
||||||
cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))),
|
|
||||||
cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))),
|
|
||||||
weConst_(readScalar(coeffsDict_.lookup("Weconst"))),
|
|
||||||
weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))),
|
|
||||||
weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))),
|
|
||||||
coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))),
|
|
||||||
onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))),
|
|
||||||
weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))),
|
|
||||||
mu_(readScalar(coeffsDict_.lookup("mu"))),
|
|
||||||
sigma_(readScalar(coeffsDict_.lookup("sigma"))),
|
|
||||||
d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))),
|
|
||||||
cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))),
|
|
||||||
cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))),
|
|
||||||
corePerc_(readScalar(coeffsDict_.lookup("corePerc")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::SHF::~SHF()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::SHF::breakupParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
label cellI = p.cell();
|
|
||||||
scalar T = p.T();
|
|
||||||
scalar pc = spray_.p()[cellI];
|
|
||||||
|
|
||||||
scalar sigma = fuels.sigma(pc, T, p.X());
|
|
||||||
scalar rhoLiquid = fuels.rho(pc, T, p.X());
|
|
||||||
scalar muLiquid = fuels.mu(pc, T, p.X());
|
|
||||||
scalar rhoGas = spray_.rho()[cellI];
|
|
||||||
|
|
||||||
scalar weGas = p.We(vel, rhoGas, sigma);
|
|
||||||
scalar weLiquid = p.We(vel, rhoLiquid, sigma);
|
|
||||||
|
|
||||||
// correct the Reynolds number. Reitz is using radius instead of diameter
|
|
||||||
|
|
||||||
scalar reLiquid = p.Re(rhoLiquid, vel, muLiquid);
|
|
||||||
scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL);
|
|
||||||
|
|
||||||
vector vRel = p.Urel(vel);
|
|
||||||
|
|
||||||
scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge);
|
|
||||||
|
|
||||||
// droplet deformation characteristic time
|
|
||||||
|
|
||||||
scalar tChar = p.d()/mag(vRel)*sqrt(rhoLiquid/rhoGas);
|
|
||||||
|
|
||||||
scalar tFirst = cInit_*tChar;
|
|
||||||
|
|
||||||
scalar tSecond = 0;
|
|
||||||
scalar tCharSecond = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// updating the droplet characteristic time
|
|
||||||
p.ct() += deltaT;
|
|
||||||
|
|
||||||
if (weGas > weConst_)
|
|
||||||
{
|
|
||||||
if (weGas < weCrit1_)
|
|
||||||
{
|
|
||||||
tCharSecond = c1_*pow((weGas - weConst_),cExp1_);
|
|
||||||
}
|
|
||||||
else if (weGas >= weCrit1_ && weGas <= weCrit2_)
|
|
||||||
{
|
|
||||||
tCharSecond = c2_*pow((weGas - weConst_),cExp2_);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tCharSecond = c3_*pow((weGas - weConst_),cExp3_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar weC = weBuCrit_*(1.0+ohnCoeffCrit_*pow(ohnesorge, ohnExpCrit_));
|
|
||||||
scalar weB = weBuBag_*(1.0+ohnCoeffBag_*pow(ohnesorge, ohnExpBag_));
|
|
||||||
scalar weMM = weBuMM_*(1.0+ohnCoeffMM_*pow(ohnesorge, ohnExpMM_));
|
|
||||||
|
|
||||||
bool bag = (weGas > weC && weGas < weB);
|
|
||||||
|
|
||||||
bool multimode = (weGas >= weB && weGas <= weMM);
|
|
||||||
|
|
||||||
bool shear = (weGas > weMM);
|
|
||||||
|
|
||||||
tSecond = tCharSecond*tChar;
|
|
||||||
|
|
||||||
scalar tBreakUP = tFirst + tSecond;
|
|
||||||
if (p.ct() > tBreakUP)
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar d32 =
|
|
||||||
coeffD_*p.d()*pow(ohnesorge, onExpD_)*pow(weGasCorr, weExpD_);
|
|
||||||
|
|
||||||
if (bag || multimode)
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar d05 = d32Coeff_*d32;
|
|
||||||
|
|
||||||
scalar x = 0.0;
|
|
||||||
scalar y = 0.0;
|
|
||||||
scalar d = 0.0;
|
|
||||||
scalar px = 0.0;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
x = cDmaxBM_*rndGen_.sample01<scalar>();
|
|
||||||
d = sqr(x)*d05;
|
|
||||||
y = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
px =
|
|
||||||
x
|
|
||||||
/(2.0*sqrt(constant::mathematical::twoPi)*sigma_)
|
|
||||||
*exp(-0.5*sqr((x-mu_)/sigma_));
|
|
||||||
|
|
||||||
} while (y >= px);
|
|
||||||
|
|
||||||
p.d() = d;
|
|
||||||
p.ct() = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shear)
|
|
||||||
{
|
|
||||||
scalar dC = weConst_*sigma/(rhoGas*sqr(mag(vRel)));
|
|
||||||
scalar d32Red = 4.0*(d32*dC)/(5.0*dC - d32);
|
|
||||||
scalar initMass = p.m();
|
|
||||||
|
|
||||||
scalar d05 = d32Coeff_*d32Red;
|
|
||||||
|
|
||||||
scalar x = 0.0;
|
|
||||||
scalar y = 0.0;
|
|
||||||
scalar d = 0.0;
|
|
||||||
scalar px = 0.0;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
|
|
||||||
x = cDmaxS_*rndGen_.sample01<scalar>();
|
|
||||||
d = sqr(x)*d05;
|
|
||||||
y = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
px =
|
|
||||||
x
|
|
||||||
/(2.0*sqrt(constant::mathematical::twoPi)*sigma_)
|
|
||||||
*exp(-0.5*sqr((x-mu_)/sigma_));
|
|
||||||
} while (y >= px);
|
|
||||||
|
|
||||||
p.d() = dC;
|
|
||||||
p.m() = corePerc_*initMass;
|
|
||||||
|
|
||||||
spray_.addParticle
|
|
||||||
(
|
|
||||||
new parcel
|
|
||||||
(
|
|
||||||
p.mesh(),
|
|
||||||
p.position(),
|
|
||||||
p.cell(),
|
|
||||||
p.tetFace(),
|
|
||||||
p.tetPt(),
|
|
||||||
p.n(),
|
|
||||||
d,
|
|
||||||
p.T(),
|
|
||||||
(1.0 - corePerc_)*initMass,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
-GREAT,
|
|
||||||
p.tTurb(),
|
|
||||||
0.0,
|
|
||||||
scalar(p.injector()),
|
|
||||||
p.U(),
|
|
||||||
p.Uturb(),
|
|
||||||
p.X(),
|
|
||||||
p.fuelNames()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
p.ct() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::SHF
|
|
||||||
|
|
||||||
Description
|
|
||||||
Secondary Breakup Model to take account of the different breakup regimes,
|
|
||||||
bag, molutimode, shear....
|
|
||||||
|
|
||||||
Accurate description in
|
|
||||||
\verbatim
|
|
||||||
R. Schmehl, G. Maier, S. Witting
|
|
||||||
"CFD Analysis of Fuel Atomization, Secondary Droplet Breakup and Spray
|
|
||||||
Dispersion in the Premix Duct of a LPP Combustor".
|
|
||||||
Eight International Conference on Liquid Atomization and Spray Systems, 2000
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef SHF_H
|
|
||||||
#define SHF_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class SHF Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class SHF
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
|
|
||||||
// reference to gravity
|
|
||||||
const vector& g_;
|
|
||||||
|
|
||||||
// model constants
|
|
||||||
|
|
||||||
scalar weCorrCoeff_;
|
|
||||||
|
|
||||||
scalar weBuCrit_;
|
|
||||||
scalar weBuBag_;
|
|
||||||
scalar weBuMM_;
|
|
||||||
|
|
||||||
scalar ohnCoeffCrit_;
|
|
||||||
scalar ohnCoeffBag_;
|
|
||||||
scalar ohnCoeffMM_;
|
|
||||||
|
|
||||||
scalar ohnExpCrit_;
|
|
||||||
scalar ohnExpBag_;
|
|
||||||
scalar ohnExpMM_;
|
|
||||||
|
|
||||||
scalar cInit_;
|
|
||||||
|
|
||||||
scalar c1_;
|
|
||||||
scalar c2_;
|
|
||||||
scalar c3_;
|
|
||||||
|
|
||||||
scalar cExp1_;
|
|
||||||
scalar cExp2_;
|
|
||||||
scalar cExp3_;
|
|
||||||
|
|
||||||
scalar weConst_;
|
|
||||||
scalar weCrit1_;
|
|
||||||
scalar weCrit2_;
|
|
||||||
|
|
||||||
scalar coeffD_;
|
|
||||||
scalar onExpD_;
|
|
||||||
scalar weExpD_;
|
|
||||||
|
|
||||||
scalar mu_;
|
|
||||||
scalar sigma_;
|
|
||||||
|
|
||||||
scalar d32Coeff_;
|
|
||||||
scalar cDmaxBM_;
|
|
||||||
scalar cDmaxS_;
|
|
||||||
|
|
||||||
scalar corePerc_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("SHF");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
SHF(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~SHF();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,208 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "TAB.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(TAB, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
TAB,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::TAB::TAB
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
Cmu_(readScalar(coeffsDict_.lookup("Cmu"))),
|
|
||||||
Comega_(readScalar(coeffsDict_.lookup("Comega"))),
|
|
||||||
WeCrit_(readScalar(coeffsDict_.lookup("WeCrit")))
|
|
||||||
{
|
|
||||||
|
|
||||||
// calculate the inverse function of the Rossin-Rammler Distribution
|
|
||||||
const scalar xx0 = 12.0;
|
|
||||||
const scalar rrd100 =
|
|
||||||
1.0/(1.0 - exp(-xx0)*(1 + xx0 + sqr(xx0)/2 + pow3(xx0)/6));
|
|
||||||
|
|
||||||
for (label n=0; n<100; n++)
|
|
||||||
{
|
|
||||||
scalar xx = 0.12*(n+1);
|
|
||||||
rrd_[n] = (1-exp(-xx)*(1 + xx + pow(xx, 2)/2 + pow(xx, 3)/6))*rrd100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::TAB::~TAB()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::TAB::breakupParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar T = p.T();
|
|
||||||
scalar pc = spray_.p()[p.cell()];
|
|
||||||
scalar r = 0.5*p.d();
|
|
||||||
scalar r2 = r*r;
|
|
||||||
scalar r3 = r*r2;
|
|
||||||
|
|
||||||
scalar rho = fuels.rho(pc, T, p.X());
|
|
||||||
scalar sigma = fuels.sigma(pc, T, p.X());
|
|
||||||
scalar mu = fuels.mu(pc, T, p.X());
|
|
||||||
|
|
||||||
// inverse of characteristic viscous damping time
|
|
||||||
scalar rtd = 0.5*Cmu_*mu/(rho*r2);
|
|
||||||
|
|
||||||
// oscillation frequency (squared)
|
|
||||||
scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
|
|
||||||
|
|
||||||
if (omega2 > 0)
|
|
||||||
{
|
|
||||||
scalar omega = sqrt(omega2);
|
|
||||||
scalar rhog = spray_.rho()[p.cell()];
|
|
||||||
scalar We = p.We(Ug, rhog, sigma);
|
|
||||||
scalar Wetmp = We/WeCrit_;
|
|
||||||
|
|
||||||
scalar y1 = p.dev() - Wetmp;
|
|
||||||
scalar y2 = p.ddev()/omega;
|
|
||||||
|
|
||||||
scalar a = sqrt(y1*y1 + y2*y2);
|
|
||||||
|
|
||||||
// scotty we may have break-up
|
|
||||||
if (a + Wetmp > 1.0)
|
|
||||||
{
|
|
||||||
scalar phic = y1/a;
|
|
||||||
|
|
||||||
// constrain phic within -1 to 1
|
|
||||||
phic = max(min(phic, 1), -1);
|
|
||||||
|
|
||||||
scalar phit = acos(phic);
|
|
||||||
scalar phi = phit;
|
|
||||||
scalar quad = -y2/a;
|
|
||||||
if (quad < 0)
|
|
||||||
{
|
|
||||||
phi = constant::mathematical::twoPi - phit;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar tb = 0;
|
|
||||||
|
|
||||||
if (mag(p.dev()) < 1.0)
|
|
||||||
{
|
|
||||||
scalar coste = 1.0;
|
|
||||||
if ((Wetmp - a < -1) && (p.ddev() < 0))
|
|
||||||
{
|
|
||||||
coste = -1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar theta = acos((coste-Wetmp)/a);
|
|
||||||
|
|
||||||
if (theta < phi)
|
|
||||||
{
|
|
||||||
if (constant::mathematical::twoPi - theta >= phi)
|
|
||||||
{
|
|
||||||
theta = -theta;
|
|
||||||
}
|
|
||||||
theta += constant::mathematical::twoPi;
|
|
||||||
}
|
|
||||||
tb = (theta - phi)/omega;
|
|
||||||
|
|
||||||
// breakup occurs
|
|
||||||
if (deltaT > tb)
|
|
||||||
{
|
|
||||||
p.dev() = 1.0;
|
|
||||||
p.ddev() = -a*omega*sin(omega*tb + phi);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// update droplet size
|
|
||||||
if (deltaT > tb)
|
|
||||||
{
|
|
||||||
scalar rs =
|
|
||||||
r
|
|
||||||
/(
|
|
||||||
1
|
|
||||||
+ (4.0/3.0)*sqr(p.dev())
|
|
||||||
+ rho*r3/(8*sigma)*sqr(p.ddev())
|
|
||||||
);
|
|
||||||
|
|
||||||
label n = 0;
|
|
||||||
bool found = false;
|
|
||||||
scalar random = rndGen_.sample01<scalar>();
|
|
||||||
while (!found && (n<99))
|
|
||||||
{
|
|
||||||
if (rrd_[n] > random)
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
n++;
|
|
||||||
|
|
||||||
}
|
|
||||||
scalar rNew = 0.04*n*rs;
|
|
||||||
if (rNew < r)
|
|
||||||
{
|
|
||||||
p.d() = 2*rNew;
|
|
||||||
p.dev() = 0;
|
|
||||||
p.ddev() = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// reset droplet distortion parameters
|
|
||||||
p.dev() = 0;
|
|
||||||
p.ddev() = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::TAB
|
|
||||||
|
|
||||||
Description
|
|
||||||
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
|
|
||||||
|
|
||||||
\verbatim
|
|
||||||
O'Rourke, P.J. and Amsden, A.A.,
|
|
||||||
"The TAB Method for Numerical Calculation of Spray Droplet Breakup,"
|
|
||||||
1987 SAE International Fuels and Lubricants Meeting and Exposition,
|
|
||||||
Toronto, Ontario, November 2-5, 1987,
|
|
||||||
Los Alamos National Laboratory document LA-UR-87-2105;
|
|
||||||
SAE Technical Paper Series, Paper 872089.
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
This implementation follows the kiva version.
|
|
||||||
|
|
||||||
See Also
|
|
||||||
The Enhanced %TAB model - ETAB
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
TABI.H
|
|
||||||
TAB.C
|
|
||||||
TABIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef TAB_H
|
|
||||||
#define TAB_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class TAB Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class TAB
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
|
|
||||||
// inverse function approximation
|
|
||||||
// of the Rossin-Rammler Distribution
|
|
||||||
// used when calculating the droplet size after breakup
|
|
||||||
scalar rrd_[100];
|
|
||||||
|
|
||||||
// model constants
|
|
||||||
|
|
||||||
scalar Cmu_;
|
|
||||||
scalar Comega_;
|
|
||||||
scalar WeCrit_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("TAB");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
TAB(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~TAB();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(breakupModel, 0);
|
|
||||||
defineRunTimeSelectionTable(breakupModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::breakupModel::breakupModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dict_(dict),
|
|
||||||
spray_(sm),
|
|
||||||
rndGen_(sm.rndGen()),
|
|
||||||
includeOscillation_(dict_.lookup("includeOscillation")),
|
|
||||||
TABcoeffsDict_(dict.subDict("TABCoeffs")),
|
|
||||||
y0_(0.0),
|
|
||||||
yDot0_(0.0),
|
|
||||||
TABComega_(0.0),
|
|
||||||
TABCmu_(0.0),
|
|
||||||
TABWeCrit_(0.0)
|
|
||||||
{
|
|
||||||
if (includeOscillation_)
|
|
||||||
{
|
|
||||||
y0_ = readScalar(TABcoeffsDict_.lookup("y0"));
|
|
||||||
yDot0_ = readScalar(TABcoeffsDict_.lookup("yDot0"));
|
|
||||||
TABComega_ = readScalar(TABcoeffsDict_.lookup("Comega"));
|
|
||||||
TABCmu_ = readScalar(TABcoeffsDict_.lookup("Cmu"));
|
|
||||||
TABWeCrit_ = readScalar(TABcoeffsDict_.lookup("WeCrit"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::breakupModel::~breakupModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::breakupModel::updateParcelProperties
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
if (includeOscillation_)
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar T = p.T();
|
|
||||||
scalar pc = spray_.p()[p.cell()];
|
|
||||||
scalar r = 0.5 * p.d();
|
|
||||||
scalar r2 = r*r;
|
|
||||||
scalar r3 = r*r2;
|
|
||||||
|
|
||||||
scalar rho = fuels.rho(pc, T, p.X());
|
|
||||||
scalar sigma = fuels.sigma(pc, T, p.X());
|
|
||||||
scalar mu = fuels.mu(pc, T, p.X());
|
|
||||||
|
|
||||||
// inverse of characteristic viscous damping time
|
|
||||||
scalar rtd = 0.5*TABCmu_*mu/(rho*r2);
|
|
||||||
|
|
||||||
// oscillation frequency (squared)
|
|
||||||
scalar omega2 = TABComega_ * sigma /(rho*r3) - rtd*rtd;
|
|
||||||
|
|
||||||
if (omega2 > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
scalar omega = sqrt(omega2);
|
|
||||||
scalar rhog = spray_.rho()[p.cell()];
|
|
||||||
scalar We = p.We(Ug, rhog, sigma);
|
|
||||||
scalar Wetmp = We/TABWeCrit_;
|
|
||||||
|
|
||||||
scalar y1 = p.dev() - Wetmp;
|
|
||||||
scalar y2 = p.ddev()/omega;
|
|
||||||
|
|
||||||
// update distortion parameters
|
|
||||||
scalar c = cos(omega*deltaT);
|
|
||||||
scalar s = sin(omega*deltaT);
|
|
||||||
scalar e = exp(-rtd*deltaT);
|
|
||||||
y2 = (p.ddev() + y1*rtd)/omega;
|
|
||||||
|
|
||||||
p.dev() = Wetmp + e*(y1*c + y2*s);
|
|
||||||
if (p.dev() < 0)
|
|
||||||
{
|
|
||||||
p.dev() = 0.0;
|
|
||||||
p.ddev() = 0.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p.ddev() = (Wetmp-p.dev())*rtd + e*omega*(y2*c - y1*s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// reset droplet distortion parameters
|
|
||||||
p.dev() = 0;
|
|
||||||
p.ddev() = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,151 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::breakupModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Base class for selecting a breakup model
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef breakupModel_H
|
|
||||||
#define breakupModel_H
|
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
|
||||||
#include "spray.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class breakupModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class breakupModel
|
|
||||||
{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
const dictionary& dict_;
|
|
||||||
|
|
||||||
spray& spray_;
|
|
||||||
cachedRandom& rndGen_;
|
|
||||||
|
|
||||||
Switch includeOscillation_;
|
|
||||||
|
|
||||||
dictionary TABcoeffsDict_;
|
|
||||||
scalar y0_;
|
|
||||||
scalar yDot0_;
|
|
||||||
scalar TABComega_;
|
|
||||||
scalar TABCmu_;
|
|
||||||
scalar TABWeCrit_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("breakupModel");
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
breakupModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
),
|
|
||||||
(dict, sm)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
breakupModel(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~breakupModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
|
||||||
|
|
||||||
static autoPtr<breakupModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the initial deviation from sphericity
|
|
||||||
inline scalar y0() const
|
|
||||||
{
|
|
||||||
return y0_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the initial rate of deviation from sphericity
|
|
||||||
inline scalar yDot0() const
|
|
||||||
{
|
|
||||||
return yDot0_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateParcelProperties
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& Ug,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
|
|
||||||
virtual void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "breakupModel.H"
|
|
||||||
#include "noBreakup.H"
|
|
||||||
#include "reitzDiwakar.H"
|
|
||||||
#include "reitzKHRT.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::breakupModel> Foam::breakupModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word modelType(dict.lookup("breakupModel"));
|
|
||||||
|
|
||||||
Info<< "Selecting breakupModel " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn("breakupModel::New(const dictionary&, const spray&)")
|
|
||||||
<< "Unknown breakupModel type "
|
|
||||||
<< modelType << nl << nl
|
|
||||||
<< "Valid breakupModel types are :" << nl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<breakupModel>(cstrIter()(dict, sm));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "noBreakup.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(noBreakup, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
noBreakup,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noBreakup::noBreakup
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noBreakup::~noBreakup()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::noBreakup::breakupParcel
|
|
||||||
(
|
|
||||||
parcel&,
|
|
||||||
const scalar,
|
|
||||||
const vector&,
|
|
||||||
const liquidMixtureProperties&
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::noBreakup
|
|
||||||
|
|
||||||
Description
|
|
||||||
Spray breakup "off"
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
noBreakupI.H
|
|
||||||
noBreakup.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef noBreakup_H
|
|
||||||
#define noBreakup_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class noBreakup Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class noBreakup
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("off");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
noBreakup(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~noBreakup();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "reitzDiwakar.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "basicMultiComponentMixture.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(reitzDiwakar, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
reitzDiwakar,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::reitzDiwakar::reitzDiwakar
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
Cbag_(readScalar(coeffsDict_.lookup("Cbag"))),
|
|
||||||
Cb_(readScalar(coeffsDict_.lookup("Cb"))),
|
|
||||||
Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))),
|
|
||||||
Cs_(readScalar(coeffsDict_.lookup("Cs")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::reitzDiwakar::~reitzDiwakar()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::reitzDiwakar::breakupParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const PtrList<volScalarField>& Y = spray_.composition().Y();
|
|
||||||
|
|
||||||
label cellI = p.cell();
|
|
||||||
scalar pressure = spray_.p()[cellI];
|
|
||||||
scalar temperature = spray_.T()[cellI];
|
|
||||||
scalar Taverage = p.T() + (temperature - p.T())/3.0;
|
|
||||||
|
|
||||||
scalar muAverage = 0.0;
|
|
||||||
scalar Winv = 0.0;
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
|
|
||||||
muAverage += Y[i][cellI]*spray_.gasProperties()[i].mu(Taverage);
|
|
||||||
}
|
|
||||||
scalar R = specie::RR*Winv;
|
|
||||||
|
|
||||||
// ideal gas law to evaluate density
|
|
||||||
scalar rhoAverage = pressure/R/Taverage;
|
|
||||||
scalar nuAverage = muAverage/rhoAverage;
|
|
||||||
scalar sigma = fuels.sigma(pressure, p.T(), p.X());
|
|
||||||
|
|
||||||
|
|
||||||
// The We and Re numbers are to be evaluated using the 1/3 rule.
|
|
||||||
|
|
||||||
scalar WeberNumber = p.We(vel, rhoAverage, sigma);
|
|
||||||
scalar ReynoldsNumber = p.Re(vel, nuAverage);
|
|
||||||
|
|
||||||
scalar sqRey = sqrt(ReynoldsNumber);
|
|
||||||
|
|
||||||
if (WeberNumber > Cbag_)
|
|
||||||
{
|
|
||||||
if (WeberNumber > Cstrip_*sqRey)
|
|
||||||
{
|
|
||||||
scalar dStrip =
|
|
||||||
sqr(2.0*Cstrip_*sigma)
|
|
||||||
/(
|
|
||||||
rhoAverage
|
|
||||||
*pow3(mag(p.Urel(vel)))
|
|
||||||
*muAverage
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar tauStrip =
|
|
||||||
Cs_*p.d()
|
|
||||||
*sqrt(fuels.rho(pressure, p.T(), p.X())/rhoAverage)
|
|
||||||
/mag(p.Urel(vel));
|
|
||||||
|
|
||||||
scalar fraction = deltaT/tauStrip;
|
|
||||||
|
|
||||||
// new droplet diameter, implicit calculation
|
|
||||||
p.d() = (fraction*dStrip + p.d())/(1.0 + fraction);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar dBag = 2.0*Cbag_*sigma/(rhoAverage*sqr(mag(p.Urel(vel))));
|
|
||||||
|
|
||||||
scalar tauBag =
|
|
||||||
Cb_*p.d()*sqrt(fuels.rho(pressure, p.T(), p.X())*p.d()/sigma);
|
|
||||||
|
|
||||||
scalar fraction = deltaT/tauBag;
|
|
||||||
|
|
||||||
// new droplet diameter, implicit calculation
|
|
||||||
p.d() = (fraction*dBag + p.d())/(1.0 + fraction);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::reitzDiwakar
|
|
||||||
|
|
||||||
Description
|
|
||||||
secondary breakup model for the spray
|
|
||||||
|
|
||||||
Default model coefficients:
|
|
||||||
Cbag = 6.0;
|
|
||||||
Cb = 0.785;
|
|
||||||
Cstrip = 0.5;
|
|
||||||
Cs = 10.0;
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef reitzDiwakar_H
|
|
||||||
#define reitzDiwakar_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class reitzDiwakar Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class reitzDiwakar
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
scalar Cbag_;
|
|
||||||
scalar Cb_;
|
|
||||||
scalar Cstrip_;
|
|
||||||
scalar Cs_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ReitzDiwakar");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
reitzDiwakar(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~reitzDiwakar();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,229 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "reitzKHRT.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(reitzKHRT, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
breakupModel,
|
|
||||||
reitzKHRT,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::reitzKHRT::reitzKHRT
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
breakupModel(dict, sm),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
g_(sm.g()),
|
|
||||||
b0_(readScalar(coeffsDict_.lookup("B0"))),
|
|
||||||
b1_(readScalar(coeffsDict_.lookup("B1"))),
|
|
||||||
cTau_(readScalar(coeffsDict_.lookup("Ctau"))),
|
|
||||||
cRT_(readScalar(coeffsDict_.lookup("CRT"))),
|
|
||||||
msLimit_(readScalar(coeffsDict_.lookup("msLimit"))),
|
|
||||||
weberLimit_(readScalar(coeffsDict_.lookup("WeberLimit")))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::reitzKHRT::~reitzKHRT()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::reitzKHRT::breakupParcel
|
|
||||||
(
|
|
||||||
parcel& p,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
label cellI = p.cell();
|
|
||||||
scalar T = p.T();
|
|
||||||
scalar r = 0.5*p.d();
|
|
||||||
scalar pc = spray_.p()[cellI];
|
|
||||||
|
|
||||||
scalar sigma = fuels.sigma(pc, T, p.X());
|
|
||||||
scalar rhoLiquid = fuels.rho(pc, T, p.X());
|
|
||||||
scalar muLiquid = fuels.mu(pc, T, p.X());
|
|
||||||
scalar rhoGas = spray_.rho()[cellI];
|
|
||||||
scalar Np = p.N(rhoLiquid);
|
|
||||||
scalar semiMass = Np*pow3(p.d());
|
|
||||||
|
|
||||||
scalar weGas = p.We(vel, rhoGas, sigma);
|
|
||||||
scalar weLiquid = p.We(vel, rhoLiquid, sigma);
|
|
||||||
// correct the Reynolds number. Reitz is using radius instead of diameter
|
|
||||||
scalar reLiquid = 0.5*p.Re(rhoLiquid, vel, muLiquid);
|
|
||||||
scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL);
|
|
||||||
scalar taylor = ohnesorge*sqrt(weGas);
|
|
||||||
|
|
||||||
vector acceleration = p.Urel(vel)/p.tMom();
|
|
||||||
vector trajectory = p.U()/mag(p.U());
|
|
||||||
scalar gt = (g_ + acceleration) & trajectory;
|
|
||||||
|
|
||||||
// frequency of the fastest growing KH-wave
|
|
||||||
scalar omegaKH =
|
|
||||||
(0.34 + 0.38*pow(weGas, 1.5))
|
|
||||||
/((1 + ohnesorge)*(1 + 1.4*pow(taylor, 0.6)))
|
|
||||||
*sqrt(sigma/(rhoLiquid*pow3(r)));
|
|
||||||
|
|
||||||
// corresponding KH wave-length.
|
|
||||||
scalar lambdaKH =
|
|
||||||
9.02
|
|
||||||
*r
|
|
||||||
*(1.0 + 0.45*sqrt(ohnesorge))
|
|
||||||
*(1.0 + 0.4*pow(taylor, 0.7))
|
|
||||||
/pow(1.0 + 0.865*pow(weGas, 1.67), 0.6);
|
|
||||||
|
|
||||||
// characteristic Kelvin-Helmholtz breakup time
|
|
||||||
scalar tauKH = 3.726*b1_*r/(omegaKH*lambdaKH);
|
|
||||||
|
|
||||||
// stable KH diameter
|
|
||||||
scalar dc = 2.0*b0_*lambdaKH;
|
|
||||||
|
|
||||||
// the frequency of the fastest growing RT wavelength.
|
|
||||||
scalar helpVariable = mag(gt*(rhoLiquid - rhoGas));
|
|
||||||
scalar omegaRT = sqrt
|
|
||||||
(
|
|
||||||
2.0*pow(helpVariable, 1.5)
|
|
||||||
/(3.0*sqrt(3.0*sigma)*(rhoGas + rhoLiquid))
|
|
||||||
);
|
|
||||||
|
|
||||||
// RT wave number
|
|
||||||
scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL));
|
|
||||||
|
|
||||||
// wavelength of the fastest growing RT frequency
|
|
||||||
scalar lambdaRT = constant::mathematical::twoPi*cRT_/(KRT + VSMALL);
|
|
||||||
|
|
||||||
// if lambdaRT < diameter, then RT waves are growing on the surface
|
|
||||||
// and we start to keep track of how long they have been growing
|
|
||||||
if ((p.ct() > 0) || (lambdaRT < p.d()))
|
|
||||||
{
|
|
||||||
p.ct() += deltaT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// characteristic RT breakup time
|
|
||||||
scalar tauRT = cTau_/(omegaRT + VSMALL);
|
|
||||||
|
|
||||||
// check if we have RT breakup
|
|
||||||
if ((p.ct() > tauRT) && (lambdaRT < p.d()))
|
|
||||||
{
|
|
||||||
// the RT breakup creates diameter/lambdaRT new droplets
|
|
||||||
p.ct() = -GREAT;
|
|
||||||
scalar multiplier = p.d()/lambdaRT;
|
|
||||||
scalar nDrops = multiplier*Np;
|
|
||||||
p.d() = cbrt(semiMass/nDrops);
|
|
||||||
}
|
|
||||||
// otherwise check for KH breakup
|
|
||||||
else if (dc < p.d())
|
|
||||||
{
|
|
||||||
// no breakup below Weber = 12
|
|
||||||
if (weGas > weberLimit_)
|
|
||||||
{
|
|
||||||
label injector = label(p.injector());
|
|
||||||
scalar fraction = deltaT/tauKH;
|
|
||||||
|
|
||||||
// reduce the diameter according to the rate-equation
|
|
||||||
p.d() = (fraction*dc + p.d())/(1.0 + fraction);
|
|
||||||
|
|
||||||
scalar ms = rhoLiquid*Np*pow3(dc)*constant::mathematical::pi/6.0;
|
|
||||||
p.ms() += ms;
|
|
||||||
|
|
||||||
// Total number of parcels for the whole injection event
|
|
||||||
label nParcels =
|
|
||||||
spray_.injectors()[injector].properties()->nParcelsToInject
|
|
||||||
(
|
|
||||||
spray_.injectors()[injector].properties()->tsoi(),
|
|
||||||
spray_.injectors()[injector].properties()->teoi()
|
|
||||||
);
|
|
||||||
|
|
||||||
scalar averageParcelMass =
|
|
||||||
spray_.injectors()[injector].properties()->mass()/nParcels;
|
|
||||||
|
|
||||||
if (p.ms()/averageParcelMass > msLimit_)
|
|
||||||
{
|
|
||||||
// set the initial ms value to -GREAT. This prevents
|
|
||||||
// new droplets from being formed from the child droplet
|
|
||||||
// from the KH instability
|
|
||||||
|
|
||||||
// mass of stripped child parcel
|
|
||||||
scalar mc = p.ms();
|
|
||||||
// Prevent child parcel from taking too much mass
|
|
||||||
mc = min(mc, 0.5*p.m());
|
|
||||||
|
|
||||||
spray_.addParticle
|
|
||||||
(
|
|
||||||
new parcel
|
|
||||||
(
|
|
||||||
p.mesh(),
|
|
||||||
p.position(),
|
|
||||||
p.cell(),
|
|
||||||
p.tetFace(),
|
|
||||||
p.tetPt(),
|
|
||||||
p.n(),
|
|
||||||
dc,
|
|
||||||
p.T(),
|
|
||||||
mc,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
-GREAT,
|
|
||||||
p.tTurb(),
|
|
||||||
0.0,
|
|
||||||
p.injector(),
|
|
||||||
p.U(),
|
|
||||||
p.Uturb(),
|
|
||||||
p.X(),
|
|
||||||
p.fuelNames()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
p.m() -= mc;
|
|
||||||
p.ms() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::reitzKHRT
|
|
||||||
|
|
||||||
Description
|
|
||||||
secondary breakup model which uses the Kelvin-Helmholtz
|
|
||||||
instability theory to predict the 'stripped' droplets... and
|
|
||||||
the Raleigh-Taylor instability as well.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef reitzKHRT_H
|
|
||||||
#define reitzKHRT_H
|
|
||||||
|
|
||||||
#include "breakupModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class reitzKHRT Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class reitzKHRT
|
|
||||||
:
|
|
||||||
public breakupModel
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
|
|
||||||
// reference to gravity
|
|
||||||
const vector& g_;
|
|
||||||
|
|
||||||
// model constants
|
|
||||||
scalar b0_;
|
|
||||||
scalar b1_;
|
|
||||||
scalar cTau_;
|
|
||||||
scalar cRT_;
|
|
||||||
scalar msLimit_;
|
|
||||||
scalar weberLimit_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ReitzKHRT");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
reitzKHRT(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~reitzKHRT();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void breakupParcel
|
|
||||||
(
|
|
||||||
parcel& parcel,
|
|
||||||
const scalar deltaT,
|
|
||||||
const vector& vel,
|
|
||||||
const liquidMixtureProperties& fuels
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "ORourkeCollisionModel.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(ORourkeCollisionModel, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
collisionModel,
|
|
||||||
ORourkeCollisionModel,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::ORourkeCollisionModel::ORourkeCollisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
)
|
|
||||||
:
|
|
||||||
collisionModel(dict, sm, rndGen),
|
|
||||||
vols_(sm.mesh().V()),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
coalescence_(coeffsDict_.lookup("coalescence"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::ORourkeCollisionModel::~ORourkeCollisionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::ORourkeCollisionModel::collideParcels(const scalar dt) const
|
|
||||||
{
|
|
||||||
if (spray_.size() < 2)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
spray::iterator secondParcel = spray_.begin();
|
|
||||||
++secondParcel;
|
|
||||||
spray::iterator p1 = secondParcel;
|
|
||||||
|
|
||||||
while (p1 != spray_.end())
|
|
||||||
{
|
|
||||||
label cell1 = p1().cell();
|
|
||||||
|
|
||||||
spray::iterator p2 = spray_.begin();
|
|
||||||
|
|
||||||
while (p2 != p1)
|
|
||||||
{
|
|
||||||
label cell2 = p2().cell();
|
|
||||||
|
|
||||||
// No collision if parcels are not in the same cell
|
|
||||||
if (cell1 == cell2)
|
|
||||||
{
|
|
||||||
#include "sameCell.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove coalesced droplet
|
|
||||||
if (p2().m() < VSMALL)
|
|
||||||
{
|
|
||||||
spray::iterator tmpElmnt = p2;
|
|
||||||
++tmpElmnt;
|
|
||||||
spray_.deleteParticle(p2());
|
|
||||||
p2 = tmpElmnt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++p2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove coalesced droplet
|
|
||||||
if (p1().m() < VSMALL)
|
|
||||||
{
|
|
||||||
spray::iterator tmpElmnt = p1;
|
|
||||||
++tmpElmnt;
|
|
||||||
spray_.deleteParticle(p1());
|
|
||||||
p1 = tmpElmnt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++p1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::ORourkeCollisionModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Collision model by P.J. O'Rourke.
|
|
||||||
|
|
||||||
Implemented as described in the KIVA manual
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ORourkeCollisionModel_H
|
|
||||||
#define ORourkeCollisionModel_H
|
|
||||||
|
|
||||||
#include "collisionModel.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ORourkeCollisionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class ORourkeCollisionModel
|
|
||||||
:
|
|
||||||
public collisionModel
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Reference to the cell volumes
|
|
||||||
const scalarField& vols_;
|
|
||||||
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
Switch coalescence_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("ORourke");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
ORourkeCollisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~ORourkeCollisionModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void collideParcels(const scalar dt) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,160 +0,0 @@
|
|||||||
vector v1 = p1().U();
|
|
||||||
vector v2 = p2().U();
|
|
||||||
|
|
||||||
vector vRel = v1 - v2;
|
|
||||||
scalar magVRel = mag(vRel);
|
|
||||||
|
|
||||||
scalar sumD = p1().d() + p2().d();
|
|
||||||
scalar pc = spray_.p()[p1().cell()];
|
|
||||||
|
|
||||||
spray::iterator pMin = p1;
|
|
||||||
spray::iterator pMax = p2;
|
|
||||||
|
|
||||||
scalar dMin = pMin().d();
|
|
||||||
scalar dMax = pMax().d();
|
|
||||||
|
|
||||||
if (dMin > dMax)
|
|
||||||
{
|
|
||||||
dMin = pMax().d();
|
|
||||||
dMax = pMin().d();
|
|
||||||
pMin = p2;
|
|
||||||
pMax = p1;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X());
|
|
||||||
scalar rhoMin = spray_.fuels().rho(pc, pMin().T(), pMin().X());
|
|
||||||
scalar mMax = pMax().m();
|
|
||||||
scalar mMin = pMin().m();
|
|
||||||
scalar mTot = mMax + mMin;
|
|
||||||
|
|
||||||
scalar nMax = pMax().N(rhoMax);
|
|
||||||
scalar nMin = pMin().N(rhoMin);
|
|
||||||
|
|
||||||
scalar mdMin = mMin/nMin;
|
|
||||||
|
|
||||||
scalar nu0 = 0.25*constant::mathematical::pi*sqr(sumD)*magVRel*dt/vols_[cell1];
|
|
||||||
scalar nu = nMin*nu0;
|
|
||||||
scalar collProb = exp(-nu);
|
|
||||||
scalar xx = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
if ((xx > collProb) && (mMin > VSMALL) && (mMax > VSMALL))
|
|
||||||
{
|
|
||||||
// collision occurs
|
|
||||||
|
|
||||||
scalar gamma = dMax/max(dMin, 1.0e-12);
|
|
||||||
scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma;
|
|
||||||
|
|
||||||
vector momMax = mMax*pMax().U();
|
|
||||||
vector momMin = mMin*pMin().U();
|
|
||||||
|
|
||||||
// use mass-averaged temperature to calculate We number
|
|
||||||
scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot;
|
|
||||||
// and mass averaged mole fractions ...
|
|
||||||
scalarField Xav
|
|
||||||
(
|
|
||||||
(pMax().m()*pMax().X()+pMin().m()*pMin().X())
|
|
||||||
/(pMax().m() + pMin().m())
|
|
||||||
);
|
|
||||||
scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav);
|
|
||||||
sigma = max(1.0e-6, sigma);
|
|
||||||
scalar rho = spray_.fuels().rho(pc, averageTemp, Xav);
|
|
||||||
|
|
||||||
scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMin/sigma);
|
|
||||||
|
|
||||||
scalar coalesceProb = min(1.0, 2.4*f/WeColl);
|
|
||||||
scalar prob = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
// Coalescence
|
|
||||||
if (prob < coalesceProb && coalescence_)
|
|
||||||
{
|
|
||||||
// How 'many' of the droplets coalesce
|
|
||||||
// This is the kiva way ... which actually works best
|
|
||||||
|
|
||||||
scalar zz = collProb;
|
|
||||||
scalar vnu = nu*collProb;
|
|
||||||
label n=2;
|
|
||||||
|
|
||||||
// xx > collProb=zz
|
|
||||||
while ((zz < xx) && (n<1000))
|
|
||||||
{
|
|
||||||
zz += vnu;
|
|
||||||
vnu *= nu/n;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
scalar nProb = n - 1;
|
|
||||||
|
|
||||||
// All droplets coalesce
|
|
||||||
if (nProb*nMax > nMin)
|
|
||||||
{
|
|
||||||
nProb = nMin/nMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Conservation of mass, momentum and energy
|
|
||||||
pMin().m() -= nProb*nMax*mdMin;
|
|
||||||
|
|
||||||
scalar newMinMass = pMin().m();
|
|
||||||
scalar newMaxMass = mMax + (mMin - newMinMass);
|
|
||||||
pMax().m() = newMaxMass;
|
|
||||||
|
|
||||||
pMax().T() = (averageTemp*mTot - newMinMass*pMin().T())/newMaxMass;
|
|
||||||
rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X());
|
|
||||||
scalar d3 = pow3(dMax) + nProb*pow3(dMin);
|
|
||||||
pMax().d() = cbrt(d3);
|
|
||||||
pMax().U() = (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass;
|
|
||||||
|
|
||||||
// update the liquid molar fractions
|
|
||||||
scalarField Ymin(spray_.fuels().Y(pMin().X()));
|
|
||||||
scalarField Ymax(spray_.fuels().Y(pMax().X()));
|
|
||||||
scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin);
|
|
||||||
scalar Wlinv = 0.0;
|
|
||||||
forAll(Ynew, i)
|
|
||||||
{
|
|
||||||
Wlinv += Ynew[i]/spray_.fuels().properties()[i].W();
|
|
||||||
}
|
|
||||||
forAll(Ynew, i)
|
|
||||||
{
|
|
||||||
pMax().X()[i] = Ynew[i]/(spray_.fuels().properties()[i].W()*Wlinv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Grazing collision (no coalescence)
|
|
||||||
|
|
||||||
scalar gf = sqrt(prob) - sqrt(coalesceProb);
|
|
||||||
scalar denom = 1.0 - sqrt(coalesceProb);
|
|
||||||
if (denom < 1.0e-5)
|
|
||||||
{
|
|
||||||
denom = 1.0;
|
|
||||||
}
|
|
||||||
gf /= denom;
|
|
||||||
|
|
||||||
// if gf negative, this means that coalescence is turned off
|
|
||||||
// and these parcels should have coalesced
|
|
||||||
gf = max(0.0, gf);
|
|
||||||
|
|
||||||
scalar rho1 = spray_.fuels().rho(pc, p1().T(), p1().X());
|
|
||||||
scalar rho2 = spray_.fuels().rho(pc, p2().T(), p2().X());
|
|
||||||
scalar m1 = p1().m();
|
|
||||||
scalar m2 = p2().m();
|
|
||||||
scalar n1 = p1().N(rho1);
|
|
||||||
scalar n2 = p2().N(rho2);
|
|
||||||
|
|
||||||
// gf -> 1 => v1p -> p1().U() ...
|
|
||||||
// gf -> 0 => v1p -> momentum/(m1+m2)
|
|
||||||
vector mr = m1*v1 + m2*v2;
|
|
||||||
vector v1p = (mr + m2*gf*vRel)/(m1+m2);
|
|
||||||
vector v2p = (mr - m1*gf*vRel)/(m1+m2);
|
|
||||||
|
|
||||||
if (n1 < n2)
|
|
||||||
{
|
|
||||||
p1().U() = v1p;
|
|
||||||
p2().U() = (n1*v2p + (n2-n1)*v2)/n2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p1().U() = (n2*v1p + (n1-n2)*v1)/n1;
|
|
||||||
p2().U() = v2p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "collisionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(collisionModel, 0);
|
|
||||||
defineRunTimeSelectionTable(collisionModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::collisionModel::collisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dict_(dict),
|
|
||||||
spray_(sm),
|
|
||||||
rndGen_(rndGen)
|
|
||||||
// coeffsDict_(dict.subDict(typeName + "Coeffs"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::collisionModel::~collisionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::collisionModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Base case for selecting a collision model
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef collisionModel_H
|
|
||||||
#define collisionModel_H
|
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
|
||||||
#include "spray.H"
|
|
||||||
#include "cachedRandom.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "autoPtr.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class collisionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class collisionModel
|
|
||||||
{
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
const dictionary& dict_;
|
|
||||||
spray& spray_;
|
|
||||||
cachedRandom& rndGen_;
|
|
||||||
|
|
||||||
//dictionary coeffsDict_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("collisionModel");
|
|
||||||
|
|
||||||
// Declare runtime constructor selection table
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
collisionModel,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
),
|
|
||||||
(dict, sm, rndGen)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
collisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~collisionModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Selector
|
|
||||||
|
|
||||||
static autoPtr<collisionModel> New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
virtual void collideParcels(const scalar dt) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "collisionModel.H"
|
|
||||||
#include "noCollision.H"
|
|
||||||
#include "ORourkeCollisionModel.H"
|
|
||||||
#include "trajectoryModel.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::collisionModel> Foam::collisionModel::New
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const word modelType(dict.lookup("collisionModel"));
|
|
||||||
|
|
||||||
Info<< "Selecting collisionModel " << modelType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"collisionModel::New(const dictionary&, const spray&)"
|
|
||||||
) << "Unknown collisionModel type "
|
|
||||||
<< modelType << nl << nl
|
|
||||||
<< "Valid collisionModel types are :" << nl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return autoPtr<collisionModel>(cstrIter()(dict, sm, rndGen));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "noCollision.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(noCollision, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
collisionModel,
|
|
||||||
noCollision,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noCollision::noCollision
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
)
|
|
||||||
:
|
|
||||||
collisionModel(dict, sm, rndGen)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::noCollision::~noCollision()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::noCollision::collideParcels(const scalar) const
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::noCollision
|
|
||||||
|
|
||||||
Description
|
|
||||||
No collisions between parcels
|
|
||||||
All parcels move independently of eachother
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef noCollision_H
|
|
||||||
#define noCollision_H
|
|
||||||
|
|
||||||
#include "collisionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class noCollision Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class noCollision
|
|
||||||
:
|
|
||||||
public collisionModel
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("off");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
noCollision
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~noCollision();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void collideParcels(const scalar dt) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,205 +0,0 @@
|
|||||||
vector v1 = p1().U();
|
|
||||||
vector v2 = p2().U();
|
|
||||||
scalar pc = spray_.p()[p1().cell()];
|
|
||||||
|
|
||||||
vector vRel = v1 - v2;
|
|
||||||
scalar magVRel = mag(vRel);
|
|
||||||
|
|
||||||
vector p = p2().position() - p1().position();
|
|
||||||
scalar dist = mag(p);
|
|
||||||
|
|
||||||
scalar vAlign = vRel & (p/(dist+SMALL));
|
|
||||||
|
|
||||||
if (vAlign > 0)
|
|
||||||
{
|
|
||||||
scalar sumD = p1().d() + p2().d();
|
|
||||||
|
|
||||||
if (vAlign*dt > dist - 0.5*sumD)
|
|
||||||
{
|
|
||||||
scalar v1Mag = mag(v1);
|
|
||||||
scalar v2Mag = mag(v2);
|
|
||||||
vector nv1 = v1/v1Mag;
|
|
||||||
vector nv2 = v2/v2Mag;
|
|
||||||
|
|
||||||
scalar v1v2 = nv1 & nv2;
|
|
||||||
scalar v1p = nv1 & p;
|
|
||||||
scalar v2p = nv2 & p;
|
|
||||||
|
|
||||||
scalar det = 1.0 - v1v2*v1v2;
|
|
||||||
|
|
||||||
scalar alpha = 1.0e+20;
|
|
||||||
scalar beta = 1.0e+20;
|
|
||||||
|
|
||||||
if (mag(det) > 1.0e-4)
|
|
||||||
{
|
|
||||||
beta = -(v2p - v1v2*v1p)/det;
|
|
||||||
alpha = v1p + v1v2*beta;
|
|
||||||
}
|
|
||||||
|
|
||||||
alpha /= v1Mag*dt;
|
|
||||||
beta /= v2Mag*dt;
|
|
||||||
|
|
||||||
// is collision possible within this timestep
|
|
||||||
if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0))
|
|
||||||
{
|
|
||||||
vector p1c = p1().position() + alpha*v1*dt;
|
|
||||||
vector p2c = p2().position() + beta*v2*dt;
|
|
||||||
|
|
||||||
scalar closestDist = mag(p1c-p2c);
|
|
||||||
|
|
||||||
scalar collProb =
|
|
||||||
pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_)
|
|
||||||
*exp(-cTime_*mag(alpha-beta));
|
|
||||||
|
|
||||||
scalar xx = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
spray::iterator pMin = p1;
|
|
||||||
spray::iterator pMax = p2;
|
|
||||||
|
|
||||||
scalar dMin = pMin().d();
|
|
||||||
scalar dMax = pMax().d();
|
|
||||||
|
|
||||||
if (dMin > dMax)
|
|
||||||
{
|
|
||||||
dMin = pMax().d();
|
|
||||||
dMax = pMin().d();
|
|
||||||
pMin = p2;
|
|
||||||
pMax = p1;
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X());
|
|
||||||
scalar rhoMin = spray_.fuels().rho(pc, pMin().T(), pMin().X());
|
|
||||||
scalar mMax = pMax().m();
|
|
||||||
scalar mMin = pMin().m();
|
|
||||||
scalar nMax = pMax().N(rhoMax);
|
|
||||||
scalar nMin = pMin().N(rhoMin);
|
|
||||||
|
|
||||||
scalar mdMin = mMin/nMin;
|
|
||||||
|
|
||||||
// collision occur
|
|
||||||
if ((xx < collProb) && (mMin > VSMALL) && (mMax > VSMALL))
|
|
||||||
{
|
|
||||||
scalar mTot = mMax + mMin;
|
|
||||||
|
|
||||||
scalar gamma = dMax/max(dMin, 1.0e-12);
|
|
||||||
scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma;
|
|
||||||
|
|
||||||
vector momMax = mMax*pMax().U();
|
|
||||||
vector momMin = mMin*pMin().U();
|
|
||||||
|
|
||||||
// use mass-averaged temperature to calculate We number
|
|
||||||
scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot;
|
|
||||||
// and mass averaged mole fractions ...
|
|
||||||
scalarField
|
|
||||||
Xav((pMax().m()*pMax().X()+pMin().m()*pMin().X())
|
|
||||||
/(pMax().m() + pMin().m()));
|
|
||||||
|
|
||||||
scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav);
|
|
||||||
sigma = max(1.0e-6, sigma);
|
|
||||||
scalar rho = spray_.fuels().rho(pc, averageTemp, Xav);
|
|
||||||
|
|
||||||
scalar dMean = sqrt(dMin*dMax);
|
|
||||||
scalar WeColl =
|
|
||||||
max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma);
|
|
||||||
|
|
||||||
// coalescence only possible when parcels are close enoug
|
|
||||||
|
|
||||||
scalar coalesceProb = min(1.0, 2.4*f/WeColl);
|
|
||||||
|
|
||||||
scalar prob = rndGen_.sample01<scalar>();
|
|
||||||
|
|
||||||
// Coalescence
|
|
||||||
if ( prob < coalesceProb && coalescence_)
|
|
||||||
{
|
|
||||||
// How 'many' of the droplets coalesce
|
|
||||||
scalar nProb = prob*nMin/nMax;
|
|
||||||
|
|
||||||
// Conservation of mass, momentum and energy
|
|
||||||
|
|
||||||
pMin().m() -= nMax*nProb*mdMin;
|
|
||||||
|
|
||||||
scalar newMinMass = pMin().m();
|
|
||||||
scalar newMaxMass = mMax + (mMin - newMinMass);
|
|
||||||
pMax().m() = newMaxMass;
|
|
||||||
|
|
||||||
pMax().T() =
|
|
||||||
(averageTemp*mTot - newMinMass*pMin().T())/newMaxMass;
|
|
||||||
rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X());
|
|
||||||
|
|
||||||
pMax().d() =
|
|
||||||
pow
|
|
||||||
(
|
|
||||||
6.0
|
|
||||||
*newMaxMass
|
|
||||||
/(rhoMax*constant::mathematical::pi*nMax),
|
|
||||||
1.0/3.0
|
|
||||||
);
|
|
||||||
|
|
||||||
pMax().U() =
|
|
||||||
(momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass;
|
|
||||||
|
|
||||||
// update the liquid molar fractions
|
|
||||||
scalarField Ymin(spray_.fuels().Y(pMin().X()));
|
|
||||||
scalarField Ymax(spray_.fuels().Y(pMax().X()));
|
|
||||||
scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin);
|
|
||||||
scalar Wlinv = 0.0;
|
|
||||||
forAll(Ynew, i)
|
|
||||||
{
|
|
||||||
Wlinv += Ynew[i]/spray_.fuels().properties()[i].W();
|
|
||||||
}
|
|
||||||
forAll(Ynew, i)
|
|
||||||
{
|
|
||||||
pMax().X()[i] =
|
|
||||||
Ynew[i]/(spray_.fuels().properties()[i].W()*Wlinv);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// Grazing collision (no coalescence)
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar gf = sqrt(prob) - sqrt(coalesceProb);
|
|
||||||
scalar denom = 1.0 - sqrt(coalesceProb);
|
|
||||||
if (denom < 1.0e-5) {
|
|
||||||
denom = 1.0;
|
|
||||||
}
|
|
||||||
gf /= denom;
|
|
||||||
|
|
||||||
// if gf negative, this means that coalescence is turned off
|
|
||||||
// and these parcels should have coalesced
|
|
||||||
gf = max(0.0, gf);
|
|
||||||
|
|
||||||
scalar rho1 = spray_.fuels().rho(pc, p1().T(), p1().X());
|
|
||||||
scalar rho2 = spray_.fuels().rho(0.0, p2().T(), p2().X());
|
|
||||||
scalar m1 = p1().m();
|
|
||||||
scalar m2 = p2().m();
|
|
||||||
scalar n1 = p1().N(rho1);
|
|
||||||
scalar n2 = p2().N(rho2);
|
|
||||||
|
|
||||||
// gf -> 1 => v1p -> p1().U() ...
|
|
||||||
// gf -> 0 => v1p -> momentum/(m1+m2)
|
|
||||||
|
|
||||||
vector mr = m1*v1 + m2*v2;
|
|
||||||
vector v1p = (mr + m2*gf*vRel)/(m1+m2);
|
|
||||||
vector v2p = (mr - m1*gf*vRel)/(m1+m2);
|
|
||||||
|
|
||||||
if (n1 < n2)
|
|
||||||
{
|
|
||||||
p1().U() = v1p;
|
|
||||||
p2().U() = (n1*v2p + (n2-n1)*v2)/n2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p1().U() = (n2*v1p + (n1-n2)*v1)/n1;
|
|
||||||
p2().U() = v2p;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // if - coalescence or not
|
|
||||||
|
|
||||||
} // if - collision
|
|
||||||
|
|
||||||
} // if - possible collision (alpha, beta) in timeinterval
|
|
||||||
|
|
||||||
} // if - travelled distance is larger distance between parcels
|
|
||||||
|
|
||||||
} // if - parcel travel towards eachother
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "trajectoryModel.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "mathematicalConstants.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(trajectoryCollisionModel, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
collisionModel,
|
|
||||||
trajectoryCollisionModel,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::trajectoryCollisionModel::trajectoryCollisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
)
|
|
||||||
:
|
|
||||||
collisionModel(dict, sm, rndGen),
|
|
||||||
coeffsDict_(dict.subDict(typeName + "Coeffs")),
|
|
||||||
cSpace_(readScalar(coeffsDict_.lookup("cSpace"))),
|
|
||||||
cTime_(readScalar(coeffsDict_.lookup("cTime"))),
|
|
||||||
coalescence_(coeffsDict_.lookup("coalescence"))
|
|
||||||
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::trajectoryCollisionModel::~trajectoryCollisionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::trajectoryCollisionModel::collideParcels(const scalar dt) const
|
|
||||||
{
|
|
||||||
if (spray_.size() < 2)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
spray::iterator secondParcel = spray_.begin();
|
|
||||||
++secondParcel;
|
|
||||||
spray::iterator p1 = secondParcel;
|
|
||||||
|
|
||||||
while (p1 != spray_.end())
|
|
||||||
{
|
|
||||||
spray::iterator p2 = spray_.begin();
|
|
||||||
|
|
||||||
while (p2 != p1)
|
|
||||||
{
|
|
||||||
#include "trajectoryCM.H"
|
|
||||||
|
|
||||||
// remove coalesced droplets
|
|
||||||
if (p2().m() < VSMALL)
|
|
||||||
{
|
|
||||||
spray::iterator tmpElmnt = p2;
|
|
||||||
++tmpElmnt;
|
|
||||||
spray_.deleteParticle(p2());
|
|
||||||
p2 = tmpElmnt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++p2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove coalesced droplets
|
|
||||||
if (p1().m() < VSMALL)
|
|
||||||
{
|
|
||||||
spray::iterator tmpElmnt = p1;
|
|
||||||
++tmpElmnt;
|
|
||||||
spray_.deleteParticle(p1());
|
|
||||||
p1 = tmpElmnt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++p1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::trajectoryCollisionModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Collision model by P.J. O'Rourke.
|
|
||||||
Implemented as described in the KIVA manual
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
trajectoryModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef trajectoryCollisionModel_H
|
|
||||||
#define trajectoryCollisionModel_H
|
|
||||||
|
|
||||||
#include "collisionModel.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class trajectoryCollisionModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class trajectoryCollisionModel
|
|
||||||
:
|
|
||||||
public collisionModel
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Reference to the cell volumes
|
|
||||||
dictionary coeffsDict_;
|
|
||||||
|
|
||||||
scalar cSpace_;
|
|
||||||
scalar cTime_;
|
|
||||||
Switch coalescence_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("trajectory");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
trajectoryCollisionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm,
|
|
||||||
cachedRandom& rndGen
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~trajectoryCollisionModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
void collideParcels(const scalar dt) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "dispersionLESModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(dispersionLESModel, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dispersionLESModel::dispersionLESModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dispersionModel(dict, sm),
|
|
||||||
turbulence_
|
|
||||||
(
|
|
||||||
sm.mesh().lookupObject<compressible::LESModel>
|
|
||||||
(
|
|
||||||
"LESProperties"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dispersionLESModel::~dispersionLESModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::dispersionLESModel
|
|
||||||
|
|
||||||
Description
|
|
||||||
Foam::dispersionLESModel
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef dispersionLESModel_H
|
|
||||||
#define dispersionLESModel_H
|
|
||||||
|
|
||||||
#include "dispersionModel.H"
|
|
||||||
#include "LESModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class dispersionLESModel Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class dispersionLESModel
|
|
||||||
:
|
|
||||||
public dispersionModel
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
const compressible::LESModel& turbulence_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("dispersionLESModel");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
dispersionLESModel(const dictionary& dict, spray& sm);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~dispersionLESModel();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
const compressible::LESModel& turbulence() const
|
|
||||||
{
|
|
||||||
return turbulence_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void disperseParcels() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "dispersionModel.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(dispersionModel, 0);
|
|
||||||
defineRunTimeSelectionTable(dispersionModel, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dispersionModel::dispersionModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
spray& sm
|
|
||||||
)
|
|
||||||
:
|
|
||||||
dict_(dict),
|
|
||||||
spray_(sm)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::dispersionModel::~dispersionModel()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user