interPhaseChangeFoam.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) 2011-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  interPhaseChangeFoam
26 
27 Description
28  Solver for 2 incompressible, isothermal immiscible fluids with phase-change
29  (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based
30  interface capturing approach.
31 
32  The momentum and other fluid properties are of the "mixture" and a
33  single momentum equation is solved.
34 
35  The set of phase-change models provided are designed to simulate cavitation
36  but other mechanisms of phase-change are supported within this solver
37  framework.
38 
39  Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #include "fvCFD.H"
44 #include "CMULES.H"
45 #include "subCycle.H"
46 #include "interfaceProperties.H"
49 #include "pimpleControl.H"
50 #include "fvIOoptionList.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 int main(int argc, char *argv[])
56 {
57  #include "setRootCase.H"
58  #include "createTime.H"
59  #include "createMesh.H"
60 
61  pimpleControl pimple(mesh);
62 
63  #include "createFields.H"
64  #include "createFvOptions.H"
65  #include "createTimeControls.H"
66  #include "CourantNo.H"
67  #include "setInitialDeltaT.H"
68 
69  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71  Info<< "\nStarting time loop\n" << endl;
72 
73  while (runTime.run())
74  {
75  #include "createTimeControls.H"
76  #include "CourantNo.H"
77  #include "setDeltaT.H"
78 
79  runTime++;
80 
81  Info<< "Time = " << runTime.timeName() << nl << endl;
82 
83  // --- Pressure-velocity PIMPLE corrector loop
84  while (pimple.loop())
85  {
86  #include "alphaControls.H"
87 
89  (
90  IOobject
91  (
92  "rhoPhi",
93  runTime.timeName(),
94  mesh
95  ),
96  mesh,
98  );
99 
100  mixture->correct();
101 
102  #include "alphaEqnSubCycle.H"
103  interface.correct();
104 
105  #include "UEqn.H"
106 
107  // --- Pressure corrector loop
108  while (pimple.correct())
109  {
110  #include "pEqn.H"
111  }
112 
113  if (pimple.turbCorr())
114  {
115  turbulence->correct();
116  }
117  }
118 
119  runTime.write();
120 
121  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
122  << " ClockTime = " << runTime.elapsedClockTime() << " s"
123  << nl << endl;
124  }
125 
126  Info<< "End\n" << endl;
127 
128  return 0;
129 }
130 
131 
132 // ************************************************************************* //
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
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
messageStream Info
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
dynamicFvMesh & mesh
rhoPhi
Definition: rhoEqn.H:10
const dictionary & pimple
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
Read the control parameters used by setDeltaT.
int main(int argc, char *argv[])
Definition: postCalc.C:54
interfaceProperties interface(alpha1, U, mixture())
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.