compressibleTwoPhaseEulerFoam: new solver for momentum conservative compressible two-phase flow

This commit is contained in:
Henry
2011-08-24 17:17:10 +01:00
parent 24a82f2d03
commit dab6fa5ed8
160 changed files with 115262 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso phaseModel
wclean libso interfacialModels
wclean libso kineticTheoryModels
wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso phaseModel
wmake libso interfacialModels
wmake libso kineticTheoryModels
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
CourantNo
Description
Calculates and outputs the mean and maximum Courant Numbers.
\*---------------------------------------------------------------------------*/
scalar CoNum = 0.0;
scalar meanCoNum = 0.0;
if (mesh.nInternalFaces())
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().internalField()
);
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum << endl;
// ************************************************************************* //

View File

@ -0,0 +1,12 @@
# include "CourantNo.H"
{
scalar UrCoNum = 0.5*gMax
(
fvc::surfaceSum(mag(phi1 - phi2))().internalField()/mesh.V().field()
)*runTime.deltaTValue();
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
CoNum = max(CoNum, UrCoNum);
}

View File

@ -0,0 +1,11 @@
{
DDtU1 =
fvc::ddt(U1)
+ fvc::div(phi1, U1)
- fvc::div(phi1)*U1;
DDtU2 =
fvc::ddt(U2)
+ fvc::div(phi2, U2)
- fvc::div(phi2)*U2;
}

View File

@ -0,0 +1,3 @@
compressibleTwoPhaseEulerFoam.C
EXE = $(FOAM_USER_APPBIN)/compressibleTwoPhaseEulerFoam

View File

@ -0,0 +1,17 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \
-IkineticTheoryModels/lnInclude \
-IinterfacialModels/lnInclude \
-IphaseModel/lnInclude \
-Iaveraging
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lincompressibleTransportModels \
-lcompressiblePhaseModel \
-lcompressibleEulerianInterfacialModels \
-lcompressibleKineticTheoryModel \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,38 @@
{
volScalarField kByCp1("kByCp1", alpha1*(k1/Cp1/rho1 + sqr(Ct)*nut2/Prt));
volScalarField kByCp2("kByCp2", alpha2*(k2/Cp2/rho2 + nut2/Prt));
fvScalarMatrix T1Eqn
(
fvm::ddt(alpha1, T1)
+ fvm::div(alphaPhi1, T1)
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), T1)
- fvm::laplacian(kByCp1, T1)
==
heatTransferCoeff*T2/Cp1/rho1
- fvm::Sp(heatTransferCoeff/Cp1/rho1, T1)
+ alpha1*Dp1Dt/Cp1/rho1
);
fvScalarMatrix T2Eqn
(
fvm::ddt(alpha2, T2)
+ fvm::div(alphaPhi2, T2)
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), T2)
- fvm::laplacian(kByCp2, T2)
==
heatTransferCoeff*T1/Cp2/rho2
- fvm::Sp(heatTransferCoeff/Cp2/rho2, T2)
+ alpha2*Dp2Dt/Cp2/rho2
);
T1Eqn.relax();
T1Eqn.solve();
T2Eqn.relax();
T2Eqn.solve();
// Update compressibilities
psi1 = 1.0/(R1*T1);
psi2 = 1.0/(R2*T2);
}

View File

@ -0,0 +1,72 @@
fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
{
{
volTensorField gradU1T = fvc::grad(U1)().T();
if (kineticTheory.on())
{
kineticTheory.solve(gradU1T);
nuEff1 = kineticTheory.mua()/rho1;
}
else // If not using kinetic theory is using Ct model
{
nuEff1 = sqr(Ct)*nut2 + nu1;
}
volTensorField Rc1
(
"Rc1",
((2.0/3.0)*I)*(sqr(Ct)*k + nuEff1*tr(gradU1T)) - nuEff1*gradU1T
);
if (kineticTheory.on())
{
Rc1 -= ((kineticTheory.lambda()/rho1)*tr(gradU1T))*tensor(I);
}
U1Eqn =
(
(scalar(1) + Cvm*rho2*alpha2/rho1)*
(
fvm::ddt(alpha1, U1)
+ fvm::div(alphaPhi1, U1)
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1)
)
- fvm::laplacian(alpha1*nuEff1, U1)
+ fvc::div(alpha1*Rc1)
==
- fvm::Sp(dragCoeff/rho1, U1)
- alpha1*alpha2/rho1*(liftForce - Cvm*rho2*DDtU2)
);
U1Eqn.relax();
}
{
volTensorField gradU2T = fvc::grad(U2)().T();
volTensorField Rc2
(
"Rc2",
((2.0/3.0)*I)*(k + nuEff2*tr(gradU2T)) - nuEff2*gradU2T
);
U2Eqn =
(
(scalar(1) + Cvm*rho2*alpha1/rho2)*
(
fvm::ddt(alpha2, U2)
+ fvm::div(alphaPhi2, U2)
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2)
)
- fvm::laplacian(alpha2*nuEff2, U2)
+ fvc::div(alpha2*Rc2)
==
- fvm::Sp(dragCoeff/rho2, U2)
+ alpha1*alpha2/rho2*(liftForce + Cvm*rho2*DDtU1)
);
U2Eqn.relax();
}
}

View File

@ -0,0 +1,105 @@
surfaceScalarField alphaPhi1("alphaPhi1", phi1);
surfaceScalarField alphaPhi2("alphaPhi2", phi2);
{
word scheme("div(phi,alpha1)");
word schemer("div(phir,alpha1)");
surfaceScalarField phic("phic", phi);
surfaceScalarField phir("phir", phi1 - phi2);
if (g0.value() > 0.0)
{
surfaceScalarField alpha1f = fvc::interpolate(alpha1);
surfaceScalarField phipp = ppMagf*fvc::snGrad(alpha1)*mesh.magSf();
phir += phipp;
phic += fvc::interpolate(alpha1)*phipp;
}
for (int acorr=0; acorr<nAlphaCorr; acorr++)
{
volScalarField::DimensionedInternalField Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
);
volScalarField::DimensionedInternalField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
fvc::div(phi)*min(alpha1, scalar(1))
);
forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]*alpha1[celli];
Su[celli] += dgdt[celli]*alpha1[celli];
}
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
{
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
}
}
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
+ fvm::div(phic, alpha1, scheme)
+ fvm::div(-fvc::flux(-phir, alpha2, schemer), alpha1, schemer)
==
fvm::Sp(Sp, alpha1) + Su
);
if (g0.value() > 0.0)
{
ppMagf = rU1Af*fvc::interpolate
(
(1.0/(rho1*(alpha1 + scalar(0.0001))))
*g0*min(exp(preAlphaExp*(alpha1 - alphaMax)), expMax)
);
alpha1Eqn -= fvm::laplacian
(
(fvc::interpolate(alpha1) + scalar(0.0001))*ppMagf,
alpha1,
"laplacian(alphaPpMag,alpha1)"
);
}
alpha1Eqn.relax();
alpha1Eqn.solve();
//***HGW temporary boundedness-fix pending the introduction of MULES
alpha1 = max(min(alpha1, 1.0), 0.0);
#include "packingLimiter.H"
alphaPhi1 = alpha1Eqn.flux();
alphaPhi2 = phi - alphaPhi1;
alpha2 = scalar(1) - alpha1;
Info<< "Dispersed phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;
}
}
rho = alpha1*rho1 + alpha2*rho2;

View File

