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
25 \*---------------------------------------------------------------------------*/
27 #include "gradientUnburntEnthalpyFvPatchScalarField.H"
28 #include <OpenFOAM/addToRunTimeSelectionTable.H>
29 #include <finiteVolume/fvPatchFieldMapper.H>
30 #include <finiteVolume/volFields.H>
31 #include <reactionThermophysicalModels/hhuCombustionThermo.H>
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 gradientUnburntEnthalpyFvPatchScalarField::
41 gradientUnburntEnthalpyFvPatchScalarField
44 const DimensionedField<scalar, volMesh>& iF
47 fixedGradientFvPatchScalarField(p, iF)
51 gradientUnburntEnthalpyFvPatchScalarField::
52 gradientUnburntEnthalpyFvPatchScalarField
54 const gradientUnburntEnthalpyFvPatchScalarField& ptf,
56 const DimensionedField<scalar, volMesh>& iF,
57 const fvPatchFieldMapper& mapper
60 fixedGradientFvPatchScalarField(ptf, p, iF, mapper)
64 gradientUnburntEnthalpyFvPatchScalarField::
65 gradientUnburntEnthalpyFvPatchScalarField
68 const DimensionedField<scalar, volMesh>& iF,
69 const dictionary& dict
72 fixedGradientFvPatchScalarField(p, iF, dict)
76 gradientUnburntEnthalpyFvPatchScalarField::
77 gradientUnburntEnthalpyFvPatchScalarField
79 const gradientUnburntEnthalpyFvPatchScalarField& tppsf
82 fixedGradientFvPatchScalarField(tppsf)
86 gradientUnburntEnthalpyFvPatchScalarField::
87 gradientUnburntEnthalpyFvPatchScalarField
89 const gradientUnburntEnthalpyFvPatchScalarField& tppsf,
90 const DimensionedField<scalar, volMesh>& iF
93 fixedGradientFvPatchScalarField(tppsf, iF)
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 void gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs()
106 const hhuCombustionThermo& thermo = db().lookupObject<hhuCombustionThermo>
108 "thermophysicalProperties"
111 const label patchi = patch().index();
113 fvPatchScalarField& Tw =
114 const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi]);
118 gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
119 + patch().deltaCoeffs()*
121 thermo.hu(Tw, patchi)
122 - thermo.hu(Tw, patch().faceCells())
125 fixedGradientFvPatchScalarField::updateCoeffs();
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 gradientUnburntEnthalpyFvPatchScalarField
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // ************************ vim: set sw=4 sts=4 et: ************************ //