BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / reactionThermo / derivedFvPatchFields / mixedUnburntEnthalpy / mixedUnburntEnthalpyFvPatchScalarField.C
blobcf238bb56a1727adacef555033337b6ad41f3d40
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
37     const fvPatch& p,
38     const DimensionedField<scalar, volMesh>& iF
41     mixedFvPatchScalarField(p, iF)
43     valueFraction() = 0.0;
44     refValue() = 0.0;
45     refGrad() = 0.0;
49 Foam::mixedUnburntEnthalpyFvPatchScalarField::
50 mixedUnburntEnthalpyFvPatchScalarField
52     const mixedUnburntEnthalpyFvPatchScalarField& ptf,
53     const fvPatch& p,
54     const DimensionedField<scalar, volMesh>& iF,
55     const fvPatchFieldMapper& mapper
58     mixedFvPatchScalarField(ptf, p, iF, mapper)
62 Foam::mixedUnburntEnthalpyFvPatchScalarField::
63 mixedUnburntEnthalpyFvPatchScalarField
65     const fvPatch& p,
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()
99     if (updated())
100     {
101         return;
102     }
104     const hhuCombustionThermo& thermo = db().lookupObject<hhuCombustionThermo>
105     (
106         "thermophysicalProperties"
107     );
109     const label patchi = patch().index();
111     mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
112     (
113         const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi])
114     );
116     Tw.evaluate();
118     valueFraction() = Tw.valueFraction();
119     refValue() = thermo.hu(Tw.refValue(), patchi);
120     refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
121       + patch().deltaCoeffs()*
122         (
123             thermo.hu(Tw, patchi)
124           - thermo.hu(Tw, patch().faceCells())
125         );
127     mixedFvPatchScalarField::updateCoeffs();
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 namespace Foam
135     makePatchTypeField
136     (
137         fvPatchScalarField,
138         mixedUnburntEnthalpyFvPatchScalarField
139     );
142 // ************************************************************************* //