CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   A beginner question (https://www.cfd-online.com/Forums/openfoam/76737-beginner-question.html)

walk_and_see June 2, 2010 18:33

A beginner question
 
Hello all,

I am a CFD person but have no experince with OPENFOAM at all. Could you please let me know the following?

1) How long it takes to learn and be able to run a simple flow problem (e.g., flow past cylinder), including mesh making?
2) Can I use a Fortran code to call OPENFOAM?

Your input is greatly appreciated.

Go and see

alberto June 3, 2010 09:11

Quote:

Originally Posted by walk_and_see (Post 261464)
Hello all,

I am a CFD person but have no experince with OPENFOAM at all. Could you please let me know the following?

1) How long it takes to learn and be able to run a simple flow problem (e.g., flow past cylinder), including mesh making?

Not very long if you have some experience with codes (not commercial black boxes), and with the UNIX/Linux environment.

The story changes if you have to change the code, and at that point I would recommend to either take a course from OpenFOAM developers or be prepared to spend a good amount of time exploring and learning the code details.

Quote:

2) Can I use a Fortran code to call OPENFOAM?
If you mean call the executable, yes, nothing different from any other executable. If you mean calling OF functions from a fortran code, I would say it's not impossible but it might be hard.

Best,

pbe_cfd March 7, 2011 14:20

Quote:

Originally Posted by alberto (Post 261540)
If you mean call the executable, yes, nothing different from any other executable. If you mean calling OF functions from a fortran code, I would say it's not impossible but it might be hard.

Best,

Hi Alberto,

I mean to call executables, this post is from me to thread " How to interface a Fortran thermodynamic tool with OpenFOAM?"
__________________________________________________ _______
Hi,

I have couple of fortran.90 subroutines which I would like to call from OpenFOAM1.6. What I know direct call of fortran subroutine from c++ is not good. Thus, one has to have C interface to routines and some more technical difficulties as, fortran stores rowwise C stores columnwise :confused: Whatever, these are general problems of C++ and Fortran mixing. My questions are more OpenFOAM specific:

1) What should be the compiled fortran source codes, dynamic library, shared objects (.so), objects (.o) ... ? If more than one is good, which one performs better?

2) How should be this "executables" (compiled files) linked to OpenFOAM, let's say scalarFoam? How should the <file> and <options> in Make folder be modified?

Please no suggestion like "why don't you rewrite your subroutines in C++" ;-)

All the best,

@ Cyp: You see, I am chasing you ;-)
__________________________________________________ _______
Any idea?

Cheers,


http://www.cfd-online.com/Forums/ima...ser_online.gif http://www.cfd-online.com/Forums/ima...reputation.gif http://www.cfd-online.com/Forums/ima...ons/report.gif http://www.cfd-online.com/Forums/ima...c/progress.gif http://www.cfd-online.com/Forums/ima...ttons/edit.gif

gwierink March 8, 2011 03:58

Hi Evren,

You can call Fortran routines from within C++ code using the extern directive. There are some general hints here, here, and here. Also, check this and this OF related threads.


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