APIdiffCoefThermophysicalFunction.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) 2011-2020 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 Class
25  Foam::thermophysicalFunctions::APIdiffCoefFunc
26 
27 Description
28  API function for vapour mass diffusivity
29 
30  Source:
31  \verbatim
32  API (American Petroleum Institute)
33  Technical Data Book
34  \endverbatim
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef APIdiffCoefThermophysicalFunction_H
39 #define APIdiffCoefThermophysicalFunction_H
40 
41 #include "thermophysicalFunction.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace thermophysicalFunctions
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class APIdiffCoef Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class APIdiffCoef
55 :
57 {
58  // Private Data
59 
60  // API vapour mass diffusivity function coefficients
61  scalar a_, b_, wf_, wa_;
62 
63  // Helper variables
64  scalar alpha_, beta_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("APIdiffCoef");
71 
72 
73  // Constructors
74 
75  //- Construct from components
77  (
78  const scalar a,
79  const scalar b,
80  const scalar wf,
81  const scalar wa
82  );
83 
84  //- Construct from dictionary
85  APIdiffCoef(const dictionary& dict);
86 
87 
88  // Member Functions
89 
90  //- API vapour mass diffusivity function using properties from
91  // construction
92  scalar f(scalar p, scalar T) const
93  {
94  return 3.6059e-3*(pow(1.8*T, 1.75))*alpha_/(p*beta_);
95  }
96 
97  //- API vapour mass diffusivity function using properties from
98  // construction - with specified binary pair
99  scalar f(scalar p, scalar T, scalar Wa) const
100  {
101  const scalar alphaBinary = sqrt(1/wf_ + 1/Wa);
102  return 3.6059e-3*(pow(1.8*T, 1.75))*alphaBinary/(p*beta_);
103  }
104 
106 
107  //- Write the function coefficients
108  virtual void write(Ostream& os) const;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace thermophysicalFunctions
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void write(Ostream &os) const
Write the function coefficients.
dimensionedScalar sqrt(const dimensionedScalar &ds)
TypeName("APIdiffCoef")
Runtime type information.
Abstract base class for thermo-physical functions.
const dimensionedScalar & b
Wien displacement law constant: default SI units: [m K].
Definition: createFields.H:27
virtual void write(Ostream &os) const =0
Write the function coefficients.
APIdiffCoef(const scalar a, const scalar b, const scalar wf, const scalar wa)
Construct from components.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
volScalarField & p
scalar f(scalar p, scalar T) const
API vapour mass diffusivity function using properties from.
Namespace for OpenFOAM.