Monthly Archives: September 2014

CFD file sizes

I’m presently taking a computational fluid dynamics (CFD) course here at Rice (taught by Dr. Tayfun E. Tezduyar), and I was shocked to learn the sheer volume of data generated from a typical CFD simulation, and the digital storage required to be able to look back at the modeled results. A homework problem was the following:

“Consider a 3D computation of air circulation in a room with temperature effects. There are also 3 chemical species (e.g. 3 pollutants) we want to keep track of. The species concentrations are so low that they do not influence the fluid density or velocity. The number of grid points is 10 million, and the simulation takes 1000 time-steps. Assuming that a number takes 8 bytes, how much disk storage do you need to store all the computed data?”

By my calculations, you would generate approximately 640 Gigabytes (GB) of data in the process of solving this problem!

In the figure below you can see how mesh size influences the storage size of the generated data for three different simulation lengths. I have isolated the figure to the interesting data (everything with a mesh size below 10^4 points generates relatively small data volumes). All model parameters are provided below the figure.

data generated for model runs

Volume of data generated for model runs of different length time-steps. Model has 8 unknowns, with every unknown value requiring 8 bytes of storage.

Model parameters:

  • 8 unknowns for every mesh point at every timestep
    • conservation of momentum = 3
    • conservation of energy = 1
    • velocity = 1
    • species to track = 3
  • evenly spaced time-steps of 1000, 1500, and 2000
  • 8 bytes are required to store a single unknown (meaning one value at one point, at one time)

Interesting note: increasing the complexity of your problem without increasing the number of unknowns has no effect on the storage size, but only on the time required to complete the simulation!

Weathering of a theoretical cube

Another old assignment here, this one to model the erosion of a theoretical 1cm³ granitoid cube of a given initial composition and neatly present the results. I did the modelling in Python, as one of my earliest Python projects. The plots were made manually in LibreOffice Calc. Below are the plots, for more information, including assumptions and citations, see the short report here. The code used for the model can be found here.

Time dependent log-log plot of dissolution of minerals in a theoretical 1cm 3 granitoid cube in a soil at pH 5, through time. Dissolution rates taken from Bandstra et al. (2007) and Palandri and Kharaka (2004). Initial weathering rates of all minerals at the start of the experiment (quartz, plagioclase feldspar, annite, tremolite, and potassium feldspar) are faster than all subsequent weathering rates rates due to continually decreasing surface area of the mineral through time. Aggradation of kaolinite is dependent on the dissolution rates of plagioclase feldspar, potassium feldspar and annite. Iron oxide aggradation is dependent on annite weathering rate. Minerals reach “zero value point” at 0.00001 moles of mineral. These times are roughly 50 years for annite, 100 years for tremolite, 300 years for plagioclase feldspar, 1,500 years for potassium feldspar, and 30,000 years for quartz.

Time dependent log-log plot of dissolution of minerals in a theoretical 1cm 3 granitoid cube in a soil at pH 5, through time. Dissolution rates taken from Bandstra et al. (2007) and Palandri and Kharaka (2004). Initial weathering rates of all minerals at the start of the experiment (quartz, plagioclase feldspar, annite, tremolite, and potassium feldspar) are faster than all subsequent weathering rates rates due to continually decreasing surface area of the mineral through time. Aggradation of kaolinite is dependent on the dissolution rates of plagioclase feldspar, potassium feldspar and annite. Iron oxide aggradation is dependent on annite weathering rate. Minerals reach “zero value point” at 0.00001 moles of mineral. These times are roughly 50 years for annite, 100 years for tremolite, 300 years for plagioclase feldspar, 1,500 years for potassium feldspar, and 30,000 years for quartz.

 

figure_2_in_report

The aggradation of solutes from the same granitoid cube described in Figure 1, in a soil. The aggradation is entirely dependent on the weathering rates of the primary minerals in the granitoid cube. Plagioclase feldspar yields calcium and sodium ions into solution, quartz yields silicic acid, annite yields potassium ions, tremolite yields calcium and sodium ions and silicic acid, and potassium feldspar yields potassium ions and silicic acid.

 

Google chrome profile fix (Ubuntu 14.04)

There was a period a number of months back where I had been getting this annoying error each time I opened Google Chrome about my profile failing to load. “Your profile could not be opened correctly”. Most of the time it had no effect on me but annoying me, but I wanted it gone.

Well I found a solution (although it seems to only be temporary…as I get the error once every few months still) and I’m here to share it. If you are using Ubuntu you can follow the code below exactly, otherwise you may have to do it manually with a file browser or some other method.

  1. quit out of Google Chrome
  2. open up a terminal shell (CTRL + ALT + T)
  3. run cd ~/.config/google-chrome/Default && rm -rf Web\ Data
  4. start Google Chrome again by your preferred method. Problem solved!

Leave a comment below if you still are having trouble and I can try to help you out. Credit for this solution to Dipto.

Isotope fractionation and sugar fermentation

For my first post on this blog, I wanted to share an old project I did during my undergraduate at Lehigh University. The credit for the idea and design of this project go out to Dr. Steve Peters and my TA in the course, Eric Ellison. The experiment was to track how the carbon isotopic concentration evolved by yeast fermenting sugars changed through time.

Let me back up a minute here and explain (very briefly) about isotope fractionation. Many Earth processes (in this case a biotic one) impart what is called a fractionation on the concentration of isotopes for a single element during and after the process. This largely happens because a particular elemental isotope is easier for the process to use or uptake, and so the other isotope(s) of the element become enriched in concentration.

An easy example to think about is oxygen isotope fractionation at the ocean-air interface. When the energy required for evaporation is being neared, water molecules that have a lighter oxygen isotope molecule will preferentially evaporate because they weigh less, and thus require less energy to switch into the gaseous phase. We measure isotopic concentrations as δ (that’s a delta) values, where a negative delta value means that the substance you are measuring is depleted in the isotope you are measuring for against some standard reference value that is globally recognized and used. Scientists do this so we can all talk to each other about isotopic concentrations and understand what the implications actually are, rather than just hearing some concentration!

So, the experiment we conducted looked at the isotopic concentration of carbon in carbon dioxide evolved from three solutions of simply sugar, water, and yeast. The variable that was changed in each solution was the sugar. One solution was comprised entirely of glucose sugar, one entirely of maltose sugar, and one had an equal weight mix of glucose and maltose. Now all we need to know going into this is that sugars are broken down by yeast and carbon dioxide is evolved as a byproduct; we measure the δ13C of that carbon dioxide. Below are the results from the study.

d13c_evolution

So how do we interpret this? Well, the simplest observations are usually the right ones! The glucose only solution generated a roughly constant δ13C of -10‰, the maltose only solution was also pretty constant at -25‰ δ13C, but the mixed solution did something interesting. At the beginning of the trials, it generated at a higher δ13C than it did by the end of the 7 day run. More specifically, it began close to -10‰ δ13C, but ended much closer to -25‰ δ13C; through time there is a shift from generating carbon dioxide sourced from glucose to sourced from maltose.

Pretty interesting! Well, I didn’t mention this before because I didn’t want to ruin the surprise, but this interpretation is backed up by the chemical structure of glucose and maltose. Glucose is a simple ring-shaped sugar, and maltose is, well, two glucose molecules joined by an oxygen. It therefore makes perfect sense that in a solution with both glucose and maltose, a yeast will preferentially break down the glucose first, since it is a simpler molecule and easier.

I’ve made some pretty big simplifications so that this post was able to remain reasonably short, so if you have a problem with an explanation or something else drop me a comment below or shoot me an email if you want to discuss more.