CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   recommend computer program for CFD (

richard2008 January 7, 2006 01:28

recommend computer program for CFD
Hello everyone,

About four years ago, there was a hot discussion about which computer program is better for CFD in this forum. The result was not clear: some guys voted for Fortran, some guys went for C or C++, but a few guys perfered VB or Java. Now is 2006, things may be different. I have the background of Fortran, C and Matlab, but I havn't used Fortran for long time. I occasionally used a little bit C during the past few years. I use Matlab most of the time. Now I'm starting to do some CFD work, could you please recommend me a better language for it? Appreciat your help!

TITAN Algorithms, Staff January 7, 2006 05:29

Re: recommend computer program for CFD

Your post is bound to create that stir again. I am not sure why. The compiler really should be a matter of personal preference. And the end result, if done correctly, will be independent of that initial choice, be it FORTRAN, C, VB, PB, Java, etc. Your CFD software is just communicating the inputs to some logic structure to compute the discretized results. In a sense, we are all just writing elaborate matrix inversion tools with extensive pre and post processors.

Having said that, I would suggest the following key factors for the compiler selection (obviously more can be added)

1) OS supported

2) fast and reliable floating point operations

3) fast and reliable memory allocation

4) fast and easy string manipulation

5) Support of the OS API

I have programmed in several languages over the years, just as most have. In the last 5 years I have settled into my null point, with the selection of PowerBasic (PB). See All of the software featured on is programmed in PB. I use PB for all these reasons and more. Everything on TITAN is PB-derived, including the graphics engines for the CFD and meshing tools (Hyperion-TFS and Hyperion-Mesh3D).

One of the strong points of PB is the ability to cut any compilation to an industry standard DLL. This DLL can then be linked with any other code such as C++. The conjugate gradient solver featured on is cut as a DLL and linked with TAS and TASStress modules. The entire product is seamless, yet works on two different compiled languages.

If you are interested I would happy to post a project example which may help you in your selection.

Hope it offers a datapoint for your selection

Kind Regards,


William Blake January 7, 2006 07:02

Re: recommend computer program for CFD
There is just one big drawback using PB: it is platform dependend and only available for windows.

You can use OpenFoam if you don't want to start from scratch.

richard2008 January 7, 2006 16:33

Re: recommend computer program for CFD
Dear TITAN Algorithms,

Thanks a lot! I'm not trying to stimulate that stir again. I'm just trying to get some suggestions from those experts like you in CFD. Previously, I mainly used the Comerical CFD package like Fluent to solve CFD. But now I get some chance to write the CFD by myself. Since it will be my first time to write the CFD code, I perfer some language which is easy to learn, compile and interprete. Initially, I prefer C, because I had some experience with that. But I'm not sure whether C is good or not for CFD. Thanks again,

khairy January 7, 2006 23:51

Re: recommend computer program for CFD
Dear richard

i hope to u good luck in written codes First:in my MSC thesis i write codes in Fortran 77 and Fortran 90,Matlab and visual basic second:i intended to learn Visual C++ third:the selection in my opinion is as follow 1:if need a GUI(like form and buttons)use Visual basic 2:if u need to reuse old subroutines or codes u need to learn F77 or F90 3:if u need to plot during calculation with small matrixsize use Matlab 4:if u need rapid calculation especially for actual CFD problems u need to use Fortran 90 or C++

this conclusion is from my limited experience,may it be useful for u,always u are welcome to discuss at


richard2008 January 8, 2006 00:49

Re: recommend computer program for CFD
Dear Khairy:

Thanks a lot. I totally agree with your points. Although I don't have any experience with VB, I know it is a good tool of GUI(actually I tried to learn it a few years ago). Yes, Matlab is very easy to use and very convenient for plot. Probabily I will go for C(or C++), because I think it can be improved to C++ later and it can also be recalled by Matlab. Fortran is alway very popular for CFD, but I am not sure how long it will last. I mean C++ may be the angle of future, and it might be more useful if you swiched your research area or major in the future. Maybe I'm wrong, you know, I have no experience with using C/C++ for CFD problem. Thanks again,


Renato. January 8, 2006 11:18

Re: recommend computer program for CFD
Hi richard2008,

I guess we´ve got a similar discussion some time ago here...

take a look in the following posts:

ROOT post:

my opinion:



All times are GMT -4. The time now is 11:29.