JuliaMolSim / Molly.jl

Molecular simulation in Julia
Other
372 stars 51 forks source link

Add custom Boltzmann's constant support #66

Closed noeblassel closed 2 years ago

noeblassel commented 2 years ago

This PR proposes letting the user specify a Boltzmann's constant when defining a System, allowing for reduced unit systems. The changes are the following

src/types.jl: Add a k field and K type parameter to the System struct Add logic for default behavior

src/spatial.jl: Let AtomsBase.velocity, velocity3D, velocity2D and maxwell_boltzmann take an additional parameter k modify random_velocities to use the system's boltzmann constant

src/coupling.jl: Fix velocity resampling to rely on the system's k

src/temperature.jl: Modify temperature to convert kinetic energy to temperature using on the system's k

test/basic.jl Modify basic tests of velocity generation

jgreener64 commented 2 years ago

:+1: