multiphaseEulerFoam.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-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Application
28  multiphaseEulerFoam
29 
30 Group
31  grpMultiphaseSolvers
32 
33 Description
34  Solver for a system of many compressible fluid phases including
35  heat-transfer.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #include "fvCFD.H"
40 #include "multiphaseSystem.H"
41 #include "phaseModel.H"
42 #include "dragModel.H"
43 #include "heatTransferModel.H"
46 #include "pimpleControl.H"
47 #include "IOMRFZoneList.H"
48 #include "CorrectPhi.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 int main(int argc, char *argv[])
53 {
54  argList::addNote
55  (
56  "Solver for a system of many compressible fluid phases including"
57  " heat-transfer."
58  );
59 
60  #include "postProcess.H"
61 
62  #include "addCheckCaseOptions.H"
63  #include "setRootCaseLists.H"
64  #include "createTime.H"
65  #include "createMesh.H"
66  #include "createControl.H"
67  #include "createFields.H"
68  #include "initContinuityErrs.H"
69  #include "createTimeControls.H"
70  #include "correctPhi.H"
71  #include "CourantNo.H"
72  #include "setInitialDeltaT.H"
73 
74  scalar slamDampCoeff
75  (
76  fluid.getOrDefault<scalar>("slamDampCoeff", 1)
77  );
78 
79  dimensionedScalar maxSlamVelocity
80  (
81  "maxSlamVelocity",
83  GREAT,
84  fluid
85  );
86 
87  turbulence->validate();
88 
89  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91  Info<< "\nStarting time loop\n" << endl;
92 
93  while (runTime.run())
94  {
95  #include "readTimeControls.H"
96  #include "CourantNo.H"
97  #include "setDeltaT.H"
98 
99  ++runTime;
100  Info<< "Time = " << runTime.timeName() << nl << endl;
101 
102  // --- Pressure-velocity PIMPLE corrector loop
103  while (pimple.loop())
104  {
105  turbulence->correct();
106  fluid.solve();
107  rho = fluid.rho();
108  #include "zonePhaseVolumes.H"
109 
110  //#include "TEqns.H"
111  #include "UEqns.H"
112 
113  // --- Pressure corrector loop
114  while (pimple.correct())
115  {
116  #include "pEqn.H"
117  }
118 
119  #include "DDtU.H"
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 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
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
Foam::dimVelocity
const dimensionSet dimVelocity
singlePhaseTransportModel.H
turbulentTransportModel.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
zonePhaseVolumes.H
rho
rho
Definition: readInitialConditions.H:88
pimpleControl.H
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
setRootCaseLists.H
addCheckCaseOptions.H
Required Classes.
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
postProcess.H
Execute application functionObjects to post-process existing results.
IOMRFZoneList.H
Foam::nl
constexpr char nl
Definition: Ostream.H:404
createTimeControls.H
Read the control parameters used by setDeltaT.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
Required Variables.
CorrectPhi.H
createTime.H
fvCFD.H