bubbleFoam: Removed, replaced by twoPhaseEulerFoam

This commit is contained in:
Henry
2012-11-14 15:43:12 +00:00
parent 701f5680c8
commit 0c9c9ef91d
38 changed files with 0 additions and 9662 deletions

View File

@ -1,11 +0,0 @@
{
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

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

View File

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

View File

@ -1,74 +0,0 @@
fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
{
volTensorField Rc1(-nuEff1*(T(fvc::grad(U1))));
Rc1 = Rc1 + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rc1);
surfaceScalarField phiR1
(
- fvc::interpolate(nuEff1)
*mesh.magSf()*fvc::snGrad(alpha1)
/fvc::interpolate(alpha1 + scalar(0.001))
);
U1Eqn =
(
(scalar(1) + Cvm*rho2*alpha2/rho1)*
(
fvm::ddt(U1)
+ fvm::div(phi1, U1, "div(phi1,U1)")
- fvm::Sp(fvc::div(phi1), U1)
)
- fvm::laplacian(nuEff1, U1)
+ fvc::div(Rc1)
+ fvm::div(phiR1, U1, "div(phi1,U1)")
- fvm::Sp(fvc::div(phiR1), U1)
+ (fvc::grad(alpha1)/(fvc::average(alpha1) + scalar(0.001)) & Rc1)
==
// g // Buoyancy term transfered to p-equation
- fvm::Sp(alpha2/rho1*dragCoef, U1)
//+ alpha2/rho1*dragCoef*U2 // Explicit drag transfered to p-equation
- alpha2/rho1*(liftCoeff - Cvm*rho2*DDtU2)
);
U1Eqn.relax();
volTensorField Rc2(-nuEff2*T(fvc::grad(U2)));
Rc2 = Rc2 + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rc2);
surfaceScalarField phiR2
(
- fvc::interpolate(nuEff2)
*mesh.magSf()*fvc::snGrad(alpha2)
/fvc::interpolate(alpha2 + scalar(0.001))
);
U2Eqn =
(
(scalar(1) + Cvm*rho2*alpha1/rho2)*
(
fvm::ddt(U2)
+ fvm::div(phi2, U2, "div(phi2,U2)")
- fvm::Sp(fvc::div(phi2), U2)
)
- fvm::laplacian(nuEff2, U2)
+ fvc::div(Rc2)
+ fvm::div(phiR2, U2, "div(phi2,U2)")
- fvm::Sp(fvc::div(phiR2), U2)
+ (fvc::grad(alpha2)/(fvc::average(alpha2) + scalar(0.001)) & Rc2)
==
// g // Buoyancy term transfered to p-equation
- fvm::Sp(alpha1/rho2*dragCoef, U2)
//+ alpha1/rho2*dragCoef*U1 // Explicit drag transfered to p-equation
+ alpha1/rho2*(liftCoeff + Cvm*rho2*DDtU1)
);
U2Eqn.relax();
}

View File

@ -1,61 +0,0 @@
{
word scheme("div(phi,alpha1)");
surfaceScalarField phir(phi1 - phi2);
Info<< "Max Ur Courant Number = "
<< (
max
(
mesh.surfaceInterpolation::deltaCoeffs()*mag(phir)
/mesh.magSf()
)*runTime.deltaT()
).value()
<< endl;
for (int acorr=0; acorr<nAlphaCorr; acorr++)
{
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
+ fvm::div(phi, alpha1, scheme)
+ fvm::div(-fvc::flux(-phir, alpha2, scheme), alpha1, scheme)
);
alpha1Eqn.relax();
alpha1Eqn.solve();
/*
fvScalarMatrix alpha2Eqn
(
fvm::ddt(alpha2)
+ fvm::div(phi, alpha2, scheme)
+ fvm::div
(
-fvc::flux(phir, scalar(1) - alpha2, scheme),
alpha2,
scheme
)
);
alpha2Eqn.relax();
alpha2Eqn.solve();
alpha1 =
0.5
*(
scalar(1)
+ sqr(scalar(1) - alpha2)
- sqr(scalar(1) - alpha1)
);
*/
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

@ -1,110 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 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
bubbleFoam
Description
Solver for a system of 2 incompressible fluid phases with one phase
dispersed, e.g. gas bubbles in a liquid.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "Switch.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 "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readBubbleFoamControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
if (correctAlpha && !pimple.finalIter())
{
#include "alphaEqn.H"
}
}
#include "DDtU.H"
if (pimple.turbCorr())
{
#include "kEpsilon.H"
nuEff1 = sqr(Ct)*nut2 + nu1;
}
}
#include "write.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,195 +0,0 @@
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
//,alpha1.boundaryField().types()
);
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U1\n" << endl;
volVectorField U1
(
IOobject
(
"U1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U2\n" << endl;
volVectorField U2
(
IOobject
(
"U2",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
alpha1*U1 + alpha2*U2
);
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar rho1
(
transportProperties.lookup("rho1")
);
dimensionedScalar rho2
(
transportProperties.lookup("rho2")
);
dimensionedScalar nu1
(
transportProperties.lookup("nu1")
);
dimensionedScalar nu2
(
transportProperties.lookup("nu2")
);
dimensionedScalar d1
(
transportProperties.lookup("d1")
);
dimensionedScalar d2
(
transportProperties.lookup("d2")
);
dimensionedScalar Cvm
(
transportProperties.lookup("Cvm")
);
dimensionedScalar Cl
(
transportProperties.lookup("Cl")
);
dimensionedScalar Ct
(
transportProperties.lookup("Ct")
);
#include "createPhi1.H"
#include "createPhi2.H"
surfaceScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh
),
fvc::interpolate(alpha1)*phi1
+ fvc::interpolate(alpha2)*phi2
);
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh
),
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());
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);

