gradientUnburntEnthalpyFvPatchScalarField.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-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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  fixedGradientFvPatchScalarField(p, iF)
44 {}
45 
46 
49 (
51  const fvPatch& p,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  fixedGradientFvPatchScalarField(ptf, p, iF, mapper)
57 {}
58 
59 
62 (
63  const fvPatch& p,
65  const dictionary& dict
66 )
67 :
68  fixedGradientFvPatchScalarField(p, iF, dict)
69 {}
70 
71 
74 (
76 )
77 :
78  fixedGradientFvPatchScalarField(tppsf)
79 {}
80 
81 
84 (
87 )
88 :
89  fixedGradientFvPatchScalarField(tppsf, iF)
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
96 {
97  if (updated())
98  {
99  return;
100  }
101 
102  const psiuReactionThermo& thermo = db().lookupObject<psiuReactionThermo>
103  (
105  );
106 
107  const label patchi = patch().index();
108 
109  const scalarField& pw = thermo.p().boundaryField()[patchi];
110  fvPatchScalarField& Tw =
111  const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi]);
112 
113  Tw.evaluate();
114 
115  gradient() = thermo.Cp(pw, Tw, patchi)*Tw.snGrad()
116  + patch().deltaCoeffs()*
117  (
118  thermo.heu(pw, Tw, patchi)
119  - thermo.heu(pw, Tw, patch().faceCells())
120  );
121 
122  fixedGradientFvPatchScalarField::updateCoeffs();
123 }
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 namespace Foam
129 {
131  (
134  );
135 }
136 
137 // ************************************************************************* //
Foam::fvPatchField< scalar >
volFields.H
Foam::fvPatchField::snGrad
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
Definition: fvPatchField.C:225
gradientUnburntEnthalpyFvPatchScalarField.H
psiuReactionThermo.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::gradientUnburntEnthalpyFvPatchScalarField
gradient boundary condition for unburnt
Definition: gradientUnburntEnthalpyFvPatchScalarField.H:53
Foam::psiuReactionThermo
Foam::psiuReactionThermo.
Definition: psiuReactionThermo.H:55
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
fvPatchFieldMapper.H
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fvPatchField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field, sets Updated to false.
Definition: fvPatchField.C:341
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::gradientUnburntEnthalpyFvPatchScalarField::gradientUnburntEnthalpyFvPatchScalarField
gradientUnburntEnthalpyFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: gradientUnburntEnthalpyFvPatchScalarField.C:38
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: gradientUnburntEnthalpyFvPatchScalarField.C:95
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::dictionary::dictName
word dictName() const
The local dictionary name (final part of scoped name)
Definition: dictionaryI.H:60