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

This commit is contained in:
andy
2013-07-19 09:49:59 +01:00
92 changed files with 82435 additions and 539 deletions

View File

@ -62,8 +62,6 @@ Foam::threePhaseMixture::threePhaseMixture
) )
), ),
transportModel(U, phi),
phase1Name_("phase1"), phase1Name_("phase1"),
phase2Name_("phase2"), phase2Name_("phase2"),
phase3Name_("phase3"), phase3Name_("phase3"),

View File

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

View File

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

View File

@ -1,8 +1,3 @@
interPhaseChangeFoam.C interPhaseChangeFoam.C
phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixtures/Kunz/Kunz.C
phaseChangeTwoPhaseMixtures/Merkle/Merkle.C
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C
EXE = $(FOAM_APPBIN)/interPhaseChangeFoam EXE = $(FOAM_APPBIN)/interPhaseChangeFoam

View File

@ -4,13 +4,14 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \ -IphaseChangeTwoPhaseMixtures/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude\ -I$(LIB_SRC)/fvOptions/lnInclude\
-I$(LIB_SRC)/sampling/lnInclude -I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lphaseChangeTwoPhaseMixtures \
-ltwoPhaseMixture \ -ltwoPhaseMixture \
-linterfaceProperties \ -linterfaceProperties \
-ltwoPhaseProperties \ -ltwoPhaseProperties \

View File

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

View File

@ -0,0 +1,31 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I../phaseChangeTwoPhaseMixtures/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude\
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lphaseChangeTwoPhaseMixtures \
-ltwoPhaseMixture \
-linterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools \
-lfvOptions \
-lsampling

View File

@ -0,0 +1,162 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 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
interPhaseChangeDyMFoam
Description
Solver for 2 incompressible, isothermal immiscible fluids with phase-change
(e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based
interface capturing approach, with optional mesh motion and mesh topology
changes including adaptive re-meshing.
The momentum and other fluid properties are of the "mixture" and a
single momentum equation is solved.
The set of phase-change models provided are designed to simulate cavitation
but other mechanisms of phase-change are supported within this solver
framework.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "phaseChangeTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readGravitationalAcceleration.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
surfaceScalarField phiAbs("phiAbs", phi);
fvc::makeAbsolute(phiAbs, U);
#include "../interFoam/interDyMFoam/correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "../interFoam/interDyMFoam/readControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
{
// Ensure old-time U exists for mapping
U.oldTime();
// Calculate the relative velocity used to map the relative flux phi
volVectorField Urel("Urel", U);
if (mesh.moving())
{
Urel -= fvc::reconstruct(fvc::meshPhi(U));
}
// Do any mesh changes
mesh.update();
}
if (mesh.changing())
{
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = g & mesh.C();
ghf = g & mesh.Cf();
}
if (mesh.changing() && correctPhi)
{
#include "../interFoam/interDyMFoam/correctPhi.H"
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
twoPhaseProperties->correct();
#include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
{
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn.H();
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
);
if (p_rgh.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p_rgh);
fvc::makeAbsolute(phiHbyA, U);
}
phiAbs = phiHbyA;
surfaceScalarField phig
(
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
phiHbyA += phig;
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
const volScalarField& vDotcP = vDotP[0]();
const volScalarField& vDotvP = vDotP[1]();
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
);
p_rghEqn.setReference(pRefCell, pRefValue);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + p_rghEqn.flux();
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
}
}
phiAbs = phi;
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
p == p_rgh + rho*gh;
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rho*gh;
}
}

View File

@ -0,0 +1,7 @@
phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
Kunz/Kunz.C
Merkle/Merkle.C
SchnerrSauer/SchnerrSauer.C
LIB = $(FOAM_LIBBIN)/libphaseChangeTwoPhaseMixtures

View File

@ -0,0 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lfiniteVolume

View File

@ -383,8 +383,6 @@ Foam::multiphaseSystem::multiphaseSystem
) )
), ),
transportModel(U, phi),
phases_(lookup("phases"), phaseModel::iNew(U.mesh())), phases_(lookup("phases"), phaseModel::iNew(U.mesh())),
mesh_(U.mesh()), mesh_(U.mesh()),

View File

@ -77,7 +77,6 @@ Foam::multiphaseMixture::multiphaseMixture
) )
), ),
transportModel(U, phi),
phases_(lookup("phases"), phase::iNew(U, phi)), phases_(lookup("phases"), phase::iNew(U, phi)),
mesh_(U.mesh()), mesh_(U.mesh()),

View File

@ -1150,11 +1150,12 @@ int main(int argc, char *argv[])
globalToMasterPatch.setSize(surfaces.nRegions(), -1); globalToMasterPatch.setSize(surfaces.nRegions(), -1);
globalToSlavePatch.setSize(surfaces.nRegions(), -1); globalToSlavePatch.setSize(surfaces.nRegions(), -1);
Info<< setw(8) << "Patch" Info<< setf(ios_base::left)
<< setw(30) << "Type" << setw(6) << "Patch"
<< setw(20) << "Type"
<< setw(30) << "Region" << nl << setw(30) << "Region" << nl
<< setw(8) << "-----" << setw(6) << "-----"
<< setw(30) << "----" << setw(20) << "----"
<< setw(30) << "------" << endl; << setw(30) << "------" << endl;
const labelList& surfaceGeometry = surfaces.surfaces(); const labelList& surfaceGeometry = surfaces.surfaces();
@ -1197,8 +1198,9 @@ int main(int argc, char *argv[])
); );
} }
Info<< setw(8) << patchI Info<< setf(ios_base::left)
<< setw(30) << mesh.boundaryMesh()[patchI].type() << setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(30) << regNames[i] << nl; << setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI; globalToMasterPatch[globalRegionI] = patchI;
@ -1236,8 +1238,9 @@ int main(int argc, char *argv[])
); );
} }
Info<< setw(8) << patchI Info<< setf(ios_base::left)
<< setw(30) << mesh.boundaryMesh()[patchI].type() << setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(30) << regNames[i] << nl; << setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI; globalToMasterPatch[globalRegionI] = patchI;
@ -1267,8 +1270,9 @@ int main(int argc, char *argv[])
); );
} }
Info<< setw(8) << patchI Info<< setf(ios_base::left)
<< setw(30) << mesh.boundaryMesh()[patchI].type() << setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(30) << slaveName << nl; << setw(30) << slaveName << nl;
globalToSlavePatch[globalRegionI] = patchI; globalToSlavePatch[globalRegionI] = patchI;

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -363,10 +363,12 @@ trap restoreDict QUIT TERM INT
if [ "$stopOpt" = now ] if [ "$stopOpt" = now ]
then then
setRawEntry $controlDict stopAt nextWrite setRawEntry $controlDict stopAt nextWrite
setRawEntry $controlDict writeControl timeStep
setRawEntry $controlDict writeInterval 1 setRawEntry $controlDict writeInterval 1
echo "$Script : Changed in controlDict:" echo "$Script : Changed in controlDict:"
echo " `getLine $controlDict stopAt`" echo " `getLine $controlDict stopAt`"
echo " `getLine $controlDict writeControl`"
echo " `getLine $controlDict writeInterval`" echo " `getLine $controlDict writeInterval`"
else else
setRawEntry $controlDict stopAt nextWrite setRawEntry $controlDict stopAt nextWrite

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -196,7 +196,7 @@ do
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
;; ;;
5) 5)
echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile echo "$sourceFoam; cd $PWD; valgrind --leak-check=full --show-reachable=yes $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
;; ;;
6) 6)

View File

@ -35,7 +35,7 @@ SourceFiles
#define labelBits_H #define labelBits_H
#include "label.H" #include "label.H"
#include "uLabel.H" //#include "uLabel.H"
#include "direction.H" #include "direction.H"
#include "error.H" #include "error.H"
@ -55,15 +55,17 @@ class labelBits
label data_; label data_;
inline static label pack(const uLabel val, const direction bits) inline static label pack(const label val, const direction bits)
{ {
# ifdef FULLDEBUG # ifdef FULLDEBUG
if (bits > 7 || (((val<<3)>>3) != val)) if (bits > 7 || (((val<<3)>>3) != val))
{ {
FatalErrorIn FatalErrorIn
( (
"labelBits::pack(const uLabel, const direction)" "labelBits::pack(const label, const direction)"
) << "Direction " << bits << " outside range 0..7" ) << "Direction " << bits << " outside range 0..7"
<< " or value " << val << " negative or larger than "
<< label(8*sizeof(label)-3) << " bit representation"
<< abort(FatalError); << abort(FatalError);
} }
# endif # endif

View File

@ -243,6 +243,21 @@ const Foam::fileName& Foam::IOobject::caseName() const
} }
Foam::word Foam::IOobject::group() const
{
word::size_type i = name_.find_last_of('.');
if (i == word::npos || i == 0)
{
return word::null;
}
else
{
return name_.substr(i+1, word::npos);
}
}
const Foam::fileName& Foam::IOobject::rootPath() const const Foam::fileName& Foam::IOobject::rootPath() const
{ {
return time().rootPath(); return time().rootPath();

View File

@ -154,6 +154,7 @@ private:
//- IOobject state //- IOobject state
objectState objState_; objectState objState_;
protected: protected:
// Protected Member Functions // Protected Member Functions
@ -187,6 +188,9 @@ public:
word& name word& name
); );
template<class Name>
static inline word groupName(Name name, const word& group);
// Constructors // Constructors
@ -313,6 +317,9 @@ public:
// Path components // Path components
//- Return group (extension part of name)
word group() const;
const fileName& rootPath() const; const fileName& rootPath() const;
const fileName& caseName() const; const fileName& caseName() const;

View File

@ -27,6 +27,20 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Name>
inline Foam::word Foam::IOobject::groupName(Name name, const word& group)
{
if (group != word::null)
{
return name + ('.' + group);
}
else
{
return name;
}
}
template<class Stream> template<class Stream>
inline Stream& Foam::IOobject::writeBanner(Stream& os, bool noHint) inline Stream& Foam::IOobject::writeBanner(Stream& os, bool noHint)
{ {

View File

@ -38,6 +38,7 @@ Description
#define geometricOneField_H #define geometricOneField_H
#include "oneFieldField.H" #include "oneFieldField.H"
#include "dimensionSet.H"
#include "scalar.H" #include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,6 +66,8 @@ public:
// Member Operators // Member Operators
inline const dimensionSet& dimensions() const;
inline scalar operator[](const label) const; inline scalar operator[](const label) const;
inline oneField field() const; inline oneField field() const;

View File

@ -27,6 +27,11 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::dimensionSet& Foam::geometricOneField::dimensions() const
{
return dimless;
}
inline Foam::scalar Foam::geometricOneField::operator[](const label) const inline Foam::scalar Foam::geometricOneField::operator[](const label) const
{ {
return scalar(1); return scalar(1);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,6 +38,7 @@ Description
#define geometricZeroField_H #define geometricZeroField_H
#include "zeroFieldField.H" #include "zeroFieldField.H"
#include "dimensionSet.H"
#include "scalar.H" #include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,6 +66,8 @@ public:
// Member Operators // Member Operators
inline const dimensionSet& dimensions() const;
inline scalar operator[](const label) const; inline scalar operator[](const label) const;
inline zeroField field() const; inline zeroField field() const;

View File

@ -27,6 +27,11 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::dimensionSet& Foam::geometricZeroField::dimensions() const
{
return dimless;
}
inline Foam::scalar Foam::geometricZeroField::operator[](const label) const inline Foam::scalar Foam::geometricZeroField::operator[](const label) const
{ {
return scalar(0); return scalar(0);

View File

@ -83,6 +83,10 @@ public:
//- Return the accumulated constraint transformation tensor //- Return the accumulated constraint transformation tensor
inline tensor constraintTransformation() const; inline tensor constraintTransformation() const;
//- Return the accumulated unconstrained directions. Directions
// coded as first n rows of tensor.
inline void unconstrainedDirections(label& n, tensor& vecs) const;
}; };

View File

@ -136,6 +136,49 @@ Foam::tensor Foam::pointConstraint::constraintTransformation() const
} }
void Foam::pointConstraint::unconstrainedDirections(label& n, tensor& tt)
const
{
n = 3-first();
FixedList<vector, 3> vecs;
if (first() == 0)
{
vecs[0] = vector(1, 0, 0);
vecs[1] = vector(0, 1, 0);
vecs[2] = vector(0, 0, 1);
}
else if (first() == 1)
{
const vector& planeDir = second();
vecs[0] = vector(1, 0, 0) - planeDir.x()*planeDir;
if (mag(vecs[0].x()) < 1e-3)
{
vecs[0] = vector(0, 1, 0) - planeDir.y()*planeDir;
}
vecs[0] /= mag(vecs[0]);
vecs[1] = vecs[0] ^ planeDir;
vecs[1] /= mag(vecs[1]);
}
else if (first() == 2)
{
vecs[0] = second();
}
// Knock out remaining vectors
for (direction dir = n; dir < vecs.size(); dir++)
{
vecs[dir] = vector::zero;
}
tt = tensor(vecs[0], vecs[1], vecs[2]);
}
void Foam::combineConstraintsEqOp::operator() void Foam::combineConstraintsEqOp::operator()
( (
pointConstraint& x, pointConstraint& x,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "lduAddressing.H" #include "lduAddressing.H"
#include "demandDrivenData.H" #include "demandDrivenData.H"
#include "scalarField.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -248,4 +249,28 @@ Foam::label Foam::lduAddressing::triIndex(const label a, const label b) const
} }
Foam::Tuple2<Foam::label, Foam::scalar> Foam::lduAddressing::band() const
{
const labelUList& owner = lowerAddr();
const labelUList& neighbour = upperAddr();
labelList cellBandwidth(size(), 0);
forAll(neighbour, faceI)
{
label own = owner[faceI];
label nei = neighbour[faceI];
// Note: mag not necessary for correct (upper-triangular) ordering.
label diff = nei-own;
cellBandwidth[nei] = max(cellBandwidth[nei], diff);
}
label bandwidth = max(cellBandwidth);
scalar profile = sum(1.0*cellBandwidth);
return Tuple2<label, scalar>(bandwidth, profile);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -98,6 +98,7 @@ SourceFiles
#include "labelList.H" #include "labelList.H"
#include "lduSchedule.H" #include "lduSchedule.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -196,6 +197,9 @@ public:
//- Return off-diagonal index given owner and neighbour label //- Return off-diagonal index given owner and neighbour label
label triIndex(const label a, const label b) const; label triIndex(const label a, const label b) const;
//- Calculate bandwidth and profile of addressing
Tuple2<label, scalar> band() const;
}; };

View File

@ -69,19 +69,26 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
procAgglomeratorPtr_().agglomerate(); procAgglomeratorPtr_().agglomerate();
if (debug) }
{
// Print a bit
if (processorAgglomerate() && debug)
{
Info<< "GAMGAgglomeration:" << nl Info<< "GAMGAgglomeration:" << nl
<< " local agglomerator : " << type() << nl << " local agglomerator : " << type() << nl;
<< " processor agglomerator : " if (processorAgglomerate())
{
Info<< " processor agglomerator : "
<< procAgglomeratorPtr_().type() << nl << procAgglomeratorPtr_().type() << nl
<< nl; << nl;
}
Info<< setw(40) << "nCells" Info<< setw(36) << "nCells"
<< setw(24) << "nFaces/nCells" << setw(20) << "nFaces/nCells"
<< setw(24) << "nInterfaces" << setw(20) << "nInterfaces"
<< setw(24) << "nIntFaces/nCells" << nl << setw(20) << "nIntFaces/nCells"
<< setw(12) << "profile"
<< nl
<< setw(8) << "Level" << setw(8) << "Level"
<< setw(8) << "nProcs" << setw(8) << "nProcs"
<< " " << " "
@ -93,8 +100,11 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
<< " " << " "
<< setw(8) << "avg" << setw(8) << "avg"
<< setw(8) << "max" << setw(8) << "max"
<< " " << setw(4) << "avg" << " "
<< " " << setw(4) << "max" << setw(8) << "avg"
<< setw(8) << "max"
//<< " "
<< setw(12) << "avg"
<< nl << nl
<< setw(8) << "-----" << setw(8) << "-----"
<< setw(8) << "------" << setw(8) << "------"
@ -104,8 +114,15 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
<< " " << " "
<< setw(8) << "---" << setw(8) << "---"
<< setw(8) << "---" << setw(8) << "---"
<< " " << setw(4) << "---" << " "
<< " " << setw(4) << "---" << setw(8) << "---"
<< setw(8) << "---"
<< " "
<< setw(8) << "---"
<< setw(8) << "---"
//<< " "
<< setw(12) << "---"
//<< " "
<< nl; << nl;
for (label levelI = 0; levelI <= size(); levelI++) for (label levelI = 0; levelI <= size(); levelI++)
@ -116,6 +133,7 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
label nInterfaces = 0; label nInterfaces = 0;
label nIntFaces = 0; label nIntFaces = 0;
scalar ratio = 0.0; scalar ratio = 0.0;
scalar profile = 0.0;
if (hasMeshLevel(levelI)) if (hasMeshLevel(levelI))
{ {
@ -137,6 +155,8 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
} }
} }
ratio = scalar(nIntFaces)/nCells; ratio = scalar(nIntFaces)/nCells;
profile = fineMesh.lduAddr().band().second();
} }
label totNprocs = returnReduce(nProcs, sumOp<label>()); label totNprocs = returnReduce(nProcs, sumOp<label>());
@ -155,12 +175,13 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
scalar maxRatio = returnReduce(ratio, maxOp<scalar>()); scalar maxRatio = returnReduce(ratio, maxOp<scalar>());
scalar totRatio = returnReduce(ratio, sumOp<scalar>()); scalar totRatio = returnReduce(ratio, sumOp<scalar>());
scalar totProfile = returnReduce(profile, sumOp<scalar>());
Info<< setw(8) << levelI Info<< setw(8) << levelI
<< setw(8) << totNprocs << setw(8) << totNprocs
<< " "
<< setw(16) << totNCells/totNprocs << setw(8) << totNCells/totNprocs
<< setw(8) << maxNCells << setw(8) << maxNCells
<< " " << " "
<< setw(8) << setprecision(4) << totFaceCellRatio/totNprocs << setw(8) << setprecision(4) << totFaceCellRatio/totNprocs
<< setw(8) << setprecision(4) << maxFaceCellRatio << setw(8) << setprecision(4) << maxFaceCellRatio
@ -170,11 +191,11 @@ void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels)
<< " " << " "
<< setw(8) << setprecision(4) << totRatio/totNprocs << setw(8) << setprecision(4) << totRatio/totNprocs
<< setw(8) << setprecision(4) << maxRatio << setw(8) << setprecision(4) << maxRatio
<< setw(12) << setprecision(4) << totProfile/totNprocs
<< nl; << nl;
} }
Info<< endl; Info<< endl;
} }
}
} }

View File

@ -224,6 +224,18 @@ class GAMGSolver
//- Interpolate the correction after injected prolongation //- Interpolate the correction after injected prolongation
void interpolate void interpolate
(
scalarField& psi,
scalarField& Apsi,
const lduMatrix& m,
const FieldField<Field, scalar>& interfaceBouCoeffs,
const lduInterfaceFieldPtrsList& interfaces,
const direction cmpt
) const;
//- Interpolate the correction after injected prolongation and
/// re-normalise
void interpolate
( (
scalarField& psi, scalarField& psi,
scalarField& Apsi, scalarField& Apsi,

View File

@ -34,8 +34,6 @@ void Foam::GAMGSolver::interpolate
const lduMatrix& m, const lduMatrix& m,
const FieldField<Field, scalar>& interfaceBouCoeffs, const FieldField<Field, scalar>& interfaceBouCoeffs,
const lduInterfaceFieldPtrsList& interfaces, const lduInterfaceFieldPtrsList& interfaces,
const labelList& restrictAddressing,
const scalarField& psiC,
const direction cmpt const direction cmpt
) const ) const
{ {
@ -81,6 +79,34 @@ void Foam::GAMGSolver::interpolate
{ {
psiPtr[celli] = -ApsiPtr[celli]/(diagPtr[celli]); psiPtr[celli] = -ApsiPtr[celli]/(diagPtr[celli]);
} }
}
void Foam::GAMGSolver::interpolate
(
scalarField& psi,
scalarField& Apsi,
const lduMatrix& m,
const FieldField<Field, scalar>& interfaceBouCoeffs,
const lduInterfaceFieldPtrsList& interfaces,
const labelList& restrictAddressing,
const scalarField& psiC,
const direction cmpt
) const
{
interpolate
(
psi,
Apsi,
m,
interfaceBouCoeffs,
interfaces,
cmpt
);
register const label nCells = m.diag().size();
scalar* __restrict__ psiPtr = psi.begin();
const scalar* const __restrict__ diagPtr = m.diag().begin();
register const label nCCells = psiC.size(); register const label nCCells = psiC.size();
scalarField corrC(nCCells, 0); scalarField corrC(nCCells, 0);

View File

@ -314,6 +314,8 @@ void Foam::GAMGSolver::Vcycle
const_cast<scalarField&>(ACf.operator const scalarField&()); const_cast<scalarField&>(ACf.operator const scalarField&());
if (interpolateCorrection_) //&& leveli < coarsestLevel - 2) if (interpolateCorrection_) //&& leveli < coarsestLevel - 2)
{
if (coarseCorrFields.set(leveli+1))
{ {
interpolate interpolate
( (
@ -327,6 +329,19 @@ void Foam::GAMGSolver::Vcycle
cmpt cmpt
); );
} }
else
{
interpolate
(
coarseCorrFields[leveli],
ACfRef,
matrixLevels_[leveli],
interfaceLevelsBouCoeffs_[leveli],
interfaceLevels_[leveli],
cmpt
);
}
}
// Scale coarse-grid correction field // Scale coarse-grid correction field
// but not on the coarsest level because it evaluates to 1 // but not on the coarsest level because it evaluates to 1

View File

@ -44,6 +44,22 @@ namespace Foam
cyclicGAMGInterfaceField, cyclicGAMGInterfaceField,
lduInterfaceField lduInterfaceField
); );
// Add under name cyclicSlip
addNamedToRunTimeSelectionTable
(
GAMGInterfaceField,
cyclicGAMGInterfaceField,
lduInterface,
cyclicSlip
);
addNamedToRunTimeSelectionTable
(
GAMGInterfaceField,
cyclicGAMGInterfaceField,
lduInterfaceField,
cyclicSlip
);
} }

View File

@ -45,6 +45,23 @@ namespace Foam
cyclicGAMGInterface, cyclicGAMGInterface,
Istream Istream
); );
// Add under name cyclicSlip
addNamedToRunTimeSelectionTable
(
GAMGInterface,
cyclicGAMGInterface,
lduInterface,
cyclicSlip
);
addNamedToRunTimeSelectionTable
(
GAMGInterface,
cyclicGAMGInterface,
Istream,
cyclicSlip
);
} }
@ -61,15 +78,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
const label coarseComm const label coarseComm
) )
: :
GAMGInterface GAMGInterface(index, coarseInterfaces),
(
index,
coarseInterfaces
// fineInterface,
// localRestrictAddressing,
// neighbourRestrictAddressing
),
//fineCyclicInterface_(refCast<const cyclicLduInterface>(fineInterface))
neighbPatchID_ neighbPatchID_
( (
refCast<const cyclicLduInterface>(fineInterface).neighbPatchID() refCast<const cyclicLduInterface>(fineInterface).neighbPatchID()
@ -169,11 +178,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
const labelUList& iF const labelUList& iF
) const ) const
{ {
const cyclicGAMGInterface& nbr = const cyclicGAMGInterface& nbr = neighbPatch();
//dynamic_cast<const cyclicGAMGInterface&>
//(
neighbPatch();
//);
const labelUList& nbrFaceCells = nbr.faceCells(); const labelUList& nbrFaceCells = nbr.faceCells();
tmp<labelField> tpnf(new labelField(size())); tmp<labelField> tpnf(new labelField(size()));

View File

@ -54,10 +54,6 @@ class cyclicGAMGInterface
{ {
// Private data // Private data
// //- Reference tor the cyclicLduInterface from which this is
// // agglomerated
// const cyclicLduInterface& fineCyclicInterface_;
//- Neigbour patch number //- Neigbour patch number
label neighbPatchID_; label neighbPatchID_;
@ -131,13 +127,11 @@ public:
//- Return neigbour processor number //- Return neigbour processor number
virtual label neighbPatchID() const virtual label neighbPatchID() const
{ {
//return fineCyclicInterface_.neighbPatchID();
return neighbPatchID_; return neighbPatchID_;
} }
virtual bool owner() const virtual bool owner() const
{ {
//return fineCyclicInterface_.owner();
return owner_; return owner_;
} }
@ -152,14 +146,12 @@ public:
//- Return face transformation tensor //- Return face transformation tensor
virtual const tensorField& forwardT() const virtual const tensorField& forwardT() const
{ {
//return fineCyclicInterface_.forwardT();
return forwardT_; return forwardT_;
} }
//- Return neighbour-cell transformation tensor //- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const virtual const tensorField& reverseT() const
{ {
//return fineCyclicInterface_.reverseT();
return reverseT_; return reverseT_;
} }

View File

@ -65,7 +65,12 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
Pout<< "MeshObject::New(const Mesh&) : constructing new " Pout<< "MeshObject::New(const Mesh&) : constructing new "
<< Type::typeName << endl; << Type::typeName << endl;
} }
return regIOobject::store(new Type(mesh));
Type* objectPtr = new Type(mesh);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
} }
} }
@ -98,7 +103,12 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
Pout<< "MeshObject::New(const Mesh&) : constructing new " Pout<< "MeshObject::New(const Mesh&) : constructing new "
<< Type::typeName << endl; << Type::typeName << endl;
} }
return regIOobject::store(new Type(mesh, d));
Type* objectPtr = new Type(mesh, d);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
} }
} }
@ -132,7 +142,14 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl; << Type::typeName << endl;
} }
return regIOobject::store(new Type(mesh, d1, d2));
Type* objectPtr = new Type(mesh, d1, d2);
// Make sure to register the top level regIOobject for if Type itself
// is a regIOobject
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
} }
} }
@ -167,7 +184,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl; << Type::typeName << endl;
} }
return regIOobject::store(new Type(mesh, d1, d2, d3)); Type* objectPtr = new Type(mesh, d1, d2, d3);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
} }
} }
@ -203,7 +224,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject(const Mesh&) : constructing new "
<< Type::typeName << endl; << Type::typeName << endl;
} }
return regIOobject::store(new Type(mesh, d1, d2, d3, d4)); Type* objectPtr = new Type(mesh, d1, d2, d3, d4);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,4 +146,129 @@ Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing)
} }
Foam::labelList Foam::bandCompression
(
const labelList& cellCells,
const labelList& offsets
)
{
// Count number of neighbours
labelList numNbrs(offsets.size()-1, 0);
forAll(numNbrs, cellI)
{
label start = offsets[cellI];
label end = offsets[cellI+1];
for (label faceI = start; faceI < end; faceI++)
{
numNbrs[cellI]++;
numNbrs[cellCells[faceI]]++;
}
}
labelList newOrder(offsets.size()-1);
// the business bit of the renumbering
SLList<label> nextCell;
PackedBoolList visited(offsets.size()-1);
label cellInOrder = 0;
// Work arrays. Kept outside of loop to minimise allocations.
// - neighbour cells
DynamicList<label> nbrs;
// - corresponding weights
DynamicList<label> weights;
// - ordering
labelList order;
while (true)
{
// For a disconnected region find the lowest connected cell.
label currentCell = -1;
label minWeight = labelMax;
forAll(visited, cellI)
{
// find the lowest connected cell that has not been visited yet
if (!visited[cellI])
{
if (numNbrs[cellI] < minWeight)
{
minWeight = numNbrs[cellI];
currentCell = cellI;
}
}
}
if (currentCell == -1)
{
break;
}
// Starting from currentCell walk breadth-first
// use this cell as a start
nextCell.append(currentCell);
// loop through the nextCell list. Add the first cell into the
// cell order if it has not already been visited and ask for its
// neighbours. If the neighbour in question has not been visited,
// add it to the end of the nextCell list
while (nextCell.size())
{
currentCell = nextCell.removeHead();
if (!visited[currentCell])
{
visited[currentCell] = 1;
// add into cellOrder
newOrder[cellInOrder] = currentCell;
cellInOrder++;
// Add in increasing order of connectivity
// 1. Count neighbours of unvisited neighbours
nbrs.clear();
weights.clear();
label start = offsets[currentCell];
label end = offsets[currentCell+1];
for (label faceI = start; faceI < end; faceI++)
{
label nbr = cellCells[faceI];
if (!visited[nbr])
{
// not visited, add to the list
nbrs.append(nbr);
weights.append(numNbrs[nbr]);
}
}
// 2. Sort in ascending order
sortedOrder(weights, order);
// 3. Add in sorted order
forAll(order, i)
{
nextCell.append(nbrs[i]);
}
}
}
}
return newOrder;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,6 +51,9 @@ namespace Foam
// original) // original)
labelList bandCompression(const labelListList& addressing); labelList bandCompression(const labelListList& addressing);
//- Renumber with addressing in losort form (neighbour + start in neighbour)
labelList bandCompression(const labelList& cellCells, const labelList& offsets);
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -152,11 +152,11 @@ public:
inline Cmpt& zz(); inline Cmpt& zz();
// Access vector components. // Access vector components.
// Note: returning const only to find out lhs usage
inline const Vector<Cmpt> x() const; inline Vector<Cmpt> x() const;
inline const Vector<Cmpt> y() const; inline Vector<Cmpt> y() const;
inline const Vector<Cmpt> z() const; inline Vector<Cmpt> z() const;
inline Vector<Cmpt> vectorComponent(const direction) const;
//- Transpose //- Transpose
inline Tensor<Cmpt> T() const; inline Tensor<Cmpt> T() const;

View File

@ -118,24 +118,42 @@ inline Tensor<Cmpt>::Tensor(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Cmpt> template<class Cmpt>
inline const Vector<Cmpt> Tensor<Cmpt>::x() const inline Vector<Cmpt> Tensor<Cmpt>::x() const
{ {
return Vector<Cmpt>(this->v_[XX], this->v_[XY], this->v_[XZ]); return Vector<Cmpt>(this->v_[XX], this->v_[XY], this->v_[XZ]);
} }
template<class Cmpt> template<class Cmpt>
inline const Vector<Cmpt> Tensor<Cmpt>::y() const inline Vector<Cmpt> Tensor<Cmpt>::y() const
{ {
return Vector<Cmpt>(this->v_[YX], this->v_[YY], this->v_[YZ]); return Vector<Cmpt>(this->v_[YX], this->v_[YY], this->v_[YZ]);
} }
template<class Cmpt> template<class Cmpt>
inline const Vector<Cmpt> Tensor<Cmpt>::z() const inline Vector<Cmpt> Tensor<Cmpt>::z() const
{ {
return Vector<Cmpt>(this->v_[ZX], this->v_[ZY], this->v_[ZZ]); return Vector<Cmpt>(this->v_[ZX], this->v_[ZY], this->v_[ZZ]);
} }
template<class Cmpt>
inline Vector<Cmpt> Tensor<Cmpt>::vectorComponent(const direction cmpt) const
{
switch (cmpt)
{
case 0:
return x();
break;
case 1:
return y();
break;
case 2:
return z();
break;
}
}
template<class Cmpt> template<class Cmpt>
inline const Cmpt& Tensor<Cmpt>::xx() const inline const Cmpt& Tensor<Cmpt>::xx() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,8 +73,18 @@ rotatingWallVelocityFvPatchVectorField
axis_(dict.lookup("axis")), axis_(dict.lookup("axis")),
omega_(DataEntry<scalar>::New("omega", dict)) omega_(DataEntry<scalar>::New("omega", dict))
{ {
if (dict.found("value"))
{
fvPatchField<vector>::operator=
(
vectorField("value", dict, p.size())
);
}
else
{
// Evaluate the wall velocity // Evaluate the wall velocity
updateCoeffs(); updateCoeffs();
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,11 +28,31 @@ Description
Two-scheme Courant number based blending differencing scheme. Two-scheme Courant number based blending differencing scheme.
Similar to localBlended but uses a blending factor computed from the Similar to localBlended but uses a blending factor computed from the
face-based Courant number and the alpha factor supplied: face-based Courant number and the lower and upper Courant number limits
supplied:
\f[
weight = 1 - max(min((Co - Co1)/(Co2 - Co1), 1), 0)
\f]
where
\vartable
Co1 | Courant number below which scheme1 is used
Co2 | Courant number above which scheme2 is used
\endvartable
weight = 1 - Co/alpha The weight applies to the first scheme and 1-weight to the second scheme.
The weight applies to the first scheme and 1-factor to the second scheme. Example of the CoBlended scheme specification using LUST for Courant numbers
less than 1 and linearUpwind for Courant numbers greater than 10:
\verbatim
divSchemes
{
.
.
div(phi,U) Gauss CoBlended 1 LUST grad(U) 10 linearUpwind grad(U);
.
.
}
\endverbatim
SourceFiles SourceFiles
CoBlended.C CoBlended.C
@ -60,13 +80,15 @@ class CoBlended
{ {
// Private data // Private data
const scalar alpha_; //- Courant number below which scheme1 is used
const scalar Co1_;
// Private Member Functions
//- Scheme 1 //- Scheme 1
tmp<surfaceInterpolationScheme<Type> > tScheme1_; tmp<surfaceInterpolationScheme<Type> > tScheme1_;
//- Courant number above which scheme2 is used
const scalar Co2_;
//- Scheme 2 //- Scheme 2
tmp<surfaceInterpolationScheme<Type> > tScheme2_; tmp<surfaceInterpolationScheme<Type> > tScheme2_;
@ -74,6 +96,8 @@ class CoBlended
const surfaceScalarField& faceFlux_; const surfaceScalarField& faceFlux_;
// Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
CoBlended(const CoBlended&); CoBlended(const CoBlended&);
@ -99,11 +123,12 @@ public:
) )
: :
surfaceInterpolationScheme<Type>(mesh), surfaceInterpolationScheme<Type>(mesh),
alpha_(readScalar(is)), Co1_(readScalar(is)),
tScheme1_ tScheme1_
( (
surfaceInterpolationScheme<Type>::New(mesh, is) surfaceInterpolationScheme<Type>::New(mesh, is)
), ),
Co2_(readScalar(is)),
tScheme2_ tScheme2_
( (
surfaceInterpolationScheme<Type>::New(mesh, is) surfaceInterpolationScheme<Type>::New(mesh, is)
@ -116,11 +141,11 @@ public:
) )
) )
{ {
if (alpha_ <= 0 ) if (Co1_ < 0 || Co2_ < 0 || Co1_ >= Co2_)
{ {
FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is) FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is)
<< "coefficient = " << alpha_ << "coefficients = " << Co1_ << " and " << Co2_
<< " should be > 0" << " should be > 0 and Co2 > Co1"
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
@ -135,22 +160,23 @@ public:
) )
: :
surfaceInterpolationScheme<Type>(mesh), surfaceInterpolationScheme<Type>(mesh),
alpha_(readScalar(is)), Co1_(readScalar(is)),
tScheme1_ tScheme1_
( (
surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is) surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
), ),
Co2_(readScalar(is)),
tScheme2_ tScheme2_
( (
surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is) surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
), ),
faceFlux_(faceFlux) faceFlux_(faceFlux)
{ {
if (alpha_ <= 0) if (Co1_ < 0 || Co2_ < 0 || Co1_ >= Co2_)
{ {
FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is) FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is)
<< "coefficient = " << alpha_ << "coefficients = " << Co1_ << " and " << Co2_
<< " should be > 0" << " should be > 0 and Co2 > Co1"
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
@ -165,11 +191,18 @@ public:
return return
( (
scalar(1) -
max max
( (
min
(
(
mesh.time().deltaT()*mesh.deltaCoeffs()
*mag(faceFlux_)/mesh.magSf()
- Co1_
)/(Co2_ - Co1_),
scalar(1) scalar(1)
- mesh.time().deltaT()*mesh.deltaCoeffs()*mag(faceFlux_) ),
/(mesh.magSf()*alpha_),
scalar(0) scalar(0)
) )
); );
@ -185,6 +218,8 @@ public:
{ {
surfaceScalarField bf(blendingFactor()); surfaceScalarField bf(blendingFactor());
Info<< "weights " << max(bf) << " " << min(bf) << endl;
return return
bf*tScheme1_().weights(vf) bf*tScheme1_().weights(vf)
+ (scalar(1.0) - bf)*tScheme2_().weights(vf); + (scalar(1.0) - bf)*tScheme2_().weights(vf);

View File

@ -115,7 +115,7 @@ Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
// Read the initial pressure gradient from file if it exists // Read the initial pressure gradient from file if it exists
IFstream propsFile IFstream propsFile
( (
mesh_.time().timeName()/"uniform"/(name_ + "Properties") mesh_.time().timePath()/"uniform"/(name_ + "Properties")
); );
if (propsFile.good()) if (propsFile.good())

View File

@ -1895,6 +1895,34 @@ Foam::labelList Foam::meshRefinement::meshedPatches() const
} }
void Foam::meshRefinement::selectSeparatedCoupledFaces(boolList& selected) const
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
if (isA<coupledPolyPatch>(patches[patchI]))
{
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
(
patches[patchI]
);
if (cpp.separated() || !cpp.parallel())
{
forAll(pp, i)
{
selected[pp.start()+i] = true;
}
}
}
}
}
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
( (
const point& keepPoint const point& keepPoint

View File

@ -864,6 +864,9 @@ public:
//- Get patchIDs for patches added in addMeshedPatch. //- Get patchIDs for patches added in addMeshedPatch.
labelList meshedPatches() const; labelList meshedPatches() const;
//- Select coupled faces that are not collocated
void selectSeparatedCoupledFaces(boolList&) const;
//- Split mesh. Keep part containing point. //- Split mesh. Keep part containing point.
autoPtr<mapPolyMesh> splitMeshRegions(const point& keepPoint); autoPtr<mapPolyMesh> splitMeshRegions(const point& keepPoint);

View File

@ -259,7 +259,7 @@ void Foam::surfaceFeatures::classifyFeatureAngles
if (eFaces.size() != 2) if (eFaces.size() != 2)
{ {
// Non-manifold. What to do here? Is region edge? external edge? // Non-manifold. What to do here? Is region edge? external edge?
edgeStat[edgeI] = NONE; edgeStat[edgeI] = REGION;
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -86,6 +86,24 @@ Foam::labelList Foam::CuthillMcKeeRenumber::renumber
} }
Foam::labelList Foam::CuthillMcKeeRenumber::renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField& cc
) const
{
labelList orderedToOld = bandCompression(cellCells, offsets);
if (reverse_)
{
reverse(orderedToOld);
}
return orderedToOld;
}
Foam::labelList Foam::CuthillMcKeeRenumber::renumber Foam::labelList Foam::CuthillMcKeeRenumber::renumber
( (
const labelListList& cellCells, const labelListList& cellCells,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -98,6 +98,17 @@ public:
const pointField& cc const pointField& cc
) const; ) const;
//- Return the order in which cells need to be visited, i.e.
// from ordered back to original cell label.
// Connectivity in losort addressing (= neighbour + offsets into
// neighbour)
virtual labelList renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField& cc
) const;
//- Return the order in which cells need to be visited, i.e. //- Return the order in which cells need to be visited, i.e.
// from ordered back to original cell label. // from ordered back to original cell label.
// The connectivity is equal to mesh.cellCells() except // The connectivity is equal to mesh.cellCells() except

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -89,6 +89,26 @@ Foam::labelList Foam::renumberMethod::renumber
} }
Foam::labelList Foam::renumberMethod::renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField& cc
) const
{
notImplemented
(
"renumberMethod::renumber\n"
"(\n"
" const labelList&,\n"
" const labelList&,\n"
" const pointField&\n"
") const"
);
return labelList();
}
Foam::labelList Foam::renumberMethod::renumber Foam::labelList Foam::renumberMethod::renumber
( (
const polyMesh& mesh, const polyMesh& mesh,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -126,6 +126,17 @@ public:
// Use the mesh connectivity (if needed) // Use the mesh connectivity (if needed)
virtual labelList renumber(const polyMesh&, const pointField&) const; virtual labelList renumber(const polyMesh&, const pointField&) const;
//- Return the order in which cells need to be visited, i.e.
// from ordered back to original cell label.
// Addresing in losort addressing (= neighbour + offsets into
// neighbour)
virtual labelList renumber
(
const labelList& cellCells,
const labelList& offsets,
const pointField&
) const;
//- Return the order in which cells need to be visited, i.e. //- Return the order in which cells need to be visited, i.e.
// from ordered back to original cell label. // from ordered back to original cell label.
// Gets passed agglomeration map (from fine to coarse cells) and coarse // Gets passed agglomeration map (from fine to coarse cells) and coarse

View File

@ -182,7 +182,7 @@ public:
const word& phaseName const word& phaseName
) )
{ {
return name + phaseName; return IOobject::groupName(name, phaseName);
} }
word phasePropertyName(const word& name) const word phasePropertyName(const word& name) const

