BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / compressibleInterFoam / compressibleInterDyMFoam / compressibleInterDyMFoam.C
blob4b3b5127d4c707dad7980fc7e86bd27f4534c141
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
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
19     for more details.
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/>.
24 Application
25     compressibleInterDyMFoam
27 Description
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
31     re-meshing.
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 \*---------------------------------------------------------------------------*/
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"
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;
70     while (runTime.run())
71     {
72         #include "readControls.H"
73         #include "CourantNo.H"
75         // Make the fluxes absolute
76         fvc::makeAbsolute(phi, U);
78         #include "setDeltaT.H"
80         runTime++;
82         Info<< "Time = " << runTime.timeName() << nl << endl;
84         {
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
91             mesh.update();
93             if (mesh.changing())
94             {
95                 Info<< "Execution time for mesh.update() = "
96                     << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
97                     << " s" << endl;
99                 gh = g & mesh.C();
100                 ghf = g & mesh.Cf();
101             }
103             if (mesh.changing() && correctPhi)
104             {
105                 #include "correctPhi.H"
106             }
107         }
109         // Make the fluxes relative to the mesh motion
110         fvc::makeRelative(phi, U);
112         if (mesh.changing() && checkMeshCourantNo)
113         {
114             #include "meshCourantNo.H"
115         }
117         turbulence->correct();
119         // --- Outer-corrector loop
120         for (pimple.start(); pimple.loop(); pimple++)
121         {
122             #include "alphaEqnsSubCycle.H"
124             solve(fvm::ddt(rho) + fvc::div(rhoPhi));
126             #include "UEqn.H"
128             // --- PISO loop
129             for (int corr=0; corr<pimple.nCorr(); corr++)
130             {
131                 #include "pEqn.H"
132             }
133         }
135         rho = alpha1*rho1 + alpha2*rho2;
137         runTime.write();
139         Info<< "ExecutionTime = "
140             << runTime.elapsedCpuTime()
141             << " s\n\n" << endl;
142     }
144     Info<< "End\n" << endl;
146     return 0;
150 // ************************************************************************* //