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-2016 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 polynomialSolidTransport& pt
35 )
36 :
37  Thermo(pt),
38  kappaCoeffs_(pt.kappaCoeffs_)
39 {}
40 
41 
42 template<class Thermo, int PolySize>
45 (
46  const Thermo& t,
47  const Polynomial<PolySize>& kappaCoeffs
48 )
49 :
50  Thermo(t),
51  kappaCoeffs_(kappaCoeffs)
52 {}
53 
54 
55 template<class Thermo, int PolySize>
58 (
59  const word& name,
60  const polynomialSolidTransport& pt
61 )
62 :
63  Thermo(name, pt),
64  kappaCoeffs_(pt.kappaCoeffs_)
65 {}
66 
67 
68 template<class Thermo, int PolySize>
71 {
73  (
75  );
76 }
77 
78 
79 template<class Thermo, int PolySize>
82 {
84  (
86  );
87 }
88 
89 
90 template<class Thermo, int PolySize>
93 {
95  (
97  );
98 }
99 
100 
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 
103 template<class Thermo, int PolySize>
105 (
106  const scalar p,
107  const scalar T
108 ) const
109 {
111  return scalar(0);
112 }
113 
114 
115 template<class Thermo, int PolySize>
117 (
118  const scalar p,
119  const scalar T
120 ) const
121 {
122  return kappaCoeffs_.value(T);
123 }
124 
125 
126 template<class Thermo, int PolySize>
128 (
129  const scalar p,
130  const scalar T
131 ) const
132 {
133  const scalar kappa(kappaCoeffs_.value(T));
134  return vector(kappa, kappa, kappa);
135 }
136 
137 
138 template<class Thermo, int PolySize>
140 (
141  const scalar p, const scalar T
142 ) const
143 {
144  return kappa(p, T)/this->Cpv(p, T);
145 }
146 
147 
148 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
149 
150 template<class Thermo, int PolySize>
151 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator=
152 (
154 )
155 {
156  Thermo::operator=(pt);
157 
158  kappaCoeffs_ = pt.kappaCoeffs_;
159 }
160 
161 
162 template<class Thermo, int PolySize>
163 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator+=
164 (
166 )
167 {
168  scalar molr1 = this->nMoles();
169 
170  Thermo::operator+=(pt);
171 
172  molr1 /= this->nMoles();
173  scalar molr2 = pt.nMoles()/this->nMoles();
174 
175  kappaCoeffs_ = molr1*kappaCoeffs_ + molr2*pt.kappaCoeffs_;
176 }
177 
178 
179 template<class Thermo, int PolySize>
180 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator-=
181 (
183 )
184 {
185  scalar molr1 = this->nMoles();
186 
187  Thermo::operator-=(pt);
188 
189  molr1 /= this->nMoles();
190  scalar molr2 = pt.nMoles()/this->nMoles();
191 
192  kappaCoeffs_ = molr1*kappaCoeffs_ - molr2*pt.kappaCoeffs_;
193 }
194 
195 
196 template<class Thermo, int PolySize>
197 inline void Foam::polynomialSolidTransport<Thermo, PolySize>::operator*=
198 (
199  const scalar s
200 )
201 {
202  Thermo::operator*=(s);
203 }
204 
205 
206 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
207 
208 template<class Thermo, int PolySize>
210 (
213 )
214 {
215  Thermo t
216  (
217  static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2)
218  );
219 
220  scalar molr1 = pt1.nMoles()/t.nMoles();
221  scalar molr2 = pt2.nMoles()/t.nMoles();
222 
224  (
225  t,
226  molr1*pt1.kappaCoeffs_ + molr2*pt2.kappaCoeffs_
227  );
228 }
229 
230 
231 template<class Thermo, int PolySize>
233 (
236 )
237 {
238  Thermo t
239  (
240  static_cast<const Thermo&>(pt1) - static_cast<const Thermo&>(pt2)
241  );
242 
243  scalar molr1 = pt1.nMoles()/t.nMoles();
244  scalar molr2 = pt2.nMoles()/t.nMoles();
245 
247  (
248  t,
249  molr1*pt1.kappaCoeffs_ - molr2*pt2.kappaCoeffs_
250  );
251 }
252 
253 
254 template<class Thermo, int PolySize>
256 (
257  const scalar s,
259 )
260 {
262  (
263  s*static_cast<const Thermo&>(pt),
264  pt.kappaCoeffs_
265  );
266 }
267 
268 
269 template<class Thermo, int PolySize>
271 (
274 )
275 {
276  return pt2 - pt1;
277 }
278 
279 
280 // ************************************************************************* //
dictionary dict
vector 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
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Transport package using polynomial functions for solid kappa.
static autoPtr< polynomialSolidTransport > New(Istream &is)
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))
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
A class for handling words, derived from string.
Definition: word.H:59
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
Polynomial templated on size (order):
Definition: Polynomial.H:63
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366