1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Direct numerical simulation solver for boxes of isotropic turbulence
31 \*---------------------------------------------------------------------------*/
35 #include "UOprocess.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 int main(int argc, char *argv[])
44 #include "setRootCase.H"
46 #include "createTime.H"
47 #include "createMeshNoClear.H"
48 #include "readTransportProperties.H"
49 #include "createFields.H"
50 #include "readTurbulenceProperties.H"
51 #include "initContinuityErrs.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 Info<< nl << "Starting time loop" << endl;
57 while (runTime.loop())
59 Info<< "Time = " << runTime.timeName() << nl << endl;
61 #include "readPISOControls.H"
63 force.internalField() = ReImSum
67 K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
71 #include "globalProperties.H"
77 - fvm::laplacian(nu, U)
82 solve(UEqn == -fvc::grad(p));
87 for (int corr=1; corr<=1; corr++)
89 volScalarField rUA = 1.0/UEqn.A();
92 phi = (fvc::interpolate(U) & mesh.Sf())
93 + fvc::ddtPhiCorr(rUA, U, phi);
97 fvm::laplacian(rUA, p) == fvc::div(phi)
104 # include "continuityErrs.H"
106 U -= rUA*fvc::grad(p);
107 U.correctBoundaryConditions();
112 if (runTime.outputTime())
114 calcEk(U, K).write(runTime.timePath()/"Ek", runTime.graphFormat());
117 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
118 << " ClockTime = " << runTime.elapsedClockTime() << " s"
122 Info<< "End\n" << endl;
128 // ************************************************************************* //