View File

@ -1,67 +0,0 @@
IOobject phi1Header
(
"phi1",
runTime.timeName(),
mesh,
IOobject::NO_READ
);
autoPtr<surfaceScalarField> phi1Ptr(NULL);
if (phi1Header.headerOk())
{
Info<< "Reading face flux field phi1\n" << endl;
phi1Ptr.reset
(
new surfaceScalarField
(
IOobject
(
"phi1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
{
Info<< "Calculating face flux field phi1\n" << endl;
wordList phiTypes
(
U1.boundaryField().size(),
calculatedFvPatchScalarField::typeName
);
forAll(U1.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U1.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
phi1Ptr.reset
(
new surfaceScalarField
(
IOobject
(
"phi1",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U1) & mesh.Sf(),
phiTypes
)
);
}
surfaceScalarField& phi1 = phi1Ptr();

View File

@ -1,67 +0,0 @@
IOobject phi2Header
(
"phi2",
runTime.timeName(),
mesh,
IOobject::NO_READ
);
autoPtr<surfaceScalarField> phi2Ptr(NULL);
if (phi2Header.headerOk())
{
Info<< "Reading face flux field phi2\n" << endl;
phi2Ptr.reset
(
new surfaceScalarField
(
IOobject
(
"phi2",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
{
Info<< "Calculating face flux field phi2\n" << endl;
wordList phiTypes
(
U2.boundaryField().size(),
calculatedFvPatchScalarField::typeName
);
forAll(U2.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U2.boundaryField()[i]))
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
phi2Ptr.reset
(
new surfaceScalarField
(
IOobject
(
"phi2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U2) & mesh.Sf(),
phiTypes
)
);
}
surfaceScalarField& phi2 = phi2Ptr();

View File

@ -1,178 +0,0 @@
IOdictionary RASProperties
(
IOobject
(
"RASProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
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 alpha1k
(
dimensionedScalar::lookupOrAddToDict
(
"alpha1k",
kEpsilonDict,
1.0
)
);
dimensionedScalar alpha1Eps
(
dimensionedScalar::lookupOrAddToDict
(
"alpha1Eps",
kEpsilonDict,
0.76923
)
);
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

@ -1,64 +0,0 @@
if (turbulence)
{
if (mesh.changing())
{
y.correct();
}
tmp<volTensorField> tgradU2 = fvc::grad(U2);
volScalarField G(2*nut2*(tgradU2() && dev(symm(tgradU2()))));
tgradU2.clear();
#include "wallFunctions.H"
// Dissipation equation
fvScalarMatrix epsEqn
(
fvm::ddt(epsilon)
+ fvm::div(phi2, epsilon)
- fvm::Sp(fvc::div(phi2), epsilon)
- fvm::laplacian
(
alpha1Eps*nuEff2, epsilon,
"laplacian(DepsilonEff,epsilon)"
)
==
C1*G*epsilon/k
- fvm::Sp(C2*epsilon/k, epsilon)
);
#include "wallDissipation.H"
epsEqn.relax();
epsEqn.solve();
epsilon.max(dimensionedScalar("zero", epsilon.dimensions(), 1.0e-15));
// Turbulent kinetic energy equation
fvScalarMatrix kEqn
(
fvm::ddt(k)
+ fvm::div(phi2, k)
- fvm::Sp(fvc::div(phi2), k)
- fvm::laplacian
(
alpha1k*nuEff2, k,
"laplacian(DkEff,k)"
)
==
G
- fvm::Sp(epsilon/k, k)
);
kEqn.relax();
kEqn.solve();
k.max(dimensionedScalar("zero", k.dimensions(), 1.0e-8));
//- Re-calculate turbulence viscosity
nut2 = Cmu*sqr(k)/epsilon;
#include "wallViscosity.H"
}
nuEff2 = nut2 + nu2;

View File

@ -1,23 +0,0 @@
volVectorField Ur(U1 - U2);
volScalarField magUr(mag(Ur));
volScalarField Cd1MagUr
(
(24.0*nu2/d1)*(scalar(1) + 0.15*pow(d1*magUr/nu2, 0.687))
);
volScalarField Cd2MagUr
(
(24.0*nu1/d2)*(scalar(1) + 0.15*pow(d2*magUr/nu1, 0.687))
);
volScalarField dragCoef
(
"Cd",
0.75*(alpha2*rho2*Cd1MagUr/d1 + alpha1*rho1*Cd2MagUr/d2)
);
volVectorField liftCoeff
(
Cl*(alpha2*rho2 + alpha1*rho1)*(Ur ^ fvc::curl(U))
);

View File

@ -1,94 +0,0 @@
{
surfaceScalarField alpha1f(fvc::interpolate(alpha1));
surfaceScalarField alpha2f(scalar(1) - alpha1f);
volScalarField rAU1(1.0/U1Eqn.A());
volScalarField rAU2(1.0/U2Eqn.A());
surfaceScalarField rAU1f(fvc::interpolate(rAU1));
surfaceScalarField rAU2f(fvc::interpolate(rAU2));
volVectorField HbyA1("HbyA1", U1);
HbyA1 = rAU1*U1Eqn.H();
volVectorField HbyA2("HbyA2", U2);
HbyA2 = rAU2*U2Eqn.H();
surfaceScalarField phiDrag1
(
fvc::interpolate(alpha2/rho1*dragCoef*rAU1)*phi2
+ rAU1f*(g & mesh.Sf())
);
surfaceScalarField phiDrag2
(
fvc::interpolate(alpha1/rho2*dragCoef*rAU2)*phi1
+ rAU2f*(g & mesh.Sf())
);
forAll(p.boundaryField(), patchi)
{
if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi]))
{
phiDrag1.boundaryField()[patchi] = 0.0;
phiDrag2.boundaryField()[patchi] = 0.0;
}
}
surfaceScalarField phiHbyA1
(
(fvc::interpolate(HbyA1) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU1, U1, phi1)
);
surfaceScalarField phiHbyA2
(
(fvc::interpolate(HbyA2) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU2, U2, phi2)
);
phi = alpha1f*phiHbyA1 + alpha2f*phiHbyA2;
phiHbyA1 += phiDrag1;
phiHbyA2 += phiDrag2;
surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2);
surfaceScalarField Dp
(
"Dp",
alpha1f*rAU1f/rho1 + alpha2f*rAU2f/rho2
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
surfaceScalarField SfGradp(pEqn.flux()/Dp);
phi1 = phiHbyA1 - rAU1f*SfGradp/rho1;
phi2 = phiHbyA2 - rAU2f*SfGradp/rho2;
phi = alpha1f*phi1 + alpha2f*phi2;
p.relax();
SfGradp = pEqn.flux()/Dp;
U1 = HbyA1 + (fvc::reconstruct(phiDrag1 - rAU1f*SfGradp/rho1));
U1.correctBoundaryConditions();
U2 = HbyA2 + (fvc::reconstruct(phiDrag2 - rAU2f*SfGradp/rho2));
U2.correctBoundaryConditions();
U = alpha1*U1 + alpha2*U2;
}
}
}
#include "continuityErrs.H"

View File

@ -1,4 +0,0 @@
int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr")));
Switch correctAlpha(pimple.dict().lookup("correctAlpha"));

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
wallDissipation
Description
Set wall dissipation in the epsilon matrix
\*---------------------------------------------------------------------------*/
{
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& p = patches[patchi];
if (isA<wallFvPatch>(p))
{
epsEqn.setValues
(
p.faceCells(),
epsilon.boundaryField()[patchi].patchInternalField()
);
}
}
}
// ************************************************************************* //

View File

@ -1,81 +0,0 @@
{
labelList cellBoundaryFaceCount(epsilon.size(), 0);
scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar Cmu75 = ::pow(Cmu.value(), 0.75);
scalar kappa_ = kappa.value();
scalar nu2_ = nu2.value();
const fvPatchList& patches = mesh.boundary();
//- Initialise the near-wall P field to zero
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isA<wallFvPatch>(currPatch))
{
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
epsilon[faceCelli] = 0.0;
G[faceCelli] = 0.0;
}
}
}
//- Accumulate the wall face contributions to epsilon and G
// Increment cellBoundaryFaceCount for each face for averaging
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isA<wallFvPatch>(currPatch))
{
const scalarField& nut2w = nut2.boundaryField()[patchi];
scalarField magFaceGradU(mag(U2.boundaryField()[patchi].snGrad()));
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon[faceCelli] +=
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa_*y[patchi][facei]);
G[faceCelli] +=
(nut2w[facei] + nu2_)*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
/(kappa_*y[patchi][facei]);
}
}
}
// perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
cellBoundaryFaceCount[faceCelli] = 1;
}
}
}
}

