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-2015 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>
153 (
155 )
156 {
157  Thermo::operator=(pt);
158 
159  kappaCoeffs_ = pt.kappaCoeffs_;
160 
161  return *this;
162 }
163 
164 
165 template<class Thermo, int PolySize>
167 (
169 )
170 {
171  scalar molr1 = this->nMoles();
172 
173  Thermo::operator+=(pt);
174 
175  molr1 /= this->nMoles();
176  scalar molr2 = pt.nMoles()/this->nMoles();
177 
178  kappaCoeffs_ = molr1*kappaCoeffs_ + molr2*pt.kappaCoeffs_;
179 }
180 
181 
182 template<class Thermo, int PolySize>
184 (
186 )
187 {
188  scalar molr1 = this->nMoles();
189 
190  Thermo::operator-=(pt);
191 
192  molr1 /= this->nMoles();
193  scalar molr2 = pt.nMoles()/this->nMoles();
194 
195  kappaCoeffs_ = molr1*kappaCoeffs_ - molr2*pt.kappaCoeffs_;
196 }
197 
198 
199 template<class Thermo, int PolySize>
201 (
202  const scalar s
203 )
204 {
205  Thermo::operator*=(s);
206 }
207 
208 
209 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
210 
211 template<class Thermo, int PolySize>
213 (
216 )
217 {
218  Thermo t
219  (
220  static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2)
221  );
222 
223  scalar molr1 = pt1.nMoles()/t.nMoles();
224  scalar molr2 = pt2.nMoles()/t.nMoles();
225 
227  (
228  t,
229  molr1*pt1.kappaCoeffs_ + molr2*pt2.kappaCoeffs_
230  );
231 }
232 
233 
234 template<class Thermo, int PolySize>
236 (
237  const polynomialSolidTransport<Thermo, PolySize>& pt1,
238  const polynomialSolidTransport<Thermo, PolySize>& pt2
239 )
240 {
241  Thermo t
242  (
243  static_cast<const Thermo&>(pt1) - static_cast<const Thermo&>(pt2)
244  );
245 
246  scalar molr1 = pt1.nMoles()/t.nMoles();
247  scalar molr2 = pt2.nMoles()/t.nMoles();
248 
249  return polynomialSolidTransport<Thermo, PolySize>
250  (
251  t,
252  molr1*pt1.kappaCoeffs_ - molr2*pt2.kappaCoeffs_
253  );
254 }
255 
256 
257 template<class Thermo, int PolySize>
259 (
260  const scalar s,
261  const polynomialSolidTransport<Thermo, PolySize>& pt
262 )
263 {
264  return polynomialSolidTransport<Thermo, PolySize>
265  (
266  s*static_cast<const Thermo&>(pt),
267  pt.kappaCoeffs_
268  );
269 }
270 
271 
272 template<class Thermo, int PolySize>
274 (
275  const polynomialSolidTransport<Thermo, PolySize>& pt1,
276  const polynomialSolidTransport<Thermo, PolySize>& pt2
277 )
278 {
279  return pt2 - pt1;
280 }
281 
282 
283 // ************************************************************************* //
Foam::polynomialSolidTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: polynomialSolidTransportI.H:105
Foam::polynomialSolidTransport::New
static autoPtr< polynomialSolidTransport > New(Istream &is)
Definition: polynomialSolidTransportI.H:81
p
p
Definition: pEqn.H:62
Foam::polynomialSolidTransport::polynomialSolidTransport
polynomialSolidTransport(const Thermo &t, const Polynomial< PolySize > &kappaPoly)
Construct from components.
Foam::polynomialSolidTransport::clone
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
Definition: polynomialSolidTransportI.H:70
specie.H
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::polynomialSolidTransport::Kappa
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:128
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Foam::polynomialSolidTransport
Transport package using polynomial functions for solid kappa.
Definition: polynomialSolidTransport.H:47
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
s
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))
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::Vector< scalar >
Foam::polynomialSolidTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:117
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::polynomialSolidTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: polynomialSolidTransportI.H:140