1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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 rUA = 1.0/UEqn.A();
91 phi = (fvc::interpolate(U) & mesh.Sf())
92 + fvc::ddtPhiCorr(rUA, U, phi);
96 fvm::laplacian(rUA, p) == fvc::div(phi)
103 # include "continuityErrs.H"
105 U -= rUA*fvc::grad(p);
106 U.correctBoundaryConditions();
111 if (runTime.outputTime())
113 calcEk(U, K).write(runTime.timePath()/"Ek", runTime.graphFormat());
116 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
117 << " ClockTime = " << runTime.elapsedClockTime() << " s"
121 Info<< "End\n" << endl;
127 // ************************************************************************* //