Loading...
Searching...
No Matches
fixedReferenceTemperature.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-------------------------------------------------------------------------------
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
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
36{
39 (
43 );
44}
45}
46
47
48// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
49
51(
52 volScalarField& htc,
54)
55{
57 const volScalarField::Boundary& Tbf = T.boundaryField();
58 const scalar eps = ROOTVSMALL;
59
60 volScalarField::Boundary& htcBf = htc.boundaryFieldRef();
61 for (const label patchi : patchIDs_)
62 {
63 htcBf[patchi] = q[patchi]/(TRef_ - Tbf[patchi] + eps);
64 }
65}
66
67
68// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
69
72(
73 const dictionary& dict,
74 const fvMesh& mesh,
75 const word& TName
76)
77:
79 TRef_(0)
81 read(dict);
82}
83
84
85// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
86
88(
89 const dictionary& dict
90)
91{
93 {
94 return false;
95 }
96
97 dict.readEntry("TRef", TRef_);
98
99 return true;
100}
101
102
103// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A field of fields is a PtrList of fields with reference counting.
Definition FieldField.H:77
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A base class for heat transfer coefficient models.
const word TName_
Name of temperature field.
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
const fvMesh & mesh_
Const reference to the mesh.
heatTransferCoeffModel(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
tmp< FieldField< Field, scalar > > q() const
Return boundary fields of heat-flux field.
const word & TName() const noexcept
Return const reference to name of temperature field.
labelList patchIDs_
List of (wall) patches to process (selected by name).
Heat transfer coefficient calculation that employs a fixed reference temperature.
fixedReferenceTemperature(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)
Set the heat transfer coefficient.
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...
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
A namespace for various heat transfer coefficient model implementations.
Namespace for OpenFOAM.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition int32.H:127
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict