Prescribing temperature profile in a system using langevin thermostat

Hi all,

I have a general question. Is it possible to prescribe a spatial temperature profile in a relatively large system using langevin thermostat? I have implemented and tested this in a small system using multiple groups (~30) but due to max. group limitation of 32, the method cannot be extended to larger systems. If you have any suggestions, please comment.

I think the best way would be to have a 'fix chunk’ available similar to compute chunk to enable binning of the system (at desired refinement) and then defining the spatial temperature profile and implementing a fixed langevin thermostat. Is it a good idea to submit this as a LAMMPS feature request? Please let me know your thoughts.

Thank you,


the best way to establish a temperature profile in LAMMPS is to use thermostat biasing, e.g. using compute temp/profile.
no groups or chunks needed. details are in the documentation.


Hi Alex,

Thanks for the reply. However, I don’t see how compute temp/profile is going to be of help (I looked at the documentation). Sorry if I was not clear but what I want to achieve is a spatially varying temperature in a system. For example, T0+ DT sin(2pix/L) where T0 is the mean temperature and DT is the amplitude of sinusoidally varying temperature of the system use a Langevin thermostat. Do you think it is possible using existing features in LAMMPS and if so can you give some details?


i was mentioning compute temp/profile only as an example since you didn’t give any specifics of what kind of temperature profile you are looking for.

in this specific case, you could be using two thermostat fixes and two regions, each a union of multiple (narrow) box regions and one corresponding to the “hot” part and the other to the “cold” part. by adjusting how wide the regions are and how much space between them, you could adjust the shape of the profile somewhat. by using regions instead of groups, there is no limit as to how many you define, but since you want a regular sinusoidal shape, you would just need two regions.



Perfect! Thanks for the help, Axel.


The fix langevin command also allows for definition of a spatial- and/or time-dependent
variable as its target temperature. For spatial dependence, the formula you
define can use each atom’s coordinates to effectively set the target
temperature for that atom to a different value depending on where it
is in the simulation box.