1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 compressibleInterDyMFoam
28 Solver for 2 compressible, isothermal immiscible fluids using a VOF
29 (volume of fluid) phase-fraction based interface capturing approach,
30 with optional mesh motion and mesh topology changes including adaptive
33 The momentum and other fluid properties are of the "mixture" and a single
34 momentum equation is solved.
36 Turbulence modelling is generic, 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"
47 #include "pimpleControl.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 int main(int argc, char *argv[])
53 #include "setRootCase.H"
54 #include "createTime.H"
55 #include "createDynamicFvMesh.H"
56 #include "readGravitationalAcceleration.H"
58 pimpleControl pimple(mesh);
60 #include "readControls.H"
61 #include "initContinuityErrs.H"
62 #include "createFields.H"
63 #include "createPcorrTypes.H"
64 #include "CourantNo.H"
65 #include "setInitialDeltaT.H"
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 Info<< "\nStarting time loop\n" << endl;
72 #include "readControls.H"
73 #include "CourantNo.H"
75 // Make the fluxes absolute
76 fvc::makeAbsolute(phi, U);
78 #include "setDeltaT.H"
82 Info<< "Time = " << runTime.timeName() << nl << endl;
85 // Store divU from the previous mesh for the correctPhi
86 volScalarField divU(fvc::div(phi));
88 scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
90 // Do any mesh changes
95 Info<< "Execution time for mesh.update() = "
96 << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
103 if (mesh.changing() && correctPhi)
105 #include "correctPhi.H"
109 // Make the fluxes relative to the mesh motion
110 fvc::makeRelative(phi, U);
112 if (mesh.changing() && checkMeshCourantNo)
114 #include "meshCourantNo.H"
117 turbulence->correct();
119 // --- Outer-corrector loop
120 for (pimple.start(); pimple.loop(); pimple++)
122 #include "alphaEqnsSubCycle.H"
124 solve(fvm::ddt(rho) + fvc::div(rhoPhi));
129 for (int corr=0; corr<pimple.nCorr(); corr++)
135 rho = alpha1*rho1 + alpha2*rho2;
139 Info<< "ExecutionTime = "
140 << runTime.elapsedCpuTime()
144 Info<< "End\n" << endl;
150 // ************************************************************************* //