mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Initial modifications to MD to incorporate strathclyde work.
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
potential pot(mesh);
|
||||
|
||||
polyatomicCloud molecules(mesh, pot);
|
||||
@ -30,59 +30,25 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "md.H"
|
||||
#include "polyatomicCloud.H"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
potential pot(mesh);
|
||||
|
||||
moleculeCloud molecules(mesh, pot);
|
||||
|
||||
#include "temperatureAndPressureVariables.H"
|
||||
|
||||
label nAveragingSteps = 0;
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
nAveragingSteps++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
molecules.evolve();
|
||||
|
||||
#include "meanMomentumEnergyAndNMols.H"
|
||||
|
||||
#include "temperatureAndPressure.H"
|
||||
|
||||
runTime.write();
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
nAveragingSteps = 0;
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
@ -4,7 +4,6 @@ makeType=${1:-libso}
|
||||
set -x
|
||||
|
||||
wmake $makeType potential
|
||||
wmake $makeType molecularMeasurements
|
||||
wmake $makeType molecule
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
reducedUnits/reducedUnits.C
|
||||
reducedUnits/reducedUnitsIO.C
|
||||
constPropSite/constPropSite.C
|
||||
|
||||
molecule/molecule.C
|
||||
molecule/moleculeIO.C
|
||||
polyatomic/polyatomic/polyatomic.C
|
||||
polyatomic/polyatomic/polyatomicIO.C
|
||||
|
||||
moleculeCloud/moleculeCloud.C
|
||||
polyatomic/polyatomicCloud/polyatomicCloud.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmolecule
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
constPropSite
|
||||
|
||||
Description
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "constPropSite.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::constPropSite::constPropSite()
|
||||
:
|
||||
siteReferencePosition_(vector::zero),
|
||||
siteMass_(0.0),
|
||||
siteCharge_(0.0),
|
||||
siteId_(0),
|
||||
name_(),
|
||||
pairPotentialSite_(false),
|
||||
electrostaticSite_(false)
|
||||
{}
|
||||
|
||||
|
||||
Foam::constPropSite::constPropSite
|
||||
(
|
||||
const vector& siteReferencePosition,
|
||||
const scalar& siteMass,
|
||||
const scalar& siteCharge,
|
||||
const label& siteId,
|
||||
const word& name,
|
||||
const bool& pairPotentialSite,
|
||||
const bool& electrostaticSite
|
||||
)
|
||||
:
|
||||
siteReferencePosition_(siteReferencePosition),
|
||||
siteMass_(siteMass),
|
||||
siteCharge_(siteCharge),
|
||||
siteId_(siteId),
|
||||
name_(name),
|
||||
pairPotentialSite_(pairPotentialSite),
|
||||
electrostaticSite_(electrostaticSite)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::constPropSite::~constPropSite()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,162 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
Class
|
||||
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
constPropSiteI.H
|
||||
constPropSite.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef constPropSite_H
|
||||
#define constPropSite_H
|
||||
|
||||
#include "vector.H"
|
||||
#include "IFstream.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constPropSite Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class constPropSite
|
||||
{
|
||||
// Private data
|
||||
|
||||
//-
|
||||
vector siteReferencePosition_;
|
||||
|
||||
//-
|
||||
scalar siteMass_;
|
||||
|
||||
//-
|
||||
scalar siteCharge_;
|
||||
|
||||
//-
|
||||
label siteId_;
|
||||
|
||||
//-
|
||||
word name_;
|
||||
|
||||
//-
|
||||
bool pairPotentialSite_;
|
||||
|
||||
//-
|
||||
bool electrostaticSite_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
constPropSite();
|
||||
|
||||
//- Construct from components
|
||||
constPropSite
|
||||
(
|
||||
const vector& siteReferencePosition,
|
||||
const scalar& siteMass,
|
||||
const scalar& siteCharge,
|
||||
const label& siteId,
|
||||
const word& name,
|
||||
const bool& pairPotentialSite,
|
||||
const bool& electrostaticSite
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
// Destructor
|
||||
|
||||
~constPropSite();
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//-
|
||||
inline const vector& siteReferencePosition() const;
|
||||
|
||||
//-
|
||||
inline vector& siteReferencePosition();
|
||||
|
||||
//-
|
||||
inline const scalar& siteMass() const;
|
||||
|
||||
//-
|
||||
inline scalar& siteMass();
|
||||
|
||||
//-
|
||||
inline const scalar& siteCharge() const;
|
||||
|
||||
//-
|
||||
inline scalar& siteCharge();
|
||||
|
||||
//-
|
||||
inline const label& siteId() const;
|
||||
|
||||
//-
|
||||
inline label& siteId();
|
||||
|
||||
//-
|
||||
inline const word& name() const;
|
||||
|
||||
//-
|
||||
inline word& name();
|
||||
|
||||
//-
|
||||
inline const bool& pairPotentialSite() const;
|
||||
|
||||
//-
|
||||
inline bool& pairPotentialSite();
|
||||
|
||||
//-
|
||||
inline const bool& electrostaticSite() const;
|
||||
|
||||
//-
|
||||
inline bool& electrostaticSite();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "constPropSiteI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::vector& Foam::constPropSite::siteReferencePosition() const
|
||||
{
|
||||
return siteReferencePosition_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::constPropSite::siteReferencePosition()
|
||||
{
|
||||
return siteReferencePosition_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::scalar& Foam::constPropSite::siteMass() const
|
||||
{
|
||||
return siteMass_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::constPropSite::siteMass()
|
||||
{
|
||||
return siteMass_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::scalar& Foam::constPropSite::siteCharge() const
|
||||
{
|
||||
return siteCharge_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::constPropSite::siteCharge()
|
||||
{
|
||||
return siteCharge_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::label& Foam::constPropSite::siteId() const
|
||||
{
|
||||
return siteId_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label& Foam::constPropSite::siteId()
|
||||
{
|
||||
return siteId_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::constPropSite::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::word& Foam::constPropSite::name()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
inline const bool& Foam::constPropSite::pairPotentialSite() const
|
||||
{
|
||||
return pairPotentialSite_;
|
||||
}
|
||||
|
||||
|
||||
inline bool& Foam::constPropSite::pairPotentialSite()
|
||||
{
|
||||
return pairPotentialSite_;
|
||||
}
|
||||
|
||||
|
||||
inline const bool& Foam::constPropSite::electrostaticSite() const
|
||||
{
|
||||
return electrostaticSite_;
|
||||
}
|
||||
|
||||
|
||||
inline bool& Foam::constPropSite::electrostaticSite()
|
||||
{
|
||||
return electrostaticSite_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,14 +23,14 @@ License
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "moleculeCloud.H"
|
||||
#include "molecule.H"
|
||||
#include "polyatomicCloud.H"
|
||||
#include "polyatomic.H"
|
||||
#include "Random.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tensor Foam::molecule::rotationTensorX(scalar phi) const
|
||||
Foam::tensor Foam::polyatomic::rotationTensorX(scalar phi) const
|
||||
{
|
||||
return tensor
|
||||
(
|
||||
@ -41,7 +41,7 @@ Foam::tensor Foam::molecule::rotationTensorX(scalar phi) const
|
||||
}
|
||||
|
||||
|
||||
Foam::tensor Foam::molecule::rotationTensorY(scalar phi) const
|
||||
Foam::tensor Foam::polyatomic::rotationTensorY(scalar phi) const
|
||||
{
|
||||
return tensor
|
||||
(
|
||||
@ -52,7 +52,7 @@ Foam::tensor Foam::molecule::rotationTensorY(scalar phi) const
|
||||
}
|
||||
|
||||
|
||||
Foam::tensor Foam::molecule::rotationTensorZ(scalar phi) const
|
||||
Foam::tensor Foam::polyatomic::rotationTensorZ(scalar phi) const
|
||||
{
|
||||
return tensor
|
||||
(
|
||||
@ -65,11 +65,16 @@ Foam::tensor Foam::molecule::rotationTensorZ(scalar phi) const
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::molecule::move(molecule::trackingData& td, const scalar trackTime)
|
||||
bool Foam::polyatomic::move(polyatomic::trackingData& td, const scalar trackTime)
|
||||
{
|
||||
td.switchProcessor = false;
|
||||
td.keepParticle = true;
|
||||
|
||||
if (special_ != SPECIAL_FROZEN)
|
||||
{
|
||||
return td.keepParticle;
|
||||
}
|
||||
|
||||
const constantProperties& constProps(td.cloud().constProps(id_));
|
||||
|
||||
if (td.part() == 0)
|
||||
@ -180,7 +185,7 @@ bool Foam::molecule::move(molecule::trackingData& td, const scalar trackTime)
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("molecule::move(trackingData&, const scalar)") << nl
|
||||
FatalErrorIn("polyatomic::move(trackingData&, const scalar)") << nl
|
||||
<< td.part() << " is an invalid part of the integration method."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -189,7 +194,7 @@ bool Foam::molecule::move(molecule::trackingData& td, const scalar trackTime)
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::transformProperties(const tensor& T)
|
||||
void Foam::polyatomic::transformProperties(const tensor& T)
|
||||
{
|
||||
particle::transformProperties(T);
|
||||
|
||||
@ -211,7 +216,7 @@ void Foam::molecule::transformProperties(const tensor& T)
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::transformProperties(const vector& separation)
|
||||
void Foam::polyatomic::transformProperties(const vector& separation)
|
||||
{
|
||||
particle::transformProperties(separation);
|
||||
|
||||
@ -224,13 +229,13 @@ void Foam::molecule::transformProperties(const vector& separation)
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::setSitePositions(const constantProperties& constProps)
|
||||
void Foam::polyatomic::setSitePositions(const constantProperties& constProps)
|
||||
{
|
||||
sitePositions_ = position_ + (Q_ & constProps.siteReferencePositions());
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::setSiteSizes(label size)
|
||||
void Foam::polyatomic::setSiteSizes(label size)
|
||||
{
|
||||
sitePositions_.setSize(size);
|
||||
|
||||
@ -238,7 +243,7 @@ void Foam::molecule::setSiteSizes(label size)
|
||||
}
|
||||
|
||||
|
||||
bool Foam::molecule::hitPatch
|
||||
bool Foam::polyatomic::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackingData&,
|
||||
@ -251,7 +256,7 @@ bool Foam::molecule::hitPatch
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitProcessorPatch
|
||||
void Foam::polyatomic::hitProcessorPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
trackingData& td
|
||||
@ -261,7 +266,7 @@ void Foam::molecule::hitProcessorPatch
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitWallPatch
|
||||
void Foam::polyatomic::hitWallPatch
|
||||
(
|
||||
const wallPolyPatch& wpp,
|
||||
trackingData& td,
|
||||
@ -269,7 +274,7 @@ void Foam::molecule::hitWallPatch
|
||||
)
|
||||
{
|
||||
// Use of the normal from tetIs is not required as
|
||||
// hasWallImpactDistance for a moleculeCloud is false.
|
||||
// hasWallImpactDistance for a polyatomicCloud is false.
|
||||
vector nw = normal();
|
||||
nw /= mag(nw);
|
||||
|
||||
@ -283,7 +288,7 @@ void Foam::molecule::hitWallPatch
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitPatch
|
||||
void Foam::polyatomic::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackingData& td
|
||||
@ -22,20 +22,20 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::molecule
|
||||
Foam::polyatomic
|
||||
|
||||
Description
|
||||
Foam::molecule
|
||||
Foam::polyatomic
|
||||
|
||||
SourceFiles
|
||||
moleculeI.H
|
||||
molecule.C
|
||||
moleculeIO.C
|
||||
polyatomicI.H
|
||||
polyatomic.C
|
||||
polyatomicIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef molecule_H
|
||||
#define molecule_H
|
||||
#ifndef polyatomic_H
|
||||
#define polyatomic_H
|
||||
|
||||
#include "particle.H"
|
||||
#include "IOstream.H"
|
||||
@ -48,13 +48,13 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Class forward declarations
|
||||
class moleculeCloud;
|
||||
class polyatomicCloud;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class molecule Declaration
|
||||
Class polyatomic Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class molecule
|
||||
class polyatomic
|
||||
:
|
||||
public particle
|
||||
{
|
||||
@ -73,7 +73,7 @@ public:
|
||||
SPECIAL_USER = 1
|
||||
};
|
||||
|
||||
//- Class to hold molecule constant properties
|
||||
//- Class to hold polyatomic constant properties
|
||||
class constantProperties
|
||||
{
|
||||
// Private data
|
||||
@ -152,7 +152,7 @@ public:
|
||||
//- Class used to pass tracking data to the trackToFace function
|
||||
class trackingData
|
||||
:
|
||||
public particle::TrackingData<moleculeCloud>
|
||||
public particle::TrackingData<polyatomicCloud>
|
||||
{
|
||||
// label specifying which part of the integration algorithm is taking
|
||||
label part_;
|
||||
@ -162,9 +162,9 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
trackingData(moleculeCloud& cloud, label part)
|
||||
trackingData(polyatomicCloud& cloud, label part)
|
||||
:
|
||||
particle::TrackingData<moleculeCloud>(cloud),
|
||||
particle::TrackingData<polyatomicCloud>(cloud),
|
||||
part_(part)
|
||||
{}
|
||||
|
||||
@ -218,12 +218,12 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
friend class Cloud<molecule>;
|
||||
friend class Cloud<polyatomic>;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
inline molecule
|
||||
inline polyatomic
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
@ -242,7 +242,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
molecule
|
||||
polyatomic
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream& is,
|
||||
@ -252,7 +252,7 @@ public:
|
||||
//- Construct and return a clone
|
||||
autoPtr<particle> clone() const
|
||||
{
|
||||
return autoPtr<particle>(new molecule(*this));
|
||||
return autoPtr<particle>(new polyatomic(*this));
|
||||
}
|
||||
|
||||
//- Factory class to read-construct particles used for
|
||||
@ -268,9 +268,9 @@ public:
|
||||
mesh_(mesh)
|
||||
{}
|
||||
|
||||
autoPtr<molecule> operator()(Istream& is) const
|
||||
autoPtr<polyatomic> operator()(Istream& is) const
|
||||
{
|
||||
return autoPtr<molecule>(new molecule(mesh_, is, true));
|
||||
return autoPtr<polyatomic>(new polyatomic(mesh_, is, true));
|
||||
}
|
||||
};
|
||||
|
||||
@ -367,14 +367,14 @@ public:
|
||||
|
||||
// I-O
|
||||
|
||||
static void readFields(Cloud<molecule>& mC);
|
||||
static void readFields(Cloud<polyatomic>& mC);
|
||||
|
||||
static void writeFields(const Cloud<molecule>& mC);
|
||||
static void writeFields(const Cloud<polyatomic>& mC);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const molecule&);
|
||||
friend Ostream& operator<<(Ostream&, const polyatomic&);
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -383,7 +383,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "moleculeI.H"
|
||||
#include "polyatomicI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::molecule::constantProperties::constantProperties()
|
||||
inline Foam::polyatomic::constantProperties::constantProperties()
|
||||
:
|
||||
siteReferencePositions_(Field<vector>(0)),
|
||||
siteMasses_(List<scalar>(0)),
|
||||
@ -38,7 +38,7 @@ inline Foam::molecule::constantProperties::constantProperties()
|
||||
{}
|
||||
|
||||
|
||||
inline Foam::molecule::constantProperties::constantProperties
|
||||
inline Foam::polyatomic::constantProperties::constantProperties
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
@ -78,7 +78,7 @@ inline Foam::molecule::constantProperties::constantProperties
|
||||
|
||||
if (siteIds_.size() == 1)
|
||||
{
|
||||
// Single site molecule - no rotational motion.
|
||||
// Single site polyatomic - no rotational motion.
|
||||
|
||||
siteReferencePositions_[0] = vector::zero;
|
||||
|
||||
@ -86,9 +86,9 @@ inline Foam::molecule::constantProperties::constantProperties
|
||||
}
|
||||
else if (linearMoleculeTest())
|
||||
{
|
||||
// Linear molecule.
|
||||
// Linear polyatomic.
|
||||
|
||||
Info<< nl << "Linear molecule." << endl;
|
||||
Info<< nl << "Linear polyatomic." << endl;
|
||||
|
||||
vector dir = siteReferencePositions_[1] - siteReferencePositions_[0];
|
||||
|
||||
@ -131,7 +131,7 @@ inline Foam::molecule::constantProperties::constantProperties
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fully 6DOF molecule
|
||||
// Fully 6DOF polyatomic
|
||||
|
||||
// Calculate the inertia tensor in the current orientation
|
||||
|
||||
@ -151,8 +151,8 @@ inline Foam::molecule::constantProperties::constantProperties
|
||||
|
||||
if (eigenValues(momOfInertia).x() < VSMALL)
|
||||
{
|
||||
FatalErrorIn("molecule::constantProperties::constantProperties")
|
||||
<< "An eigenvalue of the inertia tensor is zero, the molecule "
|
||||
FatalErrorIn("polyatomic::constantProperties::constantProperties")
|
||||
<< "An eigenvalue of the inertia tensor is zero, the polyatomic "
|
||||
<< dict.name() << " is not a valid 6DOF shape."
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
@ -217,7 +217,7 @@ inline Foam::molecule::constantProperties::constantProperties
|
||||
}
|
||||
|
||||
|
||||
inline Foam::molecule::molecule
|
||||
inline Foam::polyatomic::polyatomic
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
@ -256,7 +256,7 @@ inline Foam::molecule::molecule
|
||||
|
||||
// * * * * * * * constantProperties Private Member Functions * * * * * * * * //
|
||||
|
||||
inline void Foam::molecule::constantProperties::checkSiteListSizes() const
|
||||
inline void Foam::polyatomic::constantProperties::checkSiteListSizes() const
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -264,7 +264,7 @@ inline void Foam::molecule::constantProperties::checkSiteListSizes() const
|
||||
|| siteIds_.size() != siteCharges_.size()
|
||||
)
|
||||
{
|
||||
FatalErrorIn("molecule::constantProperties::checkSiteListSizes")
|
||||
FatalErrorIn("polyatomic::constantProperties::checkSiteListSizes")
|
||||
<< "Sizes of site id, charge and "
|
||||
<< "referencePositions are not the same. "
|
||||
<< nl << abort(FatalError);
|
||||
@ -272,7 +272,7 @@ inline void Foam::molecule::constantProperties::checkSiteListSizes() const
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::molecule::constantProperties::setInteracionSiteBools
|
||||
inline void Foam::polyatomic::constantProperties::setInteracionSiteBools
|
||||
(
|
||||
const List<word>& siteIds,
|
||||
const List<word>& pairPotSiteIds
|
||||
@ -293,7 +293,7 @@ inline void Foam::molecule::constantProperties::setInteracionSiteBools
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::constantProperties::linearMoleculeTest() const
|
||||
inline bool Foam::polyatomic::constantProperties::linearMoleculeTest() const
|
||||
{
|
||||
if (siteIds_.size() == 2)
|
||||
{
|
||||
@ -328,48 +328,48 @@ inline bool Foam::molecule::constantProperties::linearMoleculeTest() const
|
||||
// * * * * * * * constantProperties Member Functions * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::Field<Foam::vector>&
|
||||
Foam::molecule::constantProperties::siteReferencePositions() const
|
||||
Foam::polyatomic::constantProperties::siteReferencePositions() const
|
||||
{
|
||||
return siteReferencePositions_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::scalar>&
|
||||
Foam::molecule::constantProperties::siteMasses() const
|
||||
Foam::polyatomic::constantProperties::siteMasses() const
|
||||
{
|
||||
return siteMasses_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::scalar>&
|
||||
Foam::molecule::constantProperties::siteCharges() const
|
||||
Foam::polyatomic::constantProperties::siteCharges() const
|
||||
{
|
||||
return siteCharges_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::label>&
|
||||
Foam::molecule::constantProperties::siteIds() const
|
||||
Foam::polyatomic::constantProperties::siteIds() const
|
||||
{
|
||||
return siteIds_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::List<Foam::label>&
|
||||
Foam::molecule::constantProperties::siteIds()
|
||||
Foam::polyatomic::constantProperties::siteIds()
|
||||
{
|
||||
return siteIds_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<bool>&
|
||||
Foam::molecule::constantProperties::pairPotentialSites() const
|
||||
Foam::polyatomic::constantProperties::pairPotentialSites() const
|
||||
{
|
||||
return pairPotentialSites_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::constantProperties::pairPotentialSite
|
||||
inline bool Foam::polyatomic::constantProperties::pairPotentialSite
|
||||
(
|
||||
label sId
|
||||
) const
|
||||
@ -378,7 +378,7 @@ inline bool Foam::molecule::constantProperties::pairPotentialSite
|
||||
|
||||
if (s == -1)
|
||||
{
|
||||
FatalErrorIn("moleculeI.H") << nl
|
||||
FatalErrorIn("polyatomicI.H") << nl
|
||||
<< sId << " site not found."
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
@ -388,13 +388,13 @@ inline bool Foam::molecule::constantProperties::pairPotentialSite
|
||||
|
||||
|
||||
inline const Foam::List<bool>&
|
||||
Foam::molecule::constantProperties::electrostaticSites() const
|
||||
Foam::polyatomic::constantProperties::electrostaticSites() const
|
||||
{
|
||||
return electrostaticSites_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::constantProperties::electrostaticSite
|
||||
inline bool Foam::polyatomic::constantProperties::electrostaticSite
|
||||
(
|
||||
label sId
|
||||
) const
|
||||
@ -405,7 +405,7 @@ inline bool Foam::molecule::constantProperties::electrostaticSite
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"molecule::constantProperties::electrostaticSite(label)"
|
||||
"polyatomic::constantProperties::electrostaticSite(label)"
|
||||
) << sId << " site not found."
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
@ -415,25 +415,25 @@ inline bool Foam::molecule::constantProperties::electrostaticSite
|
||||
|
||||
|
||||
inline const Foam::diagTensor&
|
||||
Foam::molecule::constantProperties::momentOfInertia() const
|
||||
Foam::polyatomic::constantProperties::momentOfInertia() const
|
||||
{
|
||||
return momentOfInertia_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::constantProperties::linearMolecule() const
|
||||
inline bool Foam::polyatomic::constantProperties::linearMolecule() const
|
||||
{
|
||||
return ((momentOfInertia_.xx() < 0) && (momentOfInertia_.yy() > 0));
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::constantProperties::pointMolecule() const
|
||||
inline bool Foam::polyatomic::constantProperties::pointMolecule() const
|
||||
{
|
||||
return (momentOfInertia_.zz() < 0);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::molecule::constantProperties::degreesOfFreedom() const
|
||||
inline Foam::label Foam::polyatomic::constantProperties::degreesOfFreedom() const
|
||||
{
|
||||
if (linearMolecule())
|
||||
{
|
||||
@ -450,154 +450,154 @@ inline Foam::label Foam::molecule::constantProperties::degreesOfFreedom() const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::molecule::constantProperties::mass() const
|
||||
inline Foam::scalar Foam::polyatomic::constantProperties::mass() const
|
||||
{
|
||||
return mass_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::molecule::constantProperties::nSites() const
|
||||
inline Foam::label Foam::polyatomic::constantProperties::nSites() const
|
||||
{
|
||||
return siteIds_.size();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * molecule Member Functions * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * polyatomic Member Functions * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::tensor& Foam::molecule::Q() const
|
||||
inline const Foam::tensor& Foam::polyatomic::Q() const
|
||||
{
|
||||
return Q_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tensor& Foam::molecule::Q()
|
||||
inline Foam::tensor& Foam::polyatomic::Q()
|
||||
{
|
||||
return Q_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::molecule::v() const
|
||||
inline const Foam::vector& Foam::polyatomic::v() const
|
||||
{
|
||||
return v_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::molecule::v()
|
||||
inline Foam::vector& Foam::polyatomic::v()
|
||||
{
|
||||
return v_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::molecule::a() const
|
||||
inline const Foam::vector& Foam::polyatomic::a() const
|
||||
{
|
||||
return a_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::molecule::a()
|
||||
inline Foam::vector& Foam::polyatomic::a()
|
||||
{
|
||||
return a_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::molecule::pi() const
|
||||
inline const Foam::vector& Foam::polyatomic::pi() const
|
||||
{
|
||||
return pi_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::molecule::pi()
|
||||
inline Foam::vector& Foam::polyatomic::pi()
|
||||
{
|
||||
return pi_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::molecule::tau() const
|
||||
inline const Foam::vector& Foam::polyatomic::tau() const
|
||||
{
|
||||
return tau_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::molecule::tau()
|
||||
inline Foam::vector& Foam::polyatomic::tau()
|
||||
{
|
||||
return tau_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::vector>& Foam::molecule::siteForces() const
|
||||
inline const Foam::List<Foam::vector>& Foam::polyatomic::siteForces() const
|
||||
{
|
||||
return siteForces_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::List<Foam::vector>& Foam::molecule::siteForces()
|
||||
inline Foam::List<Foam::vector>& Foam::polyatomic::siteForces()
|
||||
{
|
||||
return siteForces_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::vector>& Foam::molecule::sitePositions() const
|
||||
inline const Foam::List<Foam::vector>& Foam::polyatomic::sitePositions() const
|
||||
{
|
||||
return sitePositions_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::List<Foam::vector>& Foam::molecule::sitePositions()
|
||||
inline Foam::List<Foam::vector>& Foam::polyatomic::sitePositions()
|
||||
{
|
||||
return sitePositions_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::molecule::specialPosition() const
|
||||
inline const Foam::vector& Foam::polyatomic::specialPosition() const
|
||||
{
|
||||
return specialPosition_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::molecule::specialPosition()
|
||||
inline Foam::vector& Foam::polyatomic::specialPosition()
|
||||
{
|
||||
return specialPosition_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::molecule::potentialEnergy() const
|
||||
inline Foam::scalar Foam::polyatomic::potentialEnergy() const
|
||||
{
|
||||
return potentialEnergy_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::molecule::potentialEnergy()
|
||||
inline Foam::scalar& Foam::polyatomic::potentialEnergy()
|
||||
{
|
||||
return potentialEnergy_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::tensor& Foam::molecule::rf() const
|
||||
inline const Foam::tensor& Foam::polyatomic::rf() const
|
||||
{
|
||||
return rf_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::tensor& Foam::molecule::rf()
|
||||
inline Foam::tensor& Foam::polyatomic::rf()
|
||||
{
|
||||
return rf_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::molecule::special() const
|
||||
inline Foam::label Foam::polyatomic::special() const
|
||||
{
|
||||
return special_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::molecule::tethered() const
|
||||
inline bool Foam::polyatomic::tethered() const
|
||||
{
|
||||
return special_ == SPECIAL_TETHERED;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::molecule::id() const
|
||||
inline Foam::label Foam::polyatomic::id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
@ -23,13 +23,13 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "molecule.H"
|
||||
#include "polyatomic.H"
|
||||
#include "IOstreams.H"
|
||||
#include "moleculeCloud.H"
|
||||
#include "polyatomicCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::molecule::molecule
|
||||
Foam::polyatomic::polyatomic
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream& is,
|
||||
@ -91,13 +91,13 @@ Foam::molecule::molecule
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"Foam::molecule::molecule"
|
||||
"(const Cloud<molecule>& cloud, Foam::Istream&), bool"
|
||||
"Foam::polyatomic::polyatomic"
|
||||
"(const Cloud<polyatomic>& cloud, Foam::Istream&), bool"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::readFields(Cloud<molecule>& mC)
|
||||
void Foam::polyatomic::readFields(Cloud<polyatomic>& mC)
|
||||
{
|
||||
if (!mC.size())
|
||||
{
|
||||
@ -134,9 +134,9 @@ void Foam::molecule::readFields(Cloud<molecule>& mC)
|
||||
mC.checkFieldIOobject(mC, id);
|
||||
|
||||
label i = 0;
|
||||
forAllIter(moleculeCloud, mC, iter)
|
||||
forAllIter(polyatomicCloud, mC, iter)
|
||||
{
|
||||
molecule& mol = iter();
|
||||
polyatomic& mol = iter();
|
||||
|
||||
mol.Q_ = Q[i];
|
||||
mol.v_ = v[i];
|
||||
@ -151,7 +151,7 @@ void Foam::molecule::readFields(Cloud<molecule>& mC)
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::writeFields(const Cloud<molecule>& mC)
|
||||
void Foam::polyatomic::writeFields(const Cloud<polyatomic>& mC)
|
||||
{
|
||||
particle::writeFields(mC);
|
||||
|
||||
@ -203,9 +203,9 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
|
||||
);
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(moleculeCloud, mC, iter)
|
||||
forAllConstIter(polyatomicCloud, mC, iter)
|
||||
{
|
||||
const molecule& mol = iter();
|
||||
const polyatomic& mol = iter();
|
||||
|
||||
Q[i] = mol.Q_;
|
||||
v[i] = mol.v_;
|
||||
@ -244,13 +244,13 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
|
||||
|
||||
Info<< "writeFields " << mC.name() << endl;
|
||||
|
||||
if (isA<moleculeCloud>(mC))
|
||||
if (isA<polyatomicCloud>(mC))
|
||||
{
|
||||
const moleculeCloud& m = dynamic_cast<const moleculeCloud&>(mC);
|
||||
const polyatomicCloud& m = dynamic_cast<const polyatomicCloud&>(mC);
|
||||
|
||||
m.writeXYZ
|
||||
(
|
||||
m.mesh().time().timePath()/cloud::prefix/"moleculeCloud.xmol"
|
||||
m.mesh().time().timePath()/cloud::prefix/"polyatomicCloud.xmol"
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -258,7 +258,7 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const molecule& mol)
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const polyatomic& mol)
|
||||
{
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
@ -302,7 +302,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const molecule& mol)
|
||||
os.check
|
||||
(
|
||||
"Foam::Ostream& Foam::operator<<"
|
||||
"(Foam::Ostream&, const Foam::molecule&)"
|
||||
"(Foam::Ostream&, const Foam::polyatomic&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
@ -23,7 +23,7 @@ License
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "moleculeCloud.H"
|
||||
#include "polyatomicCloud.H"
|
||||
#include "fvMesh.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
@ -33,14 +33,14 @@ using namespace Foam::constant::mathematical;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(Cloud<molecule>, 0);
|
||||
defineTemplateTypeNameAndDebug(Cloud<polyatomic>, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::moleculeCloud::buildConstProps()
|
||||
void Foam::polyatomicCloud::buildConstProps()
|
||||
{
|
||||
Info<< nl << "Reading moleculeProperties dictionary." << endl;
|
||||
Info<< nl << "Reading polyatomicProperties dictionary." << endl;
|
||||
|
||||
const List<word>& idList(pot_.idList());
|
||||
|
||||
@ -48,11 +48,11 @@ void Foam::moleculeCloud::buildConstProps()
|
||||
|
||||
const List<word>& siteIdList(pot_.siteIdList());
|
||||
|
||||
IOdictionary moleculePropertiesDict
|
||||
IOdictionary polyatomicPropertiesDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"moleculeProperties",
|
||||
"polyatomicProperties",
|
||||
mesh_.time().constant(),
|
||||
mesh_,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -64,7 +64,7 @@ void Foam::moleculeCloud::buildConstProps()
|
||||
forAll(idList, i)
|
||||
{
|
||||
const word& id = idList[i];
|
||||
const dictionary& molDict = moleculePropertiesDict.subDict(id);
|
||||
const dictionary& molDict = polyatomicPropertiesDict.subDict(id);
|
||||
|
||||
List<word> siteIdNames = molDict.lookup("siteIds");
|
||||
|
||||
@ -78,26 +78,26 @@ void Foam::moleculeCloud::buildConstProps()
|
||||
|
||||
if (siteIds[sI] == -1)
|
||||
{
|
||||
FatalErrorIn("moleculeCloud::buildConstProps()")
|
||||
FatalErrorIn("polyatomicCloud::buildConstProps()")
|
||||
<< siteId << " site not found."
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
molecule::constantProperties& constProp = constPropList_[i];
|
||||
polyatomic::constantProperties& constProp = constPropList_[i];
|
||||
|
||||
constProp = molecule::constantProperties(molDict);
|
||||
constProp = polyatomic::constantProperties(molDict);
|
||||
|
||||
constProp.siteIds() = siteIds;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::setSiteSizesAndPositions()
|
||||
void Foam::polyatomicCloud::setSiteSizesAndPositions()
|
||||
{
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
const molecule::constantProperties& cP = constProps(mol().id());
|
||||
const polyatomic::constantProperties& cP = constProps(mol().id());
|
||||
|
||||
mol().setSiteSizes(cP.nSites());
|
||||
|
||||
@ -106,14 +106,14 @@ void Foam::moleculeCloud::setSiteSizesAndPositions()
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::buildCellOccupancy()
|
||||
void Foam::polyatomicCloud::buildCellOccupancy()
|
||||
{
|
||||
forAll(cellOccupancy_, cO)
|
||||
{
|
||||
cellOccupancy_[cO].clear();
|
||||
}
|
||||
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
cellOccupancy_[mol().cell()].append(&mol());
|
||||
}
|
||||
@ -125,15 +125,15 @@ void Foam::moleculeCloud::buildCellOccupancy()
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::calculatePairForce()
|
||||
void Foam::polyatomicCloud::calculatePairForce()
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
|
||||
// Start sending referred data
|
||||
il_.sendReferredData(cellOccupancy(), pBufs);
|
||||
|
||||
molecule* molI = NULL;
|
||||
molecule* molJ = NULL;
|
||||
polyatomic* molI = NULL;
|
||||
polyatomic* molJ = NULL;
|
||||
|
||||
{
|
||||
// Real-Real interactions
|
||||
@ -148,7 +148,7 @@ void Foam::moleculeCloud::calculatePairForce()
|
||||
|
||||
forAll(dil[d], interactingCells)
|
||||
{
|
||||
List<molecule*> cellJ =
|
||||
List<polyatomic*> cellJ =
|
||||
cellOccupancy_[dil[d][interactingCells]];
|
||||
|
||||
forAll(cellJ, cellJMols)
|
||||
@ -180,24 +180,24 @@ void Foam::moleculeCloud::calculatePairForce()
|
||||
|
||||
const labelListList& ril = il_.ril();
|
||||
|
||||
List<IDLList<molecule> >& referredMols = il_.referredParticles();
|
||||
List<IDLList<polyatomic> >& referredMols = il_.referredParticles();
|
||||
|
||||
forAll(ril, r)
|
||||
{
|
||||
const List<label>& realCells = ril[r];
|
||||
|
||||
IDLList<molecule>& refMols = referredMols[r];
|
||||
IDLList<polyatomic>& refMols = referredMols[r];
|
||||
|
||||
forAllIter
|
||||
(
|
||||
IDLList<molecule>,
|
||||
IDLList<polyatomic>,
|
||||
refMols,
|
||||
refMol
|
||||
)
|
||||
{
|
||||
forAll(realCells, rC)
|
||||
{
|
||||
List<molecule*> cellI = cellOccupancy_[realCells[rC]];
|
||||
List<polyatomic*> cellI = cellOccupancy_[realCells[rC]];
|
||||
|
||||
forAll(cellI, cellIMols)
|
||||
{
|
||||
@ -212,11 +212,11 @@ void Foam::moleculeCloud::calculatePairForce()
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::calculateTetherForce()
|
||||
void Foam::polyatomicCloud::calculateTetherForce()
|
||||
{
|
||||
const tetherPotentialList& tetherPot(pot_.tetherPotentials());
|
||||
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
if (mol().tethered())
|
||||
{
|
||||
@ -239,16 +239,16 @@ void Foam::moleculeCloud::calculateTetherForce()
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::calculateExternalForce()
|
||||
void Foam::polyatomicCloud::calculateExternalForce()
|
||||
{
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
mol().a() += pot_.gravity();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
void Foam::polyatomicCloud::removeHighEnergyOverlaps()
|
||||
{
|
||||
Info<< nl << "Removing high energy overlaps, limit = "
|
||||
<< pot_.potentialEnergyLimit()
|
||||
@ -267,11 +267,11 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
|
||||
// Real-Real interaction
|
||||
|
||||
molecule* molI = NULL;
|
||||
molecule* molJ = NULL;
|
||||
polyatomic* molI = NULL;
|
||||
polyatomic* molJ = NULL;
|
||||
|
||||
{
|
||||
DynamicList<molecule*> molsToDelete;
|
||||
DynamicList<polyatomic*> molsToDelete;
|
||||
|
||||
const labelListList& dil(il_.dil());
|
||||
|
||||
@ -283,7 +283,7 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
|
||||
forAll(dil[d], interactingCells)
|
||||
{
|
||||
List<molecule*> cellJ =
|
||||
List<polyatomic*> cellJ =
|
||||
cellOccupancy_[dil[d][interactingCells]];
|
||||
|
||||
forAll(cellJ, cellJMols)
|
||||
@ -369,19 +369,19 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
// Real-Referred interaction
|
||||
|
||||
{
|
||||
DynamicList<molecule*> molsToDelete;
|
||||
DynamicList<polyatomic*> molsToDelete;
|
||||
|
||||
const labelListList& ril(il_.ril());
|
||||
|
||||
List<IDLList<molecule> >& referredMols = il_.referredParticles();
|
||||
List<IDLList<polyatomic> >& referredMols = il_.referredParticles();
|
||||
|
||||
forAll(ril, r)
|
||||
{
|
||||
IDLList<molecule>& refMols = referredMols[r];
|
||||
IDLList<polyatomic>& refMols = referredMols[r];
|
||||
|
||||
forAllIter
|
||||
(
|
||||
IDLList<molecule>,
|
||||
IDLList<polyatomic>,
|
||||
refMols,
|
||||
refMol
|
||||
)
|
||||
@ -394,7 +394,7 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
{
|
||||
label cellI = realCells[rC];
|
||||
|
||||
List<molecule*> cellIMols = cellOccupancy_[cellI];
|
||||
List<polyatomic*> cellIMols = cellOccupancy_[cellI];
|
||||
|
||||
forAll(cellIMols, cIM)
|
||||
{
|
||||
@ -423,7 +423,7 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
== findIndex(pot_.removalOrder(), idJ)
|
||||
)
|
||||
{
|
||||
// Remove one of the molecules
|
||||
// Remove one of the polyatomics
|
||||
// arbitrarily, assuring that a
|
||||
// consistent decision is made for
|
||||
// both real-referred pairs.
|
||||
@ -463,24 +463,24 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
|
||||
reduce(molsRemoved, sumOp<label>());
|
||||
}
|
||||
|
||||
Info<< tab << molsRemoved << " molecules removed" << endl;
|
||||
Info<< tab << molsRemoved << " polyatomics removed" << endl;
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::initialiseMolecules
|
||||
void Foam::polyatomicCloud::initialiseMolecules
|
||||
(
|
||||
const IOdictionary& mdInitialiseDict
|
||||
)
|
||||
{
|
||||
Info<< nl
|
||||
<< "Initialising molecules in each zone specified in mdInitialiseDict."
|
||||
<< "Initialising polyatomics in each zone specified in mdInitialiseDict."
|
||||
<< endl;
|
||||
|
||||
const cellZoneMesh& cellZones = mesh_.cellZones();
|
||||
|
||||
if (!cellZones.size())
|
||||
{
|
||||
FatalErrorIn("void Foam::moleculeCloud::initialiseMolecules")
|
||||
FatalErrorIn("void Foam::polyatomicCloud::initialiseMolecules")
|
||||
<< "No cellZones found in the mesh."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -520,7 +520,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
|
||||
if (latticeIds.size() != latticePositions.size())
|
||||
{
|
||||
FatalErrorIn("Foam::moleculeCloud::initialiseMolecules")
|
||||
FatalErrorIn("Foam::polyatomicCloud::initialiseMolecules")
|
||||
<< "latticeIds and latticePositions must be the same "
|
||||
<< " size." << nl
|
||||
<< abort(FatalError);
|
||||
@ -542,7 +542,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
|
||||
if (numberDensity < VSMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::initialiseMolecules")
|
||||
WarningIn("polyatomicCloud::initialiseMolecules")
|
||||
<< "numberDensity too small, not filling zone "
|
||||
<< zone.name() << endl;
|
||||
|
||||
@ -563,7 +563,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
{
|
||||
label id = findIndex(pot_.idList(), latticeIds[i]);
|
||||
|
||||
const molecule::constantProperties& cP(constProps(id));
|
||||
const polyatomic::constantProperties& cP(constProps(id));
|
||||
|
||||
unitCellMass += cP.mass();
|
||||
}
|
||||
@ -575,7 +575,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
|
||||
if (massDensity < VSMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::initialiseMolecules")
|
||||
WarningIn("polyatomicCloud::initialiseMolecules")
|
||||
<< "massDensity too small, not filling zone "
|
||||
<< zone.name() << endl;
|
||||
|
||||
@ -591,7 +591,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("Foam::moleculeCloud::initialiseMolecules")
|
||||
FatalErrorIn("Foam::polyatomicCloud::initialiseMolecules")
|
||||
<< "massDensity or numberDensity not specified " << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -686,8 +686,8 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
|
||||
anchor += (R & (latticeCellShape & latticeAnchor));
|
||||
|
||||
// Continue trying to place molecules as long as at
|
||||
// least one molecule is placed in each iteration.
|
||||
// Continue trying to place polyatomics as long as at
|
||||
// least one polyatomic is placed in each iteration.
|
||||
// The "|| totalZoneMols == 0" condition means that the
|
||||
// algorithm will continue if the origin is outside the
|
||||
// zone.
|
||||
@ -709,7 +709,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
bool partOfLayerInBounds = false;
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// start of placement of molecules
|
||||
// start of placement of polyatomics
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
if (n == 0)
|
||||
@ -949,7 +949,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// end of placement of molecules
|
||||
// end of placement of polyatomics
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
if
|
||||
@ -958,10 +958,10 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
&& !partOfLayerInBounds
|
||||
)
|
||||
{
|
||||
WarningIn("Foam::moleculeCloud::initialiseMolecules()")
|
||||
WarningIn("Foam::polyatomicCloud::initialiseMolecules()")
|
||||
<< "A whole layer of unit cells was placed "
|
||||
<< "outside the bounds of the mesh, but no "
|
||||
<< "molecules have been placed in zone '"
|
||||
<< "polyatomics have been placed in zone '"
|
||||
<< zone.name()
|
||||
<< "'. This is likely to be because the zone "
|
||||
<< "has few cells ("
|
||||
@ -987,7 +987,7 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::createMolecule
|
||||
void Foam::polyatomicCloud::createMolecule
|
||||
(
|
||||
const point& position,
|
||||
label cell,
|
||||
@ -1006,7 +1006,7 @@ void Foam::moleculeCloud::createMolecule
|
||||
|
||||
if (cell == -1)
|
||||
{
|
||||
FatalErrorIn("Foam::moleculeCloud::createMolecule")
|
||||
FatalErrorIn("Foam::polyatomicCloud::createMolecule")
|
||||
<< "Position specified does not correspond to a mesh cell." << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -1019,10 +1019,10 @@ void Foam::moleculeCloud::createMolecule
|
||||
{
|
||||
specialPosition = position;
|
||||
|
||||
special = molecule::SPECIAL_TETHERED;
|
||||
special = polyatomic::SPECIAL_TETHERED;
|
||||
}
|
||||
|
||||
const molecule::constantProperties& cP(constProps(id));
|
||||
const polyatomic::constantProperties& cP(constProps(id));
|
||||
|
||||
vector v = equipartitionLinearVelocity(temperature, cP.mass());
|
||||
|
||||
@ -1058,7 +1058,7 @@ void Foam::moleculeCloud::createMolecule
|
||||
|
||||
addParticle
|
||||
(
|
||||
new molecule
|
||||
new polyatomic
|
||||
(
|
||||
mesh_,
|
||||
position,
|
||||
@ -1079,11 +1079,11 @@ void Foam::moleculeCloud::createMolecule
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::moleculeCloud::nSites() const
|
||||
Foam::label Foam::polyatomicCloud::nSites() const
|
||||
{
|
||||
label n = 0;
|
||||
|
||||
forAllConstIter(moleculeCloud, *this, mol)
|
||||
forAllConstIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
n += constProps(mol().id()).nSites();
|
||||
}
|
||||
@ -1094,14 +1094,14 @@ Foam::label Foam::moleculeCloud::nSites() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::moleculeCloud::moleculeCloud
|
||||
Foam::polyatomicCloud::polyatomicCloud
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const potential& pot,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
Cloud<molecule>(mesh, "moleculeCloud", false),
|
||||
Cloud<polyatomic>(mesh, "polyatomicCloud", false),
|
||||
mesh_(mesh),
|
||||
pot_(pot),
|
||||
cellOccupancy_(mesh_.nCells()),
|
||||
@ -1111,7 +1111,7 @@ Foam::moleculeCloud::moleculeCloud
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
molecule::readFields(*this);
|
||||
polyatomic::readFields(*this);
|
||||
}
|
||||
|
||||
buildConstProps();
|
||||
@ -1124,7 +1124,7 @@ Foam::moleculeCloud::moleculeCloud
|
||||
}
|
||||
|
||||
|
||||
Foam::moleculeCloud::moleculeCloud
|
||||
Foam::polyatomicCloud::polyatomicCloud
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const potential& pot,
|
||||
@ -1132,7 +1132,7 @@ Foam::moleculeCloud::moleculeCloud
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
Cloud<molecule>(mesh, "moleculeCloud", false),
|
||||
Cloud<polyatomic>(mesh, "polyatomicCloud", false),
|
||||
mesh_(mesh),
|
||||
pot_(pot),
|
||||
il_(mesh_, 0.0, false),
|
||||
@ -1141,7 +1141,7 @@ Foam::moleculeCloud::moleculeCloud
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
molecule::readFields(*this);
|
||||
polyatomic::readFields(*this);
|
||||
}
|
||||
|
||||
clear();
|
||||
@ -1154,30 +1154,30 @@ Foam::moleculeCloud::moleculeCloud
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::moleculeCloud::evolve()
|
||||
void Foam::polyatomicCloud::evolve()
|
||||
{
|
||||
molecule::trackingData td0(*this, 0);
|
||||
Cloud<molecule>::move(td0, mesh_.time().deltaTValue());
|
||||
polyatomic::trackingData td0(*this, 0);
|
||||
Cloud<polyatomic>::move(td0, mesh_.time().deltaTValue());
|
||||
|
||||
molecule::trackingData td1(*this, 1);
|
||||
Cloud<molecule>::move(td1, mesh_.time().deltaTValue());
|
||||
polyatomic::trackingData td1(*this, 1);
|
||||
Cloud<polyatomic>::move(td1, mesh_.time().deltaTValue());
|
||||
|
||||
molecule::trackingData td2(*this, 2);
|
||||
Cloud<molecule>::move(td2, mesh_.time().deltaTValue());
|
||||
polyatomic::trackingData td2(*this, 2);
|
||||
Cloud<polyatomic>::move(td2, mesh_.time().deltaTValue());
|
||||
|
||||
calculateForce();
|
||||
|
||||
molecule::trackingData td3(*this, 3);
|
||||
Cloud<molecule>::move(td3, mesh_.time().deltaTValue());
|
||||
polyatomic::trackingData td3(*this, 3);
|
||||
Cloud<polyatomic>::move(td3, mesh_.time().deltaTValue());
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::calculateForce()
|
||||
void Foam::polyatomicCloud::calculateForce()
|
||||
{
|
||||
buildCellOccupancy();
|
||||
|
||||
// Set accumulated quantities to zero
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
mol().siteForces() = vector::zero;
|
||||
|
||||
@ -1194,7 +1194,7 @@ void Foam::moleculeCloud::calculateForce()
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::applyConstraintsAndThermostats
|
||||
void Foam::polyatomicCloud::applyConstraintsAndThermostats
|
||||
(
|
||||
const scalar targetTemperature,
|
||||
const scalar measuredTemperature
|
||||
@ -1214,7 +1214,7 @@ void Foam::moleculeCloud::applyConstraintsAndThermostats
|
||||
<< "----------------------------------------"
|
||||
<< endl;
|
||||
|
||||
forAllIter(moleculeCloud, *this, mol)
|
||||
forAllIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
mol().v() *= temperatureCorrectionFactor;
|
||||
|
||||
@ -1223,15 +1223,15 @@ void Foam::moleculeCloud::applyConstraintsAndThermostats
|
||||
}
|
||||
|
||||
|
||||
void Foam::moleculeCloud::writeXYZ(const fileName& fName) const
|
||||
void Foam::polyatomicCloud::writeXYZ(const fileName& fName) const
|
||||
{
|
||||
OFstream os(fName);
|
||||
|
||||
os << nSites() << nl << "moleculeCloud site positions in angstroms" << nl;
|
||||
os << nSites() << nl << "polyatomicCloud site positions in angstroms" << nl;
|
||||
|
||||
forAllConstIter(moleculeCloud, *this, mol)
|
||||
forAllConstIter(polyatomicCloud, *this, mol)
|
||||
{
|
||||
const molecule::constantProperties& cP = constProps(mol().id());
|
||||
const polyatomic::constantProperties& cP = constProps(mol().id());
|
||||
|
||||
forAll(mol().sitePositions(), i)
|
||||
{
|
||||
@ -22,22 +22,22 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::moleculeCloud
|
||||
Foam::polyatomicCloud
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
moleculeCloudI.H
|
||||
moleculeCloud.C
|
||||
polyatomicCloudI.H
|
||||
polyatomicCloud.C
|
||||
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef moleculeCloud_H
|
||||
#define moleculeCloud_H
|
||||
#ifndef polyatomicCloud_H
|
||||
#define polyatomicCloud_H
|
||||
|
||||
#include "Cloud.H"
|
||||
#include "molecule.H"
|
||||
#include "polyatomic.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "potential.H"
|
||||
#include "InteractionLists.H"
|
||||
@ -51,12 +51,12 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class moleculeCloud Declaration
|
||||
Class polyatomicCloud Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class moleculeCloud
|
||||
class polyatomicCloud
|
||||
:
|
||||
public Cloud<molecule>
|
||||
public Cloud<polyatomic>
|
||||
{
|
||||
|
||||
private:
|
||||
@ -67,11 +67,11 @@ private:
|
||||
|
||||
const potential& pot_;
|
||||
|
||||
List<DynamicList<molecule*> > cellOccupancy_;
|
||||
List<DynamicList<polyatomic*> > cellOccupancy_;
|
||||
|
||||
InteractionLists<molecule> il_;
|
||||
InteractionLists<polyatomic> il_;
|
||||
|
||||
List<molecule::constantProperties> constPropList_;
|
||||
List<polyatomic::constantProperties> constPropList_;
|
||||
|
||||
Random rndGen_;
|
||||
|
||||
@ -82,21 +82,21 @@ private:
|
||||
|
||||
void setSiteSizesAndPositions();
|
||||
|
||||
//- Determine which molecules are in which cells
|
||||
//- Determine which polyatomics are in which cells
|
||||
void buildCellOccupancy();
|
||||
|
||||
void calculatePairForce();
|
||||
|
||||
inline void evaluatePair
|
||||
(
|
||||
molecule& molI,
|
||||
molecule& molJ
|
||||
polyatomic& molI,
|
||||
polyatomic& molJ
|
||||
);
|
||||
|
||||
inline bool evaluatePotentialLimit
|
||||
(
|
||||
molecule& molI,
|
||||
molecule& molJ
|
||||
polyatomic& molI,
|
||||
polyatomic& molJ
|
||||
) const;
|
||||
|
||||
void calculateTetherForce();
|
||||
@ -133,14 +133,14 @@ private:
|
||||
inline vector equipartitionAngularMomentum
|
||||
(
|
||||
scalar temperature,
|
||||
const molecule::constantProperties& cP
|
||||
const polyatomic::constantProperties& cP
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
moleculeCloud(const moleculeCloud&);
|
||||
polyatomicCloud(const polyatomicCloud&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const moleculeCloud&);
|
||||
void operator=(const polyatomicCloud&);
|
||||
|
||||
|
||||
public:
|
||||
@ -148,7 +148,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct given mesh and potential references
|
||||
moleculeCloud
|
||||
polyatomicCloud
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const potential& pot,
|
||||
@ -156,7 +156,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct given mesh, potential and mdInitialiseDict
|
||||
moleculeCloud
|
||||
polyatomicCloud
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const potential& pot,
|
||||
@ -167,7 +167,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Evolve the molecules (move, calculate forces, control state etc)
|
||||
//- Evolve the polyatomics (move, calculate forces, control state etc)
|
||||
void evolve();
|
||||
|
||||
void calculateForce();
|
||||
@ -185,13 +185,13 @@ public:
|
||||
|
||||
inline const potential& pot() const;
|
||||
|
||||
inline const List<DynamicList<molecule*> >& cellOccupancy() const;
|
||||
inline const List<DynamicList<polyatomic*> >& cellOccupancy() const;
|
||||
|
||||
inline const InteractionLists<molecule>& il() const;
|
||||
inline const InteractionLists<polyatomic>& il() const;
|
||||
|
||||
inline const List<molecule::constantProperties> constProps() const;
|
||||
inline const List<polyatomic::constantProperties> constProps() const;
|
||||
|
||||
inline const molecule::constantProperties&
|
||||
inline const polyatomic::constantProperties&
|
||||
constProps(label id) const;
|
||||
|
||||
inline Random& rndGen();
|
||||
@ -199,7 +199,7 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Write molecule sites in XYZ format
|
||||
//- Write polyatomic sites in XYZ format
|
||||
void writeXYZ(const fileName& fName) const;
|
||||
};
|
||||
|
||||
@ -210,7 +210,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "moleculeCloudI.H"
|
||||
#include "polyatomicCloudI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -29,10 +29,10 @@ using namespace Foam::constant;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::moleculeCloud::evaluatePair
|
||||
inline void Foam::polyatomicCloud::evaluatePair
|
||||
(
|
||||
molecule& molI,
|
||||
molecule& molJ
|
||||
polyatomic& molI,
|
||||
polyatomic& molJ
|
||||
)
|
||||
{
|
||||
const pairPotentialList& pairPot = pot_.pairPotentials();
|
||||
@ -43,9 +43,9 @@ inline void Foam::moleculeCloud::evaluatePair
|
||||
|
||||
label idJ = molJ.id();
|
||||
|
||||
const molecule::constantProperties& constPropI(constProps(idI));
|
||||
const polyatomic::constantProperties& constPropI(constProps(idI));
|
||||
|
||||
const molecule::constantProperties& constPropJ(constProps(idJ));
|
||||
const polyatomic::constantProperties& constPropJ(constProps(idJ));
|
||||
|
||||
List<label> siteIdsI = constPropI.siteIds();
|
||||
|
||||
@ -152,10 +152,10 @@ inline void Foam::moleculeCloud::evaluatePair
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::moleculeCloud::evaluatePotentialLimit
|
||||
inline bool Foam::polyatomicCloud::evaluatePotentialLimit
|
||||
(
|
||||
molecule& molI,
|
||||
molecule& molJ
|
||||
polyatomic& molI,
|
||||
polyatomic& molJ
|
||||
) const
|
||||
{
|
||||
const pairPotentialList& pairPot = pot_.pairPotentials();
|
||||
@ -166,9 +166,9 @@ inline bool Foam::moleculeCloud::evaluatePotentialLimit
|
||||
|
||||
label idJ = molJ.id();
|
||||
|
||||
const molecule::constantProperties& constPropI(constProps(idI));
|
||||
const polyatomic::constantProperties& constPropI(constProps(idI));
|
||||
|
||||
const molecule::constantProperties& constPropJ(constProps(idJ));
|
||||
const polyatomic::constantProperties& constPropJ(constProps(idJ));
|
||||
|
||||
List<label> siteIdsI = constPropI.siteIds();
|
||||
|
||||
@ -207,14 +207,14 @@ inline bool Foam::moleculeCloud::evaluatePotentialLimit
|
||||
|
||||
if (rsIsJMag < SMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::removeHighEnergyOverlaps()")
|
||||
WarningIn("polyatomicCloud::removeHighEnergyOverlaps()")
|
||||
<< "Molecule site pair closer than "
|
||||
<< SMALL
|
||||
<< ": mag separation = " << rsIsJMag
|
||||
<< ". These may have been placed on top of each"
|
||||
<< " other by a rounding error in mdInitialise in"
|
||||
<< " parallel or a block filled with molecules"
|
||||
<< " twice. Removing one of the molecules."
|
||||
<< " parallel or a block filled with polyatomics"
|
||||
<< " twice. Removing one of the polyatomics."
|
||||
<< endl;
|
||||
|
||||
return true;
|
||||
@ -256,14 +256,14 @@ inline bool Foam::moleculeCloud::evaluatePotentialLimit
|
||||
|
||||
if (rsIsJMag < SMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::removeHighEnergyOverlaps()")
|
||||
WarningIn("polyatomicCloud::removeHighEnergyOverlaps()")
|
||||
<< "Molecule site pair closer than "
|
||||
<< SMALL
|
||||
<< ": mag separation = " << rsIsJMag
|
||||
<< ". These may have been placed on top of each"
|
||||
<< " other by a rounding error in mdInitialise in"
|
||||
<< " parallel or a block filled with molecules"
|
||||
<< " twice. Removing one of the molecules."
|
||||
<< " parallel or a block filled with polyatomics"
|
||||
<< " twice. Removing one of the polyatomics."
|
||||
<< endl;
|
||||
|
||||
return true;
|
||||
@ -295,7 +295,7 @@ inline bool Foam::moleculeCloud::evaluatePotentialLimit
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector Foam::moleculeCloud::equipartitionLinearVelocity
|
||||
inline Foam::vector Foam::polyatomicCloud::equipartitionLinearVelocity
|
||||
(
|
||||
scalar temperature,
|
||||
scalar mass
|
||||
@ -310,10 +310,10 @@ inline Foam::vector Foam::moleculeCloud::equipartitionLinearVelocity
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector Foam::moleculeCloud::equipartitionAngularMomentum
|
||||
inline Foam::vector Foam::polyatomicCloud::equipartitionAngularMomentum
|
||||
(
|
||||
scalar temperature,
|
||||
const molecule::constantProperties& cP
|
||||
const polyatomic::constantProperties& cP
|
||||
)
|
||||
{
|
||||
scalar sqrtKbT = sqrt(physicoChemical::k.value()*temperature);
|
||||
@ -341,47 +341,47 @@ inline Foam::vector Foam::moleculeCloud::equipartitionAngularMomentum
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::polyMesh& Foam::moleculeCloud::mesh() const
|
||||
inline const Foam::polyMesh& Foam::polyatomicCloud::mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::potential& Foam::moleculeCloud::pot() const
|
||||
inline const Foam::potential& Foam::polyatomicCloud::pot() const
|
||||
{
|
||||
return pot_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::DynamicList<Foam::molecule*> >&
|
||||
Foam::moleculeCloud::cellOccupancy() const
|
||||
inline const Foam::List<Foam::DynamicList<Foam::polyatomic*> >&
|
||||
Foam::polyatomicCloud::cellOccupancy() const
|
||||
{
|
||||
return cellOccupancy_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::InteractionLists<Foam::molecule>&
|
||||
Foam::moleculeCloud::il() const
|
||||
inline const Foam::InteractionLists<Foam::polyatomic>&
|
||||
Foam::polyatomicCloud::il() const
|
||||
{
|
||||
return il_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::List<Foam::molecule::constantProperties>
|
||||
Foam::moleculeCloud::constProps() const
|
||||
inline const Foam::List<Foam::polyatomic::constantProperties>
|
||||
Foam::polyatomicCloud::constProps() const
|
||||
{
|
||||
return constPropList_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::molecule::constantProperties&
|
||||
Foam::moleculeCloud::constProps(label id) const
|
||||
inline const Foam::polyatomic::constantProperties&
|
||||
Foam::polyatomicCloud::constProps(label id) const
|
||||
{
|
||||
return constPropList_[id];
|
||||
}
|
||||
|
||||
|
||||
inline Foam::Random& Foam::moleculeCloud::rndGen()
|
||||
inline Foam::Random& Foam::polyatomicCloud::rndGen()
|
||||
{
|
||||
return rndGen_;
|
||||
}
|
||||
Reference in New Issue
Block a user