1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
26 compressibleLesInterFoam
29 Solver for 2 compressible, isothermal immiscible fluids using a VOF
30 (volume of fluid) phase-fraction based interface capturing approach,
31 with optional mesh motion and mesh topology changes including adaptive
34 The momentum and other fluid properties are of the "mixture" and a
35 single momentum equation is solved. Turbulence modelling is generic,
36 i.e. laminar, RAS or LES may be selected.
38 \*---------------------------------------------------------------------------*/
41 #include "dynamicFvMesh.H"
44 #include "interfaceProperties.H"
45 #include "twoPhaseMixture.H"
46 #include "turbulenceModel.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 int main(int argc, char *argv[])
52 #include "setRootCase.H"
53 #include "createTime.H"
54 #include "createDynamicFvMesh.H"
55 #include "readGravitationalAcceleration.H"
56 #include "readControls.H"
57 #include "initContinuityErrs.H"
58 #include "createFields.H"
59 #include "CourantNo.H"
60 #include "setInitialDeltaT.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 Info<< "\nStarting time loop\n" << endl;
67 #include "readControls.H"
68 #include "CourantNo.H"
70 // Make the fluxes absolute
71 fvc::makeAbsolute(phi, U);
73 #include "setDeltaT.H"
77 Info<< "Time = " << runTime.timeName() << nl << endl;
80 // Store divU from the previous mesh for the correctPhi
81 volScalarField divU = fvc::div(phi);
83 scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
85 // Do any mesh changes
90 Info<< "Execution time for mesh.update() = "
91 << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
95 if (mesh.changing() && correctPhi)
97 #include "correctPhi.H"
101 // Make the fluxes relative to the mesh motion
102 fvc::makeRelative(phi, U);
104 if (mesh.changing() && checkMeshCourantNo)
106 #include "meshCourantNo.H"
109 turbulence->correct();
111 // --- Outer-corrector loop
112 for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
114 #include "alphaEqnsSubCycle.H"
116 solve(fvm::ddt(rho) + fvc::div(rhoPhi));
121 for (int corr=0; corr<nCorr; corr++)
127 rho = alpha1*rho1 + alpha2*rho2;
131 Info<< "ExecutionTime = "
132 << runTime.elapsedCpuTime()
136 Info<< "End\n" << endl;
142 // ************************************************************************* //