Reorganised DNSandLES, moved the LES solvers to the appropriate sub-directories

This commit is contained in:
henry
2008-05-22 11:05:39 +01:00
parent 665096c17b
commit 6519ade10b
54 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
description "Incompressible large eddy simulation (LES) code for channel flow";
dictionaries
{
include "$FOAMX_CONFIG/dictionaries/controlDict/controlDict.cfg";
fvSchemes;
fvSolution;
transportProperties;
include "$FOAMX_CONFIG/dictionaries/turbulenceProperties/LESmodelsIncompressible.cfg";
}
fields
{
include "$FOAMX_CONFIG/entries/geometricFields/pKinematic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/U.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/k.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/nuSgs.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Bkinematic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/nuTilda.cfg";
}
patchPhysicalTypes
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/patches.cfg";
}
patchFieldsPhysicalTypes
{
U
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/U.cfg";
}
p
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/p.cfg";
}
k
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/k.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/k.cfg";
}
nuSgs
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/nuSgs.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/nuSgs.cfg";
}
B
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/B.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/B.cfg";
}
nuTilda
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/nuTilda.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/nuTilda.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,76 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default backward;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss <>;
div(phi,k) Gauss <>;
div(phi,B) Gauss <>;
div(B) Gauss linear;
div(phi,nuTilda) Gauss <>;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DBEff,B) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p ICCG 1e-06 0;
pFinal ICCG 1e-06 0;
U BICCG 1e-05 0;
k BICCG 1e-05 0;
B BICCG 1e-05 0;
nuTilda BICCG 1e-05 0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 1001;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSchemes/fvSchemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/ddt/transient.cfg";
include "../../../incompressible/turbFoam/FoamX/fvSchemes/gradSchemes.cfg";
include "../../oodles/FoamX/fvSchemes/divSchemes.cfg";
include "../../oodles/FoamX/fvSchemes/laplacianSchemes.cfg";
include "../../../incompressible/turbFoam/FoamX/fvSchemes/interpolationSchemes.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/snGrad/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/flux/p.cfg";
}
default
{
include "defaults/system/fvSchemes";
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSolution/fvSolution.cfg";
entries
{
solvers
{
type dictionary;
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pSymm.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pFinal.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/k.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/B.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/nuTilda.cfg";
}
}
include "$FOAMX_CONFIG/dictionaries/fvSolution/PISO.cfg";
}
default
{
include "defaults/system/fvSolution";
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/transportProperties/transportProperties.cfg";
entries
{
include "$FOAMX_CONFIG/entries/dimensionedVector/Ubar.cfg";
include "$FOAMX_CONFIG/dictionaries/transportProperties/incompressibleTransportModel.cfg";
include "$FOAMX_CONFIG/dictionaries/transportProperties/NewtonianViscosity.cfg";
include "$FOAMX_CONFIG/dictionaries/transportProperties/CrossPowerLawCoeffs.cfg";
include "$FOAMX_CONFIG/dictionaries/transportProperties/BirdCarreauCoeffs.cfg";
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/LESmodels \
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I../oodles
EXE_LIBS = \
-lincompressibleLESmodels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
oodles
Description
Incompressible LES solver for flow in a channel.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/LESmodel/LESmodel.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Random.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readTransportProperties.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "createGradP.H"
Info<< "\nStarting time loop\n" << endl;
for(runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H"
sgsModel->correct();
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ sgsModel->divDevBeff(U)
==
flowDirection*gradP
);
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}
// --- PISO loop
volScalarField rUA = 1.0/UEqn.A();
for (int corr=0; corr<nCorr; corr++)
{
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}
// Correct driving force for a constant mass flow rate
// Extract the velocity in the flow direction
dimensionedScalar magUbarStar =
(flowDirection & U)().weightedAverage(mesh.V());
// Calculate the pressure gradient increment needed to
// adjust the average flow-rate to the correct value
dimensionedScalar gragPplus =
(magUbar - magUbarStar)/rUA.weightedAverage(mesh.V());
U += flowDirection*rUA*gragPplus;
gradP += gragPplus;
Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab
<< "pressure gradient = " << gradP.value() << endl;
runTime.write();
#include "writeGradP.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<LESmodel> sgsModel
(
LESmodel::New(U, phi, laminarTransport)
);

View File

@ -0,0 +1,24 @@
dimensionedScalar gradP
(
"gradP",
dimensionSet(0, 1, -2, 0, 0),
0.0
);
IFstream gradPFile
(
runTime.path()/runTime.timeName()/"gradP.raw"
);
if(gradPFile.good())
{
gradPFile >> gradP;
Info<< "Reading average pressure gradient" <<endl
<< endl;
}
else
{
Info<< "Initializing with 0 pressure gradient" <<endl
<< endl;
};

View File

@ -0,0 +1,28 @@
Info<< "\nReading transportProperties\n" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedScalar nu
(
transportProperties.lookup("nu")
);
// Read centerline velocity for channel simulations
dimensionedVector Ubar
(
transportProperties.lookup("Ubar")
);
dimensionedScalar magUbar = mag(Ubar);
vector flowDirection = (Ubar/magUbar).value();

View File

@ -0,0 +1,19 @@
if (runTime.outputTime())
{
OFstream gradPFile
(
runTime.path()/runTime.timeName()/"gradP.raw"
);
if(gradPFile.good())
{
gradPFile << gradP << endl;
}
else
{
FatalErrorIn(args.executable())
<< "Cannot open file "
<< runTime.path()/runTime.timeName()/"gradP.raw"
<< exit(FatalError);
};
};

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default backward;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss <>;
div(phi,k) Gauss <>;
div(phi,B) Gauss <>;
div(phi,nuTilda) Gauss <>;
div(B) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DBEff,B) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p ICCG 1e-06 0;
pFinal ICCG 1e-06 0;
U BICCG 1e-05 0;
k BICCG 1e-05 0;
B BICCG 1e-05 0;
nuTilda BICCG 1e-05 0;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSchemes/fvSchemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/ddt/transient.cfg";
include "../../../incompressible/turbFoam/FoamX/fvSchemes/gradSchemes.cfg";
include "fvSchemes/divSchemes.cfg";
include "fvSchemes/laplacianSchemes.cfg";
include "../../../incompressible/turbFoam/FoamX/fvSchemes/interpolationSchemes.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/snGrad/defaultOnly.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/flux/p.cfg";
}
default
{
include "defaults/system/fvSchemes";
}
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
divSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phik.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiBT.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/B.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/phiNuTilda.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/div/nuEffGradUT.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
laplacianSchemes
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/schemes.cfg";
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/default.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/nuEffU.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/1AUp.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DkEffk.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DBEffB.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSchemes/laplacian/DnuTildaEffNuTilda.cfg";
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
include "$FOAMX_CONFIG/dictionaries/fvSolution/fvSolution.cfg";
entries
{
solvers
{
type dictionary;
entries
{
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pSymm.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/pFinal.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/U.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/k.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/B.cfg";
include "$FOAMX_CONFIG/dictionaries/fvSolution/solvers/nuTilda.cfg";
}
}
include "$FOAMX_CONFIG/dictionaries/fvSolution/PISO.cfg";
}
default
{
include "defaults/system/fvSolution";
}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
description "Incompressible large eddy simulation (LES) code";
dictionaries
{
include "$FOAMX_CONFIG/dictionaries/controlDict/controlDict.cfg";
fvSchemes;
fvSolution;
include "$FOAMX_CONFIG/dictionaries/transportProperties/singlePhaseTransportProperties.cfg";
include "$FOAMX_CONFIG/dictionaries/turbulenceProperties/LESmodelsIncompressible.cfg";
}
fields
{
include "$FOAMX_CONFIG/entries/geometricFields/U.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/pKinematic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/k.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/nuSgs.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/Bkinematic.cfg";
include "$FOAMX_CONFIG/entries/geometricFields/nuTilda.cfg";
}
patchPhysicalTypes
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/patches.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/patches.cfg";
turbulentInlet
{
description "Turbulent inlet";
parentType inlet;
}
}
patchFieldsPhysicalTypes
{
U
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/U.cfg";
turbulentInlet turbulentInlet;
}
p
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/p.cfg";
}
k
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/k.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/k.cfg";
}
nuSgs
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/nuSgs.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/nuSgs.cfg";
}
B
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/B.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/B.cfg";
}
nuTilda
{
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/standard/nuTilda.cfg";
include "$FOAMX_CONFIG/entries/patchPhysicalTypes/wallFunctions/nuTilda.cfg";
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/LESmodels \
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lincompressibleLESmodels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,43 @@
Info<< "Reading field p\n" << endl;
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<LESmodel> sgsModel
(
LESmodel::New(U, phi, laminarTransport)
);

View File

@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
oodles
Description
Incompressible LES solver.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/transportModel/transportModel.H"
#include "incompressible/LESmodel/LESmodel.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Random.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoClear.H"
#include "createFields.H"
#include "initContinuityErrs.H"
Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H"
sgsModel->correct();
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ sgsModel->divDevBeff(U)
);
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //