albertopassalacqua.com

Alberto Passalacqua Home Page

Qoppa PDF Studio: Edit PDF on Linux

I have just found a very useful application to edit PDF’s on all major operating systems (Windows, Mac, Linux): Qoppa PDF Studio. You can edit, add comments, underline and make various other changes to your PDF files with a very easy to use interface.

OpenCFD releases patched OpenFOAM 1.5

OpenCFD released a patched version of OpenFOAM 1.5 today, via a git repository. You can find the official announcement here.

The procedure to install it on openSUSE 11.0 is straightforward:

  • Be sure to have git installed. You can check it with
rpm -qa git

If it is not installed, you can easily install it with the command (as root):

zypper in git

provided you have the OSS repository in your repository list (check with zypper lr, and eventually add it using Yast -> Software -> Installation sources).

  • As a user, download the OpenFOAM patched source code using the command:
git clone git://repo.or.cz/OpenFOAM-1.5.git

This will create a directory called OpenFOAM-1.5.x, containing the source code.

  • Create a directory in your home called OpenFOAM, and copy the OpenFOAM-1.5.x directory into it.
  • Copy the ThirdParty directory containing all the third party packages provided in the release from OpenCFD into the OpenFOAM directory in your home.
  • Edit your .bashrc file in your home directory, so that it contains the line:
. $HOME/OpenFOAM/OpenFOAM-1.5.x/etc/bashrc

and remove previous OpenFOAM settings if present.

  • Open a terminal and move to ~/OpenFOAM/OpenFOAM-1.5.x.
  • Run the ./Allwmake script to proceed with the compilation process.

When future updates are released, it will be possible to download them using the command:

git pull git://repo.or.cz/OpenFOAM-1.5.x.git

and compiling the source again.

Note openSUSE 11.0 comes with Qt 4.4.0. To successfully compile Paraview and paraFoam reader for Paraview, it is necessary to comment the following line out in the ~/OpenFOAM/ThirdParty/ParaView3.3-cvsCMakeLists.txt file:

MESSAGE(SEND_ERROR “Qt ${QTVERSION} not supported.  Please use Qt 4.3 (you may need to clean your dirtied cache).”)

as explained in this discussion on the OpenFOAM discussion board.

Enjoy :-)

OpenFOAM 1.5 molecular dynamics solver user guide

OpenFOAM 1.5 introduced a molecular dynamics solver, which has been documented by the multi-scale flows group of the Mechanical Engineering department at the University of Strathclyde. You can find the documentation on the wiki page of the group.

New blog look!

As you can see, I radically changed the look of my blog. After many attempts, I finally decided what theme to use to replace the old one which served me for a long time!

Porous zone in OpenFOAM

OpenFOAM offers an easy way to solve for a single flow in systems with porous zones, with the possibility of specifying the porosity and to use Darcy-Forchheimer or power law models. This feature is very versatile, allowing the user to specify also porous zones not aligned with the main reference frame and multiple porous zones in the same case. Currently this feature is implemented in a compressible flow solver (rhoPorousSimpleFoam), with both an explicit and an implicit treatment of the momentum source term due to the presence of the porous zone.

I will show the basic functionalities of this OpenFOAM feature with a simple example of a 2D channel made of two parallel walls distant 0.07m and 1m high. Let’s fix the reference frame so that the walls are perpendicular to the x direction and parallel to the y direction. The channel contains a porous zone which extends from y = 0 to y = 0.5m, with a porosity of 0.5. In this case Darcy-Forchheimer law will be used, with a viscous resistance parameter d of 107, and without inertial resistance (f = 0).

To set the case up, the tutorial case of rhoPorousSimpleFoam can be taken as reference, and the following steps must be followed:

Create the mesh specifying that the rectangle delimited by (0,0) and (0.07, 0.5) is a cell zone called porosity. The name of course is arbitrary. If the mesh is imported, it is necessary to assign the name to the zone when the mesh is created, and use the -writeZones option when importing it.

Open the constant/porousZones dictionary and edit it so that it looks like the following:

1
(
    porosity
    {
        coordinateSystem
        {
            origin (0 0 0);
            e1  (1 0 0);
            e2  (0 1 0);
        }

        porosity 0.5;

        Darcy
        {
            d   d [0 -2 0 0 0 0 0] (-1 1e7 -1);
            f   f [0 -1 0 0 0 0 0] (0 0 0);
        }
    }
)

