FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

buoyantBoussinesqPimpleFoam.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Application
00025     buoyantBoussinesqPimpleFoam
00026 
00027 Description
00028     Transient solver for buoyant, turbulent flow of incompressible fluids
00029 
00030     Uses the Boussinesq approximation:
00031     \f[
00032         rho_{k} = 1 - beta(T - T_{ref})
00033     \f]
00034 
00035     where:
00036         \f$ rho_{k} \f$ = the effective (driving) kinematic density
00037         beta = thermal expansion coefficient [1/K]
00038         T = temperature [K]
00039         \f$ T_{ref} \f$ = reference temperature [K]
00040 
00041     Valid when:
00042     \f[
00043         rho_{k} << 1
00044     \f]
00045 
00046 \*---------------------------------------------------------------------------*/
00047 
00048 #include <finiteVolume/fvCFD.H>
00049 #include <incompressibleTransportModels/singlePhaseTransportModel.H>
00050 #include <incompressibleRASModels/RASModel.H>
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 int main(int argc, char *argv[])
00055 {
00056     #include <OpenFOAM/setRootCase.H>
00057     #include <OpenFOAM/createTime.H>
00058     #include <OpenFOAM/createMesh.H>
00059     #include <finiteVolume/readGravitationalAcceleration.H>
00060     #include "createFields.H"
00061     #include <finiteVolume/initContinuityErrs.H>
00062     #include <finiteVolume/readTimeControls.H>
00063     #include <finiteVolume/CourantNo.H>
00064     #include <finiteVolume/setInitialDeltaT.H>
00065 
00066     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00067 
00068     Info<< "\nStarting time loop\n" << endl;
00069 
00070     while (runTime.loop())
00071     {
00072         Info<< "Time = " << runTime.timeName() << nl << endl;
00073 
00074         #include <finiteVolume/readTimeControls.H>
00075         #include <finiteVolume/readPIMPLEControls.H>
00076         #include <finiteVolume/CourantNo.H>
00077         #include <finiteVolume/setDeltaT.H>
00078 
00079         // --- Pressure-velocity PIMPLE corrector loop
00080         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
00081         {
00082             bool finalIter = oCorr == nOuterCorr-1;
00083 
00084             if (nOuterCorr != 1)
00085             {
00086                 p_rgh.storePrevIter();
00087             }
00088 
00089             #include "UEqn.H"
00090             #include "TEqn.H"
00091 
00092             // --- PISO loop
00093             for (int corr=0; corr<nCorr; corr++)
00094             {
00095                 #include "pEqn.H"
00096             }
00097 
00098             turbulence->correct();
00099         }
00100 
00101         runTime.write();
00102 
00103         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00104             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
00105             << nl << endl;
00106     }
00107 
00108     Info<< "End\n" << endl;
00109 
00110     return 0;
00111 }
00112 
00113 
00114 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines