mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Reorganised DNSandLES, moved the LES solvers to the appropriate sub-directories
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / 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 transportProperties;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
UOsigma 0.090295049;
|
||||
|
||||
UOalpha 0.81532036;
|
||||
|
||||
UOKupper 10;
|
||||
|
||||
UOKlower 7;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,68 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / 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 Euler;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(p) Gauss linear;
|
||||
grad(U) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss cubic;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(nu,U) Gauss linear corrected;
|
||||
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
interpolate(U) linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / 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;
|
||||
U BICCG 1e-05 0;
|
||||
}
|
||||
|
||||
PISO
|
||||
{
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
69
applications/solvers/DNS/dnsFoam/FoamX/dnsFoam.cfg
Normal file
69
applications/solvers/DNS/dnsFoam/FoamX/dnsFoam.cfg
Normal file
@ -0,0 +1,69 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
description "Direct numerical simulation (DNS) code";
|
||||
|
||||
dictionaries
|
||||
{
|
||||
include "$FOAMX_CONFIG/dictionaries/controlDict/controlDict.cfg";
|
||||
fvSchemes;
|
||||
fvSolution;
|
||||
include "$FOAMX_CONFIG/dictionaries/transportProperties/NewtonianSinglePhaseTransportProperties.cfg";
|
||||
turbulenceProperties;
|
||||
}
|
||||
|
||||
fields
|
||||
{
|
||||
include "$FOAMX_CONFIG/entries/geometricFields/pKinematic.cfg";
|
||||
include "$FOAMX_CONFIG/entries/geometricFields/U.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";
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
44
applications/solvers/DNS/dnsFoam/FoamX/fvSchemes.cfg
Normal file
44
applications/solvers/DNS/dnsFoam/FoamX/fvSchemes.cfg
Normal 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 1.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object fvSchemes.cfg;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
include "$FOAMX_CONFIG/dictionaries/fvSchemes/fvSchemes.cfg";
|
||||
|
||||
entries
|
||||
{
|
||||
include "$FOAMX_CONFIG/dictionaries/fvSchemes/ddt/transient.cfg";
|
||||
|
||||
include "../../../incompressible/turbFoam/FoamX/fvSchemes/gradSchemes.cfg";
|
||||
include "../../../incompressible/icoFoam/FoamX/fvSchemes/divSchemes.cfg";
|
||||
include "../../../incompressible/icoFoam/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";
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
31
applications/solvers/DNS/dnsFoam/FoamX/fvSolution.cfg
Normal file
31
applications/solvers/DNS/dnsFoam/FoamX/fvSolution.cfg
Normal file
@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / 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/U.cfg";
|
||||
}
|
||||
}
|
||||
|
||||
include "$FOAMX_CONFIG/dictionaries/fvSolution/PISO.cfg";
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
include "defaults/system/fvSolution";
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.4 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
type dictionary;
|
||||
description "Turbulence properties";
|
||||
dictionaryPath "constant";
|
||||
|
||||
entries
|
||||
{
|
||||
UOsigma
|
||||
{
|
||||
type scalar;
|
||||
}
|
||||
|
||||
UOalpha
|
||||
{
|
||||
type scalar;
|
||||
}
|
||||
|
||||
UOKupper
|
||||
{
|
||||
type label;
|
||||
description "Upper wave number";
|
||||
}
|
||||
|
||||
UOKlower
|
||||
{
|
||||
type label;
|
||||
description "Lower wave number";
|
||||
}
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
include "defaults/constant/turbulenceProperties";
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/solvers/DNS/dnsFoam/Make/files
Normal file
3
applications/solvers/DNS/dnsFoam/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
dnsFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/dnsFoam
|
||||
10
applications/solvers/DNS/dnsFoam/Make/options
Normal file
10
applications/solvers/DNS/dnsFoam/Make/options
Normal file
@ -0,0 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/randomProcesses/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lrandomProcesses \
|
||||
-lsampling \
|
||||
-lmeshTools
|
||||
29
applications/solvers/DNS/dnsFoam/createFields.H
Normal file
29
applications/solvers/DNS/dnsFoam/createFields.H
Normal file
@ -0,0 +1,29 @@
|
||||
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"
|
||||
129
applications/solvers/DNS/dnsFoam/dnsFoam.C
Normal file
129
applications/solvers/DNS/dnsFoam/dnsFoam.C
Normal file
@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
dnsFoam
|
||||
|
||||
Description
|
||||
Direct numerical simulation solver for boxes of isotropic turbulence
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "Kmesh.H"
|
||||
#include "UOprocess.H"
|
||||
#include "fft.H"
|
||||
#include "calcEk.H"
|
||||
#include "graph.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
# include "createMeshNoClear.H"
|
||||
# include "readTransportProperties.H"
|
||||
# include "createFields.H"
|
||||
# include "readTurbulenceProperties.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< nl << "Starting time loop" << endl;
|
||||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPISOControls.H"
|
||||
|
||||
force.internalField() = ReImSum
|
||||
(
|
||||
fft::reverseTransform
|
||||
(
|
||||
K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
|
||||
)
|
||||
);
|
||||
|
||||
# include "globalProperties.H"
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(U)
|
||||
+ fvm::div(phi, U)
|
||||
- fvm::laplacian(nu, U)
|
||||
==
|
||||
force
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=1; corr<=1; corr++)
|
||||
{
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
|
||||
U = rUA*UEqn.H();
|
||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(rUA, p) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
phi -= pEqn.flux();
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
U -= rUA*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
calcEk(U, K).write(runTime.timePath()/"Ek", runTime.graphFormat());
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
20
applications/solvers/DNS/dnsFoam/globalProperties.H
Normal file
20
applications/solvers/DNS/dnsFoam/globalProperties.H
Normal file
@ -0,0 +1,20 @@
|
||||
Info<< "k("
|
||||
<< runTime.timeName()
|
||||
<< ") = "
|
||||
<< 3.0/2.0*average(magSqr(U)).value() << endl;
|
||||
|
||||
Info<< "epsilon("
|
||||
<< runTime.timeName()
|
||||
<< ") = "
|
||||
<< (
|
||||
0.5*nu*average
|
||||
(
|
||||
magSqr(fvc::grad(U) + fvc::grad(U)().T())
|
||||
)
|
||||
).value() << endl;
|
||||
|
||||
Info<< "U.f("
|
||||
<< runTime.timeName()
|
||||
<< ") = "
|
||||
<< 181.0*average(U & force).value() << endl;
|
||||
|
||||
18
applications/solvers/DNS/dnsFoam/readTransportProperties.H
Normal file
18
applications/solvers/DNS/dnsFoam/readTransportProperties.H
Normal file
@ -0,0 +1,18 @@
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar nu
|
||||
(
|
||||
transportProperties.lookup("nu")
|
||||
);
|
||||
19
applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
Normal file
19
applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H
Normal file
@ -0,0 +1,19 @@
|
||||
Info<< "Reading turbulenceProperties\n" << endl;
|
||||
|
||||
IOdictionary turbulenceProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
volVectorField force =
|
||||
U/dimensionedScalar("dt", dimTime, runTime.deltaT().value());
|
||||
|
||||
Kmesh K(mesh);
|
||||
UOprocess forceGen(K, runTime.deltaT().value(), turbulenceProperties);
|
||||
Reference in New Issue
Block a user