- What is SLFCFD?
- Like SLFFEA
, you're keeping your
name in the acronym. Sad.
- What do I need to run SLFCFD?
- What is SS-GUI?
- What is the P-Winston Motion Engine?
- What are your qualifications to write CFD code?
- What motivated you to write this?
- There are so many free CFD codes. Why write another one?
- Can you talk a little about the other codes you surveyed?
- FEA can be applied to CFD. Will SLFCFD only include non-FEA methods
leaving it for SLFFEA?
- How do you install Mesa ?
- Why am I getting the error GL/glut.h: No such file or directory?
- What does your /usr/X11R6/lib and /usr/include/GL look like?
- Does SLFCFD include mesh generators?
- What units does SLFCFD use?
- Why do I get "command not found" when I try the text executables
in the data directories?
- What is SLFCFD?
SLFCFD stands for San Le's Free Computational Fluid Dynamics. It is a package
of scientific software and graphical user interfaces for use in computational fluid dynamics.
It is written in ANSI C by San Le and distributed under the terms of
the GNU license.
Top
- Like SLFFEA, you're keeping your
name in the acronym. Sad.
Yeah, well. It's called name branding. Those of you who are bothered by this can think of it as
SeLF-CFD as in Do-It-YourSeLF-CFD. Anyway, that's not really a question.
Top
- What do I need to run SLFCFD?
- To compile from source, you need GNU/Linux or some form of Unix.
- Extraction tool, like tar xzvfp.
- C compiler(you should know where your cc or gcc is located so you can define
the CC macro in the makefiles. Just do a:
which gcc
or
which acc
and then put the path in the Makefile. For instance, when I do a "which gcc", I get:
/usr/bin/gcc
which is how my CC is currently defined.
Mesa-3.0 (OpenGL for the PC) or higher or Open GL. If you install it, you should put it
in your /usr/local/ directory.
Top
What is SS-GUI?
SS-GUI stands for Self-Scaling GUI. If you resize the GUI window,
all the text inside will rescale itself such that the text and color scale
boxes maintain their proportions with the window, and it will also work the
same as before. This is possible because the GUI is built on OpenGL rather
than some packaged window manager.
Top
What is the P-Winston Motion Engine?
The P-Winston Motion Engine is about 300 lines of code written by Philip
Winston which he has graciously and generously allowed me to use and modify for
the GUI part of SLFCFD. The P-Winston enables you to use the mouse to rotate and
translate the mesh, especially to refine rotations and translations done
through hot keys or the GUI. It works like a trackball, but keeps the different
types of motion separate. For example, holding down the left button and moving
the mouse up and down will produce translation in Z. Moving it left and right
with this same button held down will rotate it on the Z axis. The middle button
controls translation in X and Y, and the right button, rotation in X and Y. While
this seems more complex than a typical trackball, it has the advantage of isolating
the movements for fine tuning of the position at which you want to view the object.
Also, the P-Winston has much less computational overhead than a Mesa trackball.
Note that you have to have the Mesh Window active to have mouse control.
Top
What are your qualifications to write CFD code?
I claim no qualifications to write CFD code. Like all GNU software, you
are using it at your own risk. That said, here is a bit of my academic history
which you may use to judge my qualifications:
Academic History
Note that I'm not a PE and I have never taken the PE exam.
Top
What motivated you to write this?
I elaborate more on the page for
SLFFEA, so I'll just say here that
I enjoy working within the Free Software/Open Source Community and contributing
my skills to it with these codes.
Top
There are so many free CFD codes. Why write another one?
In my survey of other codes like
Gerris ,
Featflow , and
OpenFoam
I felt that SLFCFD could offer some things they lacked. First, I will say that
I think the science of all these codes are much more sophisticated than SLFCFD, and you would
do very well to download them yourself if you need a lot of functionality and are solving a very
complex system. But here are the reasons to use SLFCFD:
- The only real dependency SLFCFD has is Mesa
which comes standard on most GNU/Linux, other Unices, and MS Windows distributions. For the other Free Codes
that include graphics which I have tried out, there are often other packages which need to be installed.
Sometimes, they even need very specific versions of the library, and all this makes installation a
challenge. I hope that my code is standard enough that this isn't true about SLFCFD.
- My control panel is built with Mesa, so there is no additional
windowing library you need like GTK, Motif, QT, or Microsoft's Visual C++ API.
- As related to the two points above, SLFCFD should be truly cross platform for all Unices,
Microsoft Windows, and Apple OSX. This has been true of SLFFEA, which I have ported to/seen others port to the
BSDs, Beos, OSX, Irix, and MS Windows(compiled with MS Visual C++ or under CYGWIN )
etc.
- I break the code down between graphics and scientific. So if you only want to deal with the
numerics, you can just focus on that.
- Input and output data/graphics data have the same format. So it is possible to easily continue
a calculation if more time steps are desired.
- SLFCFD is, I hope, less resource intensive compared to others. Like SLFFEA, I develop on a Pentium II 233 MHz
with 256 MB RAM + 128 MB swap.
- Currently, the code is fairly simple so if your needs are limited, hacking SLFCFD might be less of a challenge
than going through the other codes.
- I am writing this also for my own edification and to take a break from FEA. There is also a possibility that
I will do computations in the future requiring the merging of solid and fluid mechanics. I can customize
SLFCFD and SLFFEA in preparation for that.
Top
Can you talk a little about the other codes you surveyed?
- Gerris - This is an excellent code for incompressible
fluids. It can handle both 2-D and 3-D meshes. It has a nice GUI and will make a
video of the flow as it evolves over time. It does adaptive mesh refinement and has a multigrid
solver. Also, calculations can be done independently of the graphics. One downside is that it
requires a few other packages to compile.
- Featflow - I have only installed the scientific part,
but there is a graphics part as well. This code uses the finite element method to calculate incompressible
2-D and 3-D flows. It runs very well and has a nice mesh generator. If I add FEA to SLFCFD, I
would like to base it on their solver. The few downsides of the code are that they are not clear
about what Open Source License they are using, and this scientific part is written in Fortran.
Here are some images of the work I have done with Featflow .
- OpenFoam - I've downloaded OpenFoam,
but have not installed it. Because it used to be a proprietary commercial code, I think it would
be a very fully featured code. The reasons I have not installed it are that it has several
dependencies which I currently don't want to install or update on my machine. They include, gcc-4.0.1,
ParaView , and an implementation of Java.
The sourcecode download is very big with the tarball 67 MB in size.
- ParaView - ParaView
is like OpenDX , a very powerful general
graphics utility. It requires Tlc/Tk to run. It looks like it has very permissive redistribution
terms, like the BSD license. The download is very big, about 44 MB.
Top
FEA can be applied to CFD. Will SLFCFD only include non-FEA methods
leaving it for SLFFEA?
I don't think this will be the case. It was at University where I began to associate FEA with solid
mechanics and finite difference/finite volume methods with fluid mechanics. While I have not seen non-FEA
methods used in solid mechanics, I certainly have seen FEA applied to nearly every branch of computational physics.
Because of the advantages of FEA(non-structured grids, arbitrary boundaries), I would like to use it as
the core method of any other code I write including CFD.
Top
How do you install
Mesa?
For recent versions of GNU/Linux, you may not have to. (Mesa
comes pre-installed on Slackware 7.1). All you need to do is
add the following softlink:
cd /usr/include/
ln -s /usr/X11R6/include/GL/ GL
if it doesn't already exist.
If you would rather compile using the latest release
of Mesa, you can do the following. From Section 16.0.0
of my GNU/Linux Installation Guide:
16.0.0 Installing Mesa(the OpenGL graphics library):
16.1.0 For recent versions of GNU/Linux(like Slack-
ware-7.1), Mesa comes pre-installed. All you need to do is add the
following softlink:
cd /usr/include/
ln -s /usr/X11R6/include/GL/ GL
if it doesn't already exist.
There are several places where you can get Mesa. You can get it off
the web at:
http://sourceforge.net/project/showfiles.php?group_id=3
16.1.1 For recent versions of RedHat you need to add the glut libraries
from the RPMs on the installation disk(For RedHat 8.0, it is on the
3rd disk, for RedHat 9.0, it is on the 2nd disk):
cd /mnt/cdrom/RedHat/RPMS
rpm -Uhv glut-3.7-12.i386.rpm
rpm -Uhv glut-devel-3.7-12.i386.rpm
16.2.0 After getting the tarfiles, copy them to the
directory /usr/local/ and do:
tar xzvfp MesaLib*.gz
tar xzvfp MesaDemos*.gz
16.3.0 Compiling Mesa Programs
16.3.1 From the /Mesa-3.4.2/README:
To compile the library, first type 'make' alone to see the
list of system configurations currently supported. If you
see your configuration on the list, type 'make '.
Most popular Unix/X workstations are currently supported.
For my machine, I use:
make linux
16.3.2 Header Files and Libraries
From the /Mesa-3.4.2/docs/INSTALL:
Header and library files:
After you've compiled Mesa and tried the demos I recommend the following
procedure for "installing" Mesa.
Copy the Mesa include/GL directory to /usr/local/include:
mkdir /usr/local/include/GL
cp -r include/GL/* /usr/local/include/GL/
Copy the Mesa library files to /usr/local/lib:
cp -d lib/* /usr/local/lib
(actually, use "cp -d" on Linux to preserve symbolic
links)
16.3.3 Install Widgets-Mesa Library
You also need to install the Widgets-Mesa Library. First:
cd /usr/local/Mesa-3.4.2/widgets-mesa/
The file /usr/local/Mesa-3.4.2/widgets-mesa/INSTALL tells you to:
./configure
make
make demo.gl
make demo.mesa
make demo.ws
make demo.tea
make install
Top
Why am I getting the error GL/glut.h: No such file or directory?
Because Mesa is pretty standard on most GNU/Linux distributions, I think you are only lacking
the glut libraries(and possibly some other include files) which usually aren't installed unless you
install everything including development tools for Linux. I recommend that you check to see that
the glut libraries are in:
/usr/X11R6/lib
and that there is a directory:
/usr/include/GL
containing all the necessary Mesa and glut files. See the next question
for more information.
Sometimes, Redhat and Fedora have glut and glut development RPMs on their installation disk in the
/RedHat/RPMS directories. You may have to look around to find it. For now, I will repeat what I say
above:
To install the glut libraries from the RPMs on the installation disk(For RedHat 8.0, it is on the
3rd disk, for RedHat 9.0, it is on the 2nd disk):
cd /mnt/cdrom/RedHat/RPMS
rpm -Uhv glut-3.7-12.i386.rpm
rpm -Uhv glut-devel-3.7-12.i386.rpm
Top
What does your
/usr/X11R6/lib
and
/usr/local/include/GL
look like?
After updating to Mesa-3.2.1,(Mesa-3.0 should still work),
doing an
ls -l in
/usr/X11R6/lib gives:
-rw-r--r-- 1 root root 678504 2005-01-23 20:45 libGL.a
lrwxrwxrwx 1 root root 12 2005-05-31 07:32 libGL.so -> libGL.so.1.2
lrwxrwxrwx 1 root root 12 2005-05-31 07:32 libGL.so.1 -> libGL.so.1.2
-rwxr-xr-x 1 root root 608015 2005-01-23 20:53 libGL.so.1.2
-rw-r--r-- 1 root root 659352 2005-01-23 20:45 libGLU.a
lrwxrwxrwx 1 root root 13 2005-05-31 07:32 libGLU.so -> libGLU.so.1.3
lrwxrwxrwx 1 root root 13 2005-05-31 07:32 libGLU.so.1 -> libGLU.so.1.3
-rwxr-xr-x 1 root root 563990 2005-01-23 20:53 libGLU.so.1.3
-rw-r--r-- 1 root root 27902 2005-01-23 20:45 libGLw.a
lrwxrwxrwx 1 root root 13 2005-05-31 07:32 libGLw.so -> libGLw.so.1.0
lrwxrwxrwx 1 root root 13 2005-05-31 07:32 libGLw.so.1 -> libGLw.so.1.0
-rwxr-xr-x 1 root root 26550 2005-01-23 20:53 libGLw.so.1.0
lrwxrwxrwx 1 root root 12 2005-05-31 07:22 libglut.so -> libglut.so.3
lrwxrwxrwx 1 root root 14 2005-05-31 07:22 libglut.so.3 -> libglut.so.3.7
-rwxr-xr-x 1 root root 215332 2003-08-20 14:24 libglut.so.3.7
and doing an
ls -l
in
/usr/include/GL
gives:
-r--r--r-- 1 root root 7946 2005-01-23 20:45 GLwDrawA.h
-r--r--r-- 1 root root 4433 2005-01-23 20:45 GLwDrawAP.h
-r--r--r-- 1 root root 2309 2005-01-23 20:45 GLwMDrawA.h
-r--r--r-- 1 root root 2311 2005-01-23 20:45 GLwMDrawAP.h
-r--r--r-- 1 root root 89951 2005-01-23 20:44 gl.h
-r--r--r-- 1 root root 306424 2005-01-23 20:44 glext.h
-r--r--r-- 1 root root 15981 2005-01-23 20:44 glu.h
-r--r--r-- 1 root root 9016 2005-01-23 20:44 glx.h
-r--r--r-- 1 root root 29020 2005-01-23 20:44 glxext.h
-r--r--r-- 1 root root 4257 2005-01-23 20:44 glxint.h
-r--r--r-- 1 root root 2453 2005-01-23 20:44 glxmd.h
-r--r--r-- 1 root root 71034 2005-01-23 20:44 glxproto.h
-r--r--r-- 1 root root 8878 2005-01-23 20:44 glxtokens.h
-r--r--r-- 1 root root 8349 2005-01-23 20:44 osmesa.h
-rw-r--r-- 1 root root 20844 1998-08-07 17:18 glut.h
-rw-r--r-- 1 root root 5150 1998-08-07 17:18 glsmap.h
-rw-r--r-- 1 root root 7273 1998-08-07 17:18 fglu.h
-rw-r--r-- 1 root root 10152 1998-08-07 17:18 fglut.h
-rw-r--r-- 1 root root 60468 1998-08-07 17:18 fgl.h
Top
Does SLFCFD include mesh generators?
There are a few generators for specific meshes like the jet, bubble, and
shock tube problems. Currently, SLFCFD is only for uniform, structured,
finite difference meshes, so there's little advantage having a mesh generator
at this point. If you download SLFCFD and look at the data you will see
what I mean. Basically, the data is given in terms of i, j, k indices which
also act as nodal coordinates. So i represents x , and i = 0
would be like the boundary at x = 0 . Associated with each nodal point are
quantities such as pressure, temperature, density, etc. I think the data is
highly understandable, but tedious to generate. For very big meshes, you will
likely have to write a little program like the ones I have made. Also, the meshes
tend to be rectangular at this point.
Top
What units does SLFCFD use?
For units, just be consistent. If using inches and lbs, then you would use
psi for pressure. If meters and Newtons, then Pascals. So you can
use any system of units you want.
Top
Why do I get "command not found" when I try the text executables
in the data directories?
This is a common issue with Unices. For the incompressible flow, instead of just
"qik", type in:
./qik
which means execute the code "qik" in your current directory. You can
also add:
export PATH=$PATH:.
or
export LD_LIBRARY_PATH=.
in your ".bashrc" or ".bash_profile" (or whatever your Unix uses) to
avoid having to type "./" before every executable. The reason this
is not automatically done in Unix is for security reasons, so you may
want to think about adding "." to your path.
Top
|