View File

@ -1,36 +0,0 @@
{
scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar kappa_ = kappa.value();
scalar E_ = E.value();
scalar nu2_ = nu2.value();
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isA<wallFvPatch>(currPatch))
{
scalarField& nutw = nut2.boundaryField()[patchi];
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
// calculate yPlus
scalar yPlus =
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])/nu2_;
if (yPlus > 11.6)
{
nutw[facei] = nu2_*(yPlus*kappa_/::log(E_*yPlus) -1);
}
else
{
nutw[facei] = 0.0;
}
}
}
}
}

View File

@ -1,17 +0,0 @@
if (runTime.outputTime())
{
volVectorField Ur
(
IOobject
(
"Ur",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U1 - U2
);
runTime.write();
}

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0.1 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
walls
{
type fixedValue;
value uniform (0 0 0);
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
walls
{
type fixedValue;
value uniform (0 0 0);
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.5;
}
outlet
{
type inletOutlet;
inletValue uniform 1;
value uniform 1;
}
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.1;
}
outlet
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1e-8;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1e-8;
}
outlet
{
type inletOutlet;
inletValue uniform 1e-8;
value uniform 1e-8;
}
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedFluxPressure;
value uniform 0;
}
outlet
{
type fixedValue;
value uniform 0;
}
walls
{
type fixedFluxPressure;
value uniform 0;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.1;
}
outlet
{
type inletOutlet;
inletValue uniform 0.1;
value uniform 0.1;
}
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -1,47 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1e-8;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1e-8;
}
outlet
{
type inletOutlet;
inletValue uniform 1e-8;
value uniform 1e-8;
}
walls
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar;
turbulence off;
printCoeffs off;
// ************************************************************************* //

View File

@ -1,22 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 -9.81 0 );
// ************************************************************************* //

View File

@ -1,73 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(0.15 0 0)
(0.15 1 0)
(0 1 0)
(0 0 0.1)
(0.15 0 0.1)
(0.15 1 0.1)
(0 1 0.1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (25 75 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(1 5 4 0)
);
}
outlet
{
type patch;
faces
(
(3 7 6 2)
);
}
walls
{
type wall;
faces
(
(0 4 7 3)
(2 6 5 1)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,46 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
4
(
inlet
{
type patch;
nFaces 25;
startFace 3650;
}
outlet
{
type patch;
nFaces 25;
startFace 3675;
}
walls
{
type wall;
nFaces 150;
startFace 3700;
}
defaultFaces
{
type empty;
nFaces 3750;
startFace 3850;
}
)
// ************************************************************************* //

View File

@ -1,37 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
rho1 rho1 [ 1 -3 0 0 0 0 0 ] 1;
rho2 rho2 [ 1 -3 0 0 0 0 0 ] 1000;
nu1 nu1 [ 0 2 -1 0 0 0 0 ] 1.6e-05;
nu2 nu2 [ 0 2 -1 0 0 0 0 ] 1e-06;
d1 d1 [ 0 1 0 0 0 0 0 ] 0.003;
d2 d2 [ 0 1 0 0 0 0 0 ] 0.0001;
Cvm Cvm [ 0 0 0 0 0 0 0 ] 0.5;
Cl Cl [ 0 0 0 0 0 0 0 ] 0;
Ct Ct [ 0 0 0 0 0 0 0 ] 1;
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application bubbleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 20;
deltaT 0.002;
writeControl runTime;
writeInterval 0.5;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
// ************************************************************************* //

View File

@ -1,65 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi1,U1) Gauss limitedLinearV 1;
div(phi2,U2) Gauss limitedLinearV 1;
div(phi2,k) Gauss limitedLinear 1;
div(phi2,epsilon) Gauss limitedLinear 1;
div(phi,alpha1) Gauss limitedLinear01 1;
div((-nuEff1*T(grad(U1)))) Gauss linear;
div((-nuEff2*T(grad(U2)))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nuEff1,U1) Gauss linear corrected;
laplacian(nuEff2,U2) Gauss linear corrected;
laplacian(Dp,p) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -1,62 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0.1;
}
pFinal
{
$p;
tolerance 1e-10;
relTol 0;
}
alpha1
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0.1;
}
alpha1Final
{
$alpha1;
tolerance 1e-10;
relTol 0;
}
}
PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
nAlphaCorr 2;
correctAlpha no;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //