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-2021 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 
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(wallHeatTransferCoeffModel, 0);
35  defineRunTimeSelectionTable(wallHeatTransferCoeffModel, word);
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
40 
43 (
44  const word& name,
45  const fvMesh& mesh,
46  const dictionary& dict
47 )
48 {
49  const word model(dict.lookupOrDefault<word>("model", "kappaEff"));
50 
51  if (debug)
52  {
53  Info<< "Selecting heat transfer coefficient type: "
54  << model << endl;
55  }
56 
57  wordConstructorTable::iterator cstrIter =
58  wordConstructorTablePtr_->find(model);
59 
60  if (cstrIter == wordConstructorTablePtr_->end())
61  {
63  << "Unknown heat transfer coefficient type "
64  << model << nl << nl
65  << "Valid coefficient types: " << endl
66  << wordConstructorTablePtr_->sortedToc()
67  << exit(FatalError);
68  }
69 
70  return autoPtr<wallHeatTransferCoeffModel>(cstrIter()(name, mesh, dict));
71 }
72 
73 
74 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
75 
77 (
78  const momentumTransportModel& mmtm,
79  const fvMesh& mesh
80 ) const
81 {
82  if (isA<incompressible::momentumTransportModel>(mmtm))
83  {
84  return
85  refCast<const incompressible::momentumTransportModel>
86  (
87  mmtm
88  ).devSigma();
89  }
90  else if (isA<compressible::momentumTransportModel>(mmtm))
91  {
92  return
93  refCast<const compressible::momentumTransportModel>(mmtm).devTau()
94  /refCast<const compressible::momentumTransportModel>(mmtm).rho();
95  }
96  else
97  {
99  << "The type of momentum transport model was not recognised"
100  << exit(FatalError);
101  }
102 
104 }
105 
106 // ************************************************************************* //
dictionary dict
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:323
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
static autoPtr< wallHeatTransferCoeffModel > New(const word &name, const fvMesh &mesh, const dictionary &)
Return a reference to the selected subset.
Macros for easy insertion into run-time selection tables.
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
tmp< volSymmTensorField > tau(const momentumTransportModel &mmtm, const fvMesh &mesh) const
Calculate wall shear stress.
static const char nl
Definition: Ostream.H:260
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Abstract base class for turbulence models (RAS, LES and laminar).
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
messageStream Info
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.