Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
lagrangian
molecularDynamics
potential
pairPotential
derived
azizChen
azizChen.C
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) 2008-2010 OpenCFD Ltd.
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
#include "
azizChen.H
"
27
#include <
OpenFOAM/addToRunTimeSelectionTable.H
>
28
29
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30
31
namespace
Foam
32
{
33
namespace
pairPotentials
34
{
35
36
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37
38
defineTypeNameAndDebug
(
azizChen
, 0);
39
40
addToRunTimeSelectionTable
41
(
42
pairPotential
,
43
azizChen
,
44
dictionary
45
);
46
47
48
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49
50
azizChen::azizChen
51
(
52
const
word
&
name
,
53
const
dictionary
&
azizChen
54
)
55
:
56
pairPotential
(name, azizChen),
57
azizChenCoeffs_(azizChen.
subDict
(typeName +
"Coeffs"
)),
58
epsilon_(
readScalar
(azizChenCoeffs_.lookup(
"epsilon"
))),
59
rm_(
readScalar
(azizChenCoeffs_.lookup(
"rm"
))),
60
A_(
readScalar
(azizChenCoeffs_.lookup(
"A"
))),
61
alpha_(
readScalar
(azizChenCoeffs_.lookup(
"alpha"
))),
62
C6_(
readScalar
(azizChenCoeffs_.lookup(
"C6"
))),
63
C8_(
readScalar
(azizChenCoeffs_.lookup(
"C8"
))),
64
C10_(
readScalar
(azizChenCoeffs_.lookup(
"C10"
))),
65
D_(
readScalar
(azizChenCoeffs_.lookup(
"D"
))),
66
gamma_(
readScalar
(azizChenCoeffs_.lookup(
"gamma"
)))
67
{
68
setLookupTables();
69
}
70
71
72
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
73
74
scalar
azizChen::unscaledEnergy
(
const
scalar r)
const
75
{
76
scalar x = r/rm_;
77
78
scalar F = 1.0;
79
80
if
(x < D_)
81
{
82
F =
exp
(-
pow
(((D_ / x) - 1.0),2));
83
}
84
85
return
86
epsilon_
87
*(
88
A_ *
Foam::pow
(x, gamma_)*
exp
(-alpha_*x)
89
- (
90
(C6_/
Foam::pow
(x, 6))
91
+ (C8_/
Foam::pow
(x, 8))
92
+ (C10_/
Foam::pow
(x, 10))
93
)
94
*F
95
);
96
}
97
98
99
bool
azizChen::read
(
const
dictionary
& azizChen)
100
{
101
pairPotential::read
(azizChen);
102
103
azizChenCoeffs_ = azizChen.
subDict
(typeName +
"Coeffs"
);
104
105
azizChenCoeffs_.
lookup
(
"epsilon"
) >> epsilon_;
106
azizChenCoeffs_.
lookup
(
"rm"
) >> rm_;
107
azizChenCoeffs_.
lookup
(
"A"
) >> A_;
108
azizChenCoeffs_.
lookup
(
"alpha"
) >> alpha_;
109
azizChenCoeffs_.
lookup
(
"C6"
) >> C6_;
110
azizChenCoeffs_.
lookup
(
"C8"
) >> C8_;
111
azizChenCoeffs_.
lookup
(
"C10"
) >> C10_;
112
azizChenCoeffs_.
lookup
(
"D"
) >> D_;
113
azizChenCoeffs_.
lookup
(
"gamma"
) >> gamma_;
114
115
return
true
;
116
}
117
118
119
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121
}
// End namespace pairPotentials
122
}
// End namespace Foam
123
124
// ************************ vim: set sw=4 sts=4 et: ************************ //