Go to the documentation of this file.
64 pairPotentialProperties_(pairPotentialProperties),
65 rCut_(
readScalar(pairPotentialProperties_.lookup(
"rCut"))),
66 rCutSqr_(rCut_*rCut_),
67 rMin_(
readScalar(pairPotentialProperties_.lookup(
"rMin"))),
68 dr_(
readScalar(pairPotentialProperties_.lookup(
"dr"))),
72 writeTables_(
Switch(pairPotentialProperties_.lookup(
"writeTables")))
82 forceLookup_.setSize(
N);
84 energyLookup_.setSize(
N);
88 energyLookup_[
k] = scaledEnergy(
k*dr_ + rMin_);
90 forceLookup_[
k] = -energyDerivative((
k*dr_ + rMin_),
true);
97 scalar k_rIJ = (r - rMin_)/dr_;
104 <<
"r less than rMin in pair potential " << name_ <<
nl
109 (k_rIJ -
k)*forceLookup_[
k+1]
110 + (
k + 1 - k_rIJ)*forceLookup_[
k];
123 forceTab[
k].first() = rMin_ +
k*dr_;
125 forceTab[
k].second() = forceLookup_[
k];
134 scalar k_rIJ = (r - rMin_)/dr_;
141 <<
"r less than rMin in pair potential " << name_ <<
nl
146 (k_rIJ -
k)*energyLookup_[
k+1]
147 + (
k + 1 - k_rIJ)*energyLookup_[
k];
160 energyTab[
k].first() = rMin_ +
k*dr_;
162 energyTab[
k].second() = energyLookup_[
k];
171 scalar
e = unscaledEnergy(r);
182 const bool scaledEnergyDerivative
194 if (scaledEnergyDerivative)
196 Ea = scaledEnergy(ra);
197 Ef = scaledEnergy(rf);
198 Eb = scaledEnergy(rb);
202 Ea = unscaledEnergy(ra);
203 Ef = unscaledEnergy(rf);
204 Eb = unscaledEnergy(rb);
207 scalar denominator = (ra - rf)*(ra - rb)*(rf - rb);
211 rb*rb*(Ea - Ef) + ra*ra*(Ef - Eb) + rf*rf*(Eb - Ea)
216 rb*(Ef - Ea) + rf*(Ea - Eb) + ra*(Eb - Ef)
219 return a1 + 2.0*a2*r;
225 pairPotentialProperties_ = pairPotentialProperties;
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
void scaleEnergy(scalar &e, const scalar r) const
energyScalingFunction * esfPtr_
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
List< Pair< scalar > > energyTable() const
static autoPtr< energyScalingFunction > New(const word &name, const dictionary &energyScalingFunctionProperties, const pairPotential &pairPot)
Return a reference to the selected viscosity model.
scalar force(const scalar r) const
scalar energy(const scalar r) const
List< Pair< scalar > > forceTable() const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dictionary pairPotentialProperties_
scalar energyDerivative(const scalar r, const bool scaledEnergyDerivative=true) const
A list of keyword definitions, which are a keyword followed by any number of values (e....
errorManip< error > abort(error &err)
const double e
Elementary charge.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual bool read(const dictionary &pairPotentialProperties)=0
Read pairPotential dictionary.
label k
Boltzmann constant.
const dimensionedScalar e
Elementary charge.
scalar scaledEnergy(const scalar r) const
pairPotential(const pairPotential &)
Disallow copy construct.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
virtual void scaleEnergy(scalar &e, const scalar r) const =0