OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

hhuCombustionThermo.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "hhuCombustionThermo.H"
00028 #include "fvMesh.H"
00029 #include "zeroGradientFvPatchFields.H"
00030 #include "fixedUnburntEnthalpyFvPatchScalarField.H"
00031 #include "gradientUnburntEnthalpyFvPatchScalarField.H"
00032 #include "mixedUnburntEnthalpyFvPatchScalarField.H"
00033 
00034 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00035 
00036 namespace Foam
00037 {
00038 
00039 /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
00040 
00041 defineTypeNameAndDebug(hhuCombustionThermo, 0);
00042 defineRunTimeSelectionTable(hhuCombustionThermo, fvMesh);
00043 
00044 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00045 
00046 wordList hhuCombustionThermo::huBoundaryTypes()
00047 {
00048     const volScalarField::GeometricBoundaryField& tbf = Tu_.boundaryField();
00049 
00050     wordList hbt = tbf.types();
00051 
00052     forAll(tbf, patchi)
00053     {
00054         if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
00055         {
00056             hbt[patchi] = fixedUnburntEnthalpyFvPatchScalarField::typeName;
00057         }
00058         else if
00059         (
00060             isA<zeroGradientFvPatchScalarField>(tbf[patchi])
00061          || isA<fixedGradientFvPatchScalarField>(tbf[patchi])
00062         )
00063         {
00064             hbt[patchi] = gradientUnburntEnthalpyFvPatchScalarField::typeName;
00065         }
00066         else if (isA<mixedFvPatchScalarField>(tbf[patchi]))
00067         {
00068             hbt[patchi] = mixedUnburntEnthalpyFvPatchScalarField::typeName;
00069         }
00070     }
00071 
00072     return hbt;
00073 }
00074 
00075 void hhuCombustionThermo::huBoundaryCorrection(volScalarField& hu)
00076 {
00077     volScalarField::GeometricBoundaryField& hbf = hu.boundaryField();
00078 
00079     forAll(hbf, patchi)
00080     {
00081         if
00082         (
00083             isA<gradientUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
00084         )
00085         {
00086             refCast<gradientUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
00087                 .gradient() = hbf[patchi].fvPatchField::snGrad();
00088         }
00089         else if
00090         (
00091             isA<mixedUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
00092         )
00093         {
00094             refCast<mixedUnburntEnthalpyFvPatchScalarField>(hbf[patchi])
00095                 .refGrad() = hbf[patchi].fvPatchField::snGrad();
00096         }
00097     }
00098 }
00099 
00100 
00101 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00102 
00103 hhuCombustionThermo::hhuCombustionThermo(const fvMesh& mesh)
00104 :
00105     hCombustionThermo(mesh),
00106 
00107     Tu_
00108     (
00109         IOobject
00110         (
00111             "Tu",
00112             mesh.time().timeName(),
00113             mesh,
00114             IOobject::MUST_READ,
00115             IOobject::AUTO_WRITE
00116         ),
00117         mesh
00118     ),
00119 
00120     hu_
00121     (
00122         IOobject
00123         (
00124             "hu",
00125             mesh.time().timeName(),
00126             mesh,
00127             IOobject::NO_READ,
00128             IOobject::NO_WRITE
00129         ),
00130         mesh,
00131         dimensionSet(0, 2, -2, 0, 0),
00132         huBoundaryTypes()
00133     )
00134 {}
00135 
00136 
00137 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00138 
00139 hhuCombustionThermo::~hhuCombustionThermo()
00140 {}
00141 
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 } // End namespace Foam
00146 
00147 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd