Skip to content

Commit

Permalink
Merge pull request #232 from ls1mardyn/classicScenarios
Browse files Browse the repository at this point in the history
Classic scenarios
  • Loading branch information
FG-TUM authored Mar 2, 2023
2 parents 610fcba + 2d444be commit b6f274e
Show file tree
Hide file tree
Showing 18 changed files with 1,134 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ src/MarDyn_*.*
*.a
*.so
doxygen_doc/
__pycache__/
31 changes: 31 additions & 0 deletions examples/DropletCoalescence/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Droplet Coalescence

## Description
Two spherical liquid droplets (of argon) are suspended in vapour next to each other. Particle attractions cause the droplets to attract each other and slowly coalesce into a single droplet. The two droplets initially form a bridge between them, which eventually grows and subsumes the droplets.

## Steps
1. `config_1_generateLiq.xml` : Create a liquid argon cube and equilibrate it, saving as a checkpoint.
2. `config_2_replicateLiq.xml` : Take the checkpoint from step 1, replicate it to form a larger liquid body, and equilibrate it to smooth out the edges and create a checkpoint.
3. `config_3_generateVap.xml` : Create a vapour argon cube and equilibrate it, saving as a checkpoint.
4. `config_4_replicateVap.xml` : Take the checkpoint from step 3, replicate it to form a larger vapour body, and equilibrate it to smooth out the edges and create a checkpoint.
5. `config_5_droplet.xml` : Generate the final scenario, by copying the checkpoint from step 4 to create a large vapour box, and then creating two spherical voids inside the box and inserting liquid fron step 2's checkpoint. From here the simulation can be run for as long as required.

## Variability
The droplet size can be any desired size, achieved by editing the values in config_5. However the densities for the fluid and vapour will vary for different droplet sizes, so config_1 and config_3 would need to be rerun with new densities. A python script to calculate densities can be found in tools/scenario-helper/droplet_density_calc.py. The script uses formulae established in reference 1.

These are some common values for quick lookup.
| Diameter | Liquid Density | Vapour Density |
|----------|----------------|----------------|
| 50 nm | 0.0188022 | 0.000515 |
| 100 nm | 0.018778 | 0.000506 |
| 200 nm | 0.0187650 | 0.000501 |

## Notes
- The checkpoint reading process in config_5 is very memory intensive, since all the particles are read into rank 1 of the simulation and hence may cause the node to run out of memory. A scenario size of 4k x 6k x 4k fails on both HPE HAWK and Supercomputer Fugaku with a single node.
- When the liquid droplet is first placed into the spherical void, the sphere surface shows some oscillatory behaviour that is not observed in real life experiments. This is because the liquid boundary is not pre-equilibrated with the vapour. A more realistic scenario is being worked on, where a vapour box is created by deleting particles from a liquid box, keeping a liquid droplet in the centre intact.

## Publications
Refer to the following for more information:
- [1] Vrabec, J., Kedia, G. K., Fuchs, G., & Hasse, H. (2006). Comprehensive study of the vapour–liquid coexistence of the truncated and shifted Lennard–Jones fluid including planar and spherical interface properties. Molecular physics, 104(09), 1509-1527.
- [2] Seckler, S., Gratl, F., Heinen, M., Vrabec, J., Bungartz, H. J., & Neumann, P. (2021). AutoPas in ls1 mardyn: Massively parallel particle simulations with node-level auto-tuning. Journal of Computational Science, 50, 101296.
- [3] Heinen, M., Hoffmann, M., Diewald, F., Seckler, S., Langenbach, K., & Vrabec, J. (2022). Droplet coalescence by molecular dynamics and phase-field modeling. Physics of Fluids, 34(4), 042006.
35 changes: 35 additions & 0 deletions examples/DropletCoalescence/components.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version='1.0' encoding='UTF-8'?>

<components>

<moleculetype id="1" name="Argon">
<site type="LJ126" id="1" >
<coords> <x>0.0</x> <y>0.0</y> <z>0.0</z> </coords>
<mass>39.948</mass>
<sigma>3.3916</sigma>
<epsilon>137.90</epsilon>
<shifted>1</shifted>
</site>
<momentsofinertia rotaxes="xyz" >
<Ixx>0.0</Ixx>
<Iyy>0.0</Iyy>
<Izz>0.0</Izz>
</momentsofinertia>
</moleculetype>

<moleculetype id="2" name="Argon">
<site type="LJ126" id="1" >
<coords> <x>0.0</x> <y>0.0</y> <z>0.0</z> </coords>
<mass>39.948</mass>
<sigma>3.3916</sigma>
<epsilon>137.90</epsilon>
<shifted>1</shifted>
</site>
<momentsofinertia rotaxes="xyz" >
<Ixx>0.0</Ixx>
<Iyy>0.0</Iyy>
<Izz>0.0</Izz>
</momentsofinertia>
</moleculetype>

</components>
144 changes: 144 additions & 0 deletions examples/DropletCoalescence/liq/config_1_generateLiq.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version='1.0' encoding='UTF-8'?>
<mardyn version="20100525" >

<refunits type="SI" >
<length unit="nm">0.1</length>
<mass unit="u">1</mass>
<energy unit="K">1</energy>
</refunits>

<simulation type="MD" >
<integrator type="Leapfrog" >
<timestep unit="reduced" >0.00182367</timestep>
</integrator>

<run>
<currenttime>0.0</currenttime>
<production>
<steps>5000</steps>
</production>
</run>

<ensemble type="NVT">
<!-- Nparticles determined by the input file -->
<temperature unit="reduced" >110</temperature>
<domain type="box">
<lx>100</lx>
<ly>100</ly>
<lz>100</lz>
</domain>

<components>
<include query="/components/moleculetype" >../components.xml</include>
<include query="/mixing/rule">../mixing_2c.xml</include>
</components>

<phasespacepoint>
<generator name="MultiObjectGenerator">
<objectgenerator>
<filler type="GridFiller">
<lattice system="cubic" centering="face">
<vec id="a"> <x>1</x> <y>0</y> <z>0</z> </vec>
<vec id="b"> <x>0</x> <y>1</y> <z>0</z> </vec>
<vec id="c"> <x>0</x> <y>0</y> <z>1</z> </vec>
</lattice>
<basis>
<site>
<componentid>0</componentid>
<coordinate> <x>0.5</x> <y>0.5</y> <z>0.5</z> </coordinate>
</site>
</basis>
<latticeOccupancy>1</latticeOccupancy>
<density>0.0187650</density>
</filler>
<object type="Cuboid">
<lower> <x>0</x> <y>0</y> <z>0</z> </lower>
<upper> <x>100</x> <y>100</y> <z>100</z> </upper>
</object>
<!-- <velocityAssigner type="MaxwellVelocityDistribution"></velocityAssigner>-->
<velocityAssigner type="EqualVelocityDistribution"></velocityAssigner>
</objectgenerator>
</generator>
</phasespacepoint>
</ensemble>

<algorithm>
<parallelisation type="DomainDecomposition"></parallelisation>
<!--
<parallelisation type="KDDecomposition">
<CommunicationScheme>direct</CommunicationScheme>
<updateFrequency>100000</updateFrequency>
<fullSearchThreshold>3</fullSearchThreshold>
<splitBiggestDimension>0</splitBiggestDimension>
<useVectorizationTuner>0</useVectorizationTuner>
<generateNewFiles>0</generateNewFiles>
<useExistingFiles>0</useExistingFiles>
</parallelisation>
-->
<datastructure type="LinkedCells">
<cellsInCutoffRadius>1</cellsInCutoffRadius>
</datastructure>
<cutoffs type="CenterOfMass" >
<defaultCutoff unit="reduced" >8.479</defaultCutoff>
<radiusLJ unit="reduced" >8.479</radiusLJ>
</cutoffs>
<electrostatic type="ReactionField" >
<epsilon>1.0e+10</epsilon>
</electrostatic>
</algorithm>

<output>
<outputplugin name="CheckpointWriter">
<type>binary</type>
<writefrequency>5000</writefrequency>
<outputprefix>cp_binary_genLiq</outputprefix>
</outputplugin>

<outputplugin name="MaxWriter">
<writefrequency>5000</writefrequency>
<outputprefix>maxvals</outputprefix>
</outputplugin>
<!--
<outputplugin name="MmpldWriter" type="simple">
<include query="/spheres" >../../xml/sphereparams_2c.xml</include>
<writecontrol>
<start>0</start>
<writefrequency>50</writefrequency>
<stop>50000</stop>
<framesperfile>0</framesperfile>
</writecontrol>
<outputprefix>megamol</outputprefix>
</outputplugin>
-->
<!--
<outputplugin name="SysMonOutput">
<expression label="LoadAvg1">procloadavg:loadavg1</expression>
<expression label="Free+BufferRAM [MB]">sysinfo:freeram sysinfo:bufferram + sysinfo:mem_unit * float 1048576 /</expression>
<writefrequency>100000</writefrequency>
</outputplugin>
-->
</output>

<!--
<plugin name="MaxCheck">
<control>
<start>0</start>
<frequency>1</frequency>
<stop>500</stop>
</control>
<targets>
<target cid="1" method="2">
<Fmax>10000</Fmax>
<vmax>20.</vmax>
</target>
<target cid="2" method="2">
<Fmax>10000</Fmax>
<vmax>20.</vmax>
</target>
</targets>
</plugin>
-->

</simulation>

</mardyn>
145 changes: 145 additions & 0 deletions examples/DropletCoalescence/liq/config_2_replicateLiq.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<?xml version='1.0' encoding='UTF-8'?>
<mardyn version="20100525" >

<refunits type="SI" >
<length unit="nm">0.1</length>
<mass unit="u">1</mass>
<energy unit="K">1</energy>
</refunits>

<simulation type="MD" >
<integrator type="Leapfrog" >
<timestep unit="reduced" >0.00182367</timestep>
</integrator>

<run>
<currenttime>0.0</currenttime>
<production>
<steps>500</steps>
</production>
</run>

<ensemble type="NVT">
<!-- Nparticles determined by the input file -->
<temperature unit="reduced" >110</temperature>
<domain type="box">
<lx>500</lx>
<ly>500</ly>
<lz>500</lz>
</domain>

<components>
<include query="/components/moleculetype" >../components.xml</include>
<include query="/mixing/rule">../mixing_2c.xml</include>
</components>

<phasespacepoint>
<generator name="MultiObjectGenerator">
<objectgenerator>
<filler type="ReplicaFiller">
<input type="BinaryReader">
<header>cp_binary_genLiq-1.restart.header.xml</header>
<data>cp_binary_genLiq-1.restart.dat</data>
</input>
</filler>

<object type="Cuboid">
<lower> <x>0</x> <y>0</y> <z>0</z> </lower>
<upper> <x>500</x> <y>500</y> <z>500</z> </upper>
</object>
</objectgenerator>
</generator>
<ignoreCheckpointTime>true</ignoreCheckpointTime>
</phasespacepoint>

</ensemble>

<!--
<NEMD>
<include query="/NEMD/feature">NEMD.xml</include>
</NEMD>
-->

<algorithm>

<parallelisation type="DomainDecomposition"></parallelisation>
<!--
<parallelisation type="KDDecomposition">
<CommunicationScheme>direct</CommunicationScheme>
<updateFrequency>100000</updateFrequency>
<fullSearchThreshold>3</fullSearchThreshold>
<splitBiggestDimension>0</splitBiggestDimension>
<useVectorizationTuner>0</useVectorizationTuner>
<generateNewFiles>0</generateNewFiles>
<useExistingFiles>0</useExistingFiles>
</parallelisation>
-->
<datastructure type="LinkedCells">
<cellsInCutoffRadius>1</cellsInCutoffRadius>
</datastructure>
<cutoffs type="CenterOfMass" >
<defaultCutoff unit="reduced" >8.479</defaultCutoff>
<radiusLJ unit="reduced" >8.479</radiusLJ>
</cutoffs>
<electrostatic type="ReactionField" >
<epsilon>1.0e+10</epsilon>
</electrostatic>
</algorithm>

<output>
<outputplugin name="CheckpointWriter">
<type>binary</type>
<writefrequency>500</writefrequency>
<outputprefix>cp_binary_repLiq</outputprefix>
</outputplugin>

<!--
<outputplugin name="ResultWriter">
<writefrequency>10000</writefrequency>
<outputprefix>result</outputprefix>
</outputplugin>
-->
<!--
<outputplugin name="MmpldWriter" type="simple">
<include query="/spheres" >../../sphereparams.xml</include>
<writecontrol>
<start>0</start>
<writefrequency>100</writefrequency>
<stop>500</stop>
<framesperfile>0</framesperfile>
</writecontrol>
<outputprefix>megamol</outputprefix>
</outputplugin>
-->
<!--
<outputplugin name="SysMonOutput">
<expression label="LoadAvg1">procloadavg:loadavg1</expression>
<expression label="Free+BufferRAM [MB]">sysinfo:freeram sysinfo:bufferram + sysinfo:mem_unit * float 1048576 /</expression>
<writefrequency>100000</writefrequency>
</outputplugin>
-->
</output>

<plugin name="MaxCheck">
<control>
<start>0</start>
<frequency>1</frequency>
<stop>500</stop>
</control>
<targets>
<target cid="1" method="2">
<Fmax>10000</Fmax>
<vmax>2.</vmax>
<!-- <vmax>2.874156111274848</vmax> -->
</target>
<target cid="2" method="2">
<Fmax>10000</Fmax>
<vmax>2.</vmax>
<!-- <vmax>2.874156111274848</vmax> -->
</target>
</targets>
</plugin>

</simulation>

</mardyn>
7 changes: 7 additions & 0 deletions examples/DropletCoalescence/mixing_2c.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<mixing>
<rule type="LB" cid1="1" cid2="2">
<eta>1.0</eta>
<xi>1.0</xi>
</rule>
</mixing>
Loading

0 comments on commit b6f274e

Please sign in to comment.