Rolling back MD modifications to master branch.

This commit is contained in:
graham
2011-07-07 13:30:42 +01:00
parent 391f0d3b54
commit 4da50ebb91
98 changed files with 7298 additions and 237 deletions

View File

@ -0,0 +1,3 @@
mdEquilibrationFoam.C
EXE = $(FOAM_APPBIN)/mdEquilibrationFoam

View File

@ -0,0 +1,15 @@
EXE_INC = \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
-llagrangian \
-lmolecule \
-lpotential \
-lmolecularMeasurements

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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/>.
Application
mdEquilibrationFoam
Description
Equilibrates and/or preconditions molecular dynamics systems
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "md.H"
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.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"
#include "readmdEquilibrationDict.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"
#include "temperatureEquilibration.H"
runTime.write();
if (runTime.outputTime())
{
nAveragingSteps = 0;
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,18 @@
Info<< nl << "Reading MD Equilibration Dictionary" << nl << endl;
IOdictionary mdEquilibrationDict
(
IOobject
(
"mdEquilibrationDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
scalar targetTemperature = readScalar
(
mdEquilibrationDict.lookup("targetTemperature")
);

View File

@ -1,9 +1,7 @@
EXE_DEBUG = -DFULLDEBUG -g -O0
EXE_INC = \
${EXE_DEBUG} \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
@ -13,4 +11,5 @@ EXE_LIBS = \
-lfiniteVolume \
-llagrangian \
-lmolecule \
-lpotential
-lpotential \
-lmolecularMeasurements

View File

@ -30,31 +30,60 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "monoatomicCloud.H"
#include "polyatomicCloud.H"
#include "md.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;
monoatomics.evolve();
molecules.evolve();
polyatomics.evolve();
#include "meanMomentumEnergyAndNMols.H"
#include "temperatureAndPressure.H"
runTime.write();
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
if (runTime.outputTime())
{
nAveragingSteps = 0;
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
@ -12,5 +13,6 @@ EXE_LIBS = \
-lfiniteVolume \
-llagrangian \
-lmolecule \
-lpotential
-lpotential \
-lmolecularMeasurements

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,9 +26,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "md.H"
#include "fvCFD.H"
#include "polyatomicCloud.H"
#include "monoatomicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,15 +50,11 @@ int main(int argc, char *argv[])
)
);
word polyCloudName("polyatomicCloud");
const dictionary& polyDict(mdInitialiseDict.subDict(polyCloudName));
IOdictionary polyIdListDict
IOdictionary idListDict
(
IOobject
(
polyCloudName + "_idList",
"idList",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
@ -67,88 +62,26 @@ int main(int argc, char *argv[])
)
);
potential polyPot
(
mesh,
polyDict,
IOdictionary
(
IOobject
(
polyCloudName + "Properties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
),
polyIdListDict
);
potential pot(mesh, mdInitialiseDict, idListDict);
polyatomicCloud poly
(
polyCloudName,
mesh,
polyPot,
polyDict
);
moleculeCloud molecules(mesh, pot, mdInitialiseDict);
Info<< nl << returnReduce(poly.size(), sumOp<label>()) << " added to "
<< poly.name()
label totalMolecules = molecules.size();
if (Pstream::parRun())
{
reduce(totalMolecules, sumOp<label>());
}
Info<< nl << "Total number of molecules added: " << totalMolecules
<< nl << endl;
word monoCloudName("monoatomicCloud");
const dictionary& monoDict(mdInitialiseDict.subDict(monoCloudName));
IOdictionary monoIdListDict
(
IOobject
(
monoCloudName + "_idList",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
)
);
potential monoPot
(
mesh,
monoDict,
IOdictionary
(
IOobject
(
monoCloudName + "Properties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
),
monoIdListDict
);
monoatomicCloud mono
(
monoCloudName,
mesh,
monoPot,
monoDict
);
Info<< nl << returnReduce(mono.size(), sumOp<label>()) << " added to "
<< mono.name()
<< nl << endl;
IOstream::defaultPrecision(15);
if (!mesh.write())
{
FatalErrorIn(args.executable())
<< "Failed writing."
<< "Failed writing moleculeCloud."
<< nl << exit(FatalError);
}