OpenFOAM: API Guide
v2112
The open source CFD toolbox
interMixingFoam.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
-------------------------------------------------------------------------------
10
License
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
26
Application
27
interMixingFoam
28
29
Group
30
grpMultiphaseSolvers
31
32
Description
33
Solver for 3 incompressible fluids, two of which are miscible, using a VOF
34
method to capture the interface, with optional mesh motion and mesh topology
35
changes including adaptive re-meshing.
36
37
\*---------------------------------------------------------------------------*/
38
39
#include "
fvCFD.H
"
40
#include "
dynamicFvMesh.H
"
41
#include "
CMULES.H
"
42
#include "
localEulerDdtScheme.H
"
43
#include "
subCycle.H
"
44
#include "
immiscibleIncompressibleThreePhaseMixture.H
"
45
#include "
turbulentTransportModel.H
"
46
#include "
pimpleControl.H
"
47
#include "
fvOptions.H
"
48
#include "
CorrectPhi.H
"
49
#include "
fvcSmooth.H
"
50
51
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53
int
main(
int
argc,
char
*argv[])
54
{
55
argList::addNote
56
(
57
"Solver for three incompressible fluids (two of which are immiscible)"
58
" using VOF phase-fraction based interface capturing.\n"
59
"With optional mesh motion and mesh topology changes including"
60
" adaptive re-meshing."
61
);
62
63
#include "
postProcess.H
"
64
65
#include "
addCheckCaseOptions.H
"
66
#include "
setRootCaseLists.H
"
67
#include "
createTime.H
"
68
#include "
createDynamicFvMesh.H
"
69
#include "initContinuityErrs.H"
70
#include "createDyMControls.H"
71
#include "createFields.H"
72
#include "
initCorrectPhi.H
"
73
#include "
createUfIfPresent.H
"
74
75
turbulence
->validate();
76
77
if
(!
LTS
)
78
{
79
#include "
readTimeControls.H
"
80
#include "CourantNo.H"
81
#include "setInitialDeltaT.H"
82
}
83
84
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86
Info
<<
"\nStarting time loop\n"
<<
endl
;
87
88
while
(
runTime
.run())
89
{
90
#include "
readDyMControls.H
"
91
92
if
(
LTS
)
93
{
94
#include "setRDeltaT.H"
95
}
96
else
97
{
98
#include "CourantNo.H"
99
#include "alphaCourantNo.H"
100
#include "setDeltaT.H"
101
}
102
103
++
runTime
;
104
105
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
106
107
// --- Pressure-velocity PIMPLE corrector loop
108
while
(
pimple
.loop())
109
{
110
if
(
pimple
.firstIter() ||
moveMeshOuterCorrectors
)
111
{
112
mesh
.update();
113
114
if
(
mesh
.changing())
115
{
116
gh
= (
g
&
mesh
.C()) - ghRef;
117
ghf
= (
g
&
mesh
.Cf()) - ghRef;
118
119
MRF
.update();
120
121
if
(
correctPhi
)
122
{
123
// Calculate absolute flux
124
// from the mapped surface velocity
125
phi
=
mesh
.Sf() &
Uf
();
126
127
#include "correctPhi.H"
128
129
// Make the flux relative to the mesh motion
130
fvc::makeRelative(
phi
,
U
);
131
132
mixture
.correct();
133
}
134
135
if
(
checkMeshCourantNo
)
136
{
137
#include "
meshCourantNo.H
"
138
}
139
}
140
}
141
142
#include "alphaControls.H"
143
#include "alphaEqnSubCycle.H"
144
145
mixture
.correct();
146
147
#include "UEqn.H"
148
149
// --- Pressure corrector loop
150
while
(
pimple
.correct())
151
{
152
#include "pEqn.H"
153
}
154
155
if
(
pimple
.turbCorr())
156
{
157
turbulence
->correct();
158
}
159
}
160
161
#include "continuityErrs.H"
162
163
runTime
.write();
164
165
runTime
.printExecutionTime(Info);
166
}
167
168
Info
<<
"End\n"
<<
endl
;
169
170
return
0;
171
}
172
173
174
// ************************************************************************* //
CMULES.H
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
CorrectPhi.H
addCheckCaseOptions.H
Required Classes.
g
const uniformDimensionedVectorField & g
Definition:
createFluidFields.H:26
phi
surfaceScalarField & phi
Definition:
setRegionFluidFields.H:8
ghf
const surfaceScalarField & ghf
Definition:
setRegionFluidFields.H:18
MRF
IOMRFZoneList & MRF
Definition:
setRegionFluidFields.H:22
gh
const volScalarField & gh
Definition:
setRegionFluidFields.H:17
pimple
pimpleControl & pimple
Definition:
setRegionFluidFields.H:56
U
U
Definition:
pEqn.H:72
createDynamicFvMesh.H
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
LTS
bool LTS
Definition:
createRDeltaT.H:1
createTime.H
createUfIfPresent.H
Creates and initialises the velocity field Uf if required.
Uf
autoPtr< surfaceVectorField > Uf
Definition:
createUfIfPresent.H:33
dynamicFvMesh.H
turbulence
compressible::turbulenceModel & turbulence
Definition:
setRegionFluidFields.H:30
fvCFD.H
fvOptions.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...
immiscibleIncompressibleThreePhaseMixture.H
initCorrectPhi.H
localEulerDdtScheme.H
meshCourantNo.H
Calculates and outputs the mean and maximum Courant Numbers.
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
pimpleControl.H
postProcess.H
Execute application functionObjects to post-process existing results.
readDyMControls.H
checkMeshCourantNo
checkMeshCourantNo
Definition:
readDyMControls.H:9
correctPhi
correctPhi
Definition:
readDyMControls.H:3
moveMeshOuterCorrectors
moveMeshOuterCorrectors
Definition:
readDyMControls.H:15
readTimeControls.H
Read the control parameters used by setDeltaT.
setRootCaseLists.H
mixture
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition:
createFields.H:39
subCycle.H
turbulentTransportModel.H
applications
solvers
multiphase
interFoam
interMixingFoam
interMixingFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.