46 name_, pairPotentialProperties_, *
this 50 esfPtr_->scaleEnergy(e, r);
63 pairPotentialProperties_(pairPotentialProperties),
64 rCut_(pairPotentialProperties_.template lookup<scalar>(
"rCut")),
65 rCutSqr_(rCut_*rCut_),
66 rMin_(pairPotentialProperties_.template lookup<scalar>(
"rMin")),
67 dr_(pairPotentialProperties_.template lookup<scalar>(
"dr")),
71 writeTables_(
Switch(pairPotentialProperties_.lookup(
"writeTables")))
81 forceLookup_.setSize(N);
83 energyLookup_.setSize(N);
87 energyLookup_[
k] = scaledEnergy(
k*dr_ + rMin_);
89 forceLookup_[
k] = -energyDerivative((
k*dr_ + rMin_),
true);
96 scalar k_rIJ = (r - rMin_)/dr_;
103 <<
"r less than rMin in pair potential " << name_ <<
nl 108 (k_rIJ -
k)*forceLookup_[k+1]
109 + (k + 1 - k_rIJ)*forceLookup_[
k];
122 forceTab[
k].first() = rMin_ +
k*dr_;
124 forceTab[
k].second() = forceLookup_[
k];
133 scalar k_rIJ = (r - rMin_)/dr_;
140 <<
"r less than rMin in pair potential " << name_ <<
nl 145 (k_rIJ -
k)*energyLookup_[k+1]
146 + (k + 1 - k_rIJ)*energyLookup_[
k];
159 energyTab[
k].first() = rMin_ +
k*dr_;
161 energyTab[
k].second() = energyLookup_[
k];
170 scalar
e = unscaledEnergy(r);
181 const bool scaledEnergyDerivative
193 if (scaledEnergyDerivative)
195 Ea = scaledEnergy(ra);
196 Ef = scaledEnergy(rf);
197 Eb = scaledEnergy(rb);
201 Ea = unscaledEnergy(ra);
202 Ef = unscaledEnergy(rf);
203 Eb = unscaledEnergy(rb);
206 scalar denominator = (ra - rf)*(ra - rb)*(rf - rb);
210 rb*rb*(Ea - Ef) + ra*ra*(Ef - Eb) + rf*rf*(Eb -
Ea)
215 rb*(Ef -
Ea) + rf*(Ea - Eb) + ra*(Eb - Ef)
218 return a1 + 2.0*a2*r;
224 pairPotentialProperties_ = pairPotentialProperties;
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static autoPtr< energyScalingFunction > New(const word &name, const dictionary &energyScalingFunctionProperties, const pairPotential &pairPot)
Return a reference to the selected viscosity model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual bool read(const dictionary &pairPotentialProperties)=0
Read pairPotential dictionary.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
scalar energyDerivative(const scalar r, const bool scaledEnergyDerivative=true) const
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
label k
Boltzmann constant.
List< Pair< scalar > > forceTable() const
scalar energy(const scalar r) const
pairPotential(const word &name, const dictionary &pairPotentialProperties)
Construct from components.
A class for handling words, derived from string.
scalar force(const scalar r) const
errorManip< error > abort(error &err)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
List< Pair< scalar > > energyTable() const
void scaleEnergy(scalar &e, const scalar r) const
const doubleScalar e
Elementary charge.
scalar scaledEnergy(const scalar r) const
scalar Ea(const scalar p, const scalar T) const