icoReactingMultiphaseInterFoam.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) 2017-2020 OpenCFD Ltd.
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  icoReactingMultiphaseInterFoam
28 
29 Group
30  grpMultiphaseSolvers
31 
32 Description
33  Solver for N incompressible, non-isothermal immiscible fluids with
34  phase-change. Uses a VOF (volume of fluid) phase-fraction based interface
35  capturing approach.
36 
37  The momentum, energy and other fluid properties are of the "mixture" and a
38  single momentum equation is solved.
39 
40  Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #include "fvCFD.H"
45 #include "subCycle.H"
46 #include "multiphaseSystem.H"
48 #include "pimpleControl.H"
49 #include "fvOptions.H"
51 #include "radiationModel.H"
52 #include "HashPtrTable.H"
53 #include "fvcDDt.H"
54 #include "zeroField.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 int main(int argc, char *argv[])
59 {
60  argList::addNote
61  (
62  "Solver for N incompressible, non-isothermal immiscible fluids with"
63  " phase-change,"
64  " using VOF phase-fraction based interface capturing.\n"
65  "With optional mesh motion and mesh topology changes including"
66  " adaptive re-meshing."
67  );
68 
69  #include "postProcess.H"
70 
71  #include "setRootCaseLists.H"
72  #include "createTime.H"
73  #include "createMesh.H"
74 
75  pimpleControl pimple(mesh);
76 
77  #include "createFields.H"
78  #include "createFieldRefs.H"
79  #include "createFvOptions.H"
80  #include "createTimeControls.H"
81  #include "CourantNo.H"
82  #include "setInitialDeltaT.H"
83 
84  turbulence->validate();
85 
86  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88  Info<< "\nStarting time loop\n" << endl;
89 
90  while (runTime.run())
91  {
92  #include "readTimeControls.H"
93  #include "CourantNo.H"
94  #include "alphaCourantNo.H"
95  #include "setDeltaT.H"
96 
97  ++runTime;
98 
99  Info<< "Time = " << runTime.timeName() << nl << endl;
100 
101  fluid.correctMassSources(T);
102  fluid.solve();
103  rho = fluid.rho();
104 
105  // --- Pressure-velocity PIMPLE corrector loop
106  while (pimple.loop())
107  {
108  #include "UEqn.H"
109  #include "YEqns.H"
110  #include "TEqn.H"
111 
112  // --- Pressure corrector loop
113  while (pimple.correct())
114  {
115  #include "pEqn.H"
116  }
117 
118  if (pimple.turbCorr())
119  {
120  turbulence->correct();
121  }
122  }
123 
124  rho = fluid.rho();
125 
126  runTime.write();
127 
128  runTime.printExecutionTime(Info);
129  }
130 
131  Info<< "End\n" << endl;
132 
133  return 0;
134 }
135 
136 
137 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
fvOptions.H
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
subCycle.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
rho
rho
Definition: readInitialConditions.H:88
pimpleControl.H
zeroField.H
createFvOptions.H
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
setRootCaseLists.H
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
postProcess.H
Execute application functionObjects to post-process existing results.
T
const volScalarField & T
Definition: createFieldRefs.H:2
Foam::nl
constexpr char nl
Definition: Ostream.H:385
createTimeControls.H
Read the control parameters used by setDeltaT.
fvcDDt.H
Calculate the substantive (total) derivative.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
HashPtrTable.H
createTime.H
fvCFD.H
fixedFluxPressureFvPatchScalarField.H
radiationModel.H
turbulentFluidThermoModel.H