driftFluxFoam.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Application
27 driftFluxFoam
28
29Group
30 grpMultiphaseSolvers
31
32Description
33 Solver for two incompressible fluids using the mixture approach with
34 the drift-flux approximation for relative motion of the phases.
35
36 Used for simulating the settling of the dispersed phase and other
37 similar separation problems.
38
39\*---------------------------------------------------------------------------*/
40
41#include "fvCFD.H"
42#include "CMULES.H"
43#include "subCycle.H"
46#include "turbulenceModel.H"
48#include "pimpleControl.H"
49#include "fvOptions.H"
51#include "uncorrectedSnGrad.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55int main(int argc, char *argv[])
56{
57 argList::addNote
58 (
59 "Solver for two incompressible fluids using the mixture approach with"
60 " the drift-flux approximation for relative motion of the phases.\n"
61 "Used for simulating the settling of the dispersed phase and other"
62 " similar separation problems."
63 );
64
65 #include "postProcess.H"
66
67 #include "addCheckCaseOptions.H"
68 #include "setRootCaseLists.H"
69 #include "createTime.H"
70 #include "createMesh.H"
71 #include "createControl.H"
72 #include "createTimeControls.H"
73 #include "createFields.H"
74 #include "initContinuityErrs.H"
75
76 volScalarField& alpha2(mixture.alpha2());
77 const dimensionedScalar& rho1 = mixture.rhod();
78 const dimensionedScalar& rho2 = mixture.rhoc();
79 relativeVelocityModel& UdmModel(UdmModelPtr());
80
81 turbulence->validate();
82
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85 Info<< "\nStarting time loop\n" << endl;
86
87 while (runTime.run())
88 {
89 #include "readTimeControls.H"
90 #include "CourantNo.H"
91 #include "setDeltaT.H"
92
93 ++runTime;
94
95 Info<< "Time = " << runTime.timeName() << nl << endl;
96
97 // --- Pressure-velocity PIMPLE corrector loop
98 while (pimple.loop())
99 {
100 #include "alphaControls.H"
101
102 UdmModel.correct();
103
104 #include "alphaEqnSubCycle.H"
105
106 mixture.correct();
107
108 #include "UEqn.H"
109
110 // --- Pressure corrector loop
111 while (pimple.correct())
112 {
113 #include "pEqn.H"
114 }
115
116 if (pimple.turbCorr())
117 {
118 turbulence->correct();
119 }
120 }
121
122 runTime.write();
123
124 runTime.printExecutionTime(Info);
125 }
126
127 Info<< "End\n" << endl;
128
129 return 0;
130}
131
132
133// ************************************************************************* //
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
Required Classes.
pimpleControl & pimple
volScalarField & rho2
const volScalarField & alpha2
volScalarField & rho1
engineTime & runTime
Required Variables.
Read the control parameters used by setDeltaT.
compressible::turbulenceModel & turbulence
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Execute application functionObjects to post-process existing results.
Read the control parameters used by setDeltaT.
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<< "Reading incompressibleTwoPhaseInteractingMixture\n"<< endl;incompressibleTwoPhaseInteractingMixture mixture(U, phi);volScalarField &alpha1(mixture.alpha1());volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mixture.rho());surfaceScalarField rhoPhi(IOobject("rhoPhi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), fvc::interpolate(rho) *phi);autoPtr< relativeVelocityModel > UdmModelPtr(relativeVelocityModel::New(mixture, mixture))
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39