ls1mardyn / ls1-mardyn

ls1-MarDyn is a massively parallel Molecular Dynamics (MD) code for large systems. Its main target is the simulation of thermodynamics and nanofluidics. ls1-MarDyn is designed with a focus on performance and easy extensibility.
http://www.ls1-mardyn.de
Other
28 stars 15 forks source link

Mixing rules not implemented thoroughly #331

Closed HomesGH closed 2 months ago

HomesGH commented 2 months ago

Describe the bug The mixing rules are not really implemented user-friendly and could easily be set wrong by the user since the exact order matters. Also, there is something more to do, see here.

The variable _mixingrules is not really used but dmixcoeff is used instead. The latter is processed in Comp2Param.cpp but as the mixing coefficients xi and eta are just pushed back in the vector, the specified cid1 and cid2 are not considered in the processing.

A good solution would clean up everything and use something better than the vector of doubles (dmixcoeff) but an vector of mixing rules maybe (_mixingrules).

An easy solution would be to very strictly restrict the user input to match the processing algorithm.

To Reproduce Steps to reproduce the behavior:

  1. Enable this line to print xi and eta in Comp2Param.cpp
  2. Use at least 3 components to have more than 1 mixing rule
  3. Set mixing rules xi and eta in xml to different values for identification of single rules
  4. Set order to something like: cid1="2" cid2="3" and cid1="2" cid2="1" and cid1="1" cid2="3"
  5. Observe if xi and eta processed in Comp2Params.cpp match values of xml (Hint: They don't)

This issue was already addressed before, see

  1. 73

  2. 74

  3. 75

However, this description might be a bit cleaner and now up to date. There was an attempt for a fix #76 but not merged...