En blogg om viktige ting

- en saftig sandwich

Subscribe to RSS feed

Project Euler worldwide country statistics for 2012

So it's been a few years since I did the first comparison of the number of registered users on www.projecteuler.net, and the population in the respective countries. It would therefore be interesting to see now if anything have changed since then.

The statistics are based on the current population data, as given here by January 10. 2012.

Only countries with a population higher than 100,000 will be in this list. Ratios are registered users divided on population, and is divided by 1000 again to ease reading. A more "true" comparison would be to use solved problems instead of only registered users.

One may observe that Slovenia has improved a lot, moving from 8th to 5th, while Finland drops from 3rd to 7th. Iceland was chosen not to be on the list in the previous comparison, so the introduction of this country shifts the rankings by 1 when comparing rankings.

Rank Country 2009 ratio 2012 ratio Change
1 Iceland 0,2090 0,5307 254 %
2 Sweden 0,1420 0,2692 190 %
3 Norway 0,0956 0,2054 215 %
4 Estonia 0,0664 0,1791 270 %
5 Slovenia 0,0463 0,1785 386 %
6 Denmark 0,0568 0,1735 306 %
7 Finland 0,0758 0,1566 207 %
8 New Zealand 0,0460 0,1215 264 %
9 Israel 0,0446 0,1193 268 %
10 Ireland 0,0390 0,1168 300 %
11 Netherlands 0,0468 0,1097 234 %
12 Canada 0,0382 0,0948 248 %
13 Lithuania 0,0236 0,0929 394 %
14 Scotland 0,0378 0,0890 235 %
15 Latvia 0,0292 0,0869 298 %
16 Australia 0,0410 0,0836 204 %
17 Belgium 0,0306 0,0768 251 %
18 England 0,0316 0,0733 232 %
19 Switzerland 0,0295 0,0726 246 %
20 Portugal 0,0306 0,0667 218 %
21 Austria 0,0302 0,0660 219 %
22 Malta 0,0097 0,0647 667 %
23 Croatia 0,0210 0,0639 304 %
24 USA 0,0253 0,0620 245 %
25 Wales 0,0269 0,0602 224 %
26 Hungary 0,0180 0,0584 324 %
27 Bulgaria 0,0228 0,0558 245 %
28 Northern Ireland 0,0153 0,0542 355 %
29 Cyprus 0,0062 0,0501 803 %
30 Germany 0,0182 0,0500 274 %
31 Singapore 0,0157 0,0484 308 %
32 Slovakia 0,0144 0,0413 287 %
33 Czech Republic 0,0101 0,0401 397 %
34 Greece 0,0137 0,0395 289 %
35 Poland 0,0097 0,0357 366 %
36 Romania 0,0149 0,0349 235 %
37 Macedonia 0,0068 0,0301 441 %
38 Saint Lucia 0,0116 0,0300 258 %
39 France 0,0106 0,0293 275 %
40 Micronesia 9,0090 0,0292 0 %
41 Hong Kong - 0,0264 -
42 Serbia 0,0067 0,0261 390 %
43 Belize - 0,0256 -
44 Bahamas 11,6959 0,0254 0 %
45 Belarus 0,0095 0,0230 243 %
46 Moldova 0,0036 0,0225 618 %
47 Trinidad and Tobago 0,0060 0,0205 343 %
48 Dominican Republic 0,0064 0,0182 283 %
49 Grenada - 0,0180 -
50 Italy 0,0070 0,0176 250 %
51 Ukraine 0,0057 0,0175 310 %
52 Spain 0,0072 0,0174 242 %
53 Lebanon 0,0047 0,0169 357 %
54 South Korea 0,0048 0,0156 324 %
55 Uruguay 0,0051 0,0147 290 %
56 Russia 0,0053 0,0143 272 %
57 Puerto Rico 0,0033 0,0142 436 %
58 Japan 0,0045 0,0138 307 %
59 Bosnia 0,0027 0,0138 520 %
60 Argentina 0,0049 0,0138 279 %
61 South Africa 0,0046 0,0129 279 %
62 Armenia 0,0037 0,0129 346 %
63 Vanuatu 0,0083 0,0128 154 %
64 Mauritius 0,0054 0,0125 230 %
65 Sri Lanka 0,0008 0,0124 1568 %
66 Jordan 0,0074 0,0120 161 %
67 Barbados - 0,0109 -
68 Chile 0,0037 0,0106 289 %
69 Cape Verde 0,0059 0,0102 172 %
70 Jamaica 0,0037 0,0100 271 %
71 Tonga - 0,0097 -
72 Montenegro 0,0048 0,0097 201 %
73 Albania 0,0032 0,0092 291 %
74 Mongolia 0,0007 0,0091 1220 %
75 Costa Rica 0,0022 0,0088 404 %
76 Mexico 0,0041 0,0086 208 %
77 Turkey 0,0021 0,0085 405 %
78 Taiwan 0,0031 0,0083 266 %
79 Panama 0,0017 0,0079 456 %
80 Brazil 0,0022 0,0075 343 %
81 Palestine 0,0024 0,0072 301 %
82 Malaysia 0,0023 0,0069 303 %
83 Philippines 0,0016 0,0060 370 %
84 Iran 0,0010 0,0055 583 %
85 Bolivia 0,0010 0,0053 520 %
86 Tunisia 0,0013 0,0052 417 %
87 Guatemala 0,0007 0,0052 734 %
88 Colombia 0,0010 0,0052 530 %
89 Azerbaijan 0,0017 0,0050 290 %
90 El Salvador 0,0018 0,0047 261 %
91 Kuwait 0,0003 0,0046 1377 %
92 Bhutan - 0,0042 -
93 Venezuela 0,0013 0,0041 321 %
94 Peru 0,0014 0,0041 289 %
95 Bahrain 0,0063 0,0040 64 %
96 Turkmenistan 0,0002 0,0039 2002 %
97 United Arab Emirates 0,0022 0,0039 178 %
98 Vietnam 0,0018 0,0038 215 %
99 Thailand 0,0012 0,0038 309 %
100 Georgia 0,0018 0,0036 196 %
101 Egypt 0,0008 0,0035 428 %
102 Cuba 0,0008 0,0034 421 %
103 Swaziland 0,0008 0,0033 394 %
104 Nepal 0,0008 0,0032 395 %
105 Kyrgyzstan 0,0009 0,0031 340 %
106 India 0,0009 0,0031 337 %
107 Honduras - 0,0030 -
108 Namibia 0,0005 0,0030 654 %
109 Kazakhstan 0,0008 0,0030 360 %
110 Botswana 0,0021 0,0030 144 %
111 Qatar 0,0007 0,0029 415 %
112 East Timor 0,0009 0,0028 319 %
113 Paraguay 0,0006 0,0027 426 %
114 Morocco 0,0007 0,0026 370 %
115 Guyana 0,0013 0,0025 194 %
116 Oman 0,0014 0,0025 180 %
117 Bangladesh 0,0004 0,0023 581 %
118 Gambia 0,0006 0,0023 384 %
119 Indonesia 0,0006 0,0020 323 %
120 Tajikistan 0,0003 0,0020 685 %
121 Solomon Islands - 0,0018 -
122 Ecuador 0,0009 0,0017 200 %
123 Saudi Arabia 0,0003 0,0017 609 %
124 Uzbekistan 0,0003 0,0015 603 %
125 China 0,0006 0,0015 270 %
126 Algeria 0,0005 0,0014 262 %
127 Kenya 0,0003 0,0014 506 %
128 Central African Republic - 0,0013 -
129 Zimbabwe 0,0002 0,0013 556 %
130 Syria 0,0004 0,0013 358 %
131 Libya 0,0005 0,0011 233 %
132 Togo 0,0002 0,0010 690 %
133 Pakistan 0,0003 0,0010 341 %
134 Laos - 0,0009 -
135 Lesotho 0,0005 0,0009 188 %
136 Ghana 0,0002 0,0009 433 %
137 Nicaragua 0,0002 0,0009 494 %
138 Haiti 0,0002 0,0008 398 %
139 Cambodia 0,0002 0,0007 333 %
140 Uganda 0,0001 0,0007 728 %
141 Guinea-Bissau 0,0006 0,0007 106 %
142 Gabon - 0,0007 -
143 Cameroon 0,0002 0,0006 277 %
144 Afghanistan 0,0002 0,0006 224 %
145 Eritrea 0,0002 0,0006 281 %
146 Benin 0,0001 0,0005 491 %
147 North Korea - 0,0004 -
148 Angola 0,0001 0,0004 660 %
149 Sudan 0,0000 0,0004 1505 %
150 Iraq 0,0002 0,0003 211 %
151 Tanzania - 0,0003 -
152 Mauritania - 0,0003 -
153 Nigeria 0,0000 0,0003 698 %
154 Chad - 0,0003 -
155 Myanmar 0,0000 0,0002 621 %
156 Zambia 0,0002 0,0002 149 %
157 Somalia - 0,0002 -
158 Ethiopia 0,0000 0,0002 820 %
159 Mali - 0,0002 -
160 Rwanda - 0,0002 -
161 Yemen 0,0000 0,0002 396 %
162 Sierra Leone 0,0002 0,0002 95 %
163 Madagascar 0,0001 0,0002 156 %
164 Senegal 0,0001 0,0002 195 %
165 Niger - 0,0001 -
166 Burkina Faso 0,0001 0,0001 200 %
167 Burundi 0,0001 0,0001 97 %
168 Guinea 0,0001 0,0001 99 %
169 Mozambique - 0,0001 -
170 Côte d'Ivoire 0,0001 0,0000 49 %
171 Congo 0,0000 0,0000 146 %

