Go to the documentation of this file.
39 Info<<
nl <<
"Building pair potentials." <<
endl;
43 for (
label a = 0; a < nIds_; ++a)
51 word pairPotentialName;
55 if (pairPotentialDict.
found(idA +
"-" + idB))
57 pairPotentialName = idA +
"-" + idB;
62 <<
"Pair pairPotential specification subDict "
63 << idA <<
"-" << idB <<
" not found"
69 if (pairPotentialDict.
found(idA +
"-" + idB))
71 pairPotentialName = idA +
"-" + idB;
74 else if (pairPotentialDict.
found(idB +
"-" + idA))
76 pairPotentialName = idB +
"-" + idA;
82 <<
"Pair pairPotential specification subDict "
83 << idA <<
"-" << idB <<
" or "
84 << idB <<
"-" << idA <<
" not found"
90 pairPotentialDict.
found(idA+
"-"+idB)
91 && pairPotentialDict.
found(idB+
"-"+idA)
95 <<
"Pair pairPotential specification subDict "
96 << idA <<
"-" << idB <<
" and "
97 << idB <<
"-" << idA <<
" found multiple definition"
104 pairPotentialIndex(a,
b),
108 pairPotentialDict.
subDict(pairPotentialName)
112 if ((*
this)[pairPotentialIndex(a,
b)].rCut() > rCutMax_)
114 rCutMax_ = (*this)[pairPotentialIndex(a,
b)].rCut();
117 if ((*
this)[pairPotentialIndex(a,
b)].writeTables())
119 OFstream ppTabFile(
mesh.time().path()/pairPotentialName);
123 !(*
this)[pairPotentialIndex(a,
b)].writeEnergyAndForceTables
130 <<
"Failed writing to "
138 if (!pairPotentialDict.
found(
"electrostatic"))
141 <<
"Pair pairPotential specification subDict electrostatic"
148 pairPotentialDict.
subDict(
"electrostatic")
151 if (electrostaticPotential_->rCut() > rCutMax_)
153 rCutMax_ = electrostaticPotential_->rCut();
156 if (electrostaticPotential_->writeTables())
160 if (!electrostaticPotential_->writeEnergyAndForceTables(ppTabFile))
163 <<
"Failed writing to "
169 rCutMaxSqr_ = rCutMax_*rCutMax_;
190 buildPotentials(idList, pairPotentialDict,
mesh);
211 nIds_ = idList.
size();
213 readPairPotentialDict(idList, pairPotentialDict,
mesh);
223 return (*
this)[pairPotentialIndex(a,
b)];
229 if (rIJMagSqr < rCutMaxSqr_)
244 const scalar rIJMagSqr
247 if (rIJMagSqr < rCutSqr(a,
b))
264 return (*
this)[pairPotentialIndex(a,
b)].rMin();
274 return (*
this)[pairPotentialIndex(a,
b)].dr();
284 return (*
this)[pairPotentialIndex(a,
b)].rCutSqr();
294 return (*
this)[pairPotentialIndex(a,
b)].rCut();
305 scalar
f = (*this)[pairPotentialIndex(a,
b)].force(rIJMag);
318 scalar
e = (*this)[pairPotentialIndex(a,
b)].energy(rIJMag);
points setSize(newPointi)
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
void readPairPotentialDict(const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
scalar rCut(const label a, const label b) const
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
scalar rCutMaxSqr() 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.
bool rCutSqr(const label a, const label b, const scalar rIJMagSqr) const
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
scalar energy(const label a, const label b, const scalar rIJMag) const
~pairPotentialList()
Destructor.
scalar rMin(const label a, const label b) const
scalar dr(const label a, const label b) const
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
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.
scalar force(const label a, const label b, const scalar rIJMag) const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const pairPotential & pairPotentialFunction(const label a, const label b) const
const fileName & name() const
Return the name of the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void buildPotentials(const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.