Skip to main content

2017-06-14 daily note

1- I just learned a good trick to start my python 3 virtual environment that I use for running Nikola to update this blog. Add the following line to the end of your .bashrc file (located in your home folder):

alias py3="source ~/(path to your virtualenv)/bin/activate"

Now I can easily start my virtual environment by typing py3 in the terminal.

2- I just found out that in my JFVM.jl package, I can create 2D and 3D cell variable by assigning 1D arrays of the right size to the createCellVariable function, without reshaping the 1D array! It makes things (just a bit) easier in my reactive transport codes.

3- I bought some dried fruits and cashew nuts from this online shop. I just want to recommend it here if you happen to be close to the Netherlands. They have excellent products with a reasonable price (for this region).

4- Finally solved the geothermal problem in Julia, and just in time, because I have to go and pick up Aida from school.

2017-06-13 daily note

I just deleted my yahoo account, after receiving an email that someone from Thailand has tried to log into my account, I thought it is safer to delete an account that is barely active these days, and is full of spam anyway. I don't feel nostalgic at all. It feels like throwing away a pair of damaged shoes.

2017-06-12 daily notes

Supervising master students is a challenge. When I was a master student, I defined my project myself, planned it, did all the experiments, and went to my supervisor's office with the outline of the thesis. He was shocked at the beginning, but helped me to give the text a better structure. I am very proud of what I did at the time. Not all the students work like this. Some need constant attention and guidance. I have supervised (am supervising) more than 10 students. One of them was just amazing. Another one was almost fully independent. Two or three needed a minimum level of attention, and the rest needed constant monitoring and help. Now that I think about it, sometimes, students are somewhere between the third and the last group. The problem for someone like me with a temporary appointment is that we need to do as much as possible in the limited time of our contract; therefore, we prefer to work with the first or second group of students. But unfortunately, these students are always snatched by the Professors, who can easily identify (because they teach and we don't) and attract them. I can narrow down my final problem to this: If I need to spend 3 hours to teach a master student to do a task that I can do in less than 3 hours, I prefer to do it myself. This is, sadly, the only solution that matches the circumstances of a post-doc researcher.

In matplotlib, I can plot negative values on a (semi)logarithmic scale using the following commands:


I run the above commands in Julia. The same can be done in python by importing matplotlib.pyplot.

I'm on my second long Pomodoro break. My sessions was not as productive. I checked emails a couple of times and did not focus on a single task during my 25 minute sessions. The result is that my progress is not impressive, although it is not bad at all. I wrote only two paragraphs, but I managed to do most of the calculations that I wanted to add to the paper. Before picking up Aida and taking her to the last session of Dutch school, I'll focus more on writing the results and discussion. The simulation results are mostly analyzed. I only need to fit it into my story, without making it yet another spam paper.

I do not like csv files for storing data. They limit the user to tables, which is a form that rarely appears in real life. Moreover, usually that table describe a time series measurement for a physical system with many other parameters that cannot fit into the same table. Recently, I've started using JSON which gives me what I really need. But for this gepthermal paper, I had only CSV file, with long file names that described the properties of each system! I tried to read the file names and do some analysis on the string to extract the required data, but I gave up and did it manually since there was no pattern in the filenames. Fortunately I had only 20 files and it was not really time-consuming (even though I wasted some time trying to do it automatically!).

2017-06-09 daily notes

Today, I wasted some time finding a time management app for my Linux Mint installation. There is an applet for it, called Pomodoro with a nice red ripe tomato icon. I managed to waste a few minutes getting it to work, and it is running on my computer toolbar now.

One of the most idiotic things in this Dell laptop's keyboard is that the page up/down keys are located right next to the arrow keys. I have pressed them more that a thousand times by mistake. Are these keys even necessary for a keyboard?


Sitting in the library, my own spot this time, looking for references on the efficiency factors of the fossil fuel power plants. The numbers I have in mind are 30% for pulverized coal, 35% for IGCC (integrated coal gasification combined cycle), and 45% for NGCC (natural gas combined cycle). On this page, the heat rate (which is the amount of heat that is supplied for the production of 1 kWh electricity from the combustion of a fossil fuel) is reported for the American power plants. The numbers for the IGCC are not reported, so I used another report to estimate it. My estimates are:

power plant Efficiency
PC 34%
IGCC 40%
NGCC 45%

I have seen higher values (as high as 60%) reported for the new NGCC power plants. But apparently, those numbers are only valid if the power plant operate on its design (optimum) capacity, that never happens in practice. See for instance this report.

I've been trying to use the Poromodo technique for time management. My main problem was that when I'm really focused on a task, I can easily lose track of time. Apparently, there is an app for people like me. I just installed it.

Note to self: write a post in Simulkade about calling CoolProp from MS Excel and Excel macros. It took me a while to solve some of the issues and it is good to write the details here.


Writing here is like spitting out all the useless and very occasionally useful thoughts that comes to my mind. These days, I'm also writing other stuff that I find extremely boring and only useful if it gives the result I want, otherwise a wasted effort (I don't want to say what I really write). Doing nothing is better than what I'm doing now. The thing is it must be done and only I have to do it. Still, complaining about it feels good!

I do not understand the possibility of having a negatively charged carbonate surface without any sulfate or carbonate ions in the system.

2017-06-06 daily notes

Working on my geothermal energy paper. The second part of my gasification paper, which is practically the last piece of underground coal gasification work from my PhD thesis, is finally under review in the Applied Energy. I should have published it way earlier. Procrastination, as usual. I submitted the whole chapter first to Energy and it was rejected. It was too long for a publication. Two years ago, still in Delft, I finally forced myself to divide it into two parts and submitted the first part to the International Journal of Coal Geology which was quickly accepted. It was a good polished work. The second part needed an introduction. I finished it a few weeks ago and submitted it to Applied Energy, because I want to make my CV look better by publishing in the journals with high impact factors. Otherwise, I don't really care. This one is also a good work, made even better by a couple of notes from the editor. I don't know how many more energy- and exergy-related publications I'm going to need before being considered a semi-expert on the field. I'm going to give it a try anyway.
One important aspect of what I do in the exergy-analysis of energy-extraction processes, is the simplicity. I try to make the calculation procedure simple and accessible, i.e., no fancy commercial expensive software or complicated numerical tool. But sometimes, I have this feeling that I'm not consistent in simplifying everything. For instance, phase equilibrium and thermodynamic calculations is a topic that I consider relatively simple. But, apparently, not too many researchers concur. I have to be more careful about these aspects of my work. I can, e.g., suggest simple alternatives.
Just received this message from the post that my package (well, Aidin's package has arrived). I ordered a bike trailer for him. He can now go biking with us, with the help of a baby seat that fits inside the trailer. I hope the trailer is not too wide, so I can put in in the bicycle shed in the basement. Exciting!
I feel tired again, for no reason apparently. It might be the vitamin D problem that I had back in the Netherlands. I guess I have to start taking pills again.
I'm going to look into the updated efficiency factors of the power plants (NGCC, IGCC, and PC). The values that I've used in my old Jupyter notebook seems outdated.

Daily notes - 2017-06-02

Early in the morning, I did some computations by assuming that the injection rate is equal to the water cut and the injection pressure is around the hydrostatic pressure. Depending on the water cut, the recovery factor can be indeed negative but only for very high water cuts (99% plus)
I was thinking about using Reaktoro to estimate the enthalpy of reaction at different temperatures and then fit the correlation that is used in phreeqc for the enthalpy of reaction to the Reaktoro HKF estimations. I'll have to do it later.
I just contacted a seller on Reshopper to buy a bike trailer seat for Aidin.
I'm trying to rewrite a piece of code that I have written many times previously, but for some reason, I cannot focus today.
I sent an email that I should have sent a couple of weeks ago, and although the reply was not favorable, it made me feel less anxious.
My code finally works and it is fast enough. I do not have enough energy to finish my work today, anyway.
I have realized that my problem is not procrastination alone. My other problem is laziness. Don't get me wrong! I'm not comparing myself to the really lazy people, but to real hardworking scientists like Hans. I have to try and force my brain to work harder and longer.

Daily notes - 1 June 2017

I'm in the library and this is my plan for today:

  • Read the recovery data from the data base
  • Write an objective function based on the Buckley-Leverett formulation
  • Run the optimization problem in Julia
  • Optimize the rel-perm parameters

Funny story: the paper that has done core flooding and reported the recovery data at high temperature, does not report the viscosity of oil at high temperature. I had to calculate it using this correlation: $$\ln(\frac{\mu}{\mu_0}) = B(\frac{1}{T}-\frac{1}{T_0})$$ I found the B value by fitting the above equation to the viscosity data of n-Dodecane. The viscosity data comes from the cool CoolProp package.

The recovery data is not a straight line at the beginning of the core flooding. It must be a problem in choosing the right moment to start the timer. I shifted the curve to make it consistent.

The most important problem with using the analytical solution of the BL equation as an objective function is that very occasionally, the shock front cannot be found with a reasonable numerical accuracy. This blows up the objective function and the whole optimization procedure. Perhaps, I should try the numerical solution (upwind) that is slower, but (almost) always converges.

2017-05-31 daily notes

I have decided to write whatever comes to my mind every day.
Writing the paper on the exergy analysis of geothermal energy, and thinking about the methane carbon emission and specific exergy. The chemical exergy of methane comes from the sun, which is of course clear since we don't have any other energy source (well perhaps geothermal and nuclear are different unless. Unless we are debris of the sun?). Anyway, the funny part is that what we burn now as fossil fuel is the sunshine of millions of years ago that is stored underground. Wood is the sunshine of several years ago. Wind and waves are the sunshine of few days ago perhaps? I'm not sure.

I'm thinking about getting the temperature history for, e.g., last year to calculate the heat loss from a building block and use it to estimate the energy requirement for warming. These are some of the usefull links I have found so far. I will go through them later:


I also looked into the bicycle trailers (fietskar in Dutch or Cykeltrailer in Danish) to find out whether it is possible to use one to carry Aidin around. Apparently, there is a small seat that can be installed inside a trailer for newborns.

I wrote two more pages of our paper. The mathematical modeling section is now complete. Tomorrow I'll work on the results and discussion and then hopefully before the end of the week I can take care of the introduction and send it away.

Now I'm going home to have a cup of coffee (decaf), play with Aidin, and work on another paper if time permits.