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