Why Fedora is the new Ubuntu

, , ,

If you are familiar with Twitter and Gmail, there's no reason that you should not know about Linux. For long synonumous with geeky, ugly and difficult, it has over the past years evolved into something quite the opposite.

My reason for starting with Linux in the first place, was that I had harddrive problems - which in fact is quite common when you're using computers. However, the Windows (XP) tools available to do diagnostics and edit partitions, does not really exist. Say you want to shift some of the free space on the C: drive over to the D: drive, Windows cannot really help you out. Browsing the web for help, I found gparted - and even better - GParted Live CD. This Live option enables you to run programs and tools directly from a removable medium, without altering the system harddrive.

I then discovered that the GParted was actually launched from an operating system that was started from a CD. Linux. I was awed.

Ubuntu has been cheered the distro that took Linux to the masses. I started using this in 2008 before moving to Canada, so that I could access data back home. And since then I have truthfully upgraded home server and also desktop version of Ubuntu. Having a interest in web developing, I found the Linux desktop environment far more flexible in terms of connecting to ftp and ssh accounts, and seamlessly integrating this into a regular file browsing. There are of course downsides when it comes to available software, and trying to adapt your existing computer habits into a Linux experience. For years, Skype was terribly difficult to get to work with audio - and don't even mention video. Bluescreens doesn't exist in Ubuntu, but intense multimedia experiences - like Skype - may cause hang ups, then blackout, and eventually present the login screen over again.

Having used Ubuntu for years now, and even volunteered as a translator and in the end also as a translation administrator - the introduction of Ubuntu 11.10 forced me to make a change. And that for a number of reasons:
  1. Unity - the new interface. For some reason, introducing something new seems to be the only way to display that something really works. Bottom line is, it doesn't. The pop-up "start menu bar" is far too slow, button effects tacky, and menus terribly unintuitive.
  2. The new font. Ubuntu created their own font, which is used everywhere. And in the latest release, you don't even have the option to adjust its size. (This is not different from Fedora, though, but there the font is different and better suited)
  3. One of the key applications for adding and removing software - Synaptics - had some serios troubles with translations in the previous release. I spent a few hours fixing this, as the application at this points was completely useless. It was fixed for a period of time, which was good. But amazingly, the problems reoccurred in the latest release.
  4. Ubuntu One. This is a cloud sync software that can span across devices and OS'es. 2GB free, then you start to pay. The system itself is "ok", but is in my opinion too prominent throughout the system.
  5. Software updates. Say there is a tiny change in a software, you would have to download the entire package again. With Fedora Linux, you download the changed code lines, and the software is "prepared" locally. Faster, more efficient, and way more elegant.
  6. And for some reasons, things have started to run slow. Originally, Linux distros would "boost" your computer performance. I recently installed Fedora Linux on a removable drive, and this was actually running more smoothly than the Ubuntu running from inside the coputer. This was what finally convinced me to make the change.

And not to forget - Fedora desktop has a crisper interface and smoother animations. The whole experience is better, faster. Just the way Linux is supposed to be. Well, it does actually not support playing mp3's - but that's not a major problem, according to your favourite search engine.

Latest Fedora (16) was released just a few days ago. GNOME 3 is used also here, but in a far better way. Workspaces are not fixed, and applications are presented at a glance when clicking "super" button, or moving cursor to the upper left corner. Applications can then be moved from on screen or workspace to another, and applications are rearranged on the fly - smoothly.







Some recent experiences so far:
  • When building software from sources, install "Developer tools" group first. But you may also have to remove old version of automake/autoconf, as they exist simultaneously.
  • Install VLC from videolan.org. This will also provide repositories for playing mp3-files.

The untold story of Klättermusen Froste: before and now

,

Klättermusen outdoor gear is a robust and generally pricy, but considered very high quality, and they present a product line with about anything you would need to stay outdoor for a longer period of time. The wetter and colder the better. And, and these emerging eco-friendly times, the Klättermusen products also comes with cleaner conscience.

Moving to Trondheim in 2005, I realized I had to acquire improved outdoor gear in order to get to classes. The somewhat specialized store "Ute-butikken" had Klättermusen jackets, which I at that point had never seen before. But compared to the other brands available, this manufacturer had quite a different focus on details and design.

I have now owned a Klättermusen jacket since then, and I am quite satisfied. I use them at work, for hiking, cross country skiing, and even downhill skiing. This year I also received a new Froste jacket - but this is quite different than the older model I have. Which is interesting. Have a look:



This shows the two jacket on top of each other, the new one at the top. Here they have made one very important improvement: the strap for tightening the bottom waist is moved from hip to the front, so that your hip is not turned into bleeding wounds when carrying heavy packs.



The next picture shows how the velcro type is changed - to a much sturdier noe, and less prone to pick up threads and attach to anything wool-like. Also, it is less likely to come off, as the material is thicker.



This also shows the details of the new velcro. One other big change is that the front pocket is moved from the left to the right side. Clearly very difficult to get used to. But the flap attached to the zipper is now made of rubber, not textiles - as this is simply determined to wear off at some point.



The sleeves are also different - but in my opinion, I wish that there should be velcro there to attach the straps. (The older jacket is to the right).



Finally, the jacket now is made of a completely different fabric. It is possible to see the difference in pattern above. The new fabric is lighter, glossy and seems more synthetic than the old one. I have not gotten to try this out just yet, to see if there is any difference in weatherproofness.

Affordable home webcam monitoring with cross platform compatibility and playback

, ,

In the sequel "Get the most out of your Ubuntu home server" and "How to do cool tech stuff rather inexpensively", this topic is about using webcams, and starting and stopping them remotely.

You can get a webcam literally anywhere. It's fairly affordable, and they will most certainly connect through USB. And fortunately, that makes them compatible with any 10 year old hardware.

To use a webcam with, say, a Ubuntu computer, you would have to make sure that the webcam is UVC compliant (USB video device class). Quite often this feature isn't even marked as a feature on the packaging, so you need to actually plug it in to know that it works. Actually, most "cheap" webcams actually support UVC. There are lists online of webcams supporting UVC. Or you can just bring your handy laptop to the store, and try for yourself. Running this command while connecting should give you sufficient indications if the webcam is supported:

tail -f /var/log/syslog

The above command works in Ubuntu 11.04. Before this, "messages" was used, not "syslog". Anyways - what you're looking for is something like this:

kernel: [ 3102.392028] usb 1-1: new full speed USB device using uhci_hcd and address 18
kernel: [ 3102.677343] uvcvideo: Found UVC 1.00 device USB2.0_Camera (093a:2700)
kernel: [ 3102.686505] input: USB2.0_Camera as /devices/pci0000:00/0000:00:1f.2/usb1/1-1/1-1:1.0/input/input3

You can check that the cam actually works, by starting "cheese".

Next, we want to stream the video - that is, to be able to have a URL that we can connect and view the video. For that we need a broadcast server, and we also need to decide upon a video format. For the sake of cross platform compatibility, I would choose Theora as video format, and Icecast as stream server. These two components come from the same people - that is xiph.org, and therefore you can trust that these things work pretty well together. And best of all - Theora is supported natively on most browsers like Firefox, Opera and Google Chrome, meaning that you can playback the video literally anywhere, without extra plugins. Even on Android phones, which may use the Firefox Mobile application, which similar to its mother software also supports Theora.

Icecast is installed from Ubuntu repositories as usual. You will have to edit the config-file at /etc/icecast2/icecast.xml, to add passwords and your desired listening ports and so on.

To get the video from your webcam to Icecast, we need to do quite a trick. First we use ffmpeg2theora to encode the raw video from the webcam. Then we use oggfwd (ogg forward wink) to push this to our Icecast server. A typical command line would look something like this:

ffmpeg2theora /dev/video0 -f video4linux2 --no-skeleton --inputfps 15 -v 5.5 -x 320 -y 240 --noaudio -o - | oggfwd -d "<your description>" -n "<stream_name>" localhost <icecast-port-number> <icecast-relay-password> <desired-url>

Remember that the video source (/dev/video0) must be readable (!), which it is not by default. Chmod usually takes care of this. You may tune ffmpeg2theora parameters, i.e the resolution and encoding quality. The above command currently works with a Clas Ohlson webcam.

You should make sure that you have some way to toggle the streaming video. This can easily be done with a php script, launching a shell script like this:

exec('nohup sh stream1.sh > /dev/null 2>&1 &');

You may also add a detector to see if the script is actually running, by this command:

$p = exec('ps -ef | grep oggfwd',$out);

$is_it_really_running = (strpos($out[0],'<part-of-stream-name>') > 0);

That's it! Universal video surveillance made affordable and robust.

(You may also look into udev scripts, to make sure that the video source /etc/video0 is readable at every reboot.)

Mending cross country MTB's (Giant XtC NRS 960)

, , , ...

Without knowing much about neither Giant or mountain biking, I ended up buying a fully suspended Giant XtC NRS back in 2004. It was a tough decision, as it was twice the price for any bicycle I had up to this date. Still, hydraulic brakes with ceramic brake pads, and this darn nice suspension was beyond anything common these days. And now being 2011, these two features are still not commonly found on bikes.



(Note: "mountain bike" (MTB) is not equal to downhill. The bike mentioned here is a XC mountain bike, intended for speed, not trial-like cycling.)

As with any bike, or "mechanical thing" for that matter, things tend to urge for maintenance after some time. To me, the overall best way to get things done, and hopefully also save some money, was to do the work myself. And now, 7 years later, this argument seems to hold.

Well, when it comes to fixing and repairing yourself, you must have quite long-term visions either 1) for your bike, as tools required may fit this bike only, or 2) make sure your bikes doesn't differ too much, so tools may be used over again. If you need (new) special tools for each bike, than you would have to quit your job and put up a bike repair shop instead, as this becomes awfully expensive.



One of the first things you would notice about disk brakes, which is an advantage itself, is that you won't have to replace brake pads as often as with regular rim brakes. I have changed my ceramic pads at most 2-3 times in all these years.



(The Giant MPH brake system has this interesting oil house at the bar, as seen above, where the hydraulic pressure may be adjusted)

After brakes, chain and chain rings would be the next thing to fix. I learned this the hard way, as I wasn't aware that these things actually wear out! But you readily know this when the chain keeps "jumping" when pedalling - then the chain is worn out. And chain rings should be changed at the same time. A chain cutter will be handy for this work.

During biking (or bike handling) you might experience that spokes snap off, and needs to be replaced. I you're a dedicated biker, you should probably seek some professional help here, to have the spoke replaced and wheel tuned properly. But I have had good experience in using a spoke wrench myself.

After a few years, your gear and wiring probably needs to be replaced. At least the rear shifter tends to cause the outer cable to fail, and must be replaced. This is a simple operation, but beware to start in the right end, and mount ferrules and outer cables in the right time p

The crank (bearing) is perhaps the one I have changed most frequently. This started off when the bike suspended while one of the pedals were at the lowest - and the crank actually broke.



This is actually the part for which I have the most special tools, which includes:

  1. Shimano/ISIS standard crank tool (link)
  2. Pedal remover tool (link)
  3. Second standard crank removal tool (link)


The latest repair I did was to the unique NRS suspension itself: as I disassembled the bike for cleaning and inspection lately, I discovered two bearings in a very bad state. Fortunately I could read the bearing seal, saying "688 RS". And I found this bearing at jensonusa.com, and got 4 of them (though only 2 are actually needed for a complete replacement).



This bike will be agile for many years to come bigsmile

Home automation - building a temperature monitoring service with mobile device interface

, , ,

I believe every engineer (legally entitled or not) should spend some time on research. When I first discovered the USB devices from Phidgets last fall, I realized that my very own research budget seemed destined to increase.

And having successfully built a remotely controlled LED-system using the Interface kit, I figured literally anything would be possible.

I recently acquired my first apartment. So, as I was told the entire apartment could be heated with a single fireplace and a small electric floor radiator, I quickly decided to look into temperature monitoring the rooms. This would be rewarding both in accomplishment, but it will probably also play a role in smarter heating (and hopefully heating cost savings). The core of the system will as always be the trusty Ubuntu server, and most likely the beforementioned Phidgets interface kit. But the most critical components, not to forget how to put it all together, were still unknown.

Browsing the catalogue, I quickly found that Phidgets has a 4-port temperature sensor. And having some knowledge in temperature instrumentation, I were able to find the right thermocouples and extension wire.

So - at this point, I knew I could get the necessary equipment to get it all up and running. Still, this wasn't all:

  1. The system shall record temperatures in several places (rooms).
  2. The instrumentation shall not be visible.
  3. The data must be recorded.
  4. The data must be recorded several times every hour, and must run from a cron script.
  5. The recorded data has to be presented. If not, the effort will be all wasted.
  6. The system must be as affordable as possible.
Point 1 is covered by just buying enough thermocouples, but is on the other hand limited by the latter point - the cost. Point 2 is a challenge, as wires has to be pulled to spots were it makes sense to measure the temperature - preferably shady areas with access to circulating air. Point 3 involves some kind of database, most likely mySQL. I were depending on finding bindings between Python and mySQL, as the temperature extraction script most likely would be written in Python. Fortunately, Ubuntu has this already in repositories. Point 4 involves a cron script. Cron is always messy, but the GNOME Schedule application makes it a little easier to set up. Point 5 is the final part, but makes it all worthwhile. Point 6 is a prerequisite, as this project doesn't make sense if it costs a huge amount of money.

I might add, the temperature monitoring is interesting for several matters. In Norway, as with other Nordic countries, there is a serious concern that piping and plumbing may freeze over and create massive leaks. By always being able to check the indoor temperature, it may be possible to allow colder temperatures indoor if one should be away for longer periods of time - and still be able to react if temperatures should drop. Secondly, monitoring temperatures may reveal areas/rooms with high heat leakage.


Having spent quite a few hours wiring up the server and the thermocouples, the measurements started pouring into the database. I confronted the Phidget staff on connecting to the Temperature reading device as frequent as every 10 minutes, but they didn't have any major concerns with this:

I don't see there being a downside to this. If you were looking to
get the temperature data in 10 minute intervals that would certainly
be one way to do it. A cron job that launches a simple application
that will poll the data and store it somewhere.

You could also just have an active running service that simply polls
the value and stores it based on a timer as well, but I haven't done
services using Python so not sure how that works exactly.

-Adam

I specified 4 ciphers and 2 decimal digits for the temp readings, and currently have about 4,400 X 4 readings taking up 126KB space.


The final part was to create some kind of service for mobile devices. This sure might get improved on a later time, but currently holds 3 diagrams:

  1. A 3D model of the apartment, with current temperatures plotted.
  2. 24 hours plot
  3. Week plot
The first diagram is solved using the internal capabilities of GD. The two latter ones are created using latest version of jpgraph, which actually where a whole lot more complicated than first expected. Thanks to Maxiwebs for providing a php5-gd compiled with imageantialias() support.




Most of the thermocouples are mounted quite close to the ceiling, which introduces readings that are quite off the actual temperature mid-room. I tried to come up with a clever correction to this, but I'm at the moment using only a linear correction based on a separate temperature reading. I have however attempted to find correlations, logging temperatures mid-room with a separate thermocouple (extension wire standing at the floor):


Several ways to correlate the data were attempted. None were working as well as I had hoped for:



Using the plots, it is possible to identify at least one room which has issues regarding severe heat leakage - the bedroom. Here the temperature shows to drop by 2 degrees in a mere hour - far worse than any of the other rooms:

Axisymmetric parameterized hex mesh for corrugated pipes

, , ,

Corrugated pipes are used in industry purposes to allow a certain bending, while still having structural stiffness and withstanding i.e pressure forces. The hose of a vacuum cleaner is perhaps the most widely known example.

Recently I was introduced to the problem of determining the pressure loss in such a pipe. The Moody diagram and Darcy-Weisbach equation can be employed to determine this, at least for "normal" pipes. The Moody diagram and Colebrook equation are well suited for smooth pipes - but how well do they perform for pipes with roughness in the magnitude of several centimeters?

In October [2010] I started the work on creating a parameterized mesh script for these corrugated pipes, using the internal meshing capabilities of OpenFOAM. But getting to know the characteristics of corrugations, the problem became making the mesh in a general fashion - as corrugations can be produced in several ways:

  • Semi-circle wise
  • Sinusoidal
  • Semi-circle extremas connected with vertical lines
  • Semi-circle tapered (sloped straight sections)

And after numerous pencil sketches, and a horrendous amount of hours programming and troubleshooting, I came up with a design capable of producing most of the cases above. And with a minimum of parameters:

  1. Corrugation pitch (axial distance between "amplitudes", or period)
  2. Corrugation depth
  3. Corrugation slope

And that's all. All points and distances can be determined from these three parameters, using a rather intricate and non-linear geometric formula, plotted like this:


The geometry is designed to take advantage of the wedge capabilities of OpenFOAM, that is a 5 degree axial slice, or 1:72 of original geometry. Still, it is possible to export this geometry to a Fluent mesh, and create a complete 3D version of it. Though, that would introduce 72 times more cells... for a one meter pipe with fine mesh, probably several million cells.

And the resulting meshes turns out like this:
87 degrees slope

75 degrees slope

65 degrees slope


And a slightly tilted view:

87 degrees slope

75 degrees slope

65 degrees slope


From the end:



And some results:

Automating blockMesh pipe geometries in OpenFOAM

, , , ...

This tool is now available online: www.versati.no/mesher/

OpenFOAM is an excellent tool to perform accurate CFD studies. The software also has its own mesh language – making it possible to create simple geometries, fast, without an extra meshing application.

For larger meshes, this format becomes difficult and almost impossible to use efficiently. Still, this blockMesh format is a sought after alternative, as it produces only hex cells, and block volumes can be specified for every edge, in terms of expansion and number of cells. It can also create perfect transitions between (curved) edges.

To investigate flow in bends and diffusers, I have created automated routines to create this kind of meshes – also incorporating O-grid to avoid singularities in pipe centre. The mesh routines are completely parameterized, producing meshes in mere milliseconds – with full control of all mesh parameters.

These routines are completely module based, making it possible to add straight sections as well as bends, and diffusers.

One set-up could be like this:

$block[] = array(0,1,45,3);
$block[] = array(4,0,0,0);
$block[] = array(0,-1,30,0.4);

The three "blocks" produce first one 45 degree bend to the right with radius 3m, then a straight 4m long pipe section, and finally a bend turning "left", 30 degrees with radius 0.4m.

And this is how it all started:

Frontlys til besvær

, ,

I følge instruksjonsmanualen til bilen min, så må frontlys byttes av en ekte "fagmann". Nuvel, et serviceverksted som tar 17000kr for å montere ett enkelt hengerfeste, skal ikke få pille unødvendig mye på dette kjøretøyet, bare så det er klart. Dessuten - frontlykt, hvor vanskelig kan det egentlig være?

Tatt i betraktning at det er midnatt, og motorrommet ganske så kompakt - var faktisk det en utfordring å komme i gang. Pæren hadde jeg, standard biltematype, men jeg hadde ikke sjangs til å visuelt se hvordan jeg skulle gå frem for å plukke ut den utgåtte pæren. Et speil kunne kanskje fungert. Men det finnes noe bedre alternativer.



Et billig webkamera på Clas ohlson, samt en lommelykt, var alt som skulle til smile

Gjenbruke designmøbler

,

I disse miljøtider er det poppis å vise til små tiltak som begrenser utslipp, reduserer footprint og generelt viser at vi har et uavbrutt fokus på å bedre det rundt oss. Vel, hva er vel da mer riktig enn tiltak for å unngå å kaste selv det mest slitte møblement?

Men det holder ikke liksom å bare male over råtnet treverk i det uendelige. Dårlig vedlikehold, eller kanskje bare slitasje, medfører at man til slutt må gjøre vesentlig mer drastiske tiltak, som å bytte deler. Dette er jo ikke ulikt det man gjør med en sykkel, bil eller annet mekanisk utstyr. Mindre vanlig er det kanskje med møbler.

Men dette er heller ikke et hvilket som helst møbel. "Balans" som stolen heter, fra 1979, fikk riktig nok merket for god design allerede i 1986 - men var i første omgang en hyllest til korrekt sittestilling. Først i senere tid har det blitt mer et designmøbel enn funksjonsmøbel.



Denne stolen, som jeg har kjent i hele mitt liv, bærer nå preg av tidens tann. Den ser ikke spesielt stilig ut, og frister egentlig ikke å brukes i det hele tatt.



Etter noen runder med e-postkorrespondanse med Inside Design, ble flett nye seter bestilt, i et ganske så slitesterkt materiale. Og best av alt - den ble levert under to uker senere.
February 2012
M T W T F S S
January 2012March 2012
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29