polynomialSolidTransportI.H
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) 2013-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 "specie.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Thermo, int PolySize>
33 (
34  const Thermo& t,
35  const Polynomial<PolySize>& kappaCoeffs
36 )
37 :
38  Thermo(t),
39  kappaCoeffs_(kappaCoeffs)
40 {}
41 
42 
43 template<class Thermo, int PolySize>
46 (
47  const word& name,
48  const polynomialSolidTransport& pt
49 )
50 :
51  Thermo(name, pt),
52  kappaCoeffs_(pt.kappaCoeffs_)
53 {}
54 
55 
56 template<class Thermo, int PolySize>
59 {
61  (
63  );
64 }
65 
66 
67 template<class Thermo, int PolySize>
70 {
72  (
74  );
75 }
76 
77 
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 
80 template<class Thermo, int PolySize>
82 (
83  const scalar p,
84  const scalar T
85 ) const
86 {
88  return scalar(0);
89 }
90 
91 
92 template<class Thermo, int PolySize>
94 (
95  const scalar p,
96  const scalar T
97 ) const
98 {
99  return kappaCoeffs_.value(T);
100 }
101 
102 
103 template<class Thermo, int PolySize>
105 (
106  const scalar p,
107  const scalar T
108 ) const
109 {
110  const scalar kappa(kappaCoeffs_.value(T));
111  return vector(kappa, kappa, kappa);
112 }
113 
114 
115 template<class Thermo, int PolySize>
117 (
118  const scalar p, const scalar T
119 ) const
120 {
121  return kappa(p, T)/this->Cp(p, T);
122 }
123 
124 
125 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
126 
127 template<class Thermo, int PolySize>
128 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator=
129 (
131 )
132 {
133  Thermo::operator=(pt);
134 
135  kappaCoeffs_ = pt.kappaCoeffs_;
136 }
137 
138 
139 template<class Thermo, int PolySize>
140 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator+=
141 (
143 )
144 {
145  scalar Y1 = this->Y();
146 
147  Thermo::operator+=(pt);
148 
149  Y1 /= this->Y();
150  scalar Y2 = pt.Y()/this->Y();
151 
152  kappaCoeffs_ = Y1*kappaCoeffs_ + Y2*pt.kappaCoeffs_;
153 }
154 
155 
156 template<class Thermo, int PolySize>
157 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator*=
158 (
159  const scalar s
160 )
161 {
162  Thermo::operator*=(s);
163 }
164 
165 
166 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
167 
168 template<class Thermo, int PolySize>
170 (
173 )
174 {
175  Thermo t
176  (
177  static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2)
178  );
179 
180  scalar Y1 = pt1.Y()/t.Y();
181  scalar Y2 = pt2.Y()/t.Y();
182 
184  (
185  t,
186  Y1*pt1.kappaCoeffs_ + Y2*pt2.kappaCoeffs_
187  );
188 }
189 
190 
191 template<class Thermo, int PolySize>
193 (
194  const scalar s,
196 )
197 {
199  (
200  s*static_cast<const Thermo&>(pt),
201  pt.kappaCoeffs_
202  );
203 }
204 
205 
206 // ************************************************************************* //
PtrList< volScalarField > & Y1
Definition: YEqns.H:8
dictionary dict
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
PtrList< volScalarField > & Y2
Definition: YEqns.H:9
Transport package using polynomial functions for solid kappa.
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class for handling words, derived from string.
Definition: word.H:59
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
PtrList< volScalarField > & Y
static autoPtr< polynomialSolidTransport > New(const dictionary &dict)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366