Loading...
Searching...
No Matches
mixedUnburntEnthalpyFvPatchScalarField.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
30#include "fvPatchFieldMapper.H"
31#include "volFields.H"
32#include "psiuReactionThermo.H"
33
34// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35
38(
39 const fvPatch& p,
41)
42:
43 mixedFvPatchScalarField(p, iF)
45 refValue() = Zero;
46 refGrad() = Zero;
47 valueFraction() = 0.0;
48}
49
50
53(
55 const fvPatch& p,
57 const fvPatchFieldMapper& mapper
58)
59:
60 mixedFvPatchScalarField(ptf, p, iF, mapper)
61{}
62
63
66(
67 const fvPatch& p,
70)
71:
72 mixedFvPatchScalarField(p, iF, dict)
73{}
74
75
78(
88(
91)
93 mixedFvPatchScalarField(tppsf, iF)
94{}
95
96
97// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98
100{
101 if (updated())
102 {
103 return;
104 }
105
106 const psiuReactionThermo& thermo = db().lookupObject<psiuReactionThermo>
107 (
109 );
110
111 const label patchi = patch().index();
112
113 const scalarField& pw = thermo.p().boundaryField()[patchi];
114 mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
115 (
116 const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi])
117 );
118
119 Tw.evaluate();
120
121 valueFraction() = Tw.valueFraction();
122 refValue() = thermo.heu(pw, Tw.refValue(), patchi);
123 refGrad() = thermo.Cp(pw, Tw, patchi)*Tw.refGrad()
124 + patch().deltaCoeffs()*
125 (
126 thermo.heu(pw, Tw, patchi)
127 - thermo.heu(pw, Tw, patch().faceCells())
128 );
129
130 mixedFvPatchScalarField::updateCoeffs();
132
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136namespace Foam
137{
139 (
141 mixedUnburntEnthalpyFvPatchScalarField
142 );
143}
144
145// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const word dictName
The dictionary name ("thermophysicalProperties").
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Smooth ATC in cells next to a set of patches supplied by type.
Definition faceCells.H:55
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
mixedUnburntEnthalpyFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::psiuReactionThermo.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
volScalarField & p
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
Namespace for OpenFOAM.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
fvPatchField< scalar > fvPatchScalarField
dictionary dict