Input data from Fortran into OpenFOAM
Hey,
I have an initial turbulence condition that I generated in FORTRAN, and I want to make it the initial condition for a run of boxTurb16. I have already made sure that the mesh in Fortran and the mesh in OpenFoam are the same, but I can't figure out how to get OpenFoam to read the Fortran binary, and replace the initial conditions in /0/u and /0/p. Does OpenFoam have a built in function to read data from Fortran? Thank you for your time. |
Greetings Ryan and welcome to the forum!
Quote:
Bruno PS: I renamed the title of this thread, since MATLAB isn't anywhere mentioned on the first post... |
Answering your questions in order:
1) The reason I need to input data taken from a FORTRAN program into OpenFOAM is because I have a program in FORTRAN that models in-compressible turbulent flow using large eddy simulation, and i want to test it against a DNS to make sure that it is working correctly. I did not originally write this code, but whoever did built it so that it reads a FORTRAN binary file in order to set the initial conditions. 2) I already set the boundary conditions to be the same, I need now to input the data taken from FORTRAN into the files found at ~/0/u and ~/0/p, where currently a different turbulent initial condition is specified. Thank you for your quick reply, and for renaming the thread. Ryan. |
Hi,
you can compile the FORTRAN code as a dynamic library and link this library into your OpenFOAM solver Best Regards, Christian |
Greetings to all!
Ryan: This is a bit ambiguous at first, so here's an attempt at making it more explicit - correct me if I'm wrong:
The other possibility is to write the customized OpenFOAM utility to directly load the data from the binary file onto the OpenFOAM formatted fields in memory and then save them to their files. Either way, I vaguely remember an application that might partially fit the description - fluentDataToFoam: http://openfoam-extend.git.sourcefor...ToFoam;hb=HEAD For more, you can try using the search function on this forum and search for what people have been able to do with FORTRAN and OpenFOAM ;) Best regards, Bruno |
Hi Bruno,
I am new in OpenFOAM, now I use the OpenFOAM-3.0. Could you explain how to link the dynamic lib into OpenFOAM, Is there any example ? Is it possible to call subroutines of Fortran code in OpenFOAM ? Thank you for your time ! Kun |
All times are GMT -4. The time now is 09:39. |