View File

@ -69,7 +69,6 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),
transportModel(U, phi),
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name), twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
nuModel1_ nuModel1_

View File

@ -47,7 +47,6 @@ Foam::singlePhaseTransportModel::singlePhaseTransportModel
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),
transportModel(U, phi),
viscosityModelPtr_(viscosityModel::New("nu", *this, U, phi)) viscosityModelPtr_(viscosityModel::New("nu", *this, U, phi))
{} {}

View File

@ -36,10 +36,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::transportModel::transportModel Foam::transportModel::transportModel
( ()
const volVectorField&,
const surfaceScalarField&
)
{} {}

View File

@ -70,10 +70,7 @@ public:
//- Construct from components //- Construct from components
transportModel transportModel
( ();
const volVectorField& U,
const surfaceScalarField& phi
);\
//- Destructor //- Destructor

View File

@ -1,64 +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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6
(
outer
{
type patch;
nFaces 825;
startFace 23340;
}
ground
{
type wall;
nFaces 645;
startFace 24165;
}
blockedFaces
{
type wall;
nFaces 0;
startFace 24810;
}
baffleWall
{
type wall;
nFaces 0;
startFace 24810;
}
baffleCyclic_half0
{
type cyclic;
inGroups 1(cyclic);
nFaces 0;
startFace 24810;
matchTolerance 0.0001;
neighbourPatch baffleCyclic_half1;
}
baffleCyclic_half1
{
type cyclic;
inGroups 1(cyclic);
nFaces 0;
startFace 24810;
matchTolerance 0.0001;
neighbourPatch baffleCyclic_half0;
}
)
// ************************************************************************* //

View File

@ -1,58 +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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6
(
maxY
{
type wall;
nFaces 300;
startFace 8300;
}
minX
{
type patch;
nFaces 100;
startFace 8600;
}
maxX
{
type patch;
nFaces 100;
startFace 8700;
}
minY
{
type wall;
nFaces 300;
startFace 8800;
}
minZ
{
type wall;
nFaces 300;
startFace 9100;
}
maxZ
{
type wall;
nFaces 300;
startFace 9400;
}
)
// ************************************************************************* //

