1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Calculates and writes the heat flux for all patches as the boundary field
30 of a volScalarField and also prints the integrated flux for all wall
33 \*---------------------------------------------------------------------------*/
36 #include "hCombustionThermo.H"
38 #include "wallFvPatch.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 int main(int argc, char *argv[])
44 timeSelector::addOptions();
45 #include "setRootCase.H"
46 #include "createTime.H"
47 instantList timeDirs = timeSelector::select0(runTime, args);
48 #include "createMesh.H"
50 forAll(timeDirs, timeI)
52 runTime.setTime(timeDirs[timeI], timeI);
53 Info<< "Time = " << runTime.timeName() << endl;
56 #include "createFields.H"
58 surfaceScalarField heatFlux =
59 fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h);
61 const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
62 heatFlux.boundaryField();
64 Info<< "\nWall heat fluxes [W]" << endl;
65 forAll(patchHeatFlux, patchi)
67 if (typeid(mesh.boundary()[patchi]) == typeid(wallFvPatch))
69 Info<< mesh.boundary()[patchi].name()
73 mesh.magSf().boundaryField()[patchi]
74 *patchHeatFlux[patchi]
81 volScalarField wallHeatFlux
90 dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0)
93 forAll(wallHeatFlux.boundaryField(), patchi)
95 wallHeatFlux.boundaryField()[patchi] = patchHeatFlux[patchi];
101 Info<< "End" << endl;
106 // ************************************************************************* //