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. The pressure-energy coupling is done
34 using the Rusche manoeuvre (isentropic compression/expansion).
36 Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
38 Updated from sonicFoamAutoMotion by Hrvoje Jasak
41 Hrvoje Jasak, Wikki Ltd. All rights reserved.
43 \*---------------------------------------------------------------------------*/
46 #include "dynamicFvMesh.H"
48 #include "basicPsiThermo.H"
49 #include "turbulenceModel.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 int main(int argc, char *argv[])
55 # include "setRootCase.H"
57 # include "createTime.H"
58 # include "createDynamicFvMesh.H"
59 # include "createFields.H"
60 # include "initContinuityErrs.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 Info<< "\nStarting time loop\n" << endl;
68 # include "readControls.H"
69 # include "readFieldBounds.H"
70 # include "compressibleCourantNo.H"
71 # include "setDeltaT.H"
74 Info<< "deltaT = " << runTime.deltaT().value() << nl << endl;
75 Info<< "Time = " << runTime.timeName() << nl << endl;
77 bool meshChanged = mesh.update();
79 # include "volContinuity.H"
81 if (checkMeshCourantNo)
83 # include "meshCourantNo.H"
91 e == max(e, thermo.Cv()*TMin);
98 // # include "correctPhi.H"
104 # include "compressibleCourantNo.H"
116 volScalarField rUA = 1.0/UEqn.A();
118 surfaceScalarField psisf = fvc::interpolate(psis);
119 surfaceScalarField rhof = fvc::interpolate(rho);
121 // Needs to be outside of loop since p is changing,
122 // but psi and rho are not
123 surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
125 for (int corr = 0; corr < nCorr; corr++)
130 turbulence->correct();
131 } while (++oCorr < nOuterCorr);
135 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
136 << " ClockTime = " << runTime.elapsedClockTime() << " s"
140 Info<< "End\n" << endl;
146 // ************************************************************************* //