fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / lagrangian / molecularDynamics / potential / pairPotential / derived / azizChen / azizChen.C
blob2c97c70924cbc8943dcaf489e18d0c83185ff9d7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "azizChen.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
34 namespace pairPotentials
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameAndDebug(azizChen, 0);
41 addToRunTimeSelectionTable
43     pairPotential,
44     azizChen,
45     dictionary
49 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
51 azizChen::azizChen
53     const word& name,
54     const dictionary& azizChen
57     pairPotential(name, azizChen),
58     azizChenCoeffs_(azizChen.subDict(typeName + "Coeffs")),
59     epsilon_(readScalar(azizChenCoeffs_.lookup("epsilon"))),
60     rm_(readScalar(azizChenCoeffs_.lookup("rm"))),
61     A_(readScalar(azizChenCoeffs_.lookup("A"))),
62     alpha_(readScalar(azizChenCoeffs_.lookup("alpha"))),
63     C6_(readScalar(azizChenCoeffs_.lookup("C6"))),
64     C8_(readScalar(azizChenCoeffs_.lookup("C8"))),
65     C10_(readScalar(azizChenCoeffs_.lookup("C10"))),
66     D_(readScalar(azizChenCoeffs_.lookup("D"))),
67     gamma_(readScalar(azizChenCoeffs_.lookup("gamma")))
69     setLookupTables();
73 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
75 scalar azizChen::unscaledEnergy(const scalar r) const
77     scalar x = r/rm_;
79     scalar F = 1.0;
81     if (x < D_)
82     {
83         F = exp(-pow(((D_ / x) - 1.0),2));
84     }
86     return
87         epsilon_
88        *(
89             A_ * Foam::pow(x, gamma_)*exp(-alpha_*x)
90           - (
91                 (C6_/ Foam::pow(x, 6))
92               + (C8_/ Foam::pow(x, 8))
93               + (C10_/ Foam::pow(x, 10))
94             )
95            *F
96     );
100 bool azizChen::read(const dictionary& azizChen)
102     pairPotential::read(azizChen);
104     azizChenCoeffs_ = azizChen.subDict(typeName + "Coeffs");
106     azizChenCoeffs_.lookup("epsilon") >> epsilon_;
107     azizChenCoeffs_.lookup("rm") >> rm_;
108     azizChenCoeffs_.lookup("A") >> A_;
109     azizChenCoeffs_.lookup("alpha") >> alpha_;
110     azizChenCoeffs_.lookup("C6") >> C6_;
111     azizChenCoeffs_.lookup("C8") >> C8_;
112     azizChenCoeffs_.lookup("C10") >> C10_;
113     azizChenCoeffs_.lookup("D") >> D_;
114     azizChenCoeffs_.lookup("gamma") >> gamma_;
116     return true;
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 } // End namespace pairPotentials
123 } // End namespace Foam
125 // ************************************************************************* //