wallHeatTransferCoeffModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 #include "surfaceInterpolate.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
41 
44 (
45  const word& name,
46  const fvMesh& mesh,
47  const dictionary& dict
48 )
49 {
50  const word model(dict.lookupOrDefault<word>("model", "kappaEff"));
51 
52  if (debug)
53  {
54  Info<< "Selecting heat transfer coefficient type: "
55  << model << endl;
56  }
57 
58  wordConstructorTable::iterator cstrIter =
59  wordConstructorTablePtr_->find(model);
60 
61  if (cstrIter == wordConstructorTablePtr_->end())
62  {
64  << "Unknown heat transfer coefficient type "
65  << model << nl << nl
66  << "Valid coefficient types: " << endl
67  << wordConstructorTablePtr_->sortedToc()
68  << exit(FatalError);
69  }
70 
71  return autoPtr<wallHeatTransferCoeffModel>(cstrIter()(name, mesh, dict));
72 }
73 
74 
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 
78 (
79  const momentumTransportModel& mmtm,
80  const fvMesh& mesh
81 ) const
82 {
83  if (isA<incompressible::momentumTransportModel>(mmtm))
84  {
85  return
86  refCast<const incompressible::momentumTransportModel>
87  (
88  mmtm
89  ).devSigma();
90  }
91  else if (isA<compressible::momentumTransportModel>(mmtm))
92  {
93  return
94  refCast<const compressible::momentumTransportModel>(mmtm).devTau()
96  (
97  refCast<const compressible::momentumTransportModel>(mmtm).rho()
98  );
99  }
100  else
101  {
103  << "The type of momentum transport model was not recognised"
104  << exit(FatalError);
105  }
106 
108 }
109 
110 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
Abstract base class for turbulence models (RAS, LES and laminar).
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for run time selection of heat transfer coefficient models.
static autoPtr< wallHeatTransferCoeffModel > New(const word &name, const fvMesh &mesh, const dictionary &)
Return a reference to the selected subset.
tmp< surfaceVectorField > tau(const momentumTransportModel &mmtm, const fvMesh &mesh) const
Calculate wall shear stress.
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
messageStream Info
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
error FatalError
static const char nl
Definition: Ostream.H:267
dictionary dict