All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rhoPorousSimpleFoam.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  rhoPorousSimpleFoam
26 
27 Description
28  Steady-state solver for turbulent flow of compressible fluids, with
29  implicit or explicit porosity treatment and optional sources.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #include "argList.H"
34 #include "timeSelector.H"
35 #include "fluidThermo.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 #include "fvcVolumeIntegrate.H"
52 
53 #include "fvmDdt.H"
54 #include "fvmDiv.H"
55 #include "fvmLaplacian.H"
56 
57 using namespace Foam;
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 int main(int argc, char *argv[])
62 {
63  #include "postProcess.H"
64 
65  #include "setRootCase.H"
66  #include "createTime.H"
67  #include "createMesh.H"
68  #include "createControl.H"
69  #include "createFields.H"
70  #include "createZones.H"
71  #include "initContinuityErrs.H"
72 
73  turbulence->validate();
74 
75  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77  Info<< "\nStarting time loop\n" << endl;
78 
79  while (simple.loop(runTime))
80  {
81  Info<< "Time = " << runTime.userTimeName() << nl << endl;
82 
83  turbulence->predict();
84  thermophysicalTransport->predict();
85 
86  // Pressure-velocity SIMPLE corrector
87  {
88  #include "UEqn.H"
89  #include "EEqn.H"
90  #include "pEqn.H"
91  }
92 
93  turbulence->correct();
94  thermophysicalTransport->correct();
95 
96  runTime.write();
97  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
98  << " ClockTime = " << runTime.elapsedClockTime() << " s"
99  << nl << endl;
100  }
101 
102  Info<< "End\n" << endl;
103 
104  return 0;
105 }
106 
107 
108 // ************************************************************************* //
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
bool loop(Time &time)
Time loop loop.
Definition: simpleControl.C:80
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.
Volume integrate volField creating a volField.
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.
Info<< "Creating thermophysical transport model\n"<< endl;turbulenceThermophysicalTransportModels::unityLewisEddyDiffusivity< RASThermophysicalTransportModel< ThermophysicalTransportModel< compressibleMomentumTransportModel, fluidThermo > >> thermophysicalTransport(turbulence(), thermo, true)
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
messageStream Info
static const char nl
Definition: Ostream.H:266
Execute application functionObjects to post-process existing results.
int main(int argc, char *argv[])
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))