exponentialSolidTransportI.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) 2011-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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
28 template<class Thermo>
30 (
31  const Thermo& t,
32  const scalar kappa0,
33  const scalar n0,
34  const scalar Tref
35 )
36 :
37  Thermo(t),
38  kappa0_(kappa0),
39  n0_(n0),
40  Tref_(Tref)
41 {}
42 
43 
44 template<class Thermo>
46 (
47  const word& name,
49 )
50 :
51  Thermo(name, ct),
52  kappa0_(ct.kappa0_),
53  n0_(ct.n0_),
54  Tref_(ct.Tref_)
55 {}
56 
57 
58 template<class Thermo>
61 (
62  const dictionary& dict
63 )
64 {
66  (
68  );
69 }
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
73 template<class Thermo>
75 (
76  const scalar p, const scalar T
77 ) const
78 {
79  return (kappa0_*pow(T/Tref_, n0_));
80 }
81 
82 
83 template<class Thermo>
85 (
86  const scalar p, const scalar T
87 ) const
88 {
89  const scalar kappa(kappa0_*pow(T/Tref_, n0_));
90  return vector(kappa, kappa, kappa);
91 }
92 
93 
94 template<class Thermo>
96 mu(const scalar p, const scalar T) const
97 {
99  return scalar(0);
100 }
101 
102 
103 template<class Thermo>
105 alphah(const scalar p, const scalar T) const
106 {
107  return kappa(p, T)/this->Cpv(p, T);
108 }
109 
110 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
111 
112 
113 template<class Thermo>
116 (
118 )
119 {
120  kappa0_ = ct.kappa0_;
121  n0_ = ct.n0_;
122  Tref_ = ct.Tref_;
123  return *this;
124 }
125 
126 
127 template<class Thermo>
129 (
131 )
132 {
133  scalar molr1 = this->nMoles();
134 
135  molr1 /= this->nMoles();
136  scalar molr2 = ct.nMoles()/this->nMoles();
137 
138  kappa0_ = molr1*kappa0_ + molr2*ct.kappa0_;
139  n0_ = (molr1*n0_ + molr2*ct.n0_);
140  Tref_ = (molr1*Tref_ + molr2*ct.Tref_);
141 }
142 
143 
144 template<class Thermo>
146 (
148 )
149 {
150  scalar molr1 = this->nMoles();
151 
152  molr1 /= this->nMoles();
153  scalar molr2 = ct.nMoles()/this->nMoles();
154 
155  kappa0_ = (molr1*kappa0_ - molr2*ct.kappa0_);
156  n0_ = (molr1*n0_ - molr2*ct.n0_);
157  Tref_ = (molr1*Tref_ - molr2*ct.Tref_);
158 }
159 
160 
161 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
162 
163 template<class Thermo>
164 inline Foam::exponentialSolidTransport<Thermo> Foam::operator*
165 (
166  const scalar s,
168 )
169 {
171  (
172  s*static_cast<const Thermo&>(ct),
173  ct.kappa0_,
174  ct.n0_,
175  ct.Tref_
176  );
177 }
178 
179 // ************************************************************************* //
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::exponentialSolidTransport
Exponential properties for solid heat transport Templated into a given thermodynamics package.
Definition: exponentialSolidTransport.H:44
Foam::exponentialSolidTransport::Kappa
vector Kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: exponentialSolidTransportI.H:85
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::exponentialSolidTransport::New
static autoPtr< exponentialSolidTransport > New(const dictionary &dict)
Definition: exponentialSolidTransportI.H:61
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::exponentialSolidTransport::exponentialSolidTransport
exponentialSolidTransport(const Thermo &t, const scalar kappa0, const scalar n0, const scalar Tref)
Construct from components.
Definition: exponentialSolidTransportI.H:30
Foam::exponentialSolidTransport::kappa
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/mK].
Definition: exponentialSolidTransportI.H:75
Foam::exponentialSolidTransport::mu
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/ms].
Definition: exponentialSolidTransportI.H:96
Foam::exponentialSolidTransport::alphah
scalar alphah(const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/ms].
Definition: exponentialSolidTransportI.H:105
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:73
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::exponentialSolidTransport::kappa0_
scalar kappa0_
Constant thermal coefficient.
Definition: exponentialSolidTransport.H:73
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47