initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / multiphase / compressibleInterDyMFoam / compressibleInterDyMFoam.C
blob9a802e0f6947c466bc51a4cc2281ee35565d3f7c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Application
26     compressibleLesInterFoam
28 Description
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
32     re-meshing.
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 \*---------------------------------------------------------------------------*/
40 #include "fvCFD.H"
41 #include "dynamicFvMesh.H"
42 #include "MULES.H"
43 #include "subCycle.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;
65     while (runTime.run())
66     {
67         #include "readControls.H"
68         #include "CourantNo.H"
70         // Make the fluxes absolute
71         fvc::makeAbsolute(phi, U);
73         #include "setDeltaT.H"
75         runTime++;
77         Info<< "Time = " << runTime.timeName() << nl << endl;
79         {
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
86             mesh.update();
88             if (mesh.changing())
89             {
90                 Info<< "Execution time for mesh.update() = "
91                     << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
92                     << " s" << endl;
93             }
95             if (mesh.changing() && correctPhi)
96             {
97                 #include "correctPhi.H"
98             }
99         }
101         // Make the fluxes relative to the mesh motion
102         fvc::makeRelative(phi, U);
104         if (mesh.changing() && checkMeshCourantNo)
105         {
106             #include "meshCourantNo.H"
107         }
109         turbulence->correct();
111         // --- Outer-corrector loop
112         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
113         {
114             #include "alphaEqnsSubCycle.H"
116             solve(fvm::ddt(rho) + fvc::div(rhoPhi));
118             #include "UEqn.H"
120             // --- PISO loop
121             for (int corr=0; corr<nCorr; corr++)
122             {
123                 #include "pEqn.H"
124             }
125         }
127         rho = alpha1*rho1 + alpha2*rho2;
129         runTime.write();
131         Info<< "ExecutionTime = "
132             << runTime.elapsedCpuTime()
133             << " s\n\n" << endl;
134     }
136     Info<< "End\n" << endl;
138     return 0;
142 // ************************************************************************* //