absorptionCoeffs.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 | Copyright (C) 2011-2017 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 
26 #include "absorptionCoeffs.H"
27 #include "IOstreams.H"
28 
29 
30 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
31 
33 {}
34 
35 
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 
38 void Foam::radiation::absorptionCoeffs::checkT(const scalar T) const
39 {
40  if (T < Tlow_ || T > Thigh_)
41  {
43  << "usinf absCoeff out of temperature range:" << nl
44  << " " << Tlow_ << " -> " << Thigh_ << "; T = " << T
45  << nl << endl;
46  }
47 }
48 
49 
52 (
53  const scalar T
54 ) const
55 {
56  checkT(T);
57 
58  if (T < Tcommon_)
59  {
60  return lowACoeffs_;
61  }
62  else
63  {
64  return highACoeffs_;
65  }
66 }
67 
68 
70 {
71  dict.lookup("Tcommon") >> Tcommon_;
72  dict.lookup("Tlow") >> Tlow_;
73  dict.lookup("Thigh") >> Thigh_;
74  dict.lookup("invTemp") >> invTemp_;
75 
76  dict.lookup("loTcoeffs") >> lowACoeffs_;
77  dict.lookup("hiTcoeffs") >> highACoeffs_;
78 }
79 
80 
81 // ************************************************************************* //
dictionary dict
void initialise(const dictionary &)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static const char nl
Definition: Ostream.H:262
#define WarningInFunction
Report a warning using Foam::Warning.
const coeffArray & coeffs(const scalar T) const
Return the coefficients corresponding to the given temperature.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:576