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;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
static autoPtr< energyScalingFunction > New(const word &name, const dictionary &energyScalingFunctionProperties, const pairPotential &pairPot)
Return a reference to the selected viscosity model.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
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...
constexpr char nl
The newline '\n' character (0x0a)
virtual void scaleEnergy(scalar &e, const scalar r) const =0
scalar energyDerivative(const scalar r, const bool scaledEnergyDerivative=true) const
label k
Boltzmann constant.
List< Pair< scalar > > forceTable() const
scalar energy(const scalar r) const
energyScalingFunction * esfPtr_
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar e
Elementary charge.
pairPotential(const pairPotential &)=delete
No copy construct.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
scalar force(const scalar r) const
errorManip< error > abort(error &err)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
const Vector< label > N(dict.get< Vector< label >>("N"))
List< Pair< scalar > > energyTable() const
dictionary pairPotentialProperties_
void scaleEnergy(scalar &e, const scalar r) const
scalar scaledEnergy(const scalar r) const
scalar Ea(const scalar p, const scalar T) const