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

This commit is contained in:
mattijs
2012-11-16 02:36:29 +00:00
57 changed files with 78 additions and 9286 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,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,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

@ -12,12 +12,12 @@
mesh
);
Info<< "Reading field alpha\n" << endl;
volScalarField alpha
Info<< "Reading field Alpha\n" << endl;
volScalarField Alpha
(
IOobject
(
"alpha",
"Alpha",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@ -100,21 +100,20 @@
IOobject::NO_READ,
IOobject::NO_WRITE
),
(scalar(1) - alpha)*rhoc + alpha*rhod
rhoc/(scalar(1) + (rhoc/rhod - 1.0)*Alpha)
);
volScalarField Alpha
volScalarField alpha
(
IOobject
(
"Alpha",
"alpha",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
alpha*rhod/rho,
alpha.boundaryField().types()
rho*Alpha/rhod
);
#include "compressibleCreatePhi.H"

View File

@ -1,5 +1,4 @@
EXE_INC = \
-I../bubbleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -51,8 +51,13 @@ class subCycleField
//- Reference to the field being sub-cycled
GeometricField& gf_;
//- Reference to the field old-time field being sub-cycled
// Needed to avoid calls to oldTime() which may cause
// unexpected updates of the old-time field
GeometricField& gf0_;
//- Copy of the "real" old-time value of the field
GeometricField gf0_;
GeometricField gf_0_;
public:
@ -63,19 +68,33 @@ public:
subCycleField(GeometricField& gf)
:
gf_(gf),
gf0_(gf.oldTime())
gf0_(gf.oldTime()),
gf_0_(gf0_.name() + "_", gf0_)
{}
//- Destructor
~subCycleField()
{
// Reset the old-time field
gf0_ = gf_0_;
// Correct the time index of the field to correspond to the global time
gf_.timeIndex() = gf_.time().timeIndex();
gf0_.timeIndex() = gf_.time().timeIndex();
}
// Reset the old-time field value
gf_.oldTime() = gf0_;
gf_.oldTime().timeIndex() = gf0_.timeIndex();
//- Correct the time index of the field to correspond to
// the sub-cycling time.
//
// The time index is incremented to protect the old-time value from
// being updated at the beginning of the time-loop in the case of
// outer iteration
void updateTimeIndex()
{
gf_.timeIndex() = gf_.time().timeIndex() + 1;
gf0_.timeIndex() = gf_.time().timeIndex() + 1;
}
};
@ -106,16 +125,18 @@ public:
//- Construct field and number of sub-cycles
subCycle(GeometricField& gf, const label nSubCycles)
:
subCycleField<GeometricField>(gf),
subCycleTime(const_cast<Time&>(gf.time()), nSubCycles)
{}
{
// Update the field time index to correspond to the sub-cycle time
this->updateTimeIndex();
}
//- Destructor
// End the subCycleTime, which restores the time state
~subCycle()
{
// End the subCycleTime, which restores the time state
endSubCycle();
}
};

View File

@ -372,6 +372,12 @@ Foam::dimensionSet Foam::sqrt(const dimensionSet& ds)
}
Foam::dimensionSet Foam::cbrt(const dimensionSet& ds)
{
return pow(ds, 1.0/3.0);
}
Foam::dimensionSet Foam::magSqr(const dimensionSet& ds)
{
return pow(ds, 2);

View File

@ -76,6 +76,7 @@ dimensionSet pow6(const dimensionSet&);
dimensionSet pow025(const dimensionSet&);
dimensionSet sqrt(const dimensionSet&);
dimensionSet cbrt(const dimensionSet&);
dimensionSet magSqr(const dimensionSet&);
dimensionSet mag(const dimensionSet&);
dimensionSet sign(const dimensionSet&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -377,6 +377,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, neg, neg)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,6 +85,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, neg, neg)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -105,6 +105,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, neg)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -98,6 +98,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, neg)

View File

@ -128,6 +128,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, neg)

View File

@ -103,6 +103,7 @@ UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)
UNARY_FUNCTION(scalar, scalar, neg)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -448,6 +448,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, neg, neg)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -93,6 +93,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, cbrt, cbrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)
UNARY_FUNCTION(scalar, scalar, neg, neg)

View File

@ -296,6 +296,12 @@ Foam::MRFZone::MRFZone
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::vector Foam::MRFZone::Omega() const
{
return omega_->value(mesh_.time().timeOutputValue())*axis_;
}
void Foam::MRFZone::addCoriolis
(
const volVectorField& U,
@ -312,7 +318,7 @@ void Foam::MRFZone::addCoriolis
vectorField& ddtUc = ddtU.internalField();
const vectorField& Uc = U.internalField();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
forAll(cells, i)
{
@ -334,7 +340,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const
vectorField& Usource = UEqn.source();
const vectorField& U = UEqn.psi();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
forAll(cells, i)
{
@ -360,7 +366,7 @@ void Foam::MRFZone::addCoriolis
vectorField& Usource = UEqn.source();
const vectorField& U = UEqn.psi();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
forAll(cells, i)
{
@ -374,7 +380,7 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
{
const volVectorField& C = mesh_.C();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
const labelList& cells = mesh_.cellZones()[cellZoneID_];
@ -412,7 +418,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const
{
const volVectorField& C = mesh_.C();
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
const labelList& cells = mesh_.cellZones()[cellZoneID_];
@ -480,7 +486,7 @@ void Foam::MRFZone::absoluteFlux
void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
{
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector Omega = this->Omega();
// Included patches

View File

@ -47,7 +47,7 @@ SourceFiles
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "fvMatricesFwd.H"
#include "fvMatrices.H"
#include "mapPolyMesh.H"
#include "DataEntry.H"
#include "autoPtr.H"
@ -164,6 +164,9 @@ public:
//- Return const access to the MRF active flag
inline bool active() const;
//- Return the current Omega vector
vector Omega() const;
// Evaluation

View File

@ -27,6 +27,7 @@ License
#include "fvMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

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;
}
// ************************************************************************* //

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object alpha;
object Alpha;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -50,6 +50,7 @@ FoamFile
frontAndBack
{
type empty;
inGroups 1(empty);
nFaces 16000;
startFace 16240;
}

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object alpha;
object Alpha;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //