|
[Sponsors] |
June 9, 2012, 20:15 |
Input data from Fortran into OpenFOAM
|
#1 |
New Member
Ryan Sanders
Join Date: Jun 2012
Posts: 2
Rep Power: 0 |
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. |
|
June 10, 2012, 14:51 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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...
__________________
|
||
June 10, 2012, 17:41 |
|
#3 |
New Member
Ryan Sanders
Join Date: Jun 2012
Posts: 2
Rep Power: 0 |
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. |
|
June 11, 2012, 04:01 |
|
#4 |
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 18 |
Hi,
you can compile the FORTRAN code as a dynamic library and link this library into your OpenFOAM solver Best Regards, Christian |
|
June 12, 2012, 18:36 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
August 28, 2017, 09:58 |
|
#6 |
New Member
Kun Zheng
Join Date: May 2017
Location: Harbin, China
Posts: 20
Rep Power: 9 |
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 |
|
Tags |
boxturb16, data, fortran, initial condition, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to convert Openfoam data to fluent .cas and .msh files | sachinlb | FLUENT | 4 | December 8, 2023 17:27 |
Coupling OpenFoam with Fortran codes | anfho | OpenFOAM Programming & Development | 3 | October 29, 2015 15:21 |
Comparison between C/C++ and Fortran? | rick | Main CFD Forum | 45 | September 6, 2011 01:52 |
Velocity vector data in OpenFOAM and ParaView mismatch | tekky | OpenFOAM | 9 | December 21, 2009 12:26 |
input vertex data file format | Rick | FLUENT | 3 | March 6, 2006 03:39 |