@ -0,0 +1,115 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
compressibleTwoPhaseInterFoam
Description
Solver for a system of 2 compressible fluid phases with one phase
dispersed, e.g. gas bubbles in a liquid including heat-transfer.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "Switch.H"
#include "IFstream.H"
#include "OFstream.H"
#include "phaseModel.H"
#include "dragModel.H"
#include "heatTransferModel.H"
#include "kineticTheoryModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "readPPProperties.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNos.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTwoPhaseEulerFoamControls.H"
#include "CourantNos.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
#include "alphaEqn.H"
#include "kEpsilon.H"
#include "interfacialCoeffs.H"
#include "TEqns.H"
#include "UEqns.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
#include "DDtU.H"
}
#include "write.H"
Info<< "ExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n\n" << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,362 @@
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
autoPtr<phaseModel> phase1 = phaseModel::New
(
mesh,
transportProperties,
"1"
);
autoPtr<phaseModel> phase2 = phaseModel::New
(
mesh,
transportProperties,
"2"
);
volVectorField& U1 = phase1->U();
surfaceScalarField& phi1 = phase1->phi();
const dimensionedScalar& nu1 = phase1->nu();
const dimensionedScalar& k1 = phase1->kappa();
const dimensionedScalar& Cp1 = phase1->Cp();
dimensionedScalar rho10
(
"rho0",
dimDensity,
transportProperties.subDict("phase1").lookup("rho0")
);
dimensionedScalar R1
(
"R",
dimensionSet(0, 2, -2, -1, 0),
transportProperties.subDict("phase1").lookup("R")
);
volVectorField& U2 = phase2->U();
surfaceScalarField& phi2 = phase2->phi();
const dimensionedScalar& nu2 = phase2->nu();
const dimensionedScalar& k2 = phase2->kappa();
const dimensionedScalar& Cp2 = phase2->Cp();
dimensionedScalar rho20
(
"rho0",
dimDensity,
transportProperties.subDict("phase2").lookup("rho0")
);
dimensionedScalar R2
(
"R",
dimensionSet(0, 2, -2, -1, 0),
transportProperties.subDict("phase2").lookup("R")
);
dimensionedScalar pMin
(
"pMin",
dimPressure,
transportProperties.lookup("pMin")
);
Info<< "Reading field T1" << endl;
volScalarField T1
(
IOobject
(
"T1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field T2" << endl;
volScalarField T2
(
IOobject
(
"T2",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField psi1
(
IOobject
(
"psi1",
runTime.timeName(),
mesh
),
1.0/(R1*T1)
);
volScalarField psi2
(
IOobject
(
"psi2",
runTime.timeName(),
mesh
),
1.0/(R2*T2)
);
psi2.oldTime();
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField rho1("rho1", rho10 + psi1*p);
volScalarField rho2("rho2", rho20 + psi2*p);
Info<< "Reading field alpha1\n" << endl;
volScalarField alpha1
(
IOobject
(
"alpha1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField alpha2
(
IOobject
(
"alpha2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
scalar(1) - alpha1
);
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
alpha1*U1 + alpha2*U2
);
dimensionedScalar Cvm
(
"Cvm",
dimless,
transportProperties.lookup("Cvm")
);
dimensionedScalar Cl
(
"Cl",
dimless,
transportProperties.lookup("Cl")
);
dimensionedScalar Ct
(
"Ct",
dimless,
transportProperties.lookup("Ct")
);
surfaceScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh
),
fvc::interpolate(alpha1)*phi1 + fvc::interpolate(alpha2)*phi2
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
alpha1*rho1 + alpha2*rho2
);
#include "createRASTurbulence.H"
Info<< "Calculating field DDtU1 and DDtU2\n" << endl;
volVectorField DDtU1 =
fvc::ddt(U1)
+ fvc::div(phi1, U1)
- fvc::div(phi1)*U1;
volVectorField DDtU2 =
fvc::ddt(U2)
+ fvc::div(phi2, U2)
- fvc::div(phi2)*U2;
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
IOdictionary interfacialProperties
(
IOobject
(
"interfacialProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
autoPtr<dragModel> drag1 = dragModel::New
(
interfacialProperties,
alpha1,
phase1,
phase2
);
autoPtr<dragModel> drag2 = dragModel::New
(
interfacialProperties,
alpha2,
phase2,
phase1
);
autoPtr<heatTransferModel> heatTransfer1 = heatTransferModel::New
(
interfacialProperties,
alpha1,
phase1,
phase2
);
autoPtr<heatTransferModel> heatTransfer2 = heatTransferModel::New
(
interfacialProperties,
alpha2,
phase2,
phase1
);
word dispersedPhase(interfacialProperties.lookup("dispersedPhase"));
if
(
!(
dispersedPhase == "1"
|| dispersedPhase == "2"
|| dispersedPhase == "both"
)
)
{
FatalErrorIn(args.executable())
<< "invalid dispersedPhase " << dispersedPhase
<< exit(FatalError);
}
Info << "dispersedPhase is " << dispersedPhase << endl;
scalar minInterfaceAlpha
(
readScalar
(
interfacialProperties.lookup("minInterfaceAlpha")
)
);
kineticTheoryModel kineticTheory
(
phase1,
U2,
alpha1,
drag1
);
surfaceScalarField rU1Af
(
IOobject
(
"rU1Af",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0)
);
surfaceScalarField ppMagf
(
IOobject
(
"ppMagf",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
volScalarField dgdt =
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001));
Info<< "Creating field DpDt\n" << endl;
volScalarField Dp1Dt(fvc::DDt(phi1, p));
volScalarField Dp2Dt(fvc::DDt(phi2, p));

View File

@ -0,0 +1,189 @@
IOdictionary RASProperties
(
IOobject
(
"RASProperties",
runTime.constant(),
mesh,
//IOobject::MUST_READ_IF_MODIFIED,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
Switch turbulence
(
RASProperties.lookup("turbulence")
);
dictionary kEpsilonDict
(
RASProperties.subDictPtr("kEpsilonCoeffs")
);
dimensionedScalar Cmu
(
dimensionedScalar::lookupOrAddToDict
(
"Cmu",
kEpsilonDict,
0.09
)
);
dimensionedScalar C1
(
dimensionedScalar::lookupOrAddToDict
(
"C1",
kEpsilonDict,
1.44
)
);
dimensionedScalar C2
(
dimensionedScalar::lookupOrAddToDict
(
"C2",
kEpsilonDict,
1.92
)
);
dimensionedScalar alphak
(
dimensionedScalar::lookupOrAddToDict
(
"alphak",
kEpsilonDict,
1.0
)
);
dimensionedScalar alphaEps
(
dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
kEpsilonDict,
0.76923
)
);
dimensionedScalar Prt
(
dimensioned<scalar>::lookupOrAddToDict
(
"Prt",
kEpsilonDict,
1.0
)
);
dictionary wallFunctionDict
(
RASProperties.subDictPtr("wallFunctionCoeffs")
);
dimensionedScalar kappa
(
dimensionedScalar::lookupOrAddToDict
(
"kappa",
wallFunctionDict,
0.41
)
);
dimensionedScalar E
(
dimensionedScalar::lookupOrAddToDict
(
"E",
wallFunctionDict,
9.8
)
);
if (RASProperties.lookupOrDefault("printCoeffs", false))
{
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl;
}
nearWallDist y(mesh);
Info<< "Reading field k\n" << endl;
volScalarField k
(
IOobject
(
"k",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field epsilon\n" << endl;
volScalarField epsilon
(
IOobject
(
"epsilon",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Calculating field nut2\n" << endl;
volScalarField nut2
(
IOobject
(
"nut2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Cmu*sqr(k)/epsilon
);
Info<< "Calculating field nuEff1\n" << endl;
volScalarField nuEff1
(
IOobject
(
"nuEff1",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sqr(Ct)*nut2 + nu1
);
Info<< "Calculating field nuEff2\n" << endl;
volScalarField nuEff2
(
IOobject
(
"nuEff2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
nut2 + nu2
);

View File

@ -0,0 +1,80 @@
volScalarField dragCoeff
(
IOobject
(
"dragCoeff",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dragCoeff", dimensionSet(1, -3, -1, 0, 0), 0)
);
volVectorField liftForce
(
IOobject
(
"liftForce",
runTime.timeName(),
mesh
),
mesh,
dimensionedVector("liftForce", dimensionSet(1, -2, -2, 0, 0), vector::zero)
);
volScalarField heatTransferCoeff
(
IOobject
(
"heatTransferCoeff",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("heatTransferCoeff", dimensionSet(1, -1, -3, -1, 0), 0)
);
{
volVectorField Ur = U1 - U2;
volScalarField magUr = mag(Ur);
if (dispersedPhase == "1")
{
dragCoeff = drag1->K(magUr);
heatTransferCoeff = heatTransfer1->K(magUr);
}
else if (dispersedPhase == "2")
{
dragCoeff = drag2->K(magUr);
heatTransferCoeff = heatTransfer2->K(magUr);
}
else if (dispersedPhase == "both")
{
dragCoeff =
(
alpha2*drag1->K(magUr)
+ alpha1*drag2->K(magUr)
);
heatTransferCoeff =
(
alpha2*heatTransfer1->K(magUr)
+ alpha1*heatTransfer2->K(magUr)
);
}
else
{
FatalErrorIn(args.executable())
<< "dispersedPhase: " << dispersedPhase << " is incorrect"
<< exit(FatalError);
}
volScalarField alphaCoeff
(
(alpha1 + minInterfaceAlpha)*(alpha2 + minInterfaceAlpha)
);
dragCoeff *= alphaCoeff;
heatTransferCoeff *= alphaCoeff;
liftForce = Cl*(alpha1*rho1 + alpha2*rho2)*(Ur ^ fvc::curl(U));
}

View File

@ -0,0 +1,15 @@
dragModels/dragModel/dragModel.C
dragModels/dragModel/newDragModel.C
dragModels/Ergun/Ergun.C
dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C
dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C
dragModels/SchillerNaumann/SchillerNaumann.C
dragModels/Gibilaro/Gibilaro.C
dragModels/WenYu/WenYu.C
dragModels/SyamlalOBrien/SyamlalOBrien.C
heatTransferModels/heatTransferModel/heatTransferModel.C
heatTransferModels/heatTransferModel/newHeatTransferModel.C
heatTransferModels/RanzMarshall/RanzMarshall.C
LIB = $(FOAM_USER_LIBBIN)/libcompressibleEulerianInterfacialModels

View File

@ -0,0 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../phaseModel/lnInclude
LIB_LIBS = \
-lphaseModel

View File

@ -0,0 +1,83 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "Ergun.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(Ergun, 0);
addToRunTimeSelectionTable
(
dragModel,
Ergun,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::Ergun::Ergun
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::Ergun::~Ergun()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6)));
return
150.0*alpha_*phase2_.nu()*phase2_.rho()
/sqr(beta*phase1_.d())
+ 1.75*phase2_.rho()*Ur/(beta*phase1_.d());
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::Ergun
Description
H, Enwald, E. Peirano, A-E Almstedt
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
Eq. 104, p. 42
SourceFiles
Ergun.C
\*---------------------------------------------------------------------------*/
#ifndef Ergun_H
#define Ergun_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class Ergun Declaration
\*---------------------------------------------------------------------------*/
class Ergun
:
public dragModel
{
public:
//- Runtime type information
TypeName("Ergun");
// Constructors
//- Construct from components
Ergun
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~Ergun();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "Gibilaro.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(Gibilaro, 0);
addToRunTimeSelectionTable
(
dragModel,
Gibilaro,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::Gibilaro::Gibilaro
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::Gibilaro::~Gibilaro()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6)));
volScalarField bp(pow(beta, -2.8));
volScalarField Re(max(beta*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
return (17.3/Re + scalar(0.336))*phase2_.rho()*Ur*bp/phase1_.d();
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::Gibilaro
Description
H, Enwald, E. Peirano, A-E Almstedt
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
Eq. 106, p. 43
SourceFiles
Gibilaro.C
\*---------------------------------------------------------------------------*/
#ifndef Gibilaro_H
#define Gibilaro_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class Gibilaro Declaration
\*---------------------------------------------------------------------------*/
class Gibilaro
:
public dragModel
{
public:
//- Runtime type information
TypeName("Gibilaro");
// Constructors
//- Construct from components
Gibilaro
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~Gibilaro();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "GidaspowErgunWenYu.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(GidaspowErgunWenYu, 0);
addToRunTimeSelectionTable
(
dragModel,
GidaspowErgunWenYu,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowErgunWenYu::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6)));
volScalarField d = phase1_.d();
volScalarField bp(pow(beta, -2.65));
volScalarField Re(max(Ur*d/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re);
forAll(Re, celli)
{
if (Re[celli] > 1000.0)
{
Cds[celli] = 0.44;
}
}
// Wen and Yu (1966)
tmp<volScalarField> tKWenYu = 0.75*Cds*phase2_.rho()*Ur*bp/d;
volScalarField& KWenYu = tKWenYu();
// Ergun
forAll (beta, cellj)
{
if (beta[cellj] <= 0.8)
{
KWenYu[cellj] =
150.0*alpha_[cellj]*phase2_.nu().value()*phase2_.rho().value()
/sqr(beta[cellj]*d[cellj])
+ 1.75*phase2_.rho().value()*Ur[cellj]
/(beta[cellj]*d[cellj]);
}
}
return tKWenYu;
}
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::GidaspowErgunWenYu
Description
D. Gidaspow, Multiphase flow and fluidization,
Academic Press, New York, 1994.
SourceFiles
GidaspowErgunWenYu.C
\*---------------------------------------------------------------------------*/
#ifndef GidaspowErgunWenYu_H
#define GidaspowErgunWenYu_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class GidaspowErgunWenYu Declaration
\*---------------------------------------------------------------------------*/
class GidaspowErgunWenYu
:
public dragModel
{
public:
//- Runtime type information
TypeName("GidaspowErgunWenYu");
// Constructors
//- Construct from components
GidaspowErgunWenYu
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~GidaspowErgunWenYu();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "GidaspowSchillerNaumann.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(GidaspowSchillerNaumann, 0);
addToRunTimeSelectionTable
(
dragModel,
GidaspowSchillerNaumann,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::GidaspowSchillerNaumann::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1e-6)));
volScalarField bp(pow(beta, -2.65));
volScalarField Re(max(beta*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re);
forAll(Re, celli)
{
if (Re[celli] > 1000.0)
{
Cds[celli] = 0.44;
}
}
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();
}
// ************************************************************************* //

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::GidaspowSchillerNaumann
Description
H, Enwald, E. Peirano, A-E Almstedt
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
Eq. 86-87, p. 40
This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in
the Ph.D. thesis of Berend van Wachem
'Derivation, Implementation and Validation
of
Computer Simulation Models
for Gas-Solid Fluidized Beds'
SourceFiles
GidaspowSchillerNaumann.C
\*---------------------------------------------------------------------------*/
#ifndef GidaspowSchillerNaumann_H
#define GidaspowSchillerNaumann_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class GidaspowSchillerNaumann Declaration
\*---------------------------------------------------------------------------*/
class GidaspowSchillerNaumann
:
public dragModel
{
public:
//- Runtime type information
TypeName("GidaspowSchillerNaumann");
// Constructors
//- Construct from components
GidaspowSchillerNaumann
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~GidaspowSchillerNaumann();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SchillerNaumann.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(SchillerNaumann, 0);
addToRunTimeSelectionTable
(
dragModel,
SchillerNaumann,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::SchillerNaumann::SchillerNaumann
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::SchillerNaumann::~SchillerNaumann()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::SchillerNaumann::K
(
const volScalarField& Ur
) const
{
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re);
forAll(Re, celli)
{
if (Re[celli] > 1000.0)
{
Cds[celli] = 0.44;
}
}
return 0.75*Cds*phase2_.rho()*Ur/phase1_.d();
}
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::SchillerNaumann
Description
SourceFiles
SchillerNaumann.C
\*---------------------------------------------------------------------------*/
#ifndef SchillerNaumann_H
#define SchillerNaumann_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class SchillerNaumann Declaration
\*---------------------------------------------------------------------------*/
class SchillerNaumann
:
public dragModel
{
public:
//- Runtime type information
TypeName("SchillerNaumann");
// Constructors
//- Construct from components
SchillerNaumann
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~SchillerNaumann();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SyamlalOBrien.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(SyamlalOBrien, 0);
addToRunTimeSelectionTable
(
dragModel,
SyamlalOBrien,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::SyamlalOBrien::SyamlalOBrien
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::SyamlalOBrien::~SyamlalOBrien()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6)));
volScalarField A(pow(beta, 4.14));
volScalarField B(0.8*pow(beta, 1.28));
forAll (beta, celli)
{
if (beta[celli] > 0.85)
{
B[celli] = pow(beta[celli], 2.65);
}
}
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Vr
(
0.5*
(
A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A))
)
);
volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re)));
return 0.75*Cds*phase2_.rho()*Ur/(phase1_.d()*sqr(Vr));
}
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::SyamlalOBrien
Description
Syamlal, M., Rogers, W. and O'Brien, T. J. (1993) MFIX documentation,
Theory Guide. Technical Note DOE/METC-94/1004. Morgantown, West Virginia,
USA.
SourceFiles
SyamlalOBrien.C
\*---------------------------------------------------------------------------*/
#ifndef SyamlalOBrien_H
#define SyamlalOBrien_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class SyamlalOBrien Declaration
\*---------------------------------------------------------------------------*/
class SyamlalOBrien
:
public dragModel
{
public:
//- Runtime type information
TypeName("SyamlalOBrien");
// Constructors
//- Construct from components
SyamlalOBrien
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~SyamlalOBrien();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "WenYu.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
defineTypeNameAndDebug(WenYu, 0);
addToRunTimeSelectionTable
(
dragModel,
WenYu,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModels::WenYu::WenYu
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dragModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModels::WenYu::~WenYu()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::K
(
const volScalarField& Ur
) const
{
volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6)));
volScalarField bp(pow(beta, -2.65));
volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)));
volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re);
forAll(Re, celli)
{
if (Re[celli] > 1000.0)
{
Cds[celli] = 0.44;
}
}
return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d();
}
// ************************************************************************* //

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModels::WenYu
Description
H, Enwald, E. Peirano, A-E Almstedt
'Eulerian Two-Phase Flow Theory Applied to Fluidization'
Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996)
Eq. 86-87, p. 40
This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in
the Ph.D. thesis of Berend van Wachem
'Derivation, Implementation and Validation
of
Computer Simulation Models
for Gas-Solid Fluidized Beds'
NB: The difference between the Gidaspow-version is the void-fraction
in the Re-number
SourceFiles
WenYu.C
\*---------------------------------------------------------------------------*/
#ifndef WenYu_H
#define WenYu_H
#include "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace dragModels
{
/*---------------------------------------------------------------------------*\
Class WenYu Declaration
\*---------------------------------------------------------------------------*/
class WenYu
:
public dragModel
{
public:
//- Runtime type information
TypeName("WenYu");
// Constructors
//- Construct from components
WenYu
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~WenYu();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace dragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "dragModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(dragModel, 0);
defineRunTimeSelectionTable(dragModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dragModel::dragModel
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
interfaceDict_(interfaceDict),
alpha_(alpha),
phase1_(phase1),
phase2_(phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dragModel::~dragModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::dragModel
Description
SourceFiles
dragModel.C
newDragModel.C
\*---------------------------------------------------------------------------*/
#ifndef dragModel_H
#define dragModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dragModel Declaration
\*---------------------------------------------------------------------------*/
class dragModel
{
protected:
// Protected data
const dictionary& interfaceDict_;
const volScalarField& alpha_;
const phaseModel& phase1_;
const phaseModel& phase2_;
public:
//- Runtime type information
TypeName("dragModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
dragModel,
dictionary,
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
),
(interfaceDict, alpha, phase1, phase2)
);
// Constructors
dragModel
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~dragModel();
// Selectors
static autoPtr<dragModel> New
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
// Member Functions
//- the dragfunction K used in the momentum eq.
// ddt(alpha*rhoa*Ua) + ... = ... alpha*beta*K*(Ua-Ub)
// ddt(beta*rhob*Ub) + ... = ... alpha*beta*K*(Ub-Ua)
// **********************************<2A>NB ! *****************************
// for numerical reasons alpha and beta has been
// extracted from the dragFunction K,
// so you MUST divide K by alpha*beta when implemnting the drag function
// **********************************<2A>NB ! *****************************
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "dragModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::dragModel> Foam::dragModel::New
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
{
word dragModelType
(
interfaceDict.lookup("dragModel" + phase1.name())
);
Info << "Selecting dragModel for phase "
<< phase1.name()
<< ": "
<< dragModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(dragModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("dragModel::New")
<< "Unknown dragModelType type "
<< dragModelType << endl << endl
<< "Valid dragModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(interfaceDict, alpha, phase1, phase2);
}
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "RanzMarshall.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
defineTypeNameAndDebug(RanzMarshall, 0);
addToRunTimeSelectionTable
(
heatTransferModel,
RanzMarshall,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModels::RanzMarshall::RanzMarshall
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
heatTransferModel(interfaceDict, alpha, phase1, phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferModels::RanzMarshall::~RanzMarshall()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::heatTransferModels::RanzMarshall::K
(
const volScalarField& Ur
) const
{
volScalarField Re = max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3));
dimensionedScalar Prb = phase2_.rho()*phase2_.nu()*phase2_.Cp()/phase2_.kappa();
volScalarField Nu = scalar(2) + 0.6*sqrt(Re)*cbrt(Prb);
return 6.0*phase2_.kappa()*Nu/sqr(phase1_.d());
}
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::heatTransferModels::RanzMarshall
Description
SourceFiles
RanzMarshall.C
\*---------------------------------------------------------------------------*/
#ifndef RanzMarshall_H
#define RanzMarshall_H
#include "heatTransferModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace heatTransferModels
{
/*---------------------------------------------------------------------------*\
Class RanzMarshall Declaration
\*---------------------------------------------------------------------------*/
class RanzMarshall
:
public heatTransferModel
{
public:
//- Runtime type information
TypeName("RanzMarshall");
// Constructors
//- Construct from components
RanzMarshall
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~RanzMarshall();
// Member Functions
tmp<volScalarField> K(const volScalarField& Ur) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace heatTransferModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "heatTransferModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(heatTransferModel, 0);
defineRunTimeSelectionTable(heatTransferModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::heatTransferModel::heatTransferModel
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
:
interfaceDict_(interfaceDict),
alpha_(alpha),
phase1_(phase1),
phase2_(phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::heatTransferModel::~heatTransferModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::heatTransferModel
Description
SourceFiles
heatTransferModel.C
newHeatTransferModel.C
\*---------------------------------------------------------------------------*/
#ifndef heatTransferModel_H
#define heatTransferModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class heatTransferModel Declaration
\*---------------------------------------------------------------------------*/
class heatTransferModel
{
protected:
// Protected data
const dictionary& interfaceDict_;
const volScalarField& alpha_;
const phaseModel& phase1_;
const phaseModel& phase2_;
public:
//- Runtime type information
TypeName("heatTransferModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
heatTransferModel,
dictionary,
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
),
(interfaceDict, alpha, phase1, phase2)
);
// Constructors
heatTransferModel
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~heatTransferModel();
// Selectors
static autoPtr<heatTransferModel> New
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
);
// Member Functions
//- the heat-transfer function K used in the enthalpy eq.
// ddt(alpha*rhoa*ha) + ... = ... alpha*beta*K*(Ta - Tb)
// ddt(beta*rhob*hb) + ... = ... alpha*beta*K*(Tb - Ta)
// **********************************<2A>NB ! *****************************
// for numerical reasons alpha and beta has been
// extracted from the heat-transfer function K,
// so you MUST divide K by alpha*beta when implementing the
// heat-transfer function
// **********************************<2A>NB ! *****************************
virtual tmp<volScalarField> K(const volScalarField& Ur) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "heatTransferModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
(
const dictionary& interfaceDict,
const volScalarField& alpha,
const phaseModel& phase1,
const phaseModel& phase2
)
{
word heatTransferModelType
(
interfaceDict.lookup("heatTransferModel" + phase1.name())
);
Info<< "Selecting heatTransferModel for phase "
<< phase1.name()
<< ": "
<< heatTransferModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(heatTransferModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("heatTransferModel::New")
<< "Unknown heatTransferModelType type "
<< heatTransferModelType << endl << endl
<< "Valid heatTransferModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(interfaceDict, alpha, phase1, phase2);
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
kineticTheoryModel/kineticTheoryModel.C
viscosityModel/viscosityModel/viscosityModel.C
viscosityModel/viscosityModel/newViscosityModel.C
viscosityModel/Gidaspow/GidaspowViscosity.C
viscosityModel/Syamlal/SyamlalViscosity.C
viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C
viscosityModel/none/noneViscosity.C
conductivityModel/conductivityModel/conductivityModel.C
conductivityModel/conductivityModel/newConductivityModel.C
conductivityModel/Gidaspow/GidaspowConductivity.C
conductivityModel/Syamlal/SyamlalConductivity.C
conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C
radialModel/radialModel/radialModel.C
radialModel/radialModel/newRadialModel.C
radialModel/CarnahanStarling/CarnahanStarlingRadial.C
radialModel/Gidaspow/GidaspowRadial.C
radialModel/LunSavage/LunSavageRadial.C
radialModel/SinclairJackson/SinclairJacksonRadial.C
granularPressureModel/granularPressureModel/granularPressureModel.C
granularPressureModel/granularPressureModel/newGranularPressureModel.C
granularPressureModel/Lun/LunPressure.C
granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C
frictionalStressModel/frictionalStressModel/frictionalStressModel.C
frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C
frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C
LIB = $(FOAM_USER_LIBBIN)/libcompressibleKineticTheoryModel

View File

@ -0,0 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/foam/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../phaseModel/lnInclude \
-I../interfacialModels/lnInclude

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "GidaspowConductivity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
defineTypeNameAndDebug(Gidaspow, 0);
addToRunTimeSelectionTable
(
conductivityModel,
Gidaspow,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::Gidaspow::Gidaspow
(
const dictionary& dict
)
:
conductivityModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::Gidaspow::~Gidaspow()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::conductivityModels::Gidaspow::kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
return rhoa*da*sqrt(Theta)*
(
2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (9.0/8.0)*sqrtPi*g0*0.5*(1.0 + e)*sqr(alpha)
+ (15.0/16.0)*sqrtPi*alpha
+ (25.0/64.0)*sqrtPi/((1.0 + e)*g0)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::conductivityModels::Gidaspow
Description
SourceFiles
Gidaspow.C
\*---------------------------------------------------------------------------*/
#ifndef Gidaspow_H
#define Gidaspow_H
#include "conductivityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
/*---------------------------------------------------------------------------*\
Class Gidaspow Declaration
\*---------------------------------------------------------------------------*/
class Gidaspow
:
public conductivityModel
{
public:
//- Runtime type information
TypeName("Gidaspow");
// Constructors
//- Construct from components
Gidaspow(const dictionary& dict);
//- Destructor
virtual ~Gidaspow();
// Member Functions
tmp<volScalarField> kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace conductivityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "HrenyaSinclairConductivity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
defineTypeNameAndDebug(HrenyaSinclair, 0);
addToRunTimeSelectionTable
(
conductivityModel,
HrenyaSinclair,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair
(
const dictionary& dict
)
:
conductivityModel(dict),
coeffsDict_(dict.subDict(typeName + "Coeffs")),
L_(coeffsDict_.lookup("L"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::
~HrenyaSinclair()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
volScalarField lamda
(
scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_
);
return rhoa*da*sqrt(Theta)*
(
2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (9.0/8.0)*sqrtPi*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha)
/(49.0/16.0 - 33.0*e/16.0)
+ (15.0/16.0)*sqrtPi*alpha*(0.5*sqr(e) + 0.25*e - 0.75 + lamda)
/((49.0/16.0 - 33.0*e/16.0)*lamda)
+ (25.0/64.0)*sqrtPi
/((1.0 + e)*(49.0/16.0 - 33.0*e/16.0)*lamda*g0)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::conductivityModels::HrenyaSinclair
Description
SourceFiles
HrenyaSinclair.C
\*---------------------------------------------------------------------------*/
#ifndef HrenyaSinclair_H
#define HrenyaSinclair_H
#include "conductivityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
/*---------------------------------------------------------------------------*\
Class HrenyaSinclair Declaration
\*---------------------------------------------------------------------------*/
class HrenyaSinclair
:
public conductivityModel
{
dictionary coeffsDict_;
//- characteristic length of geometry
dimensionedScalar L_;
public:
//- Runtime type information
TypeName("HrenyaSinclair");
// Constructors
//- Construct from components
HrenyaSinclair(const dictionary& dict);
//- Destructor
virtual ~HrenyaSinclair();
// Member Functions
tmp<volScalarField> kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace conductivityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SyamlalConductivity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
defineTypeNameAndDebug(Syamlal, 0);
addToRunTimeSelectionTable
(
conductivityModel,
Syamlal,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::Syamlal::Syamlal
(
const dictionary& dict
)
:
conductivityModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModels::Syamlal::~Syamlal()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::conductivityModels::Syamlal::kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
return rhoa*da*sqrt(Theta)*
(
2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha)
/(49.0/16.0 - 33.0*e/16.0)
+ (15.0/32.0)*sqrtPi*alpha/(49.0/16.0 - 33.0*e/16.0)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::conductivityModels::Syamlal
Description
SourceFiles
Syamlal.C
\*---------------------------------------------------------------------------*/
#ifndef Syamlal_H
#define Syamlal_H
#include "conductivityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace conductivityModels
{
/*---------------------------------------------------------------------------*\
Class Syamlal Declaration
\*---------------------------------------------------------------------------*/
class Syamlal
:
public conductivityModel
{
public:
//- Runtime type information
TypeName("Syamlal");
// Constructors
//- Construct from components
Syamlal(const dictionary& dict);
//- Destructor
virtual ~Syamlal();
// Member Functions
tmp<volScalarField> kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace conductivityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "conductivityModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(conductivityModel, 0);
defineRunTimeSelectionTable(conductivityModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModel::conductivityModel
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::conductivityModel::~conductivityModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::conductivityModel
SourceFiles
conductivityModel.C
\*---------------------------------------------------------------------------*/
#ifndef conductivityModel_H
#define conductivityModel_H
#include "dictionary.H"
#include "volFields.H"
#include "dimensionedTypes.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class conductivityModel Declaration
\*---------------------------------------------------------------------------*/
class conductivityModel
{
// Private member functions
//- Disallow default bitwise copy construct
conductivityModel(const conductivityModel&);
//- Disallow default bitwise assignment
void operator=(const conductivityModel&);
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("conductivityModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
conductivityModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from components
conductivityModel(const dictionary& dict);
// Selectors
static autoPtr<conductivityModel> New
(
const dictionary& dict
);
//- Destructor
virtual ~conductivityModel();
// Member Functions
virtual tmp<volScalarField> kappa
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "conductivityModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::kineticTheoryModels::conductivityModel>
Foam::kineticTheoryModels::conductivityModel::New
(
const dictionary& dict
)
{
word conductivityModelType(dict.lookup("conductivityModel"));
Info<< "Selecting conductivityModel "
<< conductivityModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(conductivityModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "conductivityModel::New(const dictionary&) : " << endl
<< " unknown conductivityModelType type "
<< conductivityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid conductivityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
}
return autoPtr<conductivityModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "JohnsonJacksonFrictionalStress.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
defineTypeNameAndDebug(JohnsonJackson, 0);
addToRunTimeSelectionTable
(
frictionalStressModel,
JohnsonJackson,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
JohnsonJackson
(
const dictionary& dict
)
:
frictionalStressModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
~JohnsonJackson()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
frictionalPressure
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const
{
return
Fr*pow(max(alpha - alphaMinFriction, scalar(0)), eta)
/pow(max(alphaMax - alpha, scalar(5.0e-2)), p);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
frictionalPressurePrime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const
{
return Fr*
(
eta*pow(max(alpha - alphaMinFriction, scalar(0)), eta - 1.0)
*(alphaMax-alpha) + p*pow(max(alpha - alphaMinFriction, scalar(0)), eta)
)/pow(max(alphaMax - alpha, scalar(5.0e-2)), p + 1.0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const
{
return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi);
}
// ************************************************************************* //

View File

@ -0,0 +1,116 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::frictionalStressModels::JohnsonJackson
Description
SourceFiles
JohnsonJacksonFrictionalStress.C
\*---------------------------------------------------------------------------*/
#ifndef JohnsonJackson_H
#define JohnsonJackson_H
#include "frictionalStressModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
/*---------------------------------------------------------------------------*\
Class JohnsonJackson Declaration
\*---------------------------------------------------------------------------*/
class JohnsonJackson
:
public frictionalStressModel
{
public:
//- Runtime type information
TypeName("JohnsonJackson");
// Constructors
//- Construct from components
JohnsonJackson(const dictionary& dict);
//- Destructor
virtual ~JohnsonJackson();
// Member functions
virtual tmp<volScalarField> frictionalPressure
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const;
virtual tmp<volScalarField> frictionalPressurePrime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const;
virtual tmp<volScalarField> muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace frictionalStressModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
defineTypeNameAndDebug(Schaeffer, 0);
addToRunTimeSelectionTable
(
frictionalStressModel,
Schaeffer,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer
(
const dictionary& dict
)
:
frictionalStressModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::~Schaeffer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::
frictionalPressure
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const
{
return
dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24)
*pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::
frictionalPressurePrime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const
{
return
dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25)
*pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const
{
const scalar I2Dsmall = 1.0e-15;
// Creating muf assuming it should be 0 on the boundary which may not be
// true
tmp<volScalarField> tmuf
(
new volScalarField
(
IOobject
(
"muf",
alpha.mesh().time().timeName(),
alpha.mesh()
),
alpha.mesh(),
dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0)
)
);
volScalarField& muff = tmuf();
forAll (D, celli)
{
if (alpha[celli] > alphaMax.value() - 5e-2)
{
muff[celli] =
0.5*pf[celli]*sin(phi.value())
/(
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
+ sqr(D[celli].yy() - D[celli].zz())
+ sqr(D[celli].zz() - D[celli].xx()))
+ sqr(D[celli].xy()) + sqr(D[celli].xz())
+ sqr(D[celli].yz())) + I2Dsmall
);
}
}
return tmuf;
}
// ************************************************************************* //

View File

@ -0,0 +1,116 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::frictionalStressModels::Schaeffer
Description
SourceFiles
SchaefferFrictionalStress.C
\*---------------------------------------------------------------------------*/
#ifndef Schaeffer_H
#define Schaeffer_H
#include "frictionalStressModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
/*---------------------------------------------------------------------------*\
Class Schaeffer Declaration
\*---------------------------------------------------------------------------*/
class Schaeffer
:
public frictionalStressModel
{
public:
//- Runtime type information
TypeName("Schaeffer");
// Constructors
//- Construct from components
Schaeffer(const dictionary& dict);
//- Destructor
virtual ~Schaeffer();
// Member functions
virtual tmp<volScalarField> frictionalPressure
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const;
virtual tmp<volScalarField> frictionalPressurePrime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& n,
const dimensionedScalar& p
) const;
virtual tmp<volScalarField> muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace frictionalStressModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "frictionalStressModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(frictionalStressModel, 0);
defineRunTimeSelectionTable(frictionalStressModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModel::frictionalStressModel
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModel::~frictionalStressModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,147 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::frictionalStressModel
SourceFiles
frictionalStressModel.C
\*---------------------------------------------------------------------------*/
#ifndef frictionalStressModel_H
#define frictionalStressModel_H
#include "dictionary.H"
#include "volFields.H"
#include "dimensionedTypes.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class frictionalStressModel Declaration
\*---------------------------------------------------------------------------*/
class frictionalStressModel
{
// Private member functions
//- Disallow default bitwise copy construct
frictionalStressModel(const frictionalStressModel&);
//- Disallow default bitwise assignment
void operator=(const frictionalStressModel&);
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("frictionalStressModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
frictionalStressModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from components
frictionalStressModel(const dictionary& dict);
// Selectors
static autoPtr<frictionalStressModel> New
(
const dictionary& dict
);
//- Destructor
virtual ~frictionalStressModel();
// Member Functions
virtual tmp<volScalarField> frictionalPressure
(
const volScalarField& alpha,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const = 0;
virtual tmp<volScalarField> frictionalPressurePrime
(
const volScalarField& alphaf,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const dimensionedScalar& Fr,
const dimensionedScalar& eta,
const dimensionedScalar& p
) const = 0;
virtual tmp<volScalarField> muf
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D,
const dimensionedScalar& phi
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "frictionalStressModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::kineticTheoryModels::frictionalStressModel>
Foam::kineticTheoryModels::frictionalStressModel::New
(
const dictionary& dict
)
{
word frictionalStressModelType(dict.lookup("frictionalStressModel"));
Info<< "Selecting frictionalStressModel "
<< frictionalStressModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(frictionalStressModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "frictionalStressModel::New(const dictionary&) : " << endl
<< " unknown frictionalStressModelType type "
<< frictionalStressModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid frictionalStressModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<frictionalStressModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "LunPressure.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace granularPressureModels
{
defineTypeNameAndDebug(Lun, 0);
addToRunTimeSelectionTable
(
granularPressureModel,
Lun,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModels::Lun::Lun
(
const dictionary& dict
)
:
granularPressureModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModels::Lun::~Lun()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::granularPressureModels::Lun::granularPressureCoeff
(
const volScalarField& alpha,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const
{
return rhoa*alpha*(1.0 + 2.0*(1.0 + e)*alpha*g0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::granularPressureModels::Lun::
granularPressureCoeffPrime
(
const volScalarField& alpha,
const volScalarField& g0,
const volScalarField& g0prime,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const
{
return rhoa*(1.0 + alpha*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha));
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::Lun
Description
SourceFiles
LunPressure.C
\*---------------------------------------------------------------------------*/
#ifndef Lun_H
#define Lun_H
#include "granularPressureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace granularPressureModels
{
/*---------------------------------------------------------------------------*\
Class Lun Declaration
\*---------------------------------------------------------------------------*/
class Lun
:
public granularPressureModel
{
public:
//- Runtime type information
TypeName("Lun");
// Constructors
//- Construct from components
Lun(const dictionary& dict);
//- Destructor
virtual ~Lun();
// Member Functions
tmp<volScalarField> granularPressureCoeff
(
const volScalarField& alpha,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const;
tmp<volScalarField> granularPressureCoeffPrime
(
const volScalarField& alpha,
const volScalarField& g0,
const volScalarField& g0prime,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace granularPressureModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SyamlalRogersOBrienPressure.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace granularPressureModels
{
defineTypeNameAndDebug(SyamlalRogersOBrien, 0);
addToRunTimeSelectionTable
(
granularPressureModel,
SyamlalRogersOBrien,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien::
SyamlalRogersOBrien
(
const dictionary& dict
)
:
granularPressureModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien::
~SyamlalRogersOBrien()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien::
granularPressureCoeff
(
const volScalarField& alpha,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const
{
return 2.0*rhoa*(1.0 + e)*sqr(alpha)*g0;
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien::
granularPressureCoeffPrime
(
const volScalarField& alpha,
const volScalarField& g0,
const volScalarField& g0prime,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const
{
return rhoa*alpha*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha);
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::SyamlalRogersOBrien
Description
SourceFiles
SyamlalRogersOBrienPressure.C
\*---------------------------------------------------------------------------*/
#ifndef SyamlalRogersOBrien_H
#define SyamlalRogersOBrien_H
#include "granularPressureModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace granularPressureModels
{
/*---------------------------------------------------------------------------*\
Class SyamlalRogersOBrien Declaration
\*---------------------------------------------------------------------------*/
class SyamlalRogersOBrien
:
public granularPressureModel
{
public:
//- Runtime type information
TypeName("SyamlalRogersOBrien");
// Constructors
//- Construct from components
SyamlalRogersOBrien(const dictionary& dict);
//- Destructor
virtual ~SyamlalRogersOBrien();
// Member Functions
tmp<volScalarField> granularPressureCoeff
(
const volScalarField& alpha,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const;
tmp<volScalarField> granularPressureCoeffPrime
(
const volScalarField& alpha,
const volScalarField& g0,
const volScalarField& g0prime,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace granularPressureModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "granularPressureModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(granularPressureModel, 0);
defineRunTimeSelectionTable(granularPressureModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModel::granularPressureModel
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::granularPressureModel::~granularPressureModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,137 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::granularPressureModel
SourceFiles
granularPressureModel.C
\*---------------------------------------------------------------------------*/
#ifndef granularPressureModel_H
#define granularPressureModel_H
#include "dictionary.H"
#include "volFields.H"
#include "dimensionedTypes.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class granularPressureModel Declaration
\*---------------------------------------------------------------------------*/
class granularPressureModel
{
// Private member functions
//- Disallow default bitwise copy construct
granularPressureModel(const granularPressureModel&);
//- Disallow default bitwise assignment
void operator=(const granularPressureModel&);
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("granularPressureModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
granularPressureModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from components
granularPressureModel(const dictionary& dict);
// Selectors
static autoPtr<granularPressureModel> New
(
const dictionary& dict
);
//- Destructor
virtual ~granularPressureModel();
// Member Functions
//- Granular pressure coefficient
virtual tmp<volScalarField> granularPressureCoeff
(
const volScalarField& alpha,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const = 0;
//- Derivative of the granular pressure coefficient
virtual tmp<volScalarField> granularPressureCoeffPrime
(
const volScalarField& alpha,
const volScalarField& g0,
const volScalarField& g0prime,
const dimensionedScalar& rhoa,
const dimensionedScalar& e
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "granularPressureModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::kineticTheoryModels::granularPressureModel>
Foam::kineticTheoryModels::granularPressureModel::New
(
const dictionary& dict
)
{
word granularPressureModelType(dict.lookup("granularPressureModel"));
Info<< "Selecting granularPressureModel "
<< granularPressureModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(granularPressureModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "granularPressureModel::New(const dictionary&) : " << endl
<< " unknown granularPressureModelType type "
<< granularPressureModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid granularPressureModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<granularPressureModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,390 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "kineticTheoryModel.H"
#include "surfaceInterpolate.H"
#include "mathematicalConstants.H"
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModel::kineticTheoryModel
(
const Foam::phaseModel& phase1,
const Foam::volVectorField& Ub,
const Foam::volScalarField& alpha,
const Foam::dragModel& draga
)
:
phase1_(phase1),
Ua_(phase1.U()),
Ub_(Ub),
alpha_(alpha),
phia_(phase1.phi()),
draga_(draga),
rhoa_(phase1.rho()),
nua_(phase1.nu()),
kineticTheoryProperties_
(
IOobject
(
"kineticTheoryProperties",
Ua_.time().constant(),
Ua_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")),
equilibrium_(kineticTheoryProperties_.lookup("equilibrium")),
viscosityModel_
(
kineticTheoryModels::viscosityModel::New
(
kineticTheoryProperties_
)
),
conductivityModel_
(
kineticTheoryModels::conductivityModel::New
(
kineticTheoryProperties_
)
),
radialModel_
(
kineticTheoryModels::radialModel::New
(
kineticTheoryProperties_
)
),
granularPressureModel_
(
kineticTheoryModels::granularPressureModel::New
(
kineticTheoryProperties_
)
),
frictionalStressModel_
(
kineticTheoryModels::frictionalStressModel::New
(
kineticTheoryProperties_
)
),
e_(kineticTheoryProperties_.lookup("e")),
alphaMax_(kineticTheoryProperties_.lookup("alphaMax")),
alphaMinFriction_(kineticTheoryProperties_.lookup("alphaMinFriction")),
Fr_(kineticTheoryProperties_.lookup("Fr")),
eta_(kineticTheoryProperties_.lookup("eta")),
p_(kineticTheoryProperties_.lookup("p")),
phi_(dimensionedScalar(kineticTheoryProperties_.lookup("phi"))*M_PI/180.0),
Theta_
(
IOobject
(
"Theta",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
Ua_.mesh()
),
mua_
(
IOobject
(
"mua",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Ua_.mesh(),
dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
),
lambda_
(
IOobject
(
"lambda",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
Ua_.mesh(),
dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
),
pa_
(
IOobject
(
"pa",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Ua_.mesh(),
dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0)
),
kappa_
(
IOobject
(
"kappa",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
Ua_.mesh(),
dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0)
),
gs0_
(
IOobject
(
"gs0",
Ua_.time().timeName(),
Ua_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
Ua_.mesh(),
dimensionedScalar("zero", dimensionSet(0, 0, 0, 0, 0), 1.0)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModel::~kineticTheoryModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::kineticTheoryModel::solve(const volTensorField& gradUat)
{
if (!kineticTheory_)
{
return;
}
const scalar sqrtPi = sqrt(constant::mathematical::pi);
volScalarField da_(phase1_.d());
surfaceScalarField phi(1.5*rhoa_*phia_*fvc::interpolate(alpha_));
volTensorField dU(gradUat.T()); //fvc::grad(Ua_);
volSymmTensorField D(symm(dU));
// NB, drag = K*alpha*beta,
// (the alpha and beta has been extracted from the drag function for
// numerical reasons)
volScalarField Ur(mag(Ua_ - Ub_));
volScalarField betaPrim(alpha_*(1.0 - alpha_)*draga_.K(Ur));
// Calculating the radial distribution function (solid volume fraction is
// limited close to the packing limit, but this needs improvements)
// The solution is higly unstable close to the packing limit.
gs0_ = radialModel_->g0
(
min(max(alpha_, scalar(1e-6)), alphaMax_ - 0.01),
alphaMax_
);
// particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45)
volScalarField PsCoeff
(
granularPressureModel_->granularPressureCoeff
(
alpha_,
gs0_,
rhoa_,
e_
)
);
// 'thermal' conductivity (Table 3.3, p. 49)
kappa_ = conductivityModel_->kappa(alpha_, Theta_, gs0_, rhoa_, da_, e_);
// particle viscosity (Table 3.2, p.47)
mua_ = viscosityModel_->mua(alpha_, Theta_, gs0_, rhoa_, da_, e_);
dimensionedScalar Tsmall
(
"small",
dimensionSet(0 , 2 ,-2 ,0 , 0, 0, 0),
1.0e-6
);
dimensionedScalar TsmallSqrt = sqrt(Tsmall);
volScalarField ThetaSqrt(sqrt(Theta_));
// dissipation (Eq. 3.24, p.50)
volScalarField gammaCoeff
(
12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi
);
// Eq. 3.25, p. 50 Js = J1 - J2
volScalarField J1(3.0*betaPrim);
volScalarField J2
(
0.25*sqr(betaPrim)*da_*sqr(Ur)
/(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt))
);
// bulk viscosity p. 45 (Lun et al. 1984).
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
// stress tensor, Definitions, Table 3.1, p. 43
volSymmTensorField tau(2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I);
if (!equilibrium_)
{
// construct the granular temperature equation (Eq. 3.20, p. 44)
// NB. note that there are two typos in Eq. 3.20
// no grad infront of Ps
// wrong sign infront of laplacian
fvScalarMatrix ThetaEqn
(
fvm::ddt(1.5*alpha_*rhoa_, Theta_)
+ fvm::div(phi, Theta_, "div(phi,Theta)")
==
fvm::SuSp(-((PsCoeff*I) && dU), Theta_)
+ (tau && dU)
+ fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)")
+ fvm::Sp(-gammaCoeff, Theta_)
+ fvm::Sp(-J1, Theta_)
+ fvm::Sp(J2/(Theta_ + Tsmall), Theta_)
);
ThetaEqn.relax();
ThetaEqn.solve();
}
else
{
// equilibrium => dissipation == production
// Eq. 4.14, p.82
volScalarField K1(2.0*(1.0 + e_)*rhoa_*gs0_);
volScalarField K3
(
0.5*da_*rhoa_*
(
(sqrtPi/(3.0*(3.0-e_)))
*(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha_*gs0_)
+1.6*alpha_*gs0_*(1.0 + e_)/sqrtPi
)
);
volScalarField K2
(
4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0
);
volScalarField K4(12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi));
volScalarField trD(tr(D));
volScalarField tr2D(sqr(trD));
volScalarField trD2(tr(D & D));
volScalarField t1(K1*alpha_ + rhoa_);
volScalarField l1(-t1*trD);
volScalarField l2(sqr(t1)*tr2D);
volScalarField l3
(
4.0
*K4
*max(alpha_, scalar(1e-6))
*(2.0*K3*trD2 + K2*tr2D)
);
Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4));
}
Theta_.max(1.0e-15);
Theta_.min(1.0e+3);
volScalarField pf
(
frictionalStressModel_->frictionalPressure
(
alpha_,
alphaMinFriction_,
alphaMax_,
Fr_,
eta_,
p_
)
);
PsCoeff += pf/(Theta_+Tsmall);
PsCoeff.min(1.0e+10);
PsCoeff.max(-1.0e+10);
// update particle pressure
pa_ = PsCoeff*Theta_;
// frictional shear stress, Eq. 3.30, p. 52
volScalarField muf
(
frictionalStressModel_->muf
(
alpha_,
alphaMax_,
pf,
D,
phi_
)
);
// add frictional stress
mua_ += muf;
mua_.min(1.0e+2);
mua_.max(0.0);
Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl;
volScalarField ktn(mua_/rhoa_);
Info<< "kinTheory: min(nua) = " << min(ktn).value()
<< ", max(nua) = " << max(ktn).value() << endl;
Info<< "kinTheory: min(pa) = " << min(pa_).value()
<< ", max(pa) = " << max(pa_).value() << endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,196 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModel
Description
SourceFiles
kineticTheoryModel.C
\*---------------------------------------------------------------------------*/
#ifndef kineticTheoryModel_H
#define kineticTheoryModel_H
#include "dragModel.H"
#include "phaseModel.H"
#include "autoPtr.H"
#include "viscosityModel.H"
#include "conductivityModel.H"
#include "radialModel.H"
#include "granularPressureModel.H"
#include "frictionalStressModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class kineticTheoryModel Declaration
\*---------------------------------------------------------------------------*/
class kineticTheoryModel
{
// Private data
const phaseModel& phase1_;
const volVectorField& Ua_;
const volVectorField& Ub_;
const volScalarField& alpha_;
const surfaceScalarField& phia_;
const dragModel& draga_;
const dimensionedScalar& rhoa_;
const dimensionedScalar& nua_;
//- dictionary holding the modeling info
IOdictionary kineticTheoryProperties_;
//- use kinetic theory or not.
Switch kineticTheory_;
//- use generation == dissipation
Switch equilibrium_;
autoPtr<kineticTheoryModels::viscosityModel> viscosityModel_;
autoPtr<kineticTheoryModels::conductivityModel> conductivityModel_;
autoPtr<kineticTheoryModels::radialModel> radialModel_;
autoPtr<kineticTheoryModels::granularPressureModel> granularPressureModel_;
autoPtr<kineticTheoryModels::frictionalStressModel>
frictionalStressModel_;
//- coefficient of restitution
const dimensionedScalar e_;
//- maximum packing
const dimensionedScalar alphaMax_;
//- min value for which the frictional stresses are zero
const dimensionedScalar alphaMinFriction_;
//- material constant for frictional normal stress
const dimensionedScalar Fr_;
//- material constant for frictional normal stress
const dimensionedScalar eta_;
//- material constant for frictional normal stress
const dimensionedScalar p_;
//- angle of internal friction
const dimensionedScalar phi_;
//- The granular energy/temperature
volScalarField Theta_;
//- The granular viscosity
volScalarField mua_;
//- The granular bulk viscosity
volScalarField lambda_;
//- The granular pressure
volScalarField pa_;
//- The granular temperature conductivity
volScalarField kappa_;
//- The radial distribution function
volScalarField gs0_;
// Private Member Functions
//- Disallow default bitwise copy construct
kineticTheoryModel(const kineticTheoryModel&);
//- Disallow default bitwise assignment
void operator=(const kineticTheoryModel&);
public:
// Constructors
//- Construct from components
kineticTheoryModel
(
const phaseModel& phase1,
const volVectorField& Ub,
const volScalarField& alpha,
const dragModel& draga
);
//- Destructor
virtual ~kineticTheoryModel();
// Member Functions
void solve(const volTensorField& gradUat);
bool on() const
{
return kineticTheory_;
}
const volScalarField& mua() const
{
return mua_;
}
const volScalarField& pa() const
{
return pa_;
}
const volScalarField& lambda() const
{
return lambda_;
}
const volScalarField& kappa() const
{
return kappa_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "CarnahanStarlingRadial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
defineTypeNameAndDebug(CarnahanStarling, 0);
addToRunTimeSelectionTable
(
radialModel,
CarnahanStarling,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::CarnahanStarling::CarnahanStarling
(
const dictionary& dict
)
:
radialModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::CarnahanStarling::~CarnahanStarling()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return
1.0/(1.0 - alpha)
+ 3.0*alpha/(2.0*sqr(1.0 - alpha))
+ sqr(alpha)/(2.0*pow(1.0 - alpha, 3));
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return
- alpha/sqr(1.0 - alpha)
+ (3.0*(1.0 - alpha) + 6.0*sqr(alpha))/(2.0*(1.0 - alpha))
+ (2.0*alpha*(1.0 - alpha) + 3.0*pow(alpha, 3))
/(2.0*pow(1.0 - alpha, 4));
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::radialModels::CarnahanStarling
Description
SourceFiles
CarnahanStarlingRadial.C
\*---------------------------------------------------------------------------*/
#ifndef CarnahanStarling_H
#define CarnahanStarling_H
#include "radialModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
/*---------------------------------------------------------------------------*\
Class CarnahanStarling Declaration
\*---------------------------------------------------------------------------*/
class CarnahanStarling
:
public radialModel
{
public:
//- Runtime type information
TypeName("CarnahanStarling");
// Constructors
//- Construct from components
CarnahanStarling(const dictionary& dict);
//- Destructor
virtual ~CarnahanStarling();
// Member Functions
tmp<volScalarField> g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
tmp<volScalarField> g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace radialModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "GidaspowRadial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
defineTypeNameAndDebug(Gidaspow, 0);
addToRunTimeSelectionTable
(
radialModel,
Gidaspow,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::Gidaspow::Gidaspow
(
const dictionary& dict
)
:
radialModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::Gidaspow::~Gidaspow()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::Gidaspow::g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return 0.6/(1.0 - pow(alpha/alphaMax, 1.0/3.0));
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::Gidaspow::g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return
(-1.0/5.0)*pow(alpha/alphaMax, -2.0/3.0)
/(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0)));
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::radialModels::Gidaspow
Description
SourceFiles
GidaspowRadial.C
\*---------------------------------------------------------------------------*/
#ifndef Gidaspow_H
#define Gidaspow_H
#include "radialModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
/*---------------------------------------------------------------------------*\
Class Gidaspow Declaration
\*---------------------------------------------------------------------------*/
class Gidaspow
:
public radialModel
{
public:
//- Runtime type information
TypeName("Gidaspow");
// Constructors
//- Construct from components
Gidaspow(const dictionary& dict);
//- Destructor
virtual ~Gidaspow();
// Member Functions
tmp<volScalarField> g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
tmp<volScalarField> g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace radialModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "LunSavageRadial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
defineTypeNameAndDebug(LunSavage, 0);
addToRunTimeSelectionTable
(
radialModel,
LunSavage,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::LunSavage::LunSavage
(
const dictionary& dict
)
:
radialModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::LunSavage::~LunSavage()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::LunSavage::g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return pow(1.0 - alpha/alphaMax, -2.5*alphaMax);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::LunSavage::g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return 2.5*alphaMax*alpha*pow(1.0 - alpha, -1.0 - 2.5*alphaMax);
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::radialModels::LunSavage
Description
SourceFiles
LunSavage.C
\*---------------------------------------------------------------------------*/
#ifndef LunSavage_H
#define LunSavage_H
#include "radialModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
/*---------------------------------------------------------------------------*\
Class LunSavage Declaration
\*---------------------------------------------------------------------------*/
class LunSavage
:
public radialModel
{
public:
//- Runtime type information
TypeName("LunSavage");
// Constructors
//- Construct from components
LunSavage(const dictionary& dict);
//- Destructor
virtual ~LunSavage();
// Member Functions
tmp<volScalarField> g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
tmp<volScalarField> g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace radialModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SinclairJacksonRadial.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
defineTypeNameAndDebug(SinclairJackson, 0);
addToRunTimeSelectionTable
(
radialModel,
SinclairJackson,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::SinclairJackson::SinclairJackson
(
const dictionary& dict
)
:
radialModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModels::SinclairJackson::~SinclairJackson()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::SinclairJackson::g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return 1.0/(1.0 - pow(alpha/alphaMax, 1.0/3.0));
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::radialModels::SinclairJackson::g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const
{
return
(-1.0/3.0)*pow(alpha/alphaMax, -2.0/3.0)
/(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0)));
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::SinclairJackson
Description
SourceFiles
SinclairJacksonRadial.C
\*---------------------------------------------------------------------------*/
#ifndef SinclairJackson_H
#define SinclairJackson_H
#include "radialModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace radialModels
{
/*---------------------------------------------------------------------------*\
Class SinclairJackson Declaration
\*---------------------------------------------------------------------------*/
class SinclairJackson
:
public radialModel
{
public:
//- Runtime type information
TypeName("SinclairJackson");
// Constructors
//- Construct from components
SinclairJackson(const dictionary& dict);
//- Destructor
virtual ~SinclairJackson();
// Member Functions
tmp<volScalarField> g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
tmp<volScalarField> g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace radialModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "radialModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::kineticTheoryModels::radialModel>
Foam::kineticTheoryModels::radialModel::New
(
const dictionary& dict
)
{
word radialModelType(dict.lookup("radialModel"));
Info<< "Selecting radialModel "
<< radialModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(radialModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "radialModel::New(const dictionary&) : " << endl
<< " unknown radialModelType type "
<< radialModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid radialModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<radialModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "radialModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(radialModel, 0);
defineRunTimeSelectionTable(radialModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModel::radialModel
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::radialModel::~radialModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,132 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::radialModel
SourceFiles
radialModel.C
\*---------------------------------------------------------------------------*/
#ifndef radialModel_H
#define radialModel_H
#include "dictionary.H"
#include "volFields.H"
#include "dimensionedTypes.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class radialModel Declaration
\*---------------------------------------------------------------------------*/
class radialModel
{
// Private member functions
//- Disallow default bitwise copy construct
radialModel(const radialModel&);
//- Disallow default bitwise assignment
void operator=(const radialModel&);
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("radialModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
radialModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from components
radialModel(const dictionary& dict);
// Selectors
static autoPtr<radialModel> New
(
const dictionary& dict
);
//- Destructor
virtual ~radialModel();
// Member Functions
//- Radial distribution function
virtual tmp<volScalarField> g0
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const = 0;
//- Derivative of the radial distribution function
virtual tmp<volScalarField> g0prime
(
const volScalarField& alpha,
const dimensionedScalar& alphaMax
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "GidaspowViscosity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
defineTypeNameAndDebug(Gidaspow, 0);
addToRunTimeSelectionTable(viscosityModel, Gidaspow, dictionary);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::Gidaspow::Gidaspow
(
const dictionary& dict
)
:
viscosityModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::Gidaspow::~Gidaspow()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::viscosityModels::Gidaspow::mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
return rhoa*da*sqrt(Theta)*
(
(4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (1.0/15.0)*sqrtPi*g0*(1.0 + e)*sqr(alpha)
+ (1.0/6.0)*sqrtPi*alpha
+ (10.0/96.0)*sqrtPi/((1.0 + e)*g0)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::viscosityModels::Gidaspow
Description
SourceFiles
GidaspowViscosity.C
\*---------------------------------------------------------------------------*/
#ifndef Gidaspow_H
#define Gidaspow_H
#include "viscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
/*---------------------------------------------------------------------------*\
Class Gidaspow Declaration
\*---------------------------------------------------------------------------*/
class Gidaspow
:
public viscosityModel
{
public:
//- Runtime type information
TypeName("Gidaspow");
// Constructors
//- Construct from components
Gidaspow(const dictionary& dict);
//- Destructor
virtual ~Gidaspow();
// Member functions
tmp<volScalarField> mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace viscosityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "HrenyaSinclairViscosity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
defineTypeNameAndDebug(HrenyaSinclair, 0);
addToRunTimeSelectionTable
(
viscosityModel,
HrenyaSinclair,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair
(
const dictionary& dict
)
:
viscosityModel(dict),
coeffsDict_(dict.subDict(typeName + "Coeffs")),
L_(coeffsDict_.lookup("L"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::~HrenyaSinclair()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
volScalarField lamda
(
scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_
);
return rhoa*da*sqrt(Theta)*
(
(4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1)*sqr(alpha)/(3.0-e)
+ (1.0/6.0)*sqrtPi*alpha*(0.5*lamda + 0.25*(3.0*e - 1.0))
/(0.5*(3.0 - e)*lamda)
+ (10/96.0)*sqrtPi/((1.0 + e)*0.5*(3.0 - e)*g0*lamda)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::viscosityModels::HrenyaSinclair
Description
SourceFiles
HrenyaSinclairViscosity.C
\*---------------------------------------------------------------------------*/
#ifndef HrenyaSinclair_H
#define HrenyaSinclair_H
#include "viscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
/*---------------------------------------------------------------------------*\
Class HrenyaSinclair Declaration
\*---------------------------------------------------------------------------*/
class HrenyaSinclair
:
public viscosityModel
{
// Private data
dictionary coeffsDict_;
//- characteristic length of geometry
dimensionedScalar L_;
public:
//- Runtime type information
TypeName("HrenyaSinclair");
// Constructors
//- Construct from components
HrenyaSinclair(const dictionary& dict);
//- Destructor
virtual ~HrenyaSinclair();
// Member functions
tmp<volScalarField> mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace viscosityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "SyamlalViscosity.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
defineTypeNameAndDebug(Syamlal, 0);
addToRunTimeSelectionTable(viscosityModel, Syamlal, dictionary);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::Syamlal::Syamlal
(
const dictionary& dict
)
:
viscosityModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModels::Syamlal::~Syamlal()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::viscosityModels::Syamlal::mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
const scalar sqrtPi = sqrt(constant::mathematical::pi);
return rhoa*da*sqrt(Theta)*
(
(4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi
+ (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1.0)*sqr(alpha)/(3.0 - e)
+ (1.0/6.0)*alpha*sqrtPi/(3.0 - e)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::kineticTheoryModels::viscosityModels::Syamlal
Description
SourceFiles
SyamlalViscosity.C
\*---------------------------------------------------------------------------*/
#ifndef Syamlal_H
#define Syamlal_H
#include "viscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace viscosityModels
{
/*---------------------------------------------------------------------------*\
Class Syamlal Declaration
\*---------------------------------------------------------------------------*/
class Syamlal
:
public viscosityModel
{
public:
//- Runtime type information
TypeName("Syamlal");
// Constructors
//- Construct from components
Syamlal(const dictionary& dict);
//- Destructor
virtual ~Syamlal();
// Member functions
tmp<volScalarField> mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace viscosityModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "noneViscosity.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(noneViscosity, 0);
addToRunTimeSelectionTable(viscosityModel, noneViscosity, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::noneViscosity::noneViscosity(const dictionary& dict)
:
viscosityModel(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::noneViscosity::~noneViscosity()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const
{
return dimensionedScalar
(
"0",
dimensionSet(1, -1, -1, 0, 0, 0, 0),
0.0
)*alpha;
}
// ************************************************************************* //

View File

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::noneViscosity
Description
SourceFiles
noneViscosity.C
\*---------------------------------------------------------------------------*/
#ifndef noneViscosity_H
#define noneViscosity_H
#include "viscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class noneViscosity Declaration
\*---------------------------------------------------------------------------*/
class noneViscosity
:
public viscosityModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
noneViscosity(const dictionary& dict);
//- Destructor
virtual ~noneViscosity();
// Member functions
tmp<volScalarField> mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "viscosityModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::kineticTheoryModels::viscosityModel>
Foam::kineticTheoryModels::viscosityModel::New
(
const dictionary& dict
)
{
word viscosityModelType(dict.lookup("viscosityModel"));
Info<< "Selecting viscosityModel "
<< viscosityModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(viscosityModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "viscosityModel::New(const dictionary&) : " << endl
<< " unknown viscosityModelType type "
<< viscosityModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid viscosityModelType types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
}
return autoPtr<viscosityModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "viscosityModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
defineTypeNameAndDebug(viscosityModel, 0);
defineRunTimeSelectionTable(viscosityModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModel::viscosityModel
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::viscosityModel::~viscosityModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::viscosityModel
Description
SourceFiles
viscosityModel.C
\*---------------------------------------------------------------------------*/
#ifndef viscosityModel_H
#define viscosityModel_H
#include "dictionary.H"
#include "volFields.H"
#include "dimensionedTypes.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
/*---------------------------------------------------------------------------*\
Class viscosityModel Declaration
\*---------------------------------------------------------------------------*/
class viscosityModel
{
// Private member functions
//- Disallow default bitwise copy construct
viscosityModel(const viscosityModel&);
//- Disallow default bitwise assignment
void operator=(const viscosityModel&);
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("viscosityModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
viscosityModel,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
//- Construct from components
viscosityModel(const dictionary& dict);
// Selectors
static autoPtr<viscosityModel> New
(
const dictionary& dict
);
//- Destructor
virtual ~viscosityModel();
// Member Functions
virtual tmp<volScalarField> mua
(
const volScalarField& alpha,
const volScalarField& Theta,
const volScalarField& g0,
const dimensionedScalar& rhoa,
const volScalarField& da,
const dimensionedScalar& e
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,144 @@
{
rho1 = rho10 + psi1*p;
rho2 = rho20 + psi2*p;
tmp<fvScalarMatrix> pEqnComp1;
tmp<fvScalarMatrix> pEqnComp2;
//if (transonic)
//{
//}
//else
{
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi1);
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi2);
pEqnComp1 =
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p))
+ fvc::div(phid1, p)
- fvc::Sp(fvc::div(phid1), p);
pEqnComp2 =
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p))
+ fvc::div(phid2, p)
- fvc::Sp(fvc::div(phid2), p);
}
surfaceScalarField alpha1f = fvc::interpolate(alpha1);
surfaceScalarField alpha2f = scalar(1) - alpha1f;
volVectorField U10 = U1;
volVectorField U20 = U2;
volScalarField rAU1 = 1.0/U1Eqn.A();
volScalarField rAU2 = 1.0/U2Eqn.A();
surfaceScalarField rAlphaAU1f = fvc::interpolate(alpha1*rAU1);
surfaceScalarField rAlphaAU2f = fvc::interpolate(alpha2*rAU2);
U1 = rAU1*U1Eqn.H();
U2 = rAU2*U2Eqn.H();
{
surfaceScalarField phi10 = phi1;
phi1 =
(
(fvc::interpolate(U1) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1)
+ fvc::interpolate((1.0/rho1)*rAU1*dragCoeff)*phi2
+ rAlphaAU1f*(g & mesh.Sf())
);
phi2 =
(
(fvc::interpolate(U2) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU2, alpha2, U2, phi2)
+ fvc::interpolate((1.0/rho2)*rAU2*dragCoeff)*phi10
+ rAlphaAU2f*(g & mesh.Sf())
);
}
phi = alpha1f*phi1 + alpha2f*phi2;
adjustPhi(phi, U, p);
surfaceScalarField Dp
(
"(rho*1|A(U))",
mag(alpha1f*rAlphaAU1f/fvc::interpolate(rho1)
+ alpha2f*rAlphaAU2f/fvc::interpolate(rho2))
);
for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqnIncomp
(
fvc::div(phi)
- fvm::laplacian(Dp, p)
);
solve
(
(
(alpha1/rho1)*pEqnComp1()
+ (alpha2/rho2)*pEqnComp2()
) +
pEqnIncomp,
mesh.solver
(
p.select(pimple.finalInnerIter(corr, nonOrth))
/*
(
oCorr == pimple.nOuterCorr()-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
*/
)
);
if (nonOrth == pimple.nNonOrthCorr())
{
surfaceScalarField mSfGradp = pEqnIncomp.flux()/Dp;
phi1 += rAlphaAU1f*mSfGradp/fvc::interpolate(rho1);
phi2 += rAlphaAU2f*mSfGradp/fvc::interpolate(rho2);
phi = alpha1f*phi1 + alpha2f*phi2;
dgdt =
(
pos(alpha2)*(pEqnComp2 & p)/rho2
- pos(alpha1)*(pEqnComp1 & p)/rho1
);
p.relax();
mSfGradp = pEqnIncomp.flux()/Dp;
U1 += (1.0/rho1)*rAU1*dragCoeff*U20
+ fvc::reconstruct
(
rAlphaAU1f*(g & mesh.Sf())
+ rAlphaAU1f*mSfGradp/fvc::interpolate(rho1)
);
U1.correctBoundaryConditions();
U2 += (1.0/rho2)*rAU2*dragCoeff*U10
+ fvc::reconstruct
(
rAlphaAU2f*(g & mesh.Sf())
+ rAlphaAU2f*mSfGradp/fvc::interpolate(rho2)
);
U2.correctBoundaryConditions();
U = alpha1*U1 + alpha2*U2;
}
}
p = max(p, pMin);
rho1 = rho10 + psi1*p;
rho2 = rho20 + psi2*p;
Dp1Dt = fvc::DDt(phi1, p);
Dp2Dt = fvc::DDt(phi2, p);
}

View File

@ -0,0 +1,36 @@
if (packingLimiter)
{
// Calculating exceeding volume fractions
volScalarField alphaEx(max(alpha1 - alphaMax, scalar(0)));
// Finding neighbouring cells of the whole domain
labelListList neighbour = mesh.cellCells();
scalarField cellVolumes(mesh.cellVolumes());
forAll (alphaEx, celli)
{
// Finding the labels of the neighbouring cells
labelList neighbourCell = neighbour[celli];
// Initializing neighbouring cells contribution
scalar neighboursEx = 0.0;
forAll (neighbourCell, cellj)
{
labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
scalar neighboursNeighbourCellVolumes = 0.0;
forAll (neighboursNeighbour, cellk)
{
neighboursNeighbourCellVolumes +=
cellVolumes[neighboursNeighbour[cellk]];
}
neighboursEx +=
alphaEx[neighbourCell[cellj]]*cellVolumes[celli]
/neighboursNeighbourCellVolumes;
}
alpha1[celli] += neighboursEx - alphaEx[celli];
}
}

View File

@ -0,0 +1,7 @@
phaseModel/phaseModel.C
diameterModels/diameterModel/diameterModel.C
diameterModels/diameterModel/newDiameterModel.C
diameterModels/constantDiameter/constantDiameter.C
diameterModels/isothermalDiameter/isothermalDiameter.C
LIB = $(FOAM_USER_LIBBIN)/libcompressiblePhaseModel

View File

@ -0,0 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
LIB_LIBS = \
-lincompressibleTransportModels

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "constantDiameter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
defineTypeNameAndDebug(constant, 0);
addToRunTimeSelectionTable
(
diameterModel,
constant,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::constant::constant
(
const dictionary& dict,
const phaseModel& phase
)
:
diameterModel(dict, phase),
d_("d", dimLength, dict.lookup("d"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::constant::~constant()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::constant::d() const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"d",
phase_.U().time().timeName(),
phase_.U().mesh()
),
phase_.U().mesh(),
d_
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::constant
Description
Constant dispersed-phase particle diameter model.
SourceFiles
constant.C
\*---------------------------------------------------------------------------*/
#ifndef constant_H
#define constant_H
#include "diameterModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
/*---------------------------------------------------------------------------*\
Class constant Declaration
\*---------------------------------------------------------------------------*/
class constant
:
public diameterModel
{
// Private data
//- The constant diameter of the phase
dimensionedScalar d_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from components
constant
(
const dictionary& dict,
const phaseModel& phase
);
//- Destructor
virtual ~constant();
// Member Functions
tmp<volScalarField> d() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "diameterModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(diameterModel, 0);
defineRunTimeSelectionTable(diameterModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModel::diameterModel
(
const dictionary& dict,
const phaseModel& phase
)
:
dict_(dict),
phase_(phase)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModel::~diameterModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::diameterModel
Description
Abstract base-class for dispersed-phase particle diameter models.
SourceFiles
diameterModel.C
newDiameterModel.C
\*---------------------------------------------------------------------------*/
#ifndef diameterModel_H
#define diameterModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class diameterModel Declaration
\*---------------------------------------------------------------------------*/
class diameterModel
{
protected:
// Protected data
const dictionary& dict_;
const phaseModel& phase_;
public:
//- Runtime type information
TypeName("diameterModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
diameterModel,
dictionary,
(
const dictionary& dict,
const phaseModel& phase
),
(dict, phase)
);
// Constructors
diameterModel
(
const dictionary& dict,
const phaseModel& phase
);
//- Destructor
virtual ~diameterModel();
// Selectors
static autoPtr<diameterModel> New
(
const dictionary& dict,
const phaseModel& phase
);
// Member Functions
//- Return the phase mean diameter field
virtual tmp<volScalarField> d() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "diameterModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::diameterModel> Foam::diameterModel::New
(
const dictionary& dict,
const phaseModel& phase
)
{
word diameterModelType
(
dict.lookup("diameterModel")
);
Info << "Selecting diameterModel for phase "
<< phase.name()
<< ": "
<< diameterModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(diameterModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("diameterModel::New")
<< "Unknown diameterModelType type "
<< diameterModelType << endl << endl
<< "Valid diameterModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase);
}
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "isothermalDiameter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
defineTypeNameAndDebug(isothermal, 0);
addToRunTimeSelectionTable
(
diameterModel,
isothermal,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::diameterModels::isothermal::isothermal
(
const dictionary& dict,
const phaseModel& phase
)
:
diameterModel(dict, phase),
d0_("d0", dimLength, dict.lookup("d0")),
p0_("p0", dimPressure, dict.lookup("p0"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::diameterModels::isothermal::~isothermal()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::diameterModels::isothermal::d() const
{
const volScalarField& p = phase_.U().db().lookupObject<volScalarField>
(
"p"
);
return d0_*pow(p0_/p, 1.0/3.0);
}
// ************************************************************************* //

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::isothermal
Description
Isothermal dispersed-phase particle diameter model.
SourceFiles
isothermal.C
\*---------------------------------------------------------------------------*/
#ifndef isothermal_H
#define isothermal_H
#include "diameterModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace diameterModels
{
/*---------------------------------------------------------------------------*\
Class isothermal Declaration
\*---------------------------------------------------------------------------*/
class isothermal
:
public diameterModel
{
// Private data
//- Reference diameter for the isothermal expansion
dimensionedScalar d0_;
//- Reference pressure for the isothermal expansion
dimensionedScalar p0_;
public:
//- Runtime type information
TypeName("isothermal");
// Constructors
//- Construct from components
isothermal
(
const dictionary& dict,
const phaseModel& phase
);
//- Destructor
virtual ~isothermal();
// Member Functions
tmp<volScalarField> d() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace diameterModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,184 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "phaseModel.H"
#include "diameterModel.H"
#include "fixedValueFvPatchFields.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseModel::phaseModel
(
const fvMesh& mesh,
const dictionary& transportProperties,
const word& phaseName
)
:
dict_
(
transportProperties.subDict("phase" + phaseName)
),
name_(phaseName),
nu_
(
"nu",
dimensionSet(0, 2, -1, 0, 0),
dict_.lookup("nu")
),
kappa_
(
"kappa",
dimensionSet(1, 1, -3, -1, 0),
dict_.lookup("kappa")
),
Cp_
(
"Cp",
dimensionSet(0, 2, -2, -1, 0),
dict_.lookup("Cp")
),
rho_
(
"rho",
dimDensity,
dict_.lookup("rho")
),
U_
(
IOobject
(
"U" + phaseName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
{
const word phiName = "phi" + phaseName;
IOobject phiHeader
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ
);
if (phiHeader.headerOk())
{
Info<< "Reading face flux field " << phiName << endl;
phiPtr_.reset
(
new surfaceScalarField
(
IOobject
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
{
Info<< "Calculating face flux field " << phiName << endl;
wordList phiTypes
(
U_.boundaryField().size(),
calculatedFvPatchScalarField::typeName
);
forAll(U_.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
phiPtr_.reset
(
new surfaceScalarField
(
IOobject
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U_) & mesh.Sf(),
phiTypes
)
);
}
dPtr_ = diameterModel::New
(
dict_,
*this
);
}
Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
(
const fvMesh& mesh,
const dictionary& transportProperties,
const word& phaseName
)
{
return autoPtr<phaseModel>
(
new phaseModel(mesh, transportProperties, phaseName)
);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseModel::~phaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const
{
return dPtr_().d();
}
// ************************************************************************* //

View File

@ -0,0 +1,169 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::phaseModel
SourceFiles
phaseModel.C
\*---------------------------------------------------------------------------*/
#ifndef phaseModel_H
#define phaseModel_H
#include "dictionary.H"
#include "dimensionedScalar.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class diameterModel;
/*---------------------------------------------------------------------------*\
Class phaseModel Declaration
\*---------------------------------------------------------------------------*/
class phaseModel
{
// Private data
dictionary dict_;
//- Name of phase
word name_;
//- Kinematic viscosity
dimensionedScalar nu_;
//- Thermal conductivity
dimensionedScalar kappa_;
//- Heat capacity
dimensionedScalar Cp_;
//- Density
dimensionedScalar rho_;
//- Velocity
volVectorField U_;
//- Fluxes
autoPtr<surfaceScalarField> phiPtr_;
//- Diameter model
autoPtr<diameterModel> dPtr_;
public:
// Constructors
phaseModel
(
const fvMesh& mesh,
const dictionary& transportProperties,
const word& phaseName
);
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<phaseModel> New
(
const fvMesh& mesh,
const dictionary& transportProperties,
const word& phaseName
);
//- Destructor
virtual ~phaseModel();
// Member Functions
const word& name() const
{
return name_;
}
tmp<volScalarField> d() const;
const dimensionedScalar& nu() const
{
return nu_;
}
const dimensionedScalar& kappa() const
{
return kappa_;
}
const dimensionedScalar& Cp() const
{
return Cp_;
}
const dimensionedScalar& rho() const
{
return rho_;
}
const volVectorField& U() const
{
return U_;
}
volVectorField& U()
{
return U_;
}
const surfaceScalarField& phi() const
{
return phiPtr_();
}
surfaceScalarField& phi()
{
return phiPtr_();
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

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