mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
New MD tutorials.
This commit is contained in:
10
tutorials/discreteMethods/molecularDynamics/mdFoam/Allclean
Executable file
10
tutorials/discreteMethods/molecularDynamics/mdFoam/Allclean
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cd nanoNozzle
|
||||
rm -rf constant/polyMesh/sets
|
||||
rm -rf processor[0-9]
|
||||
cleanCase
|
||||
cd ..
|
||||
19
tutorials/discreteMethods/molecularDynamics/mdFoam/Allrun
Executable file
19
tutorials/discreteMethods/molecularDynamics/mdFoam/Allrun
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application="mdFoam"
|
||||
|
||||
cd nanoNozzle
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication decomposePar
|
||||
hostname > system/machines
|
||||
|
||||
runParallel mdInitialise 4 system/machines
|
||||
runParallel $application 4 system/machines
|
||||
|
||||
runApplication reconstructPar
|
||||
cd ..
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object moleculeProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
water
|
||||
{
|
||||
siteIds (H H O M);
|
||||
pairPotentialSiteIds (O);
|
||||
siteReferencePositions
|
||||
(
|
||||
(7.56950327263661e-11 5.85882276618295e-11 0)
|
||||
(-7.56950327263661e-11 5.85882276618295e-11 0)
|
||||
(0 0 0)
|
||||
(0 1.5e-11 0)
|
||||
);
|
||||
siteMasses
|
||||
(
|
||||
1.67353255e-27
|
||||
1.67353255e-27
|
||||
2.6560176e-26
|
||||
0
|
||||
);
|
||||
siteCharges
|
||||
(
|
||||
8.3313177324e-20
|
||||
8.3313177324e-20
|
||||
0
|
||||
-1.66626354648e-19
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,118 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 3.2e-9;
|
||||
|
||||
vertices
|
||||
(
|
||||
(0 0 0)
|
||||
(3.5 0 0)
|
||||
(3.5 3 0)
|
||||
(0 3 0)
|
||||
(0 0 3)
|
||||
(3.5 0 3)
|
||||
(3.5 3 3)
|
||||
(0 3 3)
|
||||
(7.5 1 0.5)
|
||||
(7.5 2 0.5)
|
||||
(7.5 1 2.5)
|
||||
(7.5 2 2.5)
|
||||
(10 1 0.5)
|
||||
(10 2 0.5)
|
||||
(10 1 2.5)
|
||||
(10 2 2.5)
|
||||
(11.5 0.5 -0.5)
|
||||
(11.5 2.5 -0.5)
|
||||
(11.5 0.5 3.5)
|
||||
(11.5 2.5 3.5)
|
||||
(16 0.5 -0.5)
|
||||
(16 2.5 -0.5)
|
||||
(16 0.5 3.5)
|
||||
(16 2.5 3.5)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) sectionA (20 16 16) simpleGrading (1 1 1)
|
||||
hex (1 8 9 2 5 10 11 6) sectionA (20 16 16) simpleGrading (1 1 1)
|
||||
hex (8 12 13 9 10 14 15 11) sectionB (29 16 16) simpleGrading (1 1 1)
|
||||
hex (12 16 17 13 14 18 19 15) sectionC (17 16 16) simpleGrading (1 1 1)
|
||||
hex (16 20 21 17 18 22 23 19) sectionC (20 16 16) simpleGrading (1 1 1)
|
||||
);
|
||||
|
||||
edges
|
||||
();
|
||||
|
||||
patches
|
||||
(
|
||||
patch
|
||||
sectionAEnd
|
||||
(
|
||||
(0 4 7 3)
|
||||
)
|
||||
|
||||
wall
|
||||
sectionCEnd
|
||||
(
|
||||
(20 21 23 22)
|
||||
)
|
||||
|
||||
wall
|
||||
front
|
||||
(
|
||||
(0 1 5 4)
|
||||
(1 8 10 5)
|
||||
(8 12 14 10)
|
||||
(12 16 18 14)
|
||||
(16 20 22 18)
|
||||
)
|
||||
|
||||
wall
|
||||
back
|
||||
(
|
||||
(2 3 7 6)
|
||||
(2 6 11 9)
|
||||
(9 11 15 13)
|
||||
(13 15 19 17)
|
||||
(17 19 23 21)
|
||||
)
|
||||
|
||||
wall
|
||||
top
|
||||
(
|
||||
(4 5 6 7)
|
||||
(5 10 11 6)
|
||||
(10 14 15 11)
|
||||
(14 18 19 15)
|
||||
(18 22 23 19)
|
||||
)
|
||||
|
||||
wall
|
||||
bottom
|
||||
(
|
||||
(0 3 2 1)
|
||||
(1 2 9 8)
|
||||
(8 9 13 12)
|
||||
(12 13 17 16)
|
||||
(16 17 21 20)
|
||||
)
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,58 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
location "constant/polyMesh";
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
6
|
||||
(
|
||||
sectionAEnd
|
||||
{
|
||||
type patch;
|
||||
nFaces 256;
|
||||
startFace 77760;
|
||||
}
|
||||
sectionCEnd
|
||||
{
|
||||
type wall;
|
||||
nFaces 256;
|
||||
startFace 78016;
|
||||
}
|
||||
front
|
||||
{
|
||||
type wall;
|
||||
nFaces 1696;
|
||||
startFace 78272;
|
||||
}
|
||||
back
|
||||
{
|
||||
type wall;
|
||||
nFaces 1696;
|
||||
startFace 79968;
|
||||
}
|
||||
top
|
||||
{
|
||||
type wall;
|
||||
nFaces 1696;
|
||||
startFace 81664;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
nFaces 1696;
|
||||
startFace 83360;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,47 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 1e-10;
|
||||
|
||||
deltaT 1e-15;
|
||||
|
||||
writeControl runTime;
|
||||
|
||||
writeInterval 2e-13;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 12;
|
||||
|
||||
writeCompression uncompressed;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep no;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.3 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method metis;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (1 1 1);
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
}
|
||||
|
||||
metisCoeffs
|
||||
{
|
||||
processorWeights
|
||||
(
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "";
|
||||
}
|
||||
|
||||
distributed no;
|
||||
|
||||
roots
|
||||
(
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default none;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,19 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object mdEquilibrationDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
targetTemperature 298;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,85 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.3 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object molConfigDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Euler angles, expressed in degrees as phi, theta, psi, see
|
||||
// http://mathworld.wolfram.com/EulerAngles.html
|
||||
|
||||
sectionA
|
||||
{
|
||||
massDensity 980;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
(
|
||||
water
|
||||
);
|
||||
tetherSiteIds ();
|
||||
latticePositions
|
||||
(
|
||||
(0 0 0)
|
||||
);
|
||||
anchor (0 0 0);
|
||||
orientationAngles (0 0 0);
|
||||
latticeCellShape (1 1 1);
|
||||
}
|
||||
|
||||
sectionB
|
||||
{
|
||||
massDensity 980;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
(
|
||||
water
|
||||
);
|
||||
tetherSiteIds ();
|
||||
latticePositions
|
||||
(
|
||||
(0 0 0)
|
||||
);
|
||||
anchor (0 0 0);
|
||||
orientationAngles (0 0 0);
|
||||
latticeCellShape (1 1 1);
|
||||
}
|
||||
|
||||
sectionC
|
||||
{
|
||||
massDensity 980;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
(
|
||||
water
|
||||
);
|
||||
tetherSiteIds ();
|
||||
latticePositions
|
||||
(
|
||||
(0 0 0)
|
||||
);
|
||||
anchor (0 0 0);
|
||||
orientationAngles (0 0 0);
|
||||
latticeCellShape (1 1 1);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,118 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object potentials;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Subdictionaries specifying types of intermolecular potential.
|
||||
// Sub-sub dictionaries specify the potentials themselves.
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Removal order
|
||||
|
||||
// This is the order in which to remove overlapping pairs if more than one
|
||||
// type of molecule is present. The most valuable molecule type is at the
|
||||
// right hand end, the molecule that will be removed 1st is 1st on the list.
|
||||
// Not all types need to be present, a molecule that is not present is
|
||||
// automatically less valuable than any on the list. For molecules of the
|
||||
// same type there is no control over which is removed.
|
||||
|
||||
removalOrder ( water );
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Potential Energy Limit
|
||||
|
||||
// Maximum permissible pair energy allowed at startup. Used to remove
|
||||
// overlapping molecules created during preprocessing.
|
||||
|
||||
potentialEnergyLimit 1e-18;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Pair potentials
|
||||
|
||||
// If a pair are not present here it is assumed that they do not interact.
|
||||
|
||||
// Electrostatic pair interactions are not listed here - they are handled
|
||||
// separately.
|
||||
|
||||
// If there are r different type of molecules, and a pair force is required
|
||||
// between all combinations, then there are C = r(r+1)/2 combinations,
|
||||
// i.e. for r = {1,2,3,4}, C = {1,3,6,10} (sum of triangular numbers).
|
||||
|
||||
// Pair potentials are specified by the combinaition of their ids,
|
||||
// for MOLA and MOLB, "MOLA-MOLB" OR "MOLB-MOLA" is acceptable
|
||||
// (strictly OR, both or neither will throw an error)
|
||||
|
||||
pair
|
||||
{
|
||||
O-O
|
||||
{
|
||||
pairPotential lennardJones;
|
||||
rCut 1.0e-9;
|
||||
rMin 0.1e-9;
|
||||
dr 1e-13;
|
||||
lennardJonesCoeffs
|
||||
{
|
||||
sigma 3.154e-10;
|
||||
epsilon 1.07690722e-21;
|
||||
}
|
||||
energyScalingFunction noScaling;
|
||||
writeTables yes;
|
||||
}
|
||||
|
||||
electrostatic
|
||||
{
|
||||
pairPotential dampedCoulomb;
|
||||
rCut 1e-9;
|
||||
rMin 2e-11;
|
||||
dr 2e-12;
|
||||
dampedCoulombCoeffs
|
||||
{
|
||||
alpha 2e9;
|
||||
}
|
||||
energyScalingFunction shiftedForce;
|
||||
writeTables yes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Tethering Potentials
|
||||
|
||||
tether
|
||||
{
|
||||
O
|
||||
{
|
||||
tetherPotential restrainedHarmonicSpring;
|
||||
restrainedHarmonicSpringCoeffs
|
||||
{
|
||||
springConstant 0.277;
|
||||
rR 1.2e-9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// External Forces
|
||||
|
||||
// Bulk external forces (namely gravity) will be specified as forces rather
|
||||
// than potentials to allow their direction to be controlled.
|
||||
|
||||
external
|
||||
{
|
||||
gravity (0 0 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user