BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / molecularDynamics / potential / pairPotential / derived / azizChen / azizChen.C
blobfa906e9e926fe01b3266918a36a4fe5f733dbc77
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "azizChen.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
33 namespace pairPotentials
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(azizChen, 0);
40 addToRunTimeSelectionTable
42     pairPotential,
43     azizChen,
44     dictionary
48 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
50 azizChen::azizChen
52     const word& name,
53     const dictionary& azizChen
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")))
68     setLookupTables();
72 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
74 scalar azizChen::unscaledEnergy(const scalar r) const
76     scalar x = r/rm_;
78     scalar F = 1.0;
80     if (x < D_)
81     {
82         F = exp(-pow(((D_ / x) - 1.0),2));
83     }
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     );
99 bool azizChen::read(const dictionary& azizChen)
101     pairPotential::read(azizChen);
103     azizChenCoeffs_ = azizChen.subDict(typeName + "Coeffs");
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_;
115     return true;
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 } // End namespace pairPotentials
122 } // End namespace Foam
124 // ************************************************************************* //