View File

@ -1,70 +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 binary;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
8
(
movingWall
{
type wall;
nFaces 85;
startFace 3665;
}
farFieldMoving
{
type patch;
nFaces 50;
startFace 3750;
}
fixedWall
{
type wall;
nFaces 35;
startFace 3800;
}
axis
{
type symmetryPlane;
nFaces 0;
startFace 3835;
}
left
{
type patch;
nFaces 30;
startFace 3835;
}
farField
{
type patch;
nFaces 35;
startFace 3865;
}
back
{
type wedge;
nFaces 1900;
startFace 3900;
}
front
{
type wedge;
nFaces 1900;
startFace 5800;
}
)
// ************************************************************************* //

View File

@ -8,51 +8,57 @@
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format binary;
class polyBoundaryMesh; class volVectorField;
location "constant/polyMesh"; object U;
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6 dimensions [0 1 -1 0 0 0 0];
(
down internalField uniform (0 0 0);
boundaryField
{
".*"
{ {
type symmetryPlane; type fixedValue;
nFaces 60; value $internalField;
startFace 3890;
} }
right
gasInlet
{ {
type patch; type fixedValue;
nFaces 30; value uniform (0 0 0.5);
startFace 3950;
} }
up
outlet
{ {
type symmetryPlane; type pressureInletOutletVelocity;
nFaces 60; phi phi;
startFace 3980; value $internalField;
} }
left
"(shaftRotating|stirrer)"
{ {
type patch; type movingWallVelocity;
nFaces 30; value $internalField;
startFace 4040;
} }
cylinder
shaft
{ {
type symmetryPlane; type rotatingWallVelocity;
nFaces 40; origin (0 0 0);
startFace 4070; axis (0 0 1);
omega -5;
} }
defaultFaces
"AMI.*"
{ {
type empty; type cyclicAMI;
nFaces 4000; value $internalField;
startFace 4110;
} }
) }
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,45 +9,39 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class polyBoundaryMesh; class volScalarField;
location "constant/polyMesh"; object alpha1;
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5 dimensions [0 0 0 0 0 0 0];
(
inlet internalField uniform 0;
boundaryField
{
".*"
{ {
type patch; type zeroGradient;
nFaces 30;
startFace 24170;
} }
gasInlet
{
type fixedValue;
value uniform 1;
}
outlet outlet
{ {
type patch; type inletOutlet;
nFaces 57; inletValue uniform 0;
startFace 24200; value $internalField;
} }
upperWall
"AMI.*"
{ {
type wall; type cyclicAMI;
nFaces 223;
startFace 24257;
} }
lowerWall }
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
inGroups 1(empty);
nFaces 24450;
startFace 24730;
}
)
// ************************************************************************* // // ************************************************************************* //

View File

@ -9,50 +9,42 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class polyBoundaryMesh; class volScalarField;
location "constant/polyMesh"; object epsilon;
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6 dimensions [0 2 -3 0 0 0 0];
(
maxX internalField uniform 7e-3;
boundaryField
{
".*"
{ {
type patch; type epsilonWallFunction;
nFaces 36; value $internalField;
startFace 540;
} }
minZ
gasInlet
{ {
type patch; type fixedValue;
nFaces 36; value $internalField;
startFace 576;
} }
maxZ
outlet
{ {
type patch; type inletOutlet;
nFaces 36; inletValue $internalField;
startFace 612; value $internalField;
} }
minX
"AMI.*"
{ {
type patch; type cyclicAMI;
nFaces 36; value $internalField;
startFace 648;
} }
minY }
{
type patch;
nFaces 36;
startFace 684;
}
maxY
{
type patch;
nFaces 36;
startFace 720;
}
)
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- 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 0.01;
boundaryField
{
".*"
{
type kqRWallFunction;
value $internalField;
}
gasInlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"AMI.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- 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 nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
".*"
{
type nutkWallFunction;
value $internalField;
}
gasInlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"AMI.*"
{
type cyclicAMI;
}
}
// ************************************************************************* //

View File

