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")),
81 label
N = label((rCut_ - rMin_)/dr_) + 1;
83 forceLookup_.setSize(
N);
85 energyLookup_.setSize(
N);
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]
124 forceTab[
k].
first() = rMin_ +
k*dr_;
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]
161 energyTab[
k].
first() = rMin_ +
k*dr_;
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;
scalar Ea(const scalar p, const scalar T) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & first()
Access first element of the list, position [0].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static autoPtr< energyScalingFunction > New(const word &name, const dictionary &energyScalingFunctionProperties, const pairPotential &pairPot)
Return a reference to the selected viscosity model.
pairPotential(const pairPotential &)=delete
No copy construct.
virtual bool read(const dictionary &pairPotentialProperties)=0
Read pairPotential dictionary.
scalar energy(const scalar r) const
const dictionary & pairPotentialProperties() const
energyScalingFunction * esfPtr_
scalar energyDerivative(const scalar r, const bool scaledEnergyDerivative=true) const
List< scalar > energyLookup_
void scaleEnergy(scalar &e, const scalar r) const
List< Pair< scalar > > energyTable() const
List< scalar > forceLookup_
virtual scalar unscaledEnergy(const scalar r) const =0
List< Pair< scalar > > forceTable() const
scalar scaledEnergy(const scalar r) const
dictionary pairPotentialProperties_
scalar force(const scalar r) const
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.
const Vector< label > N(dict.get< Vector< label > >("N"))