Extract energy changes due to two different thermostats

I am running NEMD simulation of a nanochannel where the fluid is flowing in-between two solid walls. Two Nose-Hoover thermostats (NVT) are applied on two separate sections of the wall, one at a higher temperature and the other lower. The NVT fixes have their own individual IDs, and I am trying to extract how much energy each of them exchanges with the system. One similar output might be “ecouple” from thermo_style command, but it gives accumulative energy change for the whole system due to thermostating instead of each individual thermostat. Is there a similar command that give such an output for two separate fixes?

From this page:

The cumulative energy change in the system imposed by these fixes, via either thermostatting and/or barostatting, is included in the thermodynamic output keywords ecouple and econserve. See the thermo_style page for details.

These fixes compute a global scalar which can be accessed by various output commands. The scalar is the same cumulative energy change due to this fix described in the previous paragraph. The scalar value calculated by this fix is “extensive”.

2 Likes

I understand that the total energy can be extracted using ecouple or econserve for the entire system. Is there a way to extract the values for each individual thermostat if there are two fixed in different locations?

Please look at the note that @simongravelle copied more carefully! The second paragraph explains exactly that. Note the highlighting.

1 Like

As an explicit hint, if your thermostats are

fix cold_thermostat cold_group nvt ...
fix warm_thermostat warm_group nvt ...

then a command like

thermo_style custom ... f_cold_thermostat f_warm_thermostat ...

will include the fix scalars in thermo output.

See: 8.3.1. Output from LAMMPS (thermo, dumps, computes, fixes, variables) — LAMMPS documentation for more info.

1 Like

Thank you so much! This is exactly what I am looking for. I will try this command.