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 Transient solver for trans-sonic/supersonic for laminar or turbulent
29 flow of a compressible gas with support for mesh motion and
32 Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
33 pseudo-transient simulations.
35 Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
37 Updated from sonicFoamAutoMotion by Hrvoje Jasak
40 Hrvoje Jasak, Wikki Ltd. All rights reserved.
42 \*---------------------------------------------------------------------------*/
45 #include "dynamicFvMesh.H"
47 #include "basicPsiThermo.H"
48 #include "turbulenceModel.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 int main(int argc, char *argv[])
54 # include "setRootCase.H"
56 # include "createTime.H"
57 # include "createDynamicFvMesh.H"
58 # include "createFields.H"
59 # include "initContinuityErrs.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 Info<< "\nStarting time loop\n" << endl;
67 # include "readControls.H"
68 # include "readFieldBounds.H"
69 # include "compressibleCourantNo.H"
70 # include "setDeltaT.H"
74 Info<< "Time = " << runTime.timeName() << nl << endl;
76 bool meshChanged = mesh.update();
78 # include "volContinuity.H"
80 if (checkMeshCourantNo)
82 # include "meshCourantNo.H"
90 e = max(e, thermo.Cv()*TMin);
97 // # include "correctPhi.H"
103 # include "compressibleCourantNo.H"
110 // Under-relax pDivU term
111 pDivU.storePrevIter();
116 phi/fvc::interpolate(rho)
117 + fvc::meshPhi(rho, U)
127 for (int corr = 0; corr < nCorr; corr++)
132 // Recalculate density
135 turbulence->correct();
136 } while (++oCorr < nOuterCorr);
140 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
141 << " ClockTime = " << runTime.elapsedClockTime() << " s"
145 Info<< "End\n" << endl;
151 // ************************************************************************* //