ENH: Include relative includes directly, instead of using -I
[freefoam.git] / applications / solvers / multiphase / interFoam / interDyMFoam / interDyMFoam.C
bloba6cba013606dc5df136032ae64bc64582a9911fd
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 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
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     interDyMFoam
27 Description
28     Solver for 2 incompressible, 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 Usage
34     - interDyMFoam [OPTION]
36     @param -case \<dir\> \n
37     Specify the case directory
39     @param -parallel \n
40     Run the case in parallel
42     @param -help \n
43     Display short usage message
45     @param -doc \n
46     Display Doxygen documentation page
48     @param -srcDoc \n
49     Display source code
51 \*---------------------------------------------------------------------------*/
53 #include <finiteVolume/fvCFD.H>
54 #include <dynamicFvMesh/dynamicFvMesh.H>
55 #include <finiteVolume/MULES.H>
56 #include <OpenFOAM/subCycle.H>
57 #include <interfaceProperties/interfaceProperties.H>
58 #include <incompressibleTransportModels/twoPhaseMixture.H>
59 #include <incompressibleTurbulenceModel/turbulenceModel.H>
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 int main(int argc, char *argv[])
65     #include <OpenFOAM/setRootCase.H>
66     #include <OpenFOAM/createTime.H>
67     #include <dynamicFvMesh/createDynamicFvMesh.H>
68     #include <finiteVolume/readPISOControls.H>
69     #include <finiteVolume/initContinuityErrs.H>
70     #include "../createFields.H"
71     #include <finiteVolume/readTimeControls.H>
72     #include "../correctPhi.H"
73     #include <finiteVolume/CourantNo.H>
74     #include <finiteVolume/setInitialDeltaT.H>
76     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77     Info<< "\nStarting time loop\n" << endl;
79     while (runTime.run())
80     {
81         #include "readControls.H"
82         #include "../alphaCourantNo.H"
83         #include <finiteVolume/CourantNo.H>
85         // Make the fluxes absolute
86         fvc::makeAbsolute(phi, U);
88         #include <finiteVolume/setDeltaT.H>
90         runTime++;
92         Info<< "Time = " << runTime.timeName() << nl << endl;
94         scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
96         // Do any mesh changes
97         mesh.update();
99         if (mesh.changing())
100         {
101             Info<< "Execution time for mesh.update() = "
102                 << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
103                 << " s" << endl;
105             gh = g & mesh.C();
106             ghf = g & mesh.Cf();
107         }
109         if (mesh.changing() && correctPhi)
110         {
111             #include "../correctPhi.H"
112         }
114         // Make the fluxes relative to the mesh motion
115         fvc::makeRelative(phi, U);
117         if (mesh.changing() && checkMeshCourantNo)
118         {
119             #include <dynamicFvMesh/meshCourantNo.H>
120         }
122         twoPhaseProperties.correct();
124         #include "../alphaEqnSubCycle.H"
126         #include "../UEqn.H"
128         // --- PISO loop
129         for (int corr=0; corr<nCorr; corr++)
130         {
131             #include "pEqn.H"
132         }
134         turbulence->correct();
136         runTime.write();
138         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
139             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
140             << nl << endl;
141     }
143     Info<< "End\n" << endl;
145     return 0;
149 // ************************ vim: set sw=4 sts=4 et: ************************ //