1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
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
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 \*---------------------------------------------------------------------------*/
26 #include "mixedUnburntEnthalpyFvPatchScalarField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "fvPatchFieldMapper.H"
29 #include "volFields.H"
30 #include "hhuCombustionThermo.H"
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 Foam::mixedUnburntEnthalpyFvPatchScalarField::
35 mixedUnburntEnthalpyFvPatchScalarField
38 const DimensionedField<scalar, volMesh>& iF
41 mixedFvPatchScalarField(p, iF)
43 valueFraction() = 0.0;
49 Foam::mixedUnburntEnthalpyFvPatchScalarField::
50 mixedUnburntEnthalpyFvPatchScalarField
52 const mixedUnburntEnthalpyFvPatchScalarField& ptf,
54 const DimensionedField<scalar, volMesh>& iF,
55 const fvPatchFieldMapper& mapper
58 mixedFvPatchScalarField(ptf, p, iF, mapper)
62 Foam::mixedUnburntEnthalpyFvPatchScalarField::
63 mixedUnburntEnthalpyFvPatchScalarField
66 const DimensionedField<scalar, volMesh>& iF,
67 const dictionary& dict
70 mixedFvPatchScalarField(p, iF, dict)
74 Foam::mixedUnburntEnthalpyFvPatchScalarField::
75 mixedUnburntEnthalpyFvPatchScalarField
77 const mixedUnburntEnthalpyFvPatchScalarField& tppsf
80 mixedFvPatchScalarField(tppsf)
84 Foam::mixedUnburntEnthalpyFvPatchScalarField::
85 mixedUnburntEnthalpyFvPatchScalarField
87 const mixedUnburntEnthalpyFvPatchScalarField& tppsf,
88 const DimensionedField<scalar, volMesh>& iF
91 mixedFvPatchScalarField(tppsf, iF)
95 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
97 void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
104 const hhuCombustionThermo& thermo = db().lookupObject<hhuCombustionThermo>
106 "thermophysicalProperties"
109 const label patchi = patch().index();
111 mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
113 const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi])
118 valueFraction() = Tw.valueFraction();
119 refValue() = thermo.hu(Tw.refValue(), patchi);
120 refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
121 + patch().deltaCoeffs()*
123 thermo.hu(Tw, patchi)
124 - thermo.hu(Tw, patch().faceCells())
127 mixedFvPatchScalarField::updateCoeffs();
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 mixedUnburntEnthalpyFvPatchScalarField
142 // ************************************************************************* //