OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

compressibleInterDyMFoam.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Application
00026     compressibleLesInterFoam
00027 
00028 Description
00029     Solver for 2 compressible, isothermal immiscible fluids using a VOF
00030     (volume of fluid) phase-fraction based interface capturing approach,
00031     with optional mesh motion and mesh topology changes including adaptive
00032     re-meshing.
00033 
00034     The momentum and other fluid properties are of the "mixture" and a
00035     single momentum equation is solved.  Turbulence modelling is generic,
00036     i.e. laminar, RAS or LES may be selected.
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #include "fvCFD.H"
00041 #include "dynamicFvMesh.H"
00042 #include "MULES.H"
00043 #include "subCycle.H"
00044 #include "interfaceProperties.H"
00045 #include "twoPhaseMixture.H"
00046 #include "turbulenceModel.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 int main(int argc, char *argv[])
00051 {
00052     #include "setRootCase.H"
00053     #include "createTime.H"
00054     #include "createDynamicFvMesh.H"
00055     #include "readGravitationalAcceleration.H"
00056     #include "readControls.H"
00057     #include "initContinuityErrs.H"
00058     #include "createFields.H"
00059     #include "CourantNo.H"
00060     #include "setInitialDeltaT.H"
00061 
00062     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063     Info<< "\nStarting time loop\n" << endl;
00064 
00065     while (runTime.run())
00066     {
00067         #include "readControls.H"
00068         #include "CourantNo.H"
00069 
00070         // Make the fluxes absolute
00071         fvc::makeAbsolute(phi, U);
00072 
00073         #include "setDeltaT.H"
00074 
00075         runTime++;
00076 
00077         Info<< "Time = " << runTime.timeName() << nl << endl;
00078 
00079         {
00080             // Store divU from the previous mesh for the correctPhi
00081             volScalarField divU = fvc::div(phi);
00082 
00083             scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
00084 
00085             // Do any mesh changes
00086             mesh.update();
00087 
00088             if (mesh.changing())
00089             {
00090                 Info<< "Execution time for mesh.update() = "
00091                     << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
00092                     << " s" << endl;
00093             }
00094 
00095             if (mesh.changing() && correctPhi)
00096             {
00097                 #include "correctPhi.H"
00098             }
00099         }
00100 
00101         // Make the fluxes relative to the mesh motion
00102         fvc::makeRelative(phi, U);
00103 
00104         if (mesh.changing() && checkMeshCourantNo)
00105         {
00106             #include "meshCourantNo.H"
00107         }
00108 
00109         turbulence->correct();
00110 
00111         // --- Outer-corrector loop
00112         for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
00113         {
00114             #include "alphaEqnsSubCycle.H"
00115 
00116             solve(fvm::ddt(rho) + fvc::div(rhoPhi));
00117 
00118             #include "UEqn.H"
00119 
00120             // --- PISO loop
00121             for (int corr=0; corr<nCorr; corr++)
00122             {
00123                 #include "pEqn.H"
00124             }
00125         }
00126 
00127         rho = alpha1*rho1 + alpha2*rho2;
00128 
00129         runTime.write();
00130 
00131         Info<< "ExecutionTime = "
00132             << runTime.elapsedCpuTime()
00133             << " s\n\n" << endl;
00134     }
00135 
00136     Info<< "End\n" << endl;
00137 
00138     return 0;
00139 }
00140 
00141 
00142 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd