1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Direct numerical simulation solver for boxes of isotropic turbulence
30 \*---------------------------------------------------------------------------*/
34 #include "UOprocess.H"
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 int main(int argc, char *argv[])
43 #include "setRootCase.H"
45 #include "createTime.H"
46 #include "createMeshNoClear.H"
47 #include "readTransportProperties.H"
48 #include "createFields.H"
49 #include "readTurbulenceProperties.H"
50 #include "initContinuityErrs.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 Info<< nl << "Starting time loop" << endl;
56 while (runTime.loop())
58 Info<< "Time = " << runTime.timeName() << nl << endl;
60 #include "readPISOControls.H"
62 force.internalField() = ReImSum
66 K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
70 #include "globalProperties.H"
76 - fvm::laplacian(nu, U)
81 solve(UEqn == -fvc::grad(p));
86 for (int corr=1; corr<=1; corr++)
88 volScalarField rAU(1.0/UEqn.A());
91 phi = (fvc::interpolate(U) & mesh.Sf())
92 + fvc::ddtPhiCorr(rAU, U, phi);
96 fvm::laplacian(rAU, p) == fvc::div(phi)
103 #include "continuityErrs.H"
105 U -= rAU*fvc::grad(p);
106 U.correctBoundaryConditions();
111 if (runTime.outputTime())
115 runTime.path()/"graphs"/runTime.timeName(),
117 runTime.graphFormat()
121 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
122 << " ClockTime = " << runTime.elapsedClockTime() << " s"
126 Info<< "End\n" << endl;
132 // ************************************************************************* //