localReferenceTemperature.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) 2017-2022 OpenCFD Ltd.
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 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace heatTransferCoeffModels
36 {
37  defineTypeNameAndDebug(localReferenceTemperature, 0);
39  (
40  heatTransferCoeffModel,
41  localReferenceTemperature,
42  dictionary
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
49 
51 (
52  volScalarField& htc,
54 )
55 {
56  const auto& T = mesh_.lookupObject<volScalarField>(TName_);
57  const volScalarField::Boundary& Tbf = T.boundaryField();
58  const scalar eps = ROOTVSMALL;
59 
60  volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
61 
62  for (const label patchi : patchIDs_)
63  {
64  tmp<scalarField> tTc = Tbf[patchi].patchInternalField();
65  htcBf[patchi] = q[patchi]/(tTc - Tbf[patchi] + eps);
66  }
67 }
68 
69 
70 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
71 
74 (
75  const dictionary& dict,
76  const fvMesh& mesh,
77  const word& TName
78 )
79 :
81 {
83 }
84 
85 
86 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
87 
89 (
90  const dictionary& dict
91 )
92 {
94 }
95 
96 
97 // ************************************************************************* //
localReferenceTemperature(const localReferenceTemperature &)=delete
No copy construct.
dictionary dict
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
defineTypeNameAndDebug(faceZoneReferenceTemperature, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool read(const dictionary &dict)
Read from dictionary.
virtual bool read(const dictionary &dict)
Read from dictionary.
Macros for easy insertion into run-time selection tables.
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
A base class for heat transfer coefficient models.
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
const fvMesh & mesh_
Const reference to the mesh.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const word TName_
Name of temperature field.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
addToRunTimeSelectionTable(heatTransferCoeffModel, faceZoneReferenceTemperature, dictionary)
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)
Set the heat transfer coefficient.
tmp< FieldField< Field, scalar > > q() const
Return boundary fields of heat-flux field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
labelList patchIDs_
List of (wall) patches to process (selected by name)
Namespace for OpenFOAM.