b2.jpg
HOME  Services  CFD Tools  Resources   
Jobs  Links 
Tips  Patents  News  Library  Calculators  Glossary  

CFD Advice, Tips and Trickswake


Computational Fluid Dynamics is often said to be mishmash between science and art. Navier-Stokes equations can be elegantly derived, precisely discretized and efficiently coded. However, once a scientist or an engineer is faced with unexpected, persistent  and inexplicable convergence problems associated with numerical, iterative methods of CFD, one need not only help of exact science but also extensive experience, subtle intuition and a dash of fine art of fluid flow modeling. The right advice, tip or trick from fellow modeller can save hours and days of frustration and futile drudgery. So if you have any CFD tips or tricks  to contribute - please share with others.

Currently available CFD tips and tricks:

How to install OpenFOAM on Windows XP?

Installation of OpenFOAM on Windows XP (not tested on Vista or Windows 7) can be done easily with the help of Linux. This method presented below offers a work-around for common problems during installation of OpenFOAM  on Linux systems. Theis method was tested on 32-bit system

Summary of steps:
    * Download OpenFOAM software (4 files)
    * Download Ubuntu and burn CD, start Wubi installer and install Ubuntu on you Windows as any other windows software (a new partition will be added)
    * Transfer files from Windows to Linux and unzip in OpenFOAM folder
    * Edit .bashrc (or in some cases .cshrc) file and add one line defining path to OpenFOAM folders
    * Test you installation by running first test script, and then a simple case that will generate results files
    * Convert results to VTK format, and transfer to Windows side
    * Switch to Windows, install ParaView, read in results in VTK format and visualize data.
That's All Folks!

Detailed Installation Guide:
 
1. Use Windows to download ALL 4 files for 32bit or 64bit installation. Remember you will need ALL 4 files!
                    http://www.openfoam.com

2. Download Ubuntu iso file and burn CD. Install Ubuntu using Ubuntu CD or Wubi installer (Wubi is Ubuntu installer for Windows).
                    http://wubi-installer.org/
Reboot, select Ubuntu at the boot time, and login into your new Ubuntu/Linux account.
Create in your Ubuntu home directory  OpenFOAM folder
You do not need to activate/fix Linux networking, wireless, internet etc, which potentially might be very troublesome,
 as your main OS could still be Windows.

3. Transfer all 4 OpenFOAM files to /OpenFOAM folder on Ubuntu.
The Windows partitions and files will be available within the directories
                        /host and /media
One can also conveniently transfer files using USB memory stick that is accessible by all operating systems.
(Note: one could also use Ubuntu to download files directly to Linux folder, however, often networking, wireless is not working for linux out of the box)

4. Unzip all files in /OpenFOAM:                   
 $ tar xvf   OpenFOAM-1.6.General.gtgz       
 $ tar xvf   OpenFOAM-1.6.linuxGccDPOpt.gtgz     
 $ tar xvf   ThirdParty-1.6.General.gtgz     
 $ tar xvf   ThirdParty-1.6.linuxGcc.gtgz
Watch for any errors that rarely but still might pop up because of files corrupted during the download or other issues.

5. Open terminal window In your home directory edit with gedit file .bashrc 
                      $ gedit  .bashrc
and add 1 line at the end of .bashrc file that define path to OpenFOAM executables
                      . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc

6. Open new terminal window and check if installation is correct by executing
                        foamInstallationTest

7. Disregard installation of ParaView on Linux side (at least for now).

8.  Run test case e.g. cavity, icoFoam
Create a project directory within the $HOME/OpenFOAM directory named $LOGNAME-1.6 (e.g. ‘chris-1.6’ for user chris and OpenFOAM version 1.6) and create a directory named run within it, e.g. by typing:
                       $ mkdir -p $FOAM_RUN/run
Copy the tutorial examples directory in the OpenFOAM distribution to the run directory. If the OpenFOAM environment variables are set correctly, then the following command will be correct:
   $ cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN
Run the first example case of incompressible laminar flow in a cavity:
    $ cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
    $ blockMesh
    $ icoFoam

9. Convert results to VTK format by running foamToVTK converter.
                        $ foamToVTK
