Air_Mesitylene.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) 2009-2013 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
25 #ifndef OPM_BINARY_COEFF_AIR_MESITYLENE_HPP
26 #define OPM_BINARY_COEFF_AIR_MESITYLENE_HPP
27 
30 
31 namespace Opm
32 {
33 namespace BinaryCoeff
34 {
35 
40 {
41 public:
45  template <class Evaluation>
46  static Evaluation henry(const Evaluation& /*temperature*/)
47  { OPM_THROW(std::runtime_error, "Not implemented: Henry coefficient of air in mesitylene"); }
48 
56  template <class Evaluation>
57  static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
58  {
59  typedef Opm::MathToolbox<Evaluation> Toolbox;
60  typedef Opm::Air<double> Air;
62 
63  temperature = Toolbox::max(temperature, 1e-9); // regularization
64  temperature = Toolbox::min(temperature, 500.0); // regularization
65  pressure = Toolbox::max(pressure, 0.0); // regularization
66  pressure = Toolbox::min(pressure, 1e8); // regularization
67 
68  const double M_m = 1e3*Mesitylene::molarMass(); // [g/mol] molecular weight of mesitylene
69  const double M_a = 1e3*Air::molarMass(); // [g/mol] molecular weight of air
70  const double Tb_m = 437.9; // [K] boiling temperature of mesitylene
71  const double sigma_a = 3.711; // charact. length of air
72  const double T_scal_a = 78.6; // [K] (molec. energy of attraction/Boltzmann constant)
73  const double V_B_m = 162.6; // [cm^3/mol] LeBas molal volume of mesitylene
74  const double sigma_m = 1.18*std::pow(V_B_m, 0.333); // charact. length of mesitylene
75  const double sigma_am = 0.5*(sigma_a + sigma_m);
76  const double T_scal_m = 1.15*Tb_m;
77  const double T_scal_am = std::sqrt(T_scal_a*T_scal_m);
78 
79  Evaluation T_star = temperature/T_scal_am;
80  T_star = Toolbox::max(T_star, 1e-5); // regularization
81 
82  const Evaluation Omega = 1.06036/Toolbox::pow(T_star, 0.1561) + 0.193/Toolbox::exp(T_star*0.47635)
83  + 1.03587/Toolbox::exp(T_star*1.52996) + 1.76474/Toolbox::exp(T_star*3.89411);
84  const double B_ = 0.00217 - 0.0005*std::sqrt(1.0/M_a + 1.0/M_m);
85  const double Mr = (M_a + M_m)/(M_a*M_m);
86  const Evaluation D_am = (B_*Toolbox::pow(temperature, 1.5) * std::sqrt(Mr))
87  /(1e-5*pressure*std::pow(sigma_am, 2.0) * Omega); // [cm^2/s]
88 
89  return 1e-4*D_am; // [m^2/s]
90  }
91 
95  template <class Evaluation>
96  static Evaluation liquidDiffCoeff(const Evaluation& /*temperature*/, const Evaluation& /*pressure*/)
97  { OPM_THROW(std::runtime_error, "Not implemented: Binary liquid diffusion coefficients of air and mesitylene"); }
98 };
99 
100 } // namespace BinaryCoeff
101 } // namespace Opm
102 
103 #endif
Component for Mesitylene.
Definition: Mesitylene.hpp:43
Definition: MathToolbox.hpp:39
Definition: Air_Mesitylene.hpp:31
static Evaluation henry(const Evaluation &)
Definition: Air_Mesitylene.hpp:46
Evaluation< Scalar, VarSetTag, numVars > max(const Evaluation< Scalar, VarSetTag, numVars > &x1, const Evaluation< Scalar, VarSetTag, numVars > &x2)
Definition: Math.hpp:114
Evaluation< Scalar, VarSetTag, numVars > sqrt(const Evaluation< Scalar, VarSetTag, numVars > &x)
Definition: Math.hpp:278
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for air and mesitylene. I used the method according to Wilke and ...
Definition: Air_Mesitylene.hpp:57
Binary coefficients for water and mesitylene.
Definition: Air_Mesitylene.hpp:39
A simple class implementing the fluid properties of air.
Evaluation< Scalar, VarSetTag, numVars > exp(const Evaluation< Scalar, VarSetTag, numVars > &x)
Definition: Math.hpp:295
Evaluation< Scalar, VarSetTag, numVars > min(const Evaluation< Scalar, VarSetTag, numVars > &x1, const Evaluation< Scalar, VarSetTag, numVars > &x2)
Definition: Math.hpp:61
static Scalar molarMass()
The molar mass in of .
Definition: Air.hpp:81
Component for Mesitylene.
static Evaluation liquidDiffCoeff(const Evaluation &, const Evaluation &)
Diffusion coefficent [m^2/s] for molecular mesitylene in liquid water.
Definition: Air_Mesitylene.hpp:96
Evaluation< Scalar, VarSetTag, numVars > pow(const Evaluation< Scalar, VarSetTag, numVars > &base, Scalar exp)
Definition: Math.hpp:312
A simple class implementing the fluid properties of air.
Definition: Air.hpp:47
static Scalar molarMass()
The molar mass in of mesitylene.
Definition: Mesitylene.hpp:57