polynomialSolidTransportI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2023 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 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
68 
69 template<class Thermo, int PolySize>
71 (
72  const scalar p,
73  const scalar T
74 ) const
75 {
76  return kappaCoeffs_.value(T);
77 }
78 
79 
80 template<class Thermo, int PolySize>
82 (
83  const scalar p,
84  const scalar T
85 ) const
86 {
88  const scalar kappa(kappaCoeffs_.value(T));
89  return vector(kappa, kappa, kappa);
90 }
91 
92 
93 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
94 
95 template<class Thermo, int PolySize>
97 (
99 )
100 {
101  scalar Y1 = this->Y();
102 
103  Thermo::operator+=(pt);
104 
105  Y1 /= this->Y();
106  scalar Y2 = pt.Y()/this->Y();
107 
108  kappaCoeffs_ = Y1*kappaCoeffs_ + Y2*pt.kappaCoeffs_;
109 }
110 
111 
112 template<class Thermo, int PolySize>
114 (
115  const scalar s
116 )
117 {
118  Thermo::operator*=(s);
119 }
120 
121 
122 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
123 
124 template<class Thermo, int PolySize>
126 (
129 )
130 {
131  Thermo t
132  (
133  static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2)
134  );
135 
136  scalar Y1 = pt1.Y()/t.Y();
137  scalar Y2 = pt2.Y()/t.Y();
138 
140  (
141  t,
142  Y1*pt1.kappaCoeffs_ + Y2*pt2.kappaCoeffs_
143  );
144 }
145 
146 
147 template<class Thermo, int PolySize>
149 (
150  const scalar s,
151  const polynomialSolidTransport<Thermo, PolySize>& pt
152 )
153 {
154  return polynomialSolidTransport<Thermo, PolySize>
155  (
156  s*static_cast<const Thermo&>(pt),
157  pt.kappaCoeffs_
158  );
159 }
160 
161 
162 // ************************************************************************* //
Polynomial templated on size (order):
Definition: Polynomial.H:84
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Transport package using polynomial functions for solid kappa.
vector Kappa(const scalar p, const scalar T) const
Anisotropic thermal conductivity [W/m/K].
autoPtr< polynomialSolidTransport > clone() const
Construct and return a clone.
scalar kappa(const scalar p, const scalar T) const
Isotropic thermal conductivity [W/m/K].
polynomialSolidTransport(const Thermo &t, const Polynomial< PolySize > &kappaPoly)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & p
PtrList< volScalarField > & Y