Notice that the dictionary contains one entry, and 1 is specified at the beginning of the dictionary. The coordinateSystem subdictionary specifies the main directions of the porous zone resistance, while the porosity entry sets the porosity value for the porous zone. Finally, the Darcy sub-dictionary contains the coefficients for Darcy’s law. Each parameter is a vector with a value of the parameter for each direction specified in the coordinateSystem subdictionary. Negative values of the coefficient in Darcy’s law are not valid, and can be used as multipliers of the maximum component. For further information on the porous zone and on its implementation in OpenFOAM, please refer to the Doxygen documentation here.

To complete the case set up, it is necessary to edit the boundary conditions to match the ones specified above. For the purpose of this exercise, we can switch the turbulence model off in the constant/RASProperties dictionary too. You can then run the case in a terminal by simply entering the case directory and executing rhoPorousSimpleFoam.

Note: This procedure was tested in OpenFOAM 1.5.

Enjoy :-)

Unsteady boundary conditions in openFOAM

I recently had to help a friend setting up a case in OpenFOAM, where a ramp boundary condition for the velocity was required. Apparently OpenFOAM doesn’t offer this boudary condition, or at least it might seem so at a first impression.

Actually, OpenFOAM offers a very general way to specify unsteady boundary conditions called timeVaryingFixedValue, which can read a data set from a text file, interpolate them with respect to time and use them to generate the unsteady boundary condition.

I will show how to use this boundary condition with a simple example of a ramp for a velocity boundary condition. We want the velocity to ramp from the value U1 = (0, 1, 0) to the value U2 = (0, 3, 0) in the time interval between t1 = 0 and t2 = 5s. The velocity stays constant and equal to U2 for t > t2.

The ramp is simply defined by the extrema: the interpolation routine will automatically provide the correct values for the times contained inside the interval specified above. So, we need to create a text file with the following format:

(
 (t_0 value_0)
 ...
 (t_n value_n)
)

In our specific case, we create a file called ramp containing the following lines:

(
 (0.0 (0 1 0))
 (5.0 (0 3 0))
)

This file must be saved in the main directory of the simulation case, containing the 0, constant and system directories.

The boundary condition can be then specified in the velocity dictionary in the 0 directory as follows:

rampInlet     
{
  type         timeVaryingUniformFixedValue;
  fileName     "ramp";
  outOfBounds  clamp;
}

It is worth to pay attention to the option

 outOfBounds  clamp;

which specifies that for all the values of t outside the interval provided by the data, the values of the dependent variable are clamped to the last available value. In our case this means that the condition U = U2 for t > t2 will be imposed.

The clamp option is also useful if we want to specify a ramp that begins for t > 0 or to change the final value of the dependent variable when the ramp is completed. Let’s consider the previous example again. Now we want the ramp to start at t = 2s and the velocity to go to zero at the end of the ramp. This can be simply accomplished by adding two lines to the dictionary, as follows:

(
 (1.99999 (0 0 0))
 (2.0 (0 1 0))
 (5.0 (0 3 0))
 (5.00001 (0 0 0))
)

The timeVaryingFixedValue boundary condition is of course suitable for all kinds of fields. For a scalar, the dictionary will contain couples of data (t, value), while for tensors each line will have a 9 components tuple.

Note: This procedure was tested on OpenFOAM 1.5.

Enjoy :-)

A good idea from Fedora

I came to know from Moro’s blog that Fedora has a project called Fedora Unity with, among the others, the task to prepare re-spins of the ISO images of the distribution. I think it is a very good service, because who starts to use the distribution do not need to download the ISO and then a huge number of updates. It would be nice if other distributions like openSUSE did the same, and I hope they will consider the idea in the future.

Coffee…

Today, in a discussion with some friend I found out that there is a lot of confusion about how coffee is prepared and what is its caffeine content. Let’s look at it a bit more closely.

First of all, the coffee preparation is a process that technically is called solid-liquid extraction. The water (liquid) goes through the coffee, and in the meanwhile extracts the substances that will give it the taste and the consistence. In other words, it is water that acts as a solvent for certain substances contained in the coffee powder. The preparation of a coffee does not involve steam, and surely is not an extraction with steam! Two considerations make this clear: there’s nothing in a coffee machine that would condense the steam (the coffee comes out liquid), and the water does not actually boil in a good coffee machine, because the right temperature to obtain a good coffee is 92-93°C according to experts.

About the caffeine content, there is the widely spread idea that espresso is more concentrated and so it contains more caffeine than an American coffee. Actually, even if the caffeine content strongly depends on the type of coffee used (robusta quality has about 2.5 the caffeine content of the arabic one), one espresso contains from 30 to 90mg (average 40mg) of caffeine, while a generic brewed coffee contains from 102 to 200mg (average 133mg) of caffeine. You can read more data here.

Enjoy your coffee! :-)

Send your name to the moon!

If you want to go to the Moon, you might be interested in this initiative to send a list of all the names who supported the mission of the LRO spacecraft, bringing NASA back to the moon. To have your name added it’s simply enought to fill the form and submit. You’ll be able to download a certificate proving your support to the mission. My certificate is here!

openSUSE 11.0 is out!

OpenSUSE 11.0 was released on Thursday 19th as scheduled in the release roadmap, and can be downloaded from the openSUSE site.

This version of openSUSE supports the 32bit, 64bit and PPC architectures, with a set of media constituted by the conventional, full featured DVD, the installable CD with the GNOME or KDE4 desktops, and the mini ISO CD for the network installation for the most experienced users.

The best innovations introduced in openSUSE 11.0 are listed in the sneak peeks written by Francis Giannaros, that you can read here. The detailed feature list can be found on the product highlights. The following list sums up the most important of them:

  • Kernel 2.6.25.4
  • gcc 4.3
  • Xorg 7.3
  • GNOME 2.22.1
  • KDE 4.0.4 and 3.5.9
  • Firefox 3.0
  • OpenOffice 2.4
  • Banshee 1.0

Installation

OpenSUSE 11.0 comes with a new, very elegant and clean installer, which has been redesigned both in the look and in the structure. The new installation based on images makes the installation process a lot faster and the automatic configuration significantly reduces the number of steps the user has to perform to configure his system. Of course the advanced configuration is always available, and it shows the usual YaST tools to set the details of the system up.

Hardware support

OpenSUSE hardware support has always been great, and this release keeps SUSE reputation. All the hardware of my DELL XPS m1330 was recognized immediately, including the wireless card and the webcam. The only detail which should be improved is the installation of the nVidia accelerated drivers, which still requires manual intervention, even if very reduced thanks to the 1-click technology.

GNOME

I think that the GNOME implementation of openSUSE 11.0 really deserves some special consideration. OpenSUSE has been a KDE distribution for years, with GNOME considered by many an inferior desktop in this distribution. After some releases (from 10.1 to 10.3), where the GNOME implementation improved, but still had some problems, openSUSE 11.0 clearly shows that GNOME and KDE now receive the same level of attention in openSUSE.

Of particular note is the amazing work done by Novell GNOME team for the implementation of PulseAudio, which was initially problematic for other distributions, with sound glitches when the system was under heavy workload. OpenSUSE has none of these problems: PulseAudio simply works out of the box, and the audio quality is amazing even when the whole CPU is used.

Configuring desktop effects in GNOME is really a 2 clicks operation, with the simplified tool included in the openSUSE GNOME Contol Center. You simply need to install the nVidia accelerated drivers and then to enable the effects. No need of complex configurations.

NetworkManager makes networking extremely easy, automatically reconnecting to your wireless network when it’s detected, and being able to manage mobile broadband, vpn and dsl connections with a single applet.

Banshee 1.0 include a large number of new features it would deserve a separate review to extensively comment all of them. The most interesting ones are the ability of reproducing videos, the integration with Last FM, the new engine to manage the media database, and the redesigned interface.

The new international clock integrates with the weather applet, to show the weather forecasts in each location listed, and of course, it can shows evolution appointments and to-do list, as it already did in its previous versions.

Some problem is present in YaST-gtk when managing printers, but the team has already fixed it and a patch should come through online updates very soon.

Conclusion

OpenSUSE 11.0 represents an important step forward for openSUSE. They got rid off of the package management problems introduced in openSUSE 10.1, which affected the distribution until openSUSE 10.3, and now they can be proud of having one of the fastest package managment tools in the Linux world. GNOME finally reached a good level of maturity, KDE is offered in two versions to grant stability to the users who need it and to provide cutting edge KDE 4 to those who want to experiment.

For the future. I think openSUSE needs to take some breath, working on stabilization and keeping to work on cleaning the distribution as they already did for openSUSE 11.0. I would like to see some more care for details (i.e. fully functional 1-click installs for codecs, well tested YaST modules, …), a less hurried release process to be sure that unexperienced user won’t find difficulties in accomplishing simple tasks.

However, great work Geeko! ;-)

  • Google AdSense

  • LinkedIn

    Alberto Passalacqua
  • Licence