1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 Solver for 2 incompressible fluids capturing the interface with
32 Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
35 Hrvoje Jasak, Wikki Ltd. All rights reserved.
37 \*---------------------------------------------------------------------------*/
41 #include "dynamicFvMesh.H"
42 #include "interfaceProperties.H"
44 #include "twoPhaseMixture.H"
45 #include "turbulenceModel.H"
46 #include "numericalBeach.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 int main(int argc, char *argv[])
53 # include "setRootCase.H"
54 # include "createTime.H"
55 # include "createDynamicFvMesh.H"
56 # include "readGravitationalAcceleration.H"
57 # include "initContinuityErrs.H"
58 # include "initTotalVolume.H"
59 # include "createFields.H"
60 # include "readControls.H"
61 # include "correctPhi.H"
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 // Execute function objects
66 runTime.functionObjects().execute();
68 Info<< "\nStarting time loop\n" << endl;
72 # include "readControls.H"
73 # include "checkTotalVolume.H"
74 # include "CourantNo.H"
75 # include "setDeltaT.H"
77 // Make the fluxes absolute
78 fvc::makeAbsolute(phi, U);
82 Info<< "Time = " << runTime.timeName() << nl << endl;
84 if (runTime.value() > startMotionTime)
86 bool meshChanged = mesh.update();
88 # include "volContinuity.H"
91 if (correctPhi && meshChanged)
93 # include "correctPhi.H"
96 // Make the fluxes relative to the mesh motion
97 fvc::makeRelative(phi, U);
101 # include "CourantNo.H"
105 // Pressure-velocity corrector
110 ghf = (g & mesh.Cf());
112 twoPhaseProperties.correct();
117 for (int corr=0; corr < nCorr; corr++)
126 // Make the fluxes relative
127 phi -= fvc::meshPhi(rho, U);
128 rhoPhi = phi*fvc::interpolate(rho);
131 # include "movingMeshRhoUContinuityErrs.H"
133 // Calculate static pressure
134 if (oCorr == nOuterCorr - 1)
136 // Calculate static pressure
137 Info << "Calculating static pressure" << endl;
141 # include "alphaEqn.H"
143 turbulence->correct();
144 } while (++oCorr < nOuterCorr);
148 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
149 << " ClockTime = " << runTime.elapsedClockTime() << " s"
153 Info<< "End\n" << endl;
159 // ************************************************************************* //