summaryrefslogtreecommitdiff
path: root/src/dynamics/interactionPotential.h
blob: 0877fedf01dd65f7d6282c3eb99b153fbdcad055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*  This file is part of the OpenLB library
 *
 *  Copyright (C) 2015 Peter Weisbrod
 *  E-mail contact: info@openlb.net
 *  The most recent release of OpenLB can be downloaded at
 *  <http://www.openlb.net/>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public
 *  License along with this program; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA  02110-1301, USA.
*/

#ifndef INTERACTION_POTENTIAL_H
#define INTERACTION_POTENTIAL_H


/**
 *  The functor dimensions are given by F: S^m -> T^n  (S=source, T=target)
 *  and are implemented via GenericF(n,m).
 *  Don't get confused by the flipped order of source and target.
 */

namespace olb {

// established -- original for both single- and multicomponent flow

template <typename T, typename S>
class ShanChen93 : public AnalyticalF1D<T,S> {
private:
  T _rhoZero;
public:
  ShanChen93(T rhoZero=1.);
  bool operator() (T psi[], const S rho[]);
};

// established -- only multicomponent flow

template <typename T, typename S>
class PsiEqualsRho : public AnalyticalF1D<T,S> {
private:
public:
  PsiEqualsRho();
  bool operator() (T psi[], const S rho[]) override;
};

// established -- only singlecomponent flow

template <typename T, typename S>
class ShanChen94 : public AnalyticalF1D<T,S> {
private:
  T _rhoZero;
  T _psiZero;
public:
  ShanChen94(T rhoZero=200., T psiZero=4.);
  bool operator() (T psi[], const S rho[]) override;
};

template <typename T, typename S>
class PengRobinson : public AnalyticalF1D<T,S> {
private:
  T _G;
  T _acentricFactor;
  T _a;
  T _b;
  T _R;
  T _alpha;
  T _t;
  T _tc;
public:
  PengRobinson(T G, T acentricFactor=0.334, T a=2./49., T b=2./21., T tr=.8);
  bool operator() (T psi[], const S rho[]);
  // second operator allows to incorporate temperature changes
  bool operator() (T psi[], const S rho[], const S t[]);
};

template <typename T, typename S>
class CarnahanStarling : public AnalyticalF1D<T,S> {
private:
  T _G;
  T _a;
  T _b;
  T _R;
  T _t;
public:
  CarnahanStarling(T G, T a=1., T b=4., T tr=.7);
  bool operator() (T psi[], const S rho[]) override;
  // second operator allows to incorporate temperature changes
  bool operator() (T psi[], const S rho[], const S t[]);
};

// under development -- for singlecomponent flow

// 0.5 -> psiZero=0.65
// 1 -> psiZero=1.9
// 1.5 -> psiZero=3.5
// 2. -> psiZero=5,45
template <typename T, typename S>
class Krause : public AnalyticalF1D<T,S> {
private:
  T _rhoZero;
  T _psiZero;
public:
  Krause(T rhoZero=1., T psiZero=1.9);
  bool operator() (T psi[], const S rho[]);
};

template <typename T, typename S> // density of liquid phase always equals rhoZero for G=-1
class WeisbrodKrause : public AnalyticalF1D<T,S> {
private:
  T _rhoZero;
  T _sigmu;
public:
  WeisbrodKrause(T rhoZero=1., T sigmu=1.);
  bool operator() (T psi[], const S rho[]);
};

template <typename T, typename S> // not very good
class Normal : public AnalyticalF1D<T,S> {
private:
  T _sigma;
  T _mu;
public:
  Normal(T sigma=1., T mu=1.);
  bool operator() (T psi[], const S rho[]);
};

} // end namespace olb

#endif