1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 Transient solver for trans-sonic/supersonic, laminar flow of a
30 compressible gas with mesh motion..
32 \*---------------------------------------------------------------------------*/
35 #include "motionSolver.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 int main(int argc, char *argv[])
42 # include "setRootCase.H"
43 # include "createTime.H"
44 # include "createMesh.H"
45 # include "readThermodynamicProperties.H"
46 # include "readTransportProperties.H"
47 # include "createFields.H"
48 # include "initContinuityErrs.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 Info<< "\nStarting time loop\n" << endl;
54 autoPtr<Foam::motionSolver> motionPtr = motionSolver::New(mesh);
56 for (runTime++; !runTime.end(); runTime++)
58 Info<< "Time = " << runTime.timeName() << nl << endl;
60 # include "readPISOControls.H"
61 # include "compressibleCourantNo.H"
63 mesh.movePoints(motionPtr->newPoints());
71 - fvm::laplacian(mu, U)
74 solve(UEqn == -fvc::grad(p));
80 - fvm::laplacian(mu, e)
82 - p*fvc::div(phi/fvc::interpolate(rho) + fvc::meshPhi(rho, U))
83 + mu*magSqr(symm(fvc::grad(U)))
91 for (int corr=0; corr<nCorr; corr++)
93 U = UEqn.H()/UEqn.A();
95 surfaceScalarField phid
98 fvc::interpolate(psi)*
100 (fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)
104 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
110 - fvm::laplacian(rho/UEqn.A(), p)
118 # include "compressibleContinuityErrs.H"
120 U -= fvc::grad(p)/UEqn.A();
121 U.correctBoundaryConditions();
128 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
129 << " ClockTime = " << runTime.elapsedClockTime() << " s"
133 Info<< "End\n" << endl;
139 // ************************************************************************* //