Go to the documentation of this file.
65 pairPotentialProperties_(pairPotentialProperties),
66 rCut_(pairPotentialProperties_.get<scalar>(
"rCut")),
67 rCutSqr_(rCut_*rCut_),
68 rMin_(pairPotentialProperties_.get<scalar>(
"rMin")),
69 dr_(pairPotentialProperties_.get<scalar>(
"dr")),
73 writeTables_(pairPotentialProperties_.get<
bool>(
"writeTables"))
81 label
N = label((rCut_ - rMin_)/dr_) + 1;
83 forceLookup_.setSize(
N);
85 energyLookup_.setSize(
N);
89 energyLookup_[
k] = scaledEnergy(
k*dr_ + rMin_);
91 forceLookup_[
k] = -energyDerivative((
k*dr_ + rMin_),
true);
98 scalar k_rIJ = (r - rMin_)/dr_;
100 label
k = label(k_rIJ);
105 <<
"r less than rMin in pair potential " << name_ <<
nl
110 (k_rIJ -
k)*forceLookup_[
k+1]
111 + (
k + 1 - k_rIJ)*forceLookup_[
k];
124 forceTab[
k].first() = rMin_ +
k*dr_;
126 forceTab[
k].second() = forceLookup_[
k];
135 scalar k_rIJ = (r - rMin_)/dr_;
137 label
k = label(k_rIJ);
142 <<
"r less than rMin in pair potential " << name_ <<
nl
147 (k_rIJ -
k)*energyLookup_[
k+1]
148 + (
k + 1 - k_rIJ)*energyLookup_[
k];
161 energyTab[
k].first() = rMin_ +
k*dr_;
163 energyTab[
k].second() = energyLookup_[
k];
172 scalar
e = unscaledEnergy(r);
183 const bool scaledEnergyDerivative
195 if (scaledEnergyDerivative)
197 Ea = scaledEnergy(ra);
198 Ef = scaledEnergy(rf);
199 Eb = scaledEnergy(rb);
203 Ea = unscaledEnergy(ra);
204 Ef = unscaledEnergy(rf);
205 Eb = unscaledEnergy(rb);
208 scalar denominator = (ra - rf)*(ra - rb)*(rf - rb);
212 rb*rb*(
Ea - Ef) + ra*ra*(Ef - Eb) + rf*rf*(Eb -
Ea)
217 rb*(Ef -
Ea) + rf*(
Ea - Eb) + ra*(Eb - Ef)
220 return a1 + 2.0*a2*r;
226 pairPotentialProperties_ = pairPotentialProperties;
void scaleEnergy(scalar &e, const scalar r) const
energyScalingFunction * esfPtr_
A class for handling words, derived from Foam::string.
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
scalar Ea(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
List< Pair< scalar > > forceTable() const
pairPotential(const pairPotential &)=delete
No copy construct.
dictionary pairPotentialProperties_
scalar energyDerivative(const scalar r, const bool scaledEnergyDerivative=true) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
errorManip< error > abort(error &err)
#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...
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
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const Vector< label > N(dict.get< Vector< label >>("N"))
defineTypeNameAndDebug(combustionModel, 0)
virtual void scaleEnergy(scalar &e, const scalar r) const =0