FullerMethod.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2010 by Benjamin Faigle
5  Copyright (C) 2009-2013 by Andreas Lauser
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_FULLERMETHOD_HPP
27 #define OPM_FULLERMETHOD_HPP
28 
31 
32 #include <cmath>
33 
34 namespace Opm {
35 namespace BinaryCoeff {
36 
54 template <class Scalar, class Evaluation = Scalar>
55 inline Evaluation fullerMethod(const Scalar *M, // molar masses [g/mol]
56  const Scalar *SigmaNu, // atomic diffusion volume
57  const Evaluation& temperature, // [K]
58  const Evaluation& pressure) // [Pa]
59 {
60  typedef Opm::MathToolbox<Evaluation> Toolbox;
61 
62  // "effective" molar mass in [g/m^3]
63  Scalar Mab = Opm::harmonicMean(M[0], M[1]);
64 
65  // Fuller's method
66  const Evaluation& tmp = std::pow(SigmaNu[0], 1./3) + std::pow(SigmaNu[1], 1./3);
67  return 1e-4 * (143.0*Toolbox::pow(temperature, 1.75))/(pressure*std::sqrt(Mab)*tmp*tmp);
68 }
69 
70 } // namespace BinaryCoeff
71 } // namespace Opm
72 
73 #endif
Evaluation fullerMethod(const Scalar *M, const Scalar *SigmaNu, const Evaluation &temperature, const Evaluation &pressure)
Estimate binary diffusion coefficents in gases according to the method by Fuller.
Definition: FullerMethod.hpp:55
Definition: MathToolbox.hpp:39
Definition: Air_Mesitylene.hpp:31
Implements some common averages.
Evaluation< Scalar, VarSetTag, numVars > sqrt(const Evaluation< Scalar, VarSetTag, numVars > &x)
Definition: Math.hpp:278
Scalar harmonicMean(Scalar x, Scalar y)
Computes the harmonic average of two values.
Definition: Means.hpp:72
Evaluation< Scalar, VarSetTag, numVars > pow(const Evaluation< Scalar, VarSetTag, numVars > &base, Scalar exp)
Definition: Math.hpp:312
A traits class which provides basic mathematical functions for arbitrary scalar floating point values...