porousSimpleFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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  porousSimpleFoam
26 
27 Description
28  Steady-state solver for incompressible, turbulent flow with
29  implicit or explicit porosity treatment and support for multiple reference
30  frames (MRF).
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #include "argList.H"
35 #include "timeSelector.H"
36 #include "viscosityModel.H"
38 #include "simpleControl.H"
39 #include "pressureReference.H"
40 #include "findRefCell.H"
41 #include "constrainPressure.H"
42 #include "constrainHbyA.H"
43 #include "adjustPhi.H"
44 #include "fvModels.H"
45 #include "fvConstraints.H"
46 #include "IOporosityModelList.H"
47 
48 #include "fvcDdt.H"
49 #include "fvcGrad.H"
50 #include "fvcFlux.H"
51 
52 #include "fvmDdt.H"
53 #include "fvmDiv.H"
54 #include "fvmLaplacian.H"
55 
56 using namespace Foam;
57 
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 int main(int argc, char *argv[])
62 {
63  #define CREATE_FIELDS_2 createPorousZones.H
64  #include "postProcess.H"
65 
66  #include "setRootCase.H"
67  #include "createTime.H"
68  #include "createMesh.H"
69  #include "createControl.H"
70  #include "createFields.H"
71  #include "createPorousZones.H"
72  #include "initContinuityErrs.H"
73 
74  turbulence->validate();
75 
76  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78  Info<< "\nStarting time loop\n" << endl;
79 
80  while (simple.loop(runTime))
81  {
82  Info<< "Time = " << runTime.userTimeName() << nl << endl;
83 
84  fvModels.correct();
85 
86  turbulence->predict();
87 
88  // Pressure-velocity SIMPLE corrector
89  {
90  #include "UEqn.H"
91  #include "pEqn.H"
92  }
93 
94  viscosity->correct();
95  turbulence->correct();
96 
97  runTime.write();
98 
99  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
100  << " ClockTime = " << runTime.elapsedClockTime() << " s"
101  << nl << endl;
102  }
103 
104  Info<< "End\n" << endl;
105 
106  return 0;
107 }
108 
109 
110 // ************************************************************************* //
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
Finite volume models.
Definition: fvModels.H:65
virtual void correct()
Correct the fvModels.
Definition: fvModels.C:358
bool loop(Time &time)
Time loop loop.
Definition: simpleControl.C:78
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
simpleControl simple(mesh)
Find the reference cell nearest (in index) to the given cell but which is not on a cyclic,...
Calculate the first temporal derivative.
Calculate the face-flux of the given field.
Calculate the gradient of the given field.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
Declare and initialise the cumulative continuity error.
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
messageStream Info
static const char nl
Definition: Ostream.H:260
int main(int argc, char *argv[])
Execute application functionObjects to post-process existing results.
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))