ThermophysicalTransportModel.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 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 
27 #include "volFields.H"
28 #include "surfaceFields.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class MomentumTransportModel, class ThermoModel>
35 (
36  const momentumTransportModel& momentumTransport,
37  const thermoModel& thermo
38 )
39 :
40  thermophysicalTransportModel(momentumTransport),
41  momentumTransport_(momentumTransport),
42  thermo_(thermo)
43 {}
44 
45 
46 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
47 
48 template<class MomentumTransportModel, class ThermoModel>
50 <
52 >
54 (
55  const momentumTransportModel& momentumTransport,
56  const thermoModel& thermo
57 )
58 {
59  const word modelType
60  (
61  momentumTransport.lookup("simulationType")
62  );
63 
64  Info<< "Selecting thermophysical transport type " << modelType << endl;
65 
66  typename dictionaryConstructorTable::iterator cstrIter =
67  dictionaryConstructorTablePtr_->find(modelType);
68 
69  if (cstrIter == dictionaryConstructorTablePtr_->end())
70  {
72  << "Unknown thermophysical transport type "
73  << modelType << nl << nl
74  << "Available types:" << endl
75  << dictionaryConstructorTablePtr_->sortedToc()
76  << exit(FatalError);
77  }
78 
80  (
81  cstrIter()(momentumTransport, thermo)
82  );
83 }
84 
85 
86 // ************************************************************************* //
Foam::surfaceFields.
Templated abstract base class for multiphase compressible turbulence models.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
ThermophysicalTransportModel(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
rhoReactionThermo & thermo
Definition: createFields.H:28
Templated abstract base class for thermophysical transport models.
A class for handling words, derived from string.
Definition: word.H:59
static const char nl
Definition: Ostream.H:260
Abstract base class for thermophysical transport models (RAS, LES and laminar).
messageStream Info
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
static autoPtr< ThermophysicalTransportModel > New(const momentumTransportModel &transport, const thermoModel &thermo)
Return a reference to the selected thermophysical transport model.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:812