ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / incompressible / boundaryFoam / boundaryFoam.C
blob9b6c0fabfaea4fdbf179b0090513395f496abf8f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Application
25     boundaryFoam
27 Description
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 \*---------------------------------------------------------------------------*/
38 #include "fvCFD.H"
39 #include "singlePhaseTransportModel.H"
40 #include "RASModel.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())
60     {
61         Info<< "Time = " << runTime.timeName() << nl << endl;
63         fvVectorMatrix divR(turbulence->divDevReff(U));
64         divR.source() = flowMask & divR.source();
66         fvVectorMatrix UEqn
67         (
68             divR == gradP
69         );
71         UEqn.relax();
73         UEqn.solve();
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())
87             << endl;
89         #include "evaluateNearWall.H"
91         if (runTime.outputTime())
92         {
93             #include "makeGraphs.H"
94         }
96         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
97             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
98             << nl << endl;
99     }
101     Info<< "End\n" << endl;
103     return 0;
107 // ************************************************************************* //