ExternalTemperature does not work like ExternalPressure

Started by neumannrf, August 09, 2021, 06:26:24 PM

Previous topic - Next topic

neumannrf

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

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

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

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.

h1h2x3

Quote from: David Dubbeldam 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.

Dear David:
  If I want to simulate the desorption, can I realize it by set a  pressure list like 100000 10000 1000...? Thank you.

David Dubbeldam

Yes, that is the standard way of simulation desorption. Note that is best to start from an equilibrated restart-file at the highest pressure (usually obtained from the adsorption branch).