This will create VTK folder with files readable by ParaView.
Copy or move VTK folder with results to the Windows side.

10. Switch back to the Windows side by rebooting and selecting Windows at the boot time.
Install ParaView on Windows.
                        http://www.paraview.org
Open ParaView and read in VTK files (File>Open and double-click on files in VTK folder)
Click on green Apply-button, and select variable you want to visualize, e.g., p or V
Click on green Play-button, and enjoy animation of your first simulation with OpenFOAM

If you run into troubles check out other good resources on the Internet:
http://www.openfoam.com/docs/README.php
http://www.mathlab.mtu.edu/~yegong/html/Research_OpenFOAM.html

Total time, excluding software download time, should be about 15 minutes. There is no need to compile anything, just simple, straight forward installation that boils down to downloading, unzipping files and creating path to the new installation.

The advantage is that this installation method is very simple and should work first time which is a huge improvement over the standard installation on Linux which often fails when trying to get ParaView/VTK to work on Linux with OpenFOAM. On the other hand, the installation of OpenFOAM purely on Windows by cross-compiling is very difficult due to the fact that OpenFOAM was specifically developed for Linux machines (Windows for example does not differentiate between names that include small and capital letters).

Another advantage is that the results are processed on the Windows side, which is usually sooner or later necessary anyway because of popularity of some of the Windows software in presenting and disseminating results. All you need is only one computer and you can have your Windows and Linux coexist on one hard disk drive, and you can run and post-process you CFD simulation on one computer.

How to search for latest patents?

Search or browse
by inventor name or other search pattern
e.g., AIRFLOW DISTRIBUTION TO A LOW EMISSIONS COMBUSTOR
http://www.faqs.org/patents/inv/658945
http://www.faqs.org/patents/app/20090222187
Copy the number  20090222187,  go to
and search or just replace #.pdf with the correct defining number:
http://www.freepatentsonline.com/20090222187.pdf
Enjoy full pdf document that can be viewd and/or printed.


How to view patents on uspto.gov?

Yes, it is puzzling to have US Patent Office website (http://uspto.gov/) use plugins that do not work on most computers. Anyway, there is a relatively simple workaround, just use Apple web-browser Safari.

How to run OpenFOAM in parallel?

If you have multi-core processor, and most likely you do, you can first try to run in parallel on one PC.

The steps are as follows:

1. Copy decomposer file into your working directory

let's say your working directory is
$HOME/OpenFOAM/userid-1.6/run/tutorials/incompressible/simpleFoam/pitzDaily

then copy decomposeParDict, decomposition parameter file, to your working folder

cp $HOME/OpenFOAM/userid-1.6/run/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/decomposeParDict
$HOME/OpenFOAM/userid-1.6/run/tutorials/incompressible/simpleFoam/pitzDaily/system/.

and edit decomposeParDict (use nedit or gedit or vi depending on Linux Distros)

$ nedit system/decomposeParDict

and set parameters (number of processors 2, method simple)

numberOfSubdomains 2;
method          simple;
simpleCoeffs
{
    n               ( 2 1 1 );
    delta           0.001;
}

2. Prepare mesh
$ blockMesh
and run decomposition script
$ decomposePar
 
If you getting error then most likely it is because of kqRwallFunction
Edit file
$ nedit 0/R

and set your walls as follows:
    upperWall
    {
        type            kqRwallFunction;
        value          $internalField;
    }

If you are still getting error, do not despair, for sake of running parallel-test you might try to  temporarily change BC to  very simple zeroGradient, e.g.:
   upperWall
    {
        type            zeroGradient;
    }

and run again
$ decomposePar -force
(-force to overwrite previous folders and files)

3. Now you are ready to run mpirun script and save output data in case.log. You might want to add & at the end command line to run it in background.
$ mpirun -np 2 simpleFoam  -parallel >case.log &

4. Reconstruct final results (stored in subfolder processor0, processor1 etc)
$ reconstructPar

5. Postprocess results using your favorite postprocessing software eg ParaView on Windows or Linux
$ foamToVTK
creates VTK folder result ready to be used by ParaView



Copyright © 2007-2010 by AppliedCFD.com