CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Give me some advice CFD in Fortran code or Matlab code. (

tringuyenttt May 28, 2013 02:10

Give me some advice CFD in Fortran code or Matlab code.
Dear all,
I am in a divided mind using the Matlab or Fortran code in CFD, i can use the Matlab code but not good. In Fortran code i just can just understand the code program and write a simple problem. Please give me advice? What is the advantaged and disadvantaged both of them.

cfdnewbie May 28, 2013 03:26

Matlab is great for doing 1D problems and developing new schemes, Fortran is the way to go if you want 2D and 3D production codes.

whizkid May 28, 2013 06:34

fortran is way faster and robust than matlab i guess...

Jonas Holdeman May 28, 2013 09:46

It sounds like you are in the learning process. At this stage I would recommend Matlab. Matlab has a good integrated development environment, integrating editing, execution, debugging, and graphics. You can enter a change to your code, save it with the click of a mouse, and execute it and see results immediately. You don't have to waste time compiling, linking into an executable, running the code and post-processing results.

Matlab can be slow if you program with nested do-loops Fortran style, but Matlab has features that can reduce the number of do-loops. You use explicit, interpreted Matlab more for control with the grunt-work done by compiled Matlab internals. If you are running problems with a few million degrees-of-freedom, then Fortran would be faster, but if you are developing test code with perhaps a hundred thousand DOFs, the Matlab is fast enough.

When our have your ideas working in code, you can translate to Fortran. You can always fall back on the Matlab code as a benchmark to check out your Fortran. But the issue is not 1D, 2D, or 3D, but the number of variables you need to solve for.

tringuyenttt May 29, 2013 08:32

Hi alls,
Thanks so much for your guide. I will try.

All times are GMT -4. The time now is 22:02.