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 "gradientEnthalpyFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
30 #include "volFields.H"
31 #include "basicThermo.H"
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 Foam::gradientEnthalpyFvPatchScalarField::gradientEnthalpyFvPatchScalarField
38 const DimensionedField<scalar, volMesh>& iF
41 fixedGradientFvPatchScalarField(p, iF)
45 Foam::gradientEnthalpyFvPatchScalarField::gradientEnthalpyFvPatchScalarField
47 const gradientEnthalpyFvPatchScalarField& ptf,
49 const DimensionedField<scalar, volMesh>& iF,
50 const fvPatchFieldMapper& mapper
53 fixedGradientFvPatchScalarField(ptf, p, iF, mapper)
57 Foam::gradientEnthalpyFvPatchScalarField::gradientEnthalpyFvPatchScalarField
60 const DimensionedField<scalar, volMesh>& iF,
61 const dictionary& dict
64 fixedGradientFvPatchScalarField(p, iF, dict)
68 Foam::gradientEnthalpyFvPatchScalarField::gradientEnthalpyFvPatchScalarField
70 const gradientEnthalpyFvPatchScalarField& tppsf
73 fixedGradientFvPatchScalarField(tppsf)
77 Foam::gradientEnthalpyFvPatchScalarField::gradientEnthalpyFvPatchScalarField
79 const gradientEnthalpyFvPatchScalarField& tppsf,
80 const DimensionedField<scalar, volMesh>& iF
83 fixedGradientFvPatchScalarField(tppsf, iF)
87 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs()
96 const basicThermo& thermo = db().lookupObject<basicThermo>
98 "thermophysicalProperties"
101 const label patchi = patch().index();
103 fvPatchScalarField& Tw =
104 const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi]);
108 if (dimensionedInternalField().name() == "h")
110 gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
111 + patch().deltaCoeffs()*
114 - thermo.h(Tw, patch().faceCells())
119 gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
120 + patch().deltaCoeffs()*
122 thermo.hs(Tw, patchi)
123 - thermo.hs(Tw, patch().faceCells())
127 fixedGradientFvPatchScalarField::updateCoeffs();
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 gradientEnthalpyFvPatchScalarField
143 // ************************************************************************* //