lundi 12 novembre 2012

This post is the result of my TA activities. So this time I've decided to show students how to make curved meshes and how to run free surface simulations with OpenFOAM.

Cause all students are from Civil and Environmental Engineering department typical curved mesh is necessary for meandering channels simulation. Surely there're another types of flumes with curved parts (rising sector weir gate for ex.) but with meandering channels we'll have more fun.

Scheme of the channel are shown on Fig. 1. We've got 270 degree meandering part with centerline radius of 1.5 m which is connected to straight 1 m inlet and outlet channels with two small curved parts of smaller radius.

Figure 1

Progress on mesh creation is shown on Figs. 2-5. First mesh without curved edges is built, then arc edges are added, then density of mesh increased, and at last upper part (where air is located) of the channel added.

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Boundary conditions are rather usual for this type of simulations. We have constant discharge at the inlet and outlet (though maybe it'll be better to set zero gradient BC at the outlet). Then it is possible to run simulation. On the video first 200 s from the start are shown.

Most of the time when comparing simulation results with experiment it is necessary to get some more of less steady flow in the flume. Usually it is achieved by running simulation for rather long time (as an estimation we can take the time necessary to refill the channel, i.e. channel length / inlet velocity). With initially still fluid in the channel it'll take rather long time to settle all the oscillations of the free surface. So it's better to get some initial estimation of the velocity distribution in the channel. For the straight channel this first estimation (constant velocity along the channel) can be set with setFields utility, in case of more complex channel shapes we can use pimpleFoam where fluid free surface do not move and actually is wall with slip BC. So in this case I took mesh from Fig. 5, ran pimpleFoam with the same inlet and outlet BCs and then used mapFields for initial flow field setup.

Video of the free surface evolution in this new simulation is shown below.

As in the previous case in the video around 200 seconds from the start of simulation are shown. And this time we get almost steady flow during this time.

dimanche 21 octobre 2012

Creation of these movies was a part of sudden teaching assistance duties. In the beginning the idea was to just reproduce Kármán vortex street. And then it evolved to the comparison of vortex street simulation results with different turbulence models. Case files for the LES simulations can be found at https://bitbucket.org/mrklein/openfoam-ravings.

Channels and meshes

We have simple straight channel with two bodies of different shape put inside the channels. Simple schemes of the channels are shown on the figures below.

jeudi 11 octobre 2012

Initially I've got points from OpenFOAM sample in the plane, then I collected all Xes and Ys, and then (cause there was also fluid with channel involved and velocities was not available at every point and when data is not available then it's zero)...

jeudi 27 septembre 2012

To exclude I/O from this post I've modified code. So now it not only calculates factorials but also sums their digits and at last sums the sums of digits and as a result there's on one I/O operation.
Lisp as usual behaving quite good. And a result of this code:
is

But strangely Clojure, Haskell and Julia have got some very strange behavior. Till 12345! everything seems to be ok (though for Clojure it takes almost 1.5 sec to calculate while Lisp done it in 0.091 seconds of real time). But when we get 123456! Clojure needs almost 1 minute, Haskell and Julia just plainly refused to calculate. Even in case of Julia it was not so plainly cause it decided to eat almost all memory.

mardi 19 juin 2012

After 8 months in Korea at last I’ve decided to start learning language. I’ve got Korean language textbook which I bought as soon as I came here. With my colleague we arranged language exchange lessons. English for Korean. So the time for learning words came.
I the very beginning of my life here I bought paper flip-cards to learn alphabet. This time I’ve decided to be more technological and use iPad and iPhone. Surely there are lots of flip card sets on the Internet but they are just abstract flip cards: korean numbers, colors, verbs etc. I needed special sets of flip cards linked to the lessons in my textbook. So there appeared necessity for creation of flip cards. For this activity iPad with its onscreen keyboard was perfect. And for word learning I planned to use iPhone. And final procedure for learning became: