January 22, 2012 0

Parameter variation in OpenFOAM using PyFoam

By in OpenFOAM

Series PyFoam

  1. Parameter variation in OpenFOAM using PyFoam

Performing parameter variations can be stressful, especially if some parameters have to be altered in various places in an OpenFOAM case. This is where the python modules of PyFoam come in quite handy. I assume, that you have a basic knowledge on how an OpenFOAM case is structured and that you are familiar with programming in python. If you need a brief refreshment of your python skills, you can pick one of these tutorials. Read the rest of this entry »

Tags: , , , , ,

November 4, 2010 0

Compile VTK on Snow Leopard

By in OpenFOAM

Compiling VTK on Mac OS X 10.6 turned out to be much harder than on the Unix systems, I’ve done that on recently. Unfortunately I did not find any detailed data on how to choose the installation parameters properly. After a lot of try and error and some research, the following procedure worked for me on 10.6.4.

1. Prerequisities

I should note that I used the latest version of the git repository and not the tarball. The reason for this was that I would like to be able to update the installation more easily in the future.

  • Grab cmake. I used the binary version 2.8.3 and install the command line version as well!
  • Install git for mac.

2. Clone the git repository

The next step is to clone the git repository. Before doing that, I created a parent folder to organize the source and binary files.

mkdir $HOME/Applications/src/VTK
cd $HOME/Applications/src/VTK

In that folder we clone the git repository and checkout the release branch by performing

git clone git://vtk.org/VTK.git VTK
cd VTK
git checkout release

Read the rest of this entry »

Tags: , , ,

October 14, 2010 0

Plotting massive datasets on the fly

By in OpenFOAM

One of the hassles with working on a distant HPC is that you need to push and pull huge amounts of data back and forth. This wouldn’t be a big issue if you would have a really fast internet connection and/or if you would just need to do that once a day. Unfortunately, neither is the case for my application. I’m doing two phase CFD simulations using OpenFOAM and quite large logfiles and datafiles are accumulated during a single simulation. Since I want to check e.g. the convergence of the forces on my geometry during runtime, I need to plot a datafile which increases in size each timestep up to 10MB. This cannot be done on my local machine, since the download of the datafile would take way too long. Read the rest of this entry »

Tags: , , , ,

September 13, 2010 1

Remove brackets from file

By in OpenFOAM

Removing brackets from a huge datafile can be done in multiple ways, but from my point of view, using the unix command sed and regular expressions is the fastest and easiest way to do that.

sed -e "s/[(,)]//g" $file > output

This comes in handy, if you need to plot data, that is located on a cluster or server and you do not want to transfer a 50MB file over the net just for plotting purposes.

Tags: , , , ,

July 14, 2010 0

Snap edges with snappyHexMesh

By in OpenFOAM

Series snappyHexMesh

  1. snappyHexMesh Tutorial
  2. snappyHexMesh Tutorial Part 2
  3. Snap edges with snappyHexMesh

Making use of snappyHexMesh for the mesh generation polarizes, some love it and some hate it. I personally switch between love and hate, depending on the efforts that need to be taken, to get a proper mesh. The major drawback of snappyHexMesh is that it does not respect sharp edges, but creates these jagged edges as shown in the picture above.

Up until today’s morning, I was pretty much convinced that there is no OpenSource tool for OpenFOAM, that enables snappyHexMesh to snap vertices to sharp edges. But then I’ve found this on the forum.

Niklas Nordin has written a tool called snapEdge, that provides exactly this missing functionality. He introduced his code with only a one sentence post.

I’ve written a little program that might help, I call it snapEdge.Niklas Nordin

Unfortunately, I’ve not had the time to try it, but from what I’ve read on the forum so far it looks pretty promising. As soon as I find the time to try it out, I’ll update this post.

Tags: ,

July 13, 2010 0

Replace Textmate by vim

By in Apple, Web

First of all, this is not going to be yet an other hot tempered discussion on which editor is the best, but a description why and how I switched my workflow from Textmate to vim.

1. Why?

NerdTree in action

This is an easy one. As you might know or at least guess, I am editing files on a HPC over the internet and this was a hassle with Textmate. Why? Because I had to mount the HPC‘s filesystem via my internet connection and edit the remote files with my local Textmate, which is a really bad idea. It just felt like sedated and still trying to get things done. I was in need of a proper alternative for doing such things, something that could be run in an ssh terminal window. I remembered vim from some administrative jobs on a server, I did some time ago and so I gave vim a try. Read the rest of this entry »

Tags: , , , ,

July 8, 2010 7

snappyHexMesh Tutorial Part 2

By in OpenFOAM, Studies

Series snappyHexMesh

  1. snappyHexMesh Tutorial
  2. snappyHexMesh Tutorial Part 2
  3. Snap edges with snappyHexMesh

The first snappyHexMesh tutorial is more or less a little extended listing of the information gained from the OpenFOAM User’s Guide. This tutorial gives a brief view on how to setup the background mesh and how refinement regions should be configured. As an example, a container vessel is meshed within this tutorial. No prismatic boundary layer will be used for this tutorial.

Update 26.01.2012:
You can download the geometry of the KRISO Container Vessel (KCS) as STL from here. Thanks to Abe for reminding me to make the download available.

0. Prerequisities

Before we start, we need to take some prerequisities

  1. Check the quality of the STL file. The surface needs to be as smooth as possible, without any humps.
  2. Check the orientation of the STL file. Are the coordinate axes aligned correctly?
  3. Check the position of the STL file. Is the origin of the STL file located, where it is supposed to be?
  4. Check the scaling of the STL file. Guess…
  5. Check the format of the STL file. It should be ASCII and not binary. You can have multiple surface groups in your STL file, but the naming should be without whitespaces, such as
     solid OBJECT
        facet normal 1 -0 0
        [...]

Not all features of snappyHexMesh are described within this article. Either have a look into the tutorials, that come with OpenFOAM, or read the first snappyHexMesh tutorial.

Read the rest of this entry »

Tags: , ,

November 29, 2009 1

Kleiner Tag in Big Bay

By in General, Travel, Windsurfing

Der heutige Tag startete mit der ersten Karte meines Adventskalenders :-)
Vormittags haben wir uns die windfreie Zeit im Canal Walk (vergleichbar mit dem CentrO) mit shoppen vertrieben. Danach hatten wir eine super Session in Big Bay! Wind fürs 4.7 und kleine Welle – super für’n Jan zum Üben!

Völlig ausgehungert haben wir dann einen mexikanisches Restaurant überfallen und vorzüglich gespeist. Den krönenden Abschluss haben wir uns bei sternenklarem Himmel mit einer dicken Portion Schoko-Mint-Eis im Jacuzzi gegeben – ja, es könnte uns schlechter gehen… oder: geiler Tag!!

Da in der letzten Woche zweimal genau an unserem Parkplatz ein Auto aufgebrochen wurde, nehmen wir die Kamera nicht mit zum Strand. Deshalb gibt es leider noch keine Surfbilder
:-(

Tags: ,

November 28, 2009 0

Sharks@False Bay; kleine Cape-Tour

By in General, Travel, Windsurfing

Nachdem der Swell leider nicht zum Wellenreiten reichte, sind wir heute nach Muizenberg in der False Bay gefahren. Danach ging es über Simon’s Town, Scarborough, über den Chapman’s Peak Drive, Clifton, vorbei am neuen World-Cup Stadion zurück nach Table View.
In Muizenberg angekommen erinnerte uns prompt eine weiße Flagge mit schwarzem Hai daran, warum unsere Wellenreiter in Table View geblieben waren. (weiße Flagge mit schwarzem Hai = Shark-Spotter haben Haie in der Bucht gesehen) Ansonsten gab es auf dieser Tour coole Surf-Läden und Bars, tolle Strände und viele imposante Ausblicke.

So sieht’s bei uns einen Tag vor dem ersten Advent aus:

Tags:

November 26, 2009 1

Wasserstandsmeldung aus CPT

By in General, Travel, Windsurfing

Hey Guys!
Nach einer Woche wollen wir uns mal wie versprochen aus Kapstadt melden:

Der Flug nach München verlief etwas unentspannt, weil der kleine, temperamentvolle Ethan in der Reihe hinter uns leider sehr unzufieden mit der Gesamtsituation war. Ab München war es aber ruhig und für meine Erwartungen recht kurzweilig.
Am Flughafen in Kapstadt hat uns unser Vermieter Wolfgang erwartet und nach einigem Experimentieren hatten wir unser Equipment im Auto.
Die Unterkunft Cape Oasis ist wirklich sehr sehr schön. Mit vielen Palmen, Pool, Jacuzzi, Billard-Tisch und Tafelberg-Blick fehlt es uns hier eigentlich nur an einem scharfen Koch-Messer.Blick aus der Lodge

Unsere erste Woche war vom Wind her nicht unbedingt übertrieben. Zuerst waren wir auf dem See vorm Haus mit “großem” Material dümpeln. Danach einen Tag am Sunset Beach mit 4.7. Die Welle war sehr gut, nicht übertrieben groß, aber leider für den Anfang deutlich zu groß für mich. Immerhin bin ich dreimal rausgekommen und ich habe nichts kaputt gemacht. Die Tage danach hatte es guten Swell, aber Wind war noch nicht wirklich sicher, sodass wir uns Wellenreiter gekauft haben. Nach drei schönen Sessions, in denen wir sogar einige Meter gestanden haben, hat Jens Wellenreiten als Flautenalternative entdeckt. Heute waren wir in Big-Bay und haben unser Glück bei sehr schöner Welle mit 5.3 versucht. Leider flaute der Wind aber wieder ab und nach endlosem Warten haben wir die Klamotten wieder abgebaut und sind zu einer schönen Abendsession zum See gefahren.

Letzte Woche waren wir zweimal auf eigene Faust in der City und an einem anderen Tag haben wir eine Bustour durch Kapstadt gemacht. Besonders beeindruckt hat mich der Pan-African-Market, ein Haus voller afrikanischer Kunst und überengagierten Verkäufern die “good prices we can’t believe” machten, weil ja unser “lucky day” war. Etwa jeder 10. Verkäufer war auch schon mal in Deutschland gewesen, sodass die Tour über die kompletten 3 Etagen einige Zeit dauerte.

Und um sich dem Jargon der Surfshop-Locals zu nähern:
Take care and keep it real!

Tags: