compressibleMultiphaseInterFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Application
25  compressibleMultiphaseInterFoam
26 
27 Group
28  grpMultiphaseSolvers
29 
30 Description
31  Solver for n compressible, non-isothermal immiscible fluids using a VOF
32  (volume of fluid) phase-fraction based interface capturing approach.
33 
34  The momentum and other fluid properties are of the "mixture" and a single
35  momentum equation is solved.
36 
37  Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #include "fvCFD.H"
44 #include "pimpleControl.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 int main(int argc, char *argv[])
50 {
51  #include "setRootCase.H"
52  #include "createTime.H"
53  #include "createMesh.H"
54 
55  pimpleControl pimple(mesh);
56 
57  #include "createTimeControls.H"
58  #include "createFields.H"
59  #include "CourantNo.H"
60  #include "setInitialDeltaT.H"
61 
62  turbulence->validate();
63 
64  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66  Info<< "\nStarting time loop\n" << endl;
67 
68  while (runTime.run())
69  {
70  #include "createTimeControls.H"
71  #include "CourantNo.H"
72  #include "alphaCourantNo.H"
73  #include "setDeltaT.H"
74 
75  runTime++;
76 
77  Info<< "Time = " << runTime.timeName() << nl << endl;
78 
79  // --- Pressure-velocity PIMPLE corrector loop
80  while (pimple.loop())
81  {
82  mixture.solve();
83 
84  solve(fvm::ddt(rho) + fvc::div(mixture.rhoPhi()));
85 
86  #include "UEqn.H"
87  #include "TEqn.H"
88 
89  // --- Pressure corrector loop
90  while (pimple.correct())
91  {
92  #include "pEqn.H"
93  }
94 
95  if (pimple.turbCorr())
96  {
97  turbulence->correct();
98  }
99  }
100 
101  runTime.write();
102 
103  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
104  << " ClockTime = " << runTime.elapsedClockTime() << " s"
105  << nl << endl;
106  }
107 
108  Info<< "End\n" << endl;
109 
110  return 0;
111 }
112 
113 
114 // ************************************************************************* //
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
mixture
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\n"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:33
pimpleControl.H
solve
rhoEqn solve()
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
multiphaseMixtureThermo.H
rho
rho
Definition: pEqn.H:3
setRootCase.H
createTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
fixedFluxPressureFvPatchScalarField.H
turbulentFluidThermoModel.H