- Q:"When I run remody with a larger domain the program doesn't run and show me this message:"
CAN'T INSERT ELEMENT: Collection OF 99999 IS FULL
A: Increase the number of molecules above 100000 in <molecules>....</molecules> section of the config file (syngas.xml) You can estimate the number of molecules you should use from the ideal gas law, that is how many molecules you can have in the domain size you selected and increase that number by 10% to avoid that error condition above.
- Q: "How to make the code run faster?"
A: When you run the code check how much memory the program is using. For example, you can do it running 'top' from a terminal. If it is using less than 80%, then decrease the parameter inside <grid><cellsize>...</cellsize></grid> tag. This will make code run a bit faster but it will also increase the memory utilization. It may not even start if you decrease it too much. If the memory utilization is still less than 80%, you can keep decreasing that parameter. Do not decrease it below twice the size of the biggetst molecule in your composition.
- Q: "How do I restart the run?"
A: When the code is running it generates output files at regular time interval (physical time, that is) which is set inside <time><output>...</output></time> tag. The output is dumped to the gzipped-files named like remody-<timestamp>.dat.gz. To restart the run from the output file you should start the run as:
./remody -f configfile.xml remody-<timestamp>.dat.gz
- Q: "How do I produce time-curves of various parameters?"
A: You can produce time curves for such parameters as temperature (T), number of molecules in the domain (N), average energy per molecule (E), and various specie concentrations. For T,N, and E follow the procedure as described below, using the syntax with an equal sign (=), for species do not use equal sign as described in the following two questions.
- Q: "How do I construct the temperature curve?"
A: Run the readlog.py utility with the remody terminal output log file as input. For example, when you start the batch job, use the command like this:
./job -f config.xml > job.log &
This will dump temperature, concentrations, and other parameters into the job.log file every iteration. Then you can run the readlog.py utility to produce the temperature curve file from the log file, like:
python readlog.py T= < job.log > temp.dat
where the temp.dat file contains two columns of temperature versus time, which be displayed in gnuplot with a command like:
plot 'temp.dat' w l
- Q: "How do I construct specie concentration time curves?"
A: Do similarly as for the temperature curve above, except when running the readlog specify the specie chemical formula as provided in the input xml file, and do not use the equal sign (=) after the specie name as in the case above, like this:
python readlog.py CO2 < job.log > co2.dat
- Q: "How can I retrieve the results of simulation?"
A: Here is how you can produce the results from the simulation run. First check if the run is going with top:
This will show the table like this:
top - 04:29:40 up 42 days, 3:41, 2 users, load average: 1.03, 1.10, 1.20 There you can see that job is running. Quit it by pressing 'q'-key. Then check how far the run has gone:
Tasks: 126 total, 3 running, 123 sleeping, 0 stopped, 0 zombie
Cpu(s): 25.2us, 0.1sy, 0.0ni, 74.7id, 0.0wa, 0.0hi, 0.0si, 0.0st
Mem: 4031520k total, 3878180k used, 153340k free, 336828k buffers
Swap: 10241428k total, 1454736k used, 8786692k free, 552436k cached
PID USER PR NI VIRT RES SHR S CPU MEM TIME+ COMMAND
29283 rolando 25 0 3353m 2.0g 1336 R 100 52.8 9843:09 job
1 root 15 0 10308 596 544 S 0 0.0 0:04.77 init
tail -f syngas2.log
This will show the something like:
Time=6.103e-01 Step=2.439e-06 Memory=41% N=8279309 T=1039.63K E=1.188e-13J
H H2 OH H2O CH3 CH4
5.45126 31.48455 0.00104 18.91287 0.00041 13.87211
CO2 CO N2
8.70242 10.84918 10.72622
Note that syngas2.log file above was used because the job started with the command:
./job -f syngas2.xml job-4.dat.gz 1> syngas2.log 2> syngas2.err &
If you used a different log file you should use that one above. From the table you can see all the species currently in the simulation. Now you can quit tail -f with pressing ^C (Cntrl.C).
To produce the time sequence do this:
- Run this command:
python readlog.py H2 < syngas2.log > H2-time.dat
Note that readlog.py program is in your remody/util directory. This should create the H2-time.dat file.
- Check the file with gnuplot:
gnuplot> plot 'H2-time.dat' w l
And then you do the same for H2O, CO2, etc.
- Q: "How to produce a spatial distribution along one axis?"
- Check that you have the hist program in run directory: ls hist if you dont, compile it if necessary in your remody/util directory by running make and link it or copy into your run directory, like ln -s ../util/hist .
- Select the time step for which you want the distribution. For example, for 5 nanoseconds, you should use job-5.dat.gz file.
- Run the command:
gunzip job-5.dat.gz -c | grep H2 | grep -v H2O | cut -f 3 | ./hist > H2-5.dat
This will create the H2-5.dat file, which you can see with gnuplot as:
plot 'H2-5.dat' w l
Note, that the line above has 'grep -v H2O' part. This is needed to preclude all H2O molecules from the H2 list. Similarily, when you produce CO distribution, you should use:
gunzip job-5.dat.gz -c | grep CO | grep -v CO2 | cut -f 3 | ./hist > CO-5.dat
But to produce H2O or CO2 distributions, you should use:
gunzip job-5.dat.gz -c | grep H2O | cut -f 3 | ./hist > H2O-5.dat gunzip job-5.dat.gz -c | grep CO2 | cut -f 3 | ./hist > CO2-5.dat
Then you can produce plot of all of them like:
plot 'H2-5.dat' w l, 'H2O-5.dat w l, 'CO-5.dat' w l, 'CO2-5.dat' w l
etc. The same for other nanoseconds. You may need to set the axes labels, like
set xlabel 'TIME [ns]' set ylabel 'NUMBER OF MOLECULES'
To save the plot into a png-file, use:
set term png set output 'concentrations-5ns.png'
and then run the above plot command again. This will create the concentrations-5ns.png file, which you can include into a presentation or a paper. But don't forget to get the output back to the screen with:
set output set term x11
before you try other plot commands, or everything will be written to that png file.
Of course if you are proficient with Python, you can use the matplotlib module to plot and alalyze the results.