1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "interpolateSolid.H"
27 #include "interpolateXY.H"
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 Foam::interpolateSolid::interpolateSolid(const dictionary& dict)
36 Info<< "Constructed directionalKSolidThermo with samples" << nl
37 << " T : " << TValues_ << nl
38 << " rho : " << rhoValues_ << nl
39 << " cp : " << cpValues_ << nl
40 << " Hf : " << HfValues_ << nl
41 << " emissivity : " << emissivityValues_ << nl
42 << " kappa : " << kappaValues_ << nl
43 << " sigmaS : " << sigmaSValues_ << nl
49 (TValues_.size() != rhoValues_.size())
50 && (TValues_.size() != cpValues_.size())
51 && (TValues_.size() != rhoValues_.size())
52 && (TValues_.size() != HfValues_.size())
53 && (TValues_.size() != emissivityValues_.size())
56 FatalIOErrorIn("interpolateSolid::read()", dict)
57 << "Size of property tables should be equal to size of Temperature"
58 << " values " << TValues_.size()
59 << exit(FatalIOError);
62 for (label i = 1; i < TValues_.size(); i++)
64 if (TValues_[i] <= TValues_[i-1])
66 FatalIOErrorIn("interpolateSolid::read()", dict)
67 << "Temperature values are not in increasing order "
68 << TValues_ << exit(FatalIOError);
74 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
76 Foam::interpolateSolid::~interpolateSolid()
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 bool Foam::interpolateSolid::writeData(Ostream& os) const
85 os.writeKeyword("TValues") << TValues_ << token::END_STATEMENT << nl;
86 os.writeKeyword("rhoValues") << rhoValues_ << token::END_STATEMENT << nl;
87 os.writeKeyword("cpValues") << cpValues_ << token::END_STATEMENT << nl;
88 os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
89 os.writeKeyword("emissivityValues") << emissivityValues_ << nl;
90 os.writeKeyword("kappaValues") << kappaValues_ << nl;
91 os.writeKeyword("sigmaSValues") << sigmaSValues_
92 << token::END_STATEMENT << nl;
98 bool Foam::interpolateSolid::read(const dictionary& dict)
100 TValues_ = Field<scalar>(dict.lookup("TValues"));
101 rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
102 cpValues_ = Field<scalar>(dict.lookup("cpValues"));
103 kappaValues_ = Field<scalar>(dict.lookup("kappaValues"));
104 sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues"));
105 HfValues_ = Field<scalar>(dict.lookup("HfValues"));
106 emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues"));
107 sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues"));
112 // ************************************************************************* //