CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   recommend computer program for CFD (http://www.cfd-online.com/Forums/main/10584-recommend-computer-program-cfd.html)

richard2008 January 7, 2006 00: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 04:29

Re: recommend computer program for CFD
 
Richard,

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 www.PowerBasic.com. All of the software featured on www.TITANAlgorithms.com 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 www.TITANAlgorithms.com/hyperion_gcg is cut as a DLL and linked with HarvardThermal.com 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,

DSS www.TITANAlgorithms.com


William Blake January 7, 2006 06: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.

http://www.opencfd.co.uk


richard2008 January 7, 2006 15: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 22: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 omrkhairy75@yahoo.com

Khairy-Egypt

richard2008 January 7, 2006 23: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,

richard

Renato. January 8, 2006 10: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: http://www.cfd-online.com/Forum/main.cgi?read=42218

my opinion:

http://www.cfd-online.com/Forum/main.cgi?read=42222

http://www.cfd-online.com/Forum/main.cgi?read=42238

Regards

Renato.



All times are GMT -4. The time now is 13:40.