FreeFOAM The Cross-Platform CFD Toolkit
rhoPorousMRFPimpleFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Application
25  rhoPorousMRFPimpleFoam
26 
27 Description
28  Transient solver for laminar or turbulent flow of compressible fluids
29  with support for porous media and MRF for HVAC and similar applications.
30 
31  Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
32  pseudo-transient simulations.
33 
34 Usage
35  - rhoPorousMRFPimpleFoam [OPTION]
36 
37  @param -case <dir> \n
38  Specify the case directory
39 
40  @param -parallel \n
41  Run the case in parallel
42 
43  @param -help \n
44  Display short usage message
45 
46  @param -doc \n
47  Display Doxygen documentation page
48 
49  @param -srcDoc \n
50  Display source code
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #include <finiteVolume/fvCFD.H>
57 #include <finiteVolume/bound.H>
58 #include <finiteVolume/MRFZones.H>
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 int main(int argc, char *argv[])
64 {
65  #include <OpenFOAM/setRootCase.H>
66  #include <OpenFOAM/createTime.H>
67  #include <OpenFOAM/createMesh.H>
68  #include "createFields.H"
70 
71  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73  Info<< "\nStarting time loop\n" << endl;
74 
75  while (runTime.run())
76  {
80  #include <finiteVolume/setDeltaT.H>
81 
82  runTime++;
83 
84  Info<< "Time = " << runTime.timeName() << nl << endl;
85 
86  if (nOuterCorr != 1)
87  {
88  p.storePrevIter();
89  rho.storePrevIter();
90  }
91 
92  #include <finiteVolume/rhoEqn.H>
93 
94  // --- Pressure-velocity PIMPLE corrector loop
95  for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
96  {
97  #include "UEqn.H"
98  #include "../rhoPimpleFoam/hEqn.H"
99 
100  // --- PISO loop
101  for (int corr=0; corr<nCorr; corr++)
102  {
103  #include "pEqn.H"
104  }
105 
106  turbulence->correct();
107  }
108 
109  runTime.write();
110 
111  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
112  << " ClockTime = " << runTime.elapsedClockTime() << " s"
113  << nl << endl;
114  }
115 
116  Info<< "End\n" << endl;
117 
118  return 0;
119 }
120 
121 
122 // ************************ vim: set sw=4 sts=4 et: ************************ //