Author Topic: ExternalTemperature does not work like ExternalPressure  (Read 144 times)

neumannrf

  • Newbie
  • *
  • Posts: 8
    • View Profile
ExternalTemperature does not work like ExternalPressure
« on: August 09, 2021, 06:26:24 PM »
Hello everyone!

I noticed that although one can provide a list of reals as input to ExternalPressure, effectively simulating a full isotherm curve in a single run, the same is not true when it comes to ExternalTemperature.

Despite of what the RASPA manual says
  • ExternalTemperature [list-of-reals]
    The external temperature in Kelvin for each system. Because the system is in contact with this imaginary reservoir the average temperature of the system can be controlled. Default: 298K.
  • ExternalPressure [list-of-reals]
    The external pressure in Pascal for each system. Because the system is in contact with this imaginary reservoir the average pressure of the system can be controlled.
the temperature parsing code does not have the while loop to read the list of real numbers representing the temperature. See here: https://github.com/iRASPA/RASPA2/blob/master/src/input.c#L2171-L2193.

Do you know of an alternative way to run a full isobar curve in a single run?

David Dubbeldam

  • Full Member
  • ***
  • Posts: 176
    • View Profile
Re: ExternalTemperature does not work like ExternalPressure
« Reply #1 on: August 11, 2021, 09:00:28 AM »
You are correct (and the manual has an error). You can put a list of pressures in the input, but only one temperature.
In practice, using a list of pressures is a bad idea, unless you really want to compute adsorption+desorption and examine hysteresis. The downside is that all simulations have to be run sequentially.

In practice, people develop scripts to submit batch-scripts to submit large number of jobs (for example: for various MOFs, various temperatures, various molecules, compute the isotherm over a pressure range).

An an inspiration, see the example scrips in the 'scripts' directory of the RASPA source.
You fill in the top-part, run the script and it will generate the input-files. A second script will read the data out of the output-files and put in a more useful format that can be used for plotting.

neumannrf

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: ExternalTemperature does not work like ExternalPressure
« Reply #2 on: August 18, 2021, 02:25:44 PM »
Hi David! I am curious about why you consider providing a list of pressures to be a bad idea. Is that only because the simulations run sequentially rather than in parallel (as different jobs)?

I find it a great feature and I use it to run a full isotherm curve in a single execution. As I understand it from the output, it seems that each new pressure point already starts with the last loading of the previous pressure point. This helps a lot to speed up equilibration, specially at the highest pressures in the curve, as I am not starting from 0 molecules each time.

Were I to submit N independent simulations for N different pressure points, wouldn't I get the same result as running a single simulation with N pressure values? That, of course, provided I choose a long enough number of MC cycles.

David Dubbeldam

  • Full Member
  • ***
  • Posts: 176
    • View Profile
Re: ExternalTemperature does not work like ExternalPressure
« Reply #3 on: August 31, 2021, 08:35:10 PM »
Like you say, if simulation-time was not an issue, then starting from a previous point helps with equilibration. But the computational cost is large, especially for higher pressures. So by submitting them all in parallel, you can compute the full isotherm at the costs of the time of the largest loading. For sequential running, you will need to wait for the result of the previous pressure. So, especially for isotherm with say 10-20 points, running them in parallel really helps.