1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Steady-state solver for incompressible, 1D turbulent flow, typically to
29 generate boundary layer conditions at an inlet, for use in a simulation.
31 Boundary layer code to calculate the U, k and epsilon distributions.
32 Used to create inlet boundary conditions for experimental comparisons
33 for which U and k have not been measured.
34 Turbulence model is runtime selectable.
36 \*---------------------------------------------------------------------------*/
39 #include "singlePhaseTransportModel.H"
41 #include "wallFvPatch.H"
42 #include "makeGraph.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 int main(int argc, char *argv[])
48 #include "setRootCase.H"
50 #include "createTime.H"
51 #include "createMesh.H"
52 #include "createFields.H"
53 #include "interrogateWallPatches.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 Info<< "\nStarting time loop\n" << endl;
59 while (runTime.loop())
61 Info<< "Time = " << runTime.timeName() << nl << endl;
63 fvVectorMatrix divR(turbulence->divDevReff(U));
64 divR.source() = flowMask & divR.source();
76 // Correct driving force for a constant volume flow rate
77 dimensionedVector UbarStar = flowMask & U.weightedAverage(mesh.V());
79 U += (Ubar - UbarStar);
80 gradP += (Ubar - UbarStar)/(1.0/UEqn.A())().weightedAverage(mesh.V());
83 turbulence->correct();
85 Info<< "Uncorrected Ubar = " << (flowDirection & UbarStar.value())
86 << ", pressure gradient = " << (flowDirection & gradP.value())
89 #include "evaluateNearWall.H"
91 if (runTime.outputTime())
93 #include "makeGraphs.H"
96 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
97 << " ClockTime = " << runTime.elapsedClockTime() << " s"
101 Info<< "End\n" << endl;
107 // ************************************************************************* //