@ -9,32 +9,35 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class polyBoundaryMesh; class volScalarField;
location "constant/polyMesh"; object p_rgh;
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
3 dimensions [1 -1 -2 0 0 0 0];
(
Default_Boundary_Region internalField uniform 1.25e5;
boundaryField
{
".*"
{ {
type wall; type fixedFluxPressure;
nFaces 22400; phi phiAbs;
startFace 324400; value $internalField;
}
inlet
{
type patch;
nFaces 400;
startFace 346800;
} }
outlet outlet
{ {
type patch; type fixedValue;
nFaces 400; value $internalField;
startFace 347200;
} }
)
"AMI.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,13 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
\rm -rf 0
\rm -rf constant/extendedFeatureEdgeMesh/
\rm -f constant/triSurface/*.eMesh*
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,37 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application=`getApplication`
\rm -rf 0
# Meshing
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
runApplication createBaffles -overwrite
runApplication mergeOrSplitBaffles -split -overwrite
# Get rid of zero faced patches
runApplication createPatch -overwrite
# Copy fields after meshing to avoind the generation of unnecessary patch fields
\cp -r 0.org 0
# Initialize alpha
runApplication setFields
# Decompose
runApplication decomposePar -force
# Run
runParallel $application 6
# Reconstruct
runApplication reconstructPar -noFunctionObjects
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,25 @@
/*--------------------------------*- 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 kEpsilon;
turbulence on;
printCoeffs off;
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- 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 dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
motionSolverLibs ( "libfvMotionSolvers.so" );
solidBodyMotionFvMeshCoeffs
{
cellZone rotating;
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
CofG (0 0 0);
radialVelocity (0 0 -288); // deg/s -> 5 rad/s -> 48 rpm
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- 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 0 -9.81 );
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- 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.3 -0.3 -0.15)
( 0.3 -0.3 -0.15)
( 0.3 0.3 -0.15)
( -0.3 0.3 -0.15)
( -0.3 -0.3 1.4)
( 0.3 -0.3 1.4)
( 0.3 0.3 1.4)
( -0.3 0.3 1.4)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (50 50 100) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
allBoundary
{
type patch;
faces
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
(0 3 2 1)
(4 5 6 7)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*--------------------------------*- 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 binary;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
10
(
vessel
{
type wall;
inGroups 1(meshedWalls);
nFaces 46033;
startFace 2418792;
}
gasInlet
{
type patch;
nFaces 820;
startFace 2464825;
}
outlet
{
type patch;
nFaces 93;
startFace 2465645;
}
shaftRotating
{
type wall;
inGroups 1(meshedWalls);
nFaces 2230;
startFace 2465738;
}
shaft
{
type wall;
inGroups 1(meshedWalls);
nFaces 648;
startFace 2467968;
}
sparger
{
type wall;
inGroups 1(meshedWalls);
nFaces 1472;
startFace 2468616;
}
stirrer
{
type wall;
inGroups 1(meshedWalls);
nFaces 5981;
startFace 2470088;
}
baffles
{
type wall;
inGroups 1(meshedWalls);
nFaces 2668;
startFace 2476069;
}
AMI1
{
type cyclicAMI;
inGroups 1(cyclicAMI);
nFaces 42566;
startFace 2478737;
matchTolerance 0.0001;
transform noOrdering;
neighbourPatch AMI2;
}
AMI2
{
type cyclicAMI;
inGroups 1(cyclicAMI);
nFaces 42566;
startFace 2521303;
matchTolerance 0.0001;
transform noOrdering;
neighbourPatch AMI1;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
twoPhase
{
transportModel twoPhase;
phase1 phase1;
phase2 phase2;
}
phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 300;
}
phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-6;
rho rho [ 1 -3 0 0 0 0 0 ] 1027;
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
solid baffles
facet normal 0.707107 0.707107 -0
outer loop
vertex 0.137322 -0.137322 0.025
vertex 0.137322 -0.137322 0.4
vertex 0.155 -0.155 0.025
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex 0.137322 -0.137322 0.4
vertex 0.155 -0.155 0.4
vertex 0.155 -0.155 0.025
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex 0.155 -0.155 0.025
vertex 0.155 -0.155 0.4
vertex 0.172678 -0.172678 0.025
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex 0.155 -0.155 0.4
vertex 0.172678 -0.172678 0.4
vertex 0.172678 -0.172678 0.025
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex 0.137322 -0.137322 0.4
vertex 0.137322 -0.137322 0.775
vertex 0.155 -0.155 0.4
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex 0.137322 -0.137322 0.775
vertex 0.155 -0.155 0.775
vertex 0.155 -0.155 0.4
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex 0.155 -0.155 0.4
vertex 0.155 -0.155 0.775
vertex 0.172678 -0.172678 0.4
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex 0.155 -0.155 0.775
vertex 0.172678 -0.172678 0.775
vertex 0.172678 -0.172678 0.4
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex -0.172678 0.172678 0.025
vertex -0.172678 0.172678 0.4
vertex -0.155 0.155 0.025
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex -0.172678 0.172678 0.4
vertex -0.155 0.155 0.4
vertex -0.155 0.155 0.025
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex -0.155 0.155 0.025
vertex -0.155 0.155 0.4
vertex -0.137322 0.137322 0.025
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex -0.155 0.155 0.4
vertex -0.137322 0.137322 0.4
vertex -0.137322 0.137322 0.025
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex -0.172678 0.172678 0.4
vertex -0.172678 0.172678 0.775
vertex -0.155 0.155 0.4
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex -0.172678 0.172678 0.775
vertex -0.155 0.155 0.775
vertex -0.155 0.155 0.4
endloop
endfacet
facet normal 0.707107 0.707107 -0
outer loop
vertex -0.155 0.155 0.4
vertex -0.155 0.155 0.775
vertex -0.137322 0.137322 0.4
endloop
endfacet
facet normal 0.707107 0.707107 0
outer loop
vertex -0.155 0.155 0.775
vertex -0.137322 0.137322 0.775
vertex -0.137322 0.137322 0.4
endloop
endfacet
endsolid baffles

View File

@ -0,0 +1,254 @@
solid gasInlet
facet normal 0 0 1
outer loop
vertex 0.0984808 0.0173648 0
vertex 0 0 0
vertex 0.1 0 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0939693 0.034202 0
vertex 0 0 0
vertex 0.0984808 0.0173648 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0866025 0.05 0
vertex 0 0 0
vertex 0.0939693 0.034202 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0766044 0.0642788 0
vertex 0 0 0
vertex 0.0866025 0.05 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0642788 0.0766044 0
vertex 0 0 0
vertex 0.0766044 0.0642788 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.05 0.0866025 0
vertex 0 0 0
vertex 0.0642788 0.0766044 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.034202 0.0939693 0
vertex 0 0 0
vertex 0.05 0.0866025 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0173648 0.0984808 0
vertex 0 0 0
vertex 0.034202 0.0939693 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 6.12323e-18 0.1 0
vertex 0 0 0
vertex 0.0173648 0.0984808 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0173648 0.0984808 0
vertex 0 0 0
vertex 6.12323e-18 0.1 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.034202 0.0939693 0
vertex 0 0 0
vertex -0.0173648 0.0984808 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.05 0.0866025 0
vertex 0 0 0
vertex -0.034202 0.0939693 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0642788 0.0766044 0
vertex 0 0 0
vertex -0.05 0.0866025 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0766044 0.0642788 0
vertex 0 0 0
vertex -0.0642788 0.0766044 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0866025 0.05 0
vertex 0 0 0
vertex -0.0766044 0.0642788 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0939693 0.034202 0
vertex 0 0 0
vertex -0.0866025 0.05 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.0984808 0.0173648 0
vertex 0 0 0
vertex -0.0939693 0.034202 0
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.1 1.22465e-17 0
vertex 0 0 0
vertex -0.0984808 0.0173648 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0984808 -0.0173648 0
vertex 0 0 0
vertex -0.1 1.22465e-17 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0939693 -0.034202 0
vertex 0 0 0
vertex -0.0984808 -0.0173648 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0866025 -0.05 0
vertex 0 0 0
vertex -0.0939693 -0.034202 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0766044 -0.0642788 0
vertex 0 0 0
vertex -0.0866025 -0.05 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0642788 -0.0766044 0
vertex 0 0 0
vertex -0.0766044 -0.0642788 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.05 -0.0866025 0
vertex 0 0 0
vertex -0.0642788 -0.0766044 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.034202 -0.0939693 0
vertex 0 0 0
vertex -0.05 -0.0866025 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -0.0173648 -0.0984808 0
vertex 0 0 0
vertex -0.034202 -0.0939693 0
endloop
endfacet
facet normal 0 -0 1
outer loop
vertex -1.83697e-17 -0.1 0
vertex 0 0 0
vertex -0.0173648 -0.0984808 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0173648 -0.0984808 0
vertex 0 0 0
vertex -1.83697e-17 -0.1 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.034202 -0.0939693 0
vertex 0 0 0
vertex 0.0173648 -0.0984808 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.05 -0.0866025 0
vertex 0 0 0
vertex 0.034202 -0.0939693 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0642788 -0.0766044 0
vertex 0 0 0
vertex 0.05 -0.0866025 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0766044 -0.0642788 0
vertex 0 0 0
vertex 0.0642788 -0.0766044 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0866025 -0.05 0
vertex 0 0 0
vertex 0.0766044 -0.0642788 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0939693 -0.034202 0
vertex 0 0 0
vertex 0.0866025 -0.05 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.0984808 -0.0173648 0
vertex 0 0 0
vertex 0.0939693 -0.034202 0
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.1 -2.44929e-17 0
vertex 0 0 0
vertex 0.0984808 -0.0173648 0
endloop
endfacet
endsolid gasInlet

View File

@ -0,0 +1,240 @@
solid outlet
facet normal 0 0 1
outer loop
vertex -0.129544 -0.0947905 1.3
vertex -0.13 -0.1 1.3
vertex -0.129544 -0.105209 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.125981 -0.115 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.128191 -0.110261 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.128191 -0.110261 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.129544 -0.105209 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.122981 -0.119284 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.125981 -0.115 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.119284 -0.122981 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.122981 -0.119284 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.115 -0.125981 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.119284 -0.122981 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.110261 -0.128191 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.115 -0.125981 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.105209 -0.129544 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.110261 -0.128191 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.1 -0.13 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.105209 -0.129544 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0947905 -0.129544 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.1 -0.13 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0897394 -0.128191 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0947905 -0.129544 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.085 -0.125981 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0897394 -0.128191 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0807164 -0.122981 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.085 -0.125981 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0770187 -0.119284 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0807164 -0.122981 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0740192 -0.115 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0770187 -0.119284 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0718092 -0.110261 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0740192 -0.115 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0704558 -0.105209 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0718092 -0.110261 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.07 -0.1 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0704558 -0.105209 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0704558 -0.0947905 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.07 -0.1 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0718092 -0.0897394 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0704558 -0.0947905 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0740192 -0.085 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0718092 -0.0897394 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0770187 -0.0807164 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0740192 -0.085 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0807164 -0.0770187 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0770187 -0.0807164 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.085 -0.0740192 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0807164 -0.0770187 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0897394 -0.0718092 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.085 -0.0740192 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.0947905 -0.0704558 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0897394 -0.0718092 1.3
endloop
endfacet
facet normal 0 0 1
outer loop
vertex -0.1 -0.07 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.0947905 -0.0704558 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.105209 -0.0704558 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.1 -0.07 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.110261 -0.0718092 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.105209 -0.0704558 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.115 -0.0740192 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.110261 -0.0718092 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.119284 -0.0770187 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.115 -0.0740192 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.122981 -0.0807164 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.119284 -0.0770187 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.125981 -0.085 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.122981 -0.0807164 1.3
endloop
endfacet
facet normal -0 0 1
outer loop
vertex -0.128191 -0.0897394 1.3
vertex -0.129544 -0.0947905 1.3
vertex -0.125981 -0.085 1.3
endloop
endfacet
endsolid ascii

View File

@ -0,0 +1,40 @@
36
(
1069
1071
1074
1253
1256
1259
1262
1264
1266
1269
1271
1273
1276
1463
1466
1468
1471
1474
1477
1480
1482
1485
1487
1490
1492
1494
1497
1500
1503
1506
1508
1512
1514
1517
1519
1522
)

View File

@ -0,0 +1,20 @@
/*--------------------------------*- 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 turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- 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 interDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 5.0;
deltaT 1e-4;
writeControl adjustableRunTime;
writeInterval 0.025;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 10;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 1.5;
maxAlphaCo 1;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- 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 createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Whether to convert internal faces only (so leave boundary faces intact).
// This is only relevant if your face selection type can pick up boundary
// faces.
internalFacesOnly true;
// Baffles to create.
baffles
{
rotating
{
//- Use predefined faceZone to select faces and orientation.
type faceZone;
zoneName rotating;
patches
{
master
{
//- Master side patch
name AMI1;
type cyclicAMI;
matchTolerance 0.0001;
neighbourPatch AMI2;
transform noOrdering;
}
slave
{
//- Slave side patch
name AMI2;
type cyclicAMI;
matchTolerance 0.0001;
neighbourPatch AMI1;
transform noOrdering;
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- 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 createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
// with transformations (i.e. cyclics).
pointSync false;
// Patches to create.
patches
(
);
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- 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 decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 6;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- 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;
grad(U) cellLimited Gauss linear 1;
}
divSchemes
{
div(rho*phi,U) Gauss linearUpwind grad(U);
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression 1;
div(phid1,p_rgh) Gauss upwind;
div(phid2,p_rgh) Gauss upwind;
div(rho*phi,T) Gauss linearUpwind unlimited;
div(rho*phi,K) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div((muEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear limited 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited 0.333;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
}
// ************************************************************************* //

View File

@ -0,0 +1,105 @@
/*--------------------------------*- 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
{
alpha1
{
nAlphaCorr 1;
nAlphaSubCycles 2;
cAlpha 1;
}
p_rgh
{
solver GAMG;
tolerance 1e-6;
relTol 0.02;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
nPreSweeps 0;
nPostSweeps 2;
mergeLevels 1;
}
pcorr
{
$p_rgh;
tolerance 0.1;
relTol 0;
}
p_rghFinal
{
$p_rgh;
relTol 0;
}
".*(rho|rhoFinal)"
{
solver diagonal;
}
"U.*"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-6;
relTol 0;
nSweeps 1;
}
"(T|k|epsilon).*"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
correctPhi yes;
transSonic no;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 2;
cAlpha 1;
}
relaxationFactors
{
fields
{
}
equations
{
"U.*" 1;
"k.*" 1;
"epsilon.*" 1;
"T.*" 1;
}
}
// ************************************************************************* //

View File

@ -9,26 +9,28 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class polyBoundaryMesh; class dictionary;
location "constant/polyMesh"; location "system";
object boundary; object setFieldsDict;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2 defaultFieldValues
( (
stationaryWalls volScalarFieldValue alpha1 1
);
regions
(
boxToCell
{ {
type patch; box (-4 -4 -1) (4 4 0.74);
nFaces 666; fieldValues
startFace 3069; (
volScalarFieldValue alpha1 0
);
} }
movingBlock );
{
type patch;
nFaces 0;
startFace 3735;
}
)
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,571 @@
/*--------------------------------*- 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 snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap true;
addLayers false;
geometry
{
vessel.stl
{
name vessel;
type triSurfaceMesh;
regions
{
vessel
{
name vessel;
}
}
}
gasInlet.stl
{
name gasInlet;
type triSurfaceMesh;
regions
{
gasInlet
{
name gasInlet;
}
}
}
outlet.stl
{
name outlet;
type triSurfaceMesh;
regions
{
outlet
{
name outlet;
}
}
}
shaftRotating.stl
{
name shaftRotating;
type triSurfaceMesh;
regions
{
shaftRotating
{
name shaftRotating;
}
}
}
shaft.stl
{
name shaft;
type triSurfaceMesh;
regions
{
shaft
{
name shaft;
}
}
}
sparger.stl
{
name sparger;
type triSurfaceMesh;
regions
{
sparger
{
name sparger;
}
}
}
stirrer.stl
{
name stirrer;
type triSurfaceMesh;
regions
{
stirrer
{
name stirrer;
}
}
}
baffles.stl
{
name baffles;
type triSurfaceMesh;
regions
{
baffles
{
name baffles;
}
}
}
rotating.stl
{
name rotating;
type triSurfaceMesh;
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 100000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 3000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 0;
// Allow a certain level of imbalance during refining
// (since balancing is quite expensive)
// Expressed as fraction of perfect balance (= overall number of cells /
// nProcs). 0=balance always.
maxLoadUnbalance 0.10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 1;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by explicitly provided
// edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
// Specify 'levels' in the same way as the 'distance' mode in the
// refinementRegions (see below). The old specification
// level 2;
// is equivalent to
// levels ((0 2));
features
(
{
file "gasInlet.eMesh";
levels ((1 1));
}
{
file "vessel.eMesh";
levels ((1 1));
}
{
file "outlet.eMesh";
levels ((1 1));
}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
vessel
{
level (1 2);
patchInfo
{
type wall;
inGroups (meshedWalls);
}
}
gasInlet
{
level (0 1);
patchInfo
{
type patch;
}
}
outlet
{
level (0 1);
patchInfo
{
type patch;
}
}
shaftRotating
{
level (1 1);
patchInfo
{
${...vessel.patchInfo}
}
}
shaft
{
level (1 1);
patchInfo
{
${...vessel.patchInfo}
}
}
sparger
{
level (1 1);
patchInfo
{
${...vessel.patchInfo}
}
}
stirrer
{
level (1 1);
patchInfo
{
${...vessel.patchInfo}
}
}
baffles
{
level (1 1);
patchInfo
{
${...vessel.patchInfo}
}
}
rotating
{
level (1 2);
cellZone rotating;
faceZone rotating;
cellZoneInside insidePoint;
insidePoint (0 0.1 0.5);
}
}
// Feature angle:
// - used if min and max refinement level of a surface differ
// - used if feature snapping (see snapControls below) is used
resolveFeatureAngle 30;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// increasing order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (0 0.1 1.0);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
}
// Settings for the snapping.
snapControls
{
// Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
// Maximum relative distance for points to be attracted by surface.
// True distance is this factor times local maximum edge length.
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
tolerance 3.0;
// Number of mesh displacement relaxation iterations.
nSolveIter 30;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Feature snapping
// Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 15;
// Detect (geometric only) features by sampling the surface
// (default=false).
implicitFeatureSnap false;
// Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;
// Detect features between multiple surfaces
// (only for explicitFeatureSnap, default = false)
multiRegionFeatureSnap false;
}
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Layer thickness specification. This can be specified in one of four ways
// - expansionRatio and finalLayerThickness (cell nearest internal mesh)
// - expansionRatio and firstLayerThickness (cell on surface)
// - overall thickness and firstLayerThickness
// - overall thickness and finalLayerThickness
// Expansion factor for layer mesh
expansionRatio 1.0;
// Wanted thickness of the layer furthest away from the wall.
// If relativeSizes this is relative to undistorted size of cell
// outside layer.
finalLayerThickness 0.3;
// Wanted thickness of the layer next to the wall.
// If relativeSizes this is relative to undistorted size of cell
// outside layer.
//firstLayerThickness 0.3;
// Wanted overall thickness of layers.
// If relativeSizes this is relative to undistorted size of cell
// outside layer.
//thickness 0.5
// Minimum overall thickness of total layers. If for any reason layer
// cannot be above minThickness do not add layer.
// If relativeSizes this is relative to undistorted size of cell
// outside layer..
minThickness 0.25;
// Per final patch (so not geometry!) the layer information
// Note: This behaviour changed after 21x. Any non-mentioned patches
// now slide unless:
// - nSurfaceLayers is explicitly mentioned to be 0.
// - angle to nearest surface < slipFeatureAngle (see below)
layers
{
vessel
{
nSurfaceLayers 1;
expansionRatio 1.3;
finalLayerThickness 0.5;
minThickness 0.1;
}
}
// If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
// Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
nGrow 0;
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 60;
// At non-patched sides allow mesh to slip if extrusion direction makes
// angle larger than slipFeatureAngle.
slipFeatureAngle 30;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 10;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
// Max number of iterations after which relaxed meshQuality controls
// get used. Up to nRelaxIter it uses the settings in meshQualityControls,
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
nRelaxedIter 20;
// Additional reporting: if there are just a few faces where there
// are mesh errors (after adding the layers) print their face centres.
// This helps in tracking down problematic mesh areas.
//additionalReporting true;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
// Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;
// Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;
// Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
// Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
// Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. This has to be a positive number for tracking
// to work. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-9;
// Minimum face area. Set to <0 to disable.
minArea -1;
// Minimum face twist. Set to <-1 to disable. dot product of face normal
// and face centre triangles normal
minTwist 0.05;
// minimum normalised cell determinant
// 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
// minFaceWeight (0 -> 0.5)
minFaceWeight 0.05;
// minVolRatio (0 -> 1)
minVolRatio 0.01;
// must be >0 for Fluent compatibility
minTriangleTwist -1;
//- if >0 : preserve single cells with all points on the surface if the
// resulting volume after snapping (by approximation) is larger than
// minVolCollapseRatio times old volume (i.e. not collapsed to flat cell).
// If <0 : delete always.
//minVolCollapseRatio 0.5;
// Advanced
// Number of error distribution iterations
nSmoothScale 4;
// amount to scale back displacement at error points
errorReduction 0.75;
// Optional : some meshing phases allow usage of relaxed rules.
// See e.g. addLayersControls::nRelaxedIter.
relaxed
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 75;
}
}
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;
// ************************************************************************* //

View File

@ -0,0 +1,113 @@
/*--------------------------------*- 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 surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vessel.stl
{
// How to obtain raw features (extractFromFile || extractFromSurface)
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 120;
}
// Write options
// Write features to obj format for postprocessing
writeObj no;
}
gasInlet.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
stirrer.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
outlet.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
/*
baffles.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
rotating.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
sparger.stl
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 120;
}
writeObj no;
}
*/
// ************************************************************************* //