mixedEnergyFvPatchScalarField.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-2012 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 "basicThermo.H"
33 
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
39 (
40  const fvPatch& p,
42 )
43 :
44  mixedFvPatchScalarField(p, iF)
45 {
46  valueFraction() = 0.0;
47  refValue() = 0.0;
48  refGrad() = 0.0;
49 }
50 
51 
54 (
56  const fvPatch& p,
58  const fvPatchFieldMapper& mapper
59 )
60 :
61  mixedFvPatchScalarField(ptf, p, iF, mapper)
62 {}
63 
64 
67 (
68  const fvPatch& p,
70  const dictionary& dict
71 )
72 :
73  mixedFvPatchScalarField(p, iF, dict)
74 {}
75 
76 
79 (
81 )
82 :
83  mixedFvPatchScalarField(tppsf)
84 {}
85 
86 
89 (
90  const mixedEnergyFvPatchScalarField& tppsf,
92 )
93 :
94  mixedFvPatchScalarField(tppsf, iF)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 {
102  if (updated())
103  {
104  return;
105  }
106 
108  const label patchi = patch().index();
109 
110  const scalarField& pw = thermo.p().boundaryField()[patchi];
111  mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
112  (
113  const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi])
114  );
115 
116  Tw.evaluate();
117 
118  valueFraction() = Tw.valueFraction();
119  refValue() = thermo.he(pw, Tw.refValue(), patchi);
120  refGrad() =
121  thermo.Cpv(pw, Tw, patchi)*Tw.refGrad()
122  + patch().deltaCoeffs()*
123  (
124  thermo.he(pw, Tw, patchi)
125  - thermo.he(pw, Tw, patch().faceCells())
126  );
127 
128  mixedFvPatchScalarField::updateCoeffs();
129 }
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 namespace Foam
135 {
137  (
140  );
141 }
142 
143 // ************************************************************************* //
Foam::fvPatchField< scalar >
volFields.H
p
volScalarField & p
Definition: createFieldRefs.H:8
basicThermo.H
Foam::mixedEnergyFvPatchScalarField::mixedEnergyFvPatchScalarField
mixedEnergyFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: mixedEnergyFvPatchScalarField.C:39
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:63
fvPatchFieldMapper.H
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::mixedEnergyFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: mixedEnergyFvPatchScalarField.C:100
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::mixedEnergyFvPatchScalarField
This boundary condition provides a mixed condition for internal energy.
Definition: mixedEnergyFvPatchScalarField.H:56
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedEnergyFvPatchScalarField.H
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::basicThermo::lookupThermo
static Table::iterator lookupThermo(const dictionary &thermoTypeDict, Table *tablePtr, std::initializer_list< const char * > cmptNames, const word &thermoTypeName)
Generic lookup for thermodynamics package thermoTypeName.
Definition: basicThermoTemplates.C:35
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54