MRFInterFoam.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) 2011-2013 OpenFOAM Foundation
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  MRFInterFoam
26 
27 Description
28  Solver for 2 incompressible, isothermal immiscible fluids using a VOF
29  (volume of fluid) phase-fraction based interface capturing approach.
30  The momentum and other fluid properties are of the "mixture" and a single
31  momentum equation is solved.
32 
33  Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
34 
35  For a two-fluid approach see twoPhaseEulerFoam.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #include "fvCFD.H"
40 #include "CMULES.H"
41 #include "subCycle.H"
42 #include "interfaceProperties.H"
44 #include "turbulenceModel.H"
45 #include "IOMRFZoneList.H"
46 #include "pimpleControl.H"
47 #include "fvIOoptionList.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 int main(int argc, char *argv[])
53 {
54  #include "setRootCase.H"
55  #include "createTime.H"
56  #include "createMesh.H"
57  #include "initContinuityErrs.H"
58  #include "createFields.H"
59  #include "createMRFZones.H"
60  #include "readTimeControls.H"
61 
63 
64  #include "createPrghCorrTypes.H"
65  #include "correctPhi.H"
66  #include "CourantNo.H"
67  #include "setInitialDeltaT.H"
68 
69  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71  Info<< "\nStarting time loop\n" << endl;
72 
73  while (runTime.run())
74  {
75  #include "readTimeControls.H"
76  #include "CourantNo.H"
77  #include "alphaCourantNo.H"
78  #include "setDeltaT.H"
79 
80  runTime++;
81 
82  Info<< "Time = " << runTime.timeName() << nl << endl;
83 
84  // --- Pressure-velocity PIMPLE corrector loop
85  while (pimple.loop())
86  {
87  #include "alphaControls.H"
88 
89  if (pimple.firstIter() || alphaOuterCorrectors)
90  {
91  twoPhaseProperties.correct();
92 
93  #include "alphaEqnSubCycle.H"
95  #include "zonePhaseVolumes.H"
96  }
97 
98  #include "UEqn.H"
99 
100  // --- Pressure corrector loop
101  while (pimple.correct())
102  {
103  #include "pEqn.H"
104  }
105 
106  if (pimple.turbCorr())
107  {
108  turbulence->correct();
109  }
110  }
111 
112  runTime.write();
113 
114  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
115  << " ClockTime = " << runTime.elapsedClockTime() << " s"
116  << nl << endl;
117  }
118 
119  Info<< "End\n" << endl;
120 
121  return 0;
122 }
123 
124 
125 // ************************************************************************* //