Dear Ander Bloms,
It's for simulating Joule's heating in a small region.
I would love to share but I am still improving upon the code. I am not able to maintain temperature properly. I used manual code in hook method but I was thinking if I could utilize velocity distribution from class MaxwellBoltzmannDistribution in QuantumATK. I have been trying to obtain velocities from this distribution but i run into errors.
Can you help me with that? I am trying to set velocities using this method for a configuration but it runs into error. Kindly help in this case.
Also, is there a direct way to extract say 10 random velocities from class MaxwellBoltzmannDistribution?
# %% Molybdenite (1)
# Set up lattice
lattice = Hexagonal(3.1604*Angstrom, 12.295*Angstrom)
# Define elements
elements = [Molybdenum, Sulfur, Molybdenum]
# Define coordinates
fractional_coordinates = [[ 0.333333333333, 0.666666666667, 0.25 ],
[ 0.666666666667, 0.333333333333, 0.121 ],
[ 0.666666666667, 0.333333333333, 0.379 ]]
# Set up configuration
molybdenite_1 = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates,
)
molybdenite_1_name = "molybdenite_1"
molybdenite_1.setVelocities(
velocities=MaxwellBoltzmannDistribution(
temperature=300*Kelvin
)
)
This is a special use case, normally the MaxwellBoltzmannDistribution is passed as an argument to the molecular dynamics algorithm, not the configuration itself. But it can be done, like so:
mb = MaxwellBoltzmannDistribution(temperature=300*Kelvin)
mb._applyToConfiguration(molybdenite_1)
However, if you anyway intend to run MD on this, you don't need to set velocities on the atoms, just tell the MD algorithm to use the Maxwell Boltzmann distribution for initial velocities.