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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "specie.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class Thermo, int PolySize>
35 (
36  const Thermo& t,
37  const Polynomial<PolySize>& kappaCoeffs
38 )
39 :
40  Thermo(t),
41  kappaCoeffs_(kappaCoeffs)
42 {}
43 
44 
45 template<class Thermo, int PolySize>
48 (
49  const word& name,
50  const polynomialSolidTransport& pt
51 )
52 :
53  Thermo(name, pt),
54  kappaCoeffs_(pt.kappaCoeffs_)
55 {}
56 
57 
58 template<class Thermo, int PolySize>
61 {
63 }
64 
65 
66 template<class Thermo, int PolySize>
69 {
71 }
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
76 template<class Thermo, int PolySize>
78 (
79  const scalar p,
80  const scalar T
81 ) const
82 {
84  return scalar(0);
85 }
86 
87 
88 template<class Thermo, int PolySize>
90 (
91  const scalar p,
92  const scalar T
93 ) const
94 {
95  return kappaCoeffs_.value(T);
96 }
97 
98 
99 template<class Thermo, int PolySize>
101 (
102  const scalar p,
103  const scalar T
104 ) const
105 {
106  const scalar kappa(kappaCoeffs_.value(T));
107  return vector(kappa, kappa, kappa);
108 }
109 
110 
111 template<class Thermo, int PolySize>
113 (
114  const scalar p, const scalar T
115 ) const
116 {
117  return kappa(p, T)/this->Cp(p, T);
118 }
119 
120 
121 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
122 
123 template<class Thermo, int PolySize>
125 (
127 )
128 {
129  Thermo::operator=(pt);
130 
131  kappaCoeffs_ = pt.kappaCoeffs_;
132 }
133 
134 
135 template<class Thermo, int PolySize>
137 (
139 )
140 {
141  scalar Y1 = this->Y();
142 
143  Thermo::operator+=(pt);
144 
145  Y1 /= this->Y();
146  scalar Y2 = pt.Y()/this->Y();
147 
148  kappaCoeffs_ = Y1*kappaCoeffs_ + Y2*pt.kappaCoeffs_;
149 }
150 
151 
152 template<class Thermo, int PolySize>
154 (
155  const scalar s
156 )
157 {
158  Thermo::operator*=(s);
159 }
160 
161 
162 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
163 
164 template<class Thermo, int PolySize>
166 (
169 )
170 {
171  Thermo t
172  (
173  static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2)
174  );
175 
176  scalar Y1 = pt1.Y()/t.Y();
177  scalar Y2 = pt2.Y()/t.Y();
178 
180  (
181  t,
182  Y1*pt1.kappaCoeffs_ + Y2*pt2.kappaCoeffs_
183  );
184 }
185 
186 
187 template<class Thermo, int PolySize>
189 (
190  const scalar s,
191  const polynomialSolidTransport<Thermo, PolySize>& pt
192 )
193 {
194  return polynomialSolidTransport<Thermo, PolySize>
195  (
196  s*static_cast<const Thermo&>(pt),
197  pt.kappaCoeffs_
198  );
199 }
200 
201 
202 // ************************************************************************* //
Foam::polynomialSolidTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: polynomialSolidTransportI.H:78
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Definition: gmvOutputSpray.H:25
Foam::polynomialSolidTransport::clone
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
Definition: polynomialSolidTransportI.H:60
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:101
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:419
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::polynomialSolidTransport
Transport package using polynomial functions for solid kappa.
Definition: polynomialSolidTransport.H:83
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Y
PtrList< volScalarField > & Y
Definition: createFieldRefs.H:7
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
Cp
const volScalarField & Cp
Definition: EEqn.H:7
Foam::polynomialSolidTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: polynomialSolidTransportI.H:90
Foam::polynomialSolidTransport::New
static autoPtr< polynomialSolidTransport > New(const dictionary &dict)
Definition: polynomialSolidTransportI.H:68
Foam::polynomialSolidTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: polynomialSolidTransportI.H:113