CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Convert exisiting data to openfoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   July 29, 2006, 07:44
Default Hi, I would like to conver
  #1
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,

I would like to convert existing data (e.g. u-velocity form a vtk file) to the 'native' openfoam format using a small script (python). It is a structured orthogonal hexa mesh, so it should be pretty easy...

Unfortunately, I could not find anything about the format of openfoam's U file.
Would be nice, if anybody has an idea!

Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   July 30, 2006, 15:24
Default The U-file is just another fie
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
The U-file is just another field-file. It is described in Section 4.2.7 of the UserGuide (there is even a small example of a U-file there).

Writing the U-file should be the easy once you have generated the mesh-information. THAT should be the interesting part (Chapter 6)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 31, 2006, 09:39
Default Hi Bernhard, I saw the docu
  #3
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi Bernhard,

I saw the docu, but I did not get smart out of it...
to be clear, I do not know in what kind of loop I have to write the internal field. Does it look like
a loop

for z 1 to 100
for y 1 to 100
for x 1 to 100
write u(x,y,z) to internal field
end
end
end


or is it totally different!? It should be important, so openfoam does not get confused...
I imported the mesh from Fluent, so it should be no problem for me
anymore.

Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   July 31, 2006, 10:38
Default Well, the problem is, that the
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Well, the problem is, that the order of the values in the internalField depends on the "order" of the cells in the geometry. Because OpenFOAM doesn't depend on a block-structured mesh to work there is no "natural" order for blocks like other solvers have it. It all depends on who contructed the mesh (and how). So there are two routes:

a) you use blockMesh to build your mesh. Reverse engineer the output (or the source) to determine in which order cells are constructed for one block. Then write the loops accordingly. I guess this is less work, but you've got to hope that the order doesn't change with future versions of blockMesh
b) you let your script write the whole polyMesh (write the points - that should be trivial for your mesh, write the faces and the cells - that shouldfn't be too hard to). Then write the data in the field according to the Fabian-given order

Sorry: I overread the Fluent-Remark (and I don't want to throw away what I previously typed). That makes things a bit more complicated. But if it's a straight block-mesh (as I assume from your pseudo-program): is Fluent necessary? (as you seem to have the data in a different format anyway)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 31, 2006, 10:49
Default We currently have fluentMeshTo
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,762
Rep Power: 21
hjasak will become famous soon enough
We currently have fluentMeshToFoam and foamDataToFluent, but I'm pretty sure I also wrote fluentDataToFoam. This would take the Fluent data file and split it up into OpenFOAM fields. If this is what you need, I can have a look at the backup tapes etc. to dig it out.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 3, 2006, 09:22
Default Hi, Bernhard: I actuall
  #6
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,


Bernhard:
I actually created the original mesh for fluent and a fortran code (multiblock format) with icem. I could use the fluent mesh for some simpleFoam calculations and now, I want to 'import' the velocity field of my fortran code. I can convert my velocity to tecplot, ensight and vtk format, but not yet to openfoam.
You are probably right, that it would be easiest to write the whole polymesh with the script too...
Thanks!

Hrvoje:
Thanks, but right now, I would not need it... but maybe later :-)


Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   August 10, 2006, 18:08
Default Hi Hrv. If it isn't too muc
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Hrv.

If it isn't too much trouble and you can find it: could I have that fluentDataToFoam?

Thanks
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 30, 2008, 17:09
Default Hello, Were you able to find
  #8
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 201
Rep Power: 11
kwardle is on a distinguished road
Hello,
Were you able to find this fluentdatatofoam utility? I would really like to have it.
Thanks.
kwardle is offline   Reply With Quote

Old   June 30, 2008, 22:22
Default hi, I am doing a simulation,i
  #9
Senior Member
 
weihong yao
Join Date: Mar 2009
Posts: 117
Rep Power: 8
ivanyao is on a distinguished road
hi,
I am doing a simulation,it is about the wind pressure on the building.there is a problem to set the velocity of the wind.it is ok when I set it the exactly value, such as 5m/s,but the velocity of the wind is change by the height,such as 0.2Z(Z is the height.),I don't know how to fix it,I am very appreciate if someone can help me.
ivanyao is offline   Reply With Quote

Old   September 17, 2008, 07:05
Default Hi! I have a problem related
  #10
New Member
 
Hansjoerg Seybold
Join Date: Mar 2009
Posts: 16
Rep Power: 8
hansjoerg is on a distinguished road
Hi!
I have a problem related to Hrv's posting about the fluentToFoam.

I want to solve advection diffusion on a given velocity field/mesh (generated by fluent).

scalarTransportFoam would do this for me, and
with fluentMesh3DToFoam i can import the mesh,
but what is missing is the import of the veolcity field.

The "fluentDataToFoam" would probably solve this elegantly.

Has anybody an idea where one can find the utility?

thanks a lot hansjoerg
hansjoerg is offline   Reply With Quote

Old   September 17, 2008, 08:49
Default Hi, i have done this once b
  #11
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 8
caw is on a distinguished road
Hi,

i have done this once by hand. Not very convenient but it worked at least for my case.

1) use fluent3DMeshToFoam for the grid
2) export the velocity field by writing a interpolation file from fluent
3) copy the appropriate data columns to 0/U

This works as long as the cell order in fluent and openfoam is the same. i remember doing this for a 2D Case. should work for 3d as well...
but no guarantee ;-)

bst regards
christian
solefire likes this.
caw is offline   Reply With Quote

Old   September 17, 2008, 09:13
Default Hi christian! Sounds interest
  #12
New Member
 
Hansjoerg Seybold
Join Date: Mar 2009
Posts: 16
Rep Power: 8
hansjoerg is on a distinguished road
Hi christian!
Sounds interesting, thanks a lot.
What uou mean with writing a interpolation file?

do you remember the fluent commands?

thanks hj
hansjoerg is offline   Reply With Quote

Old   September 17, 2008, 09:48
Default hj, I have also done this wit
  #13
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 201
Rep Power: 11
kwardle is on a distinguished road
hj,
I have also done this with a dirty little fortran program I wrote to take the Fluent .ip file and write it out to OF input formats for certain variables. While it seemed to work and the resulting fields were somewhat decent, it had a lot of "noise" (random cells with discontinuities). This may have been due to differences in cell numbering that may have occured at some point in the fluentMeshToFoam conversion...I'm not sure. If Hrv has a better fluentDataToFoam converter I would love to have it as well...*please*.

As for creating a Fluent interpolation file, you go to "file interpolate write-data" and select your fields to write out and name the file as a ".ip". The format is relatively simple and is described in section 4.13.2 of the Fluent User Guide.
kwardle is offline   Reply With Quote

Old   September 17, 2008, 10:09
Default One other note - the x,y,z cel
  #14
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 201
Rep Power: 11
kwardle is on a distinguished road
One other note - the x,y,z cell coordinates are also included in the .ip file and it may be possible to use these somehow in mapping the new fields in order to eliminate the issue of cell numbering.
-Kent
kwardle is offline   Reply With Quote

Old   September 17, 2008, 13:21
Default Hi, 'visit' could be the tool
  #15
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi,
'visit' could be the tool of choice, it has a lot of readers and might export into openfoam format in the near future; I hope :-) I am not sure, how easy it is to implement, but one of there developers gets an eye on it... this would be nice, to get some inlet conditions of experiments as well.

Fabian
braennstroem is offline   Reply With Quote

Old   September 20, 2008, 02:25
Default Hello! I'll try to write the
  #16
New Member
 
Hansjoerg Seybold
Join Date: Mar 2009
Posts: 16
Rep Power: 8
hansjoerg is on a distinguished road
Hello!
I'll try to write the converter for fluentDataToFoam, if nobody already did. (Horve ?)
Any ideas where to start from?
- I'll use the foamDataToFluent as template for the code, but where can i get good documentation of the storage formats (especially fluent data structure)
Thanks hj
hansjoerg is offline   Reply With Quote

Old   September 24, 2008, 04:07
Default In visit there is a tool calle
  #17
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
In visit there is a tool called 'spreadsheet', which can be used to export every format into a raw text format. This is not suitable to extract all data to OpenFoam, but is certainly a way to extract bc-data from experiments and e.g. fluent for the use with 'timeVaryingMappedFixedValue' bc.

Fabian
braennstroem is offline   Reply With Quote

Old   November 21, 2008, 08:25
Default I'd like to know the present s
  #18
New Member
 
Wassja A. Kopp
Join Date: Mar 2009
Posts: 4
Rep Power: 8
wassja is on a distinguished road
I'd like to know the present state of the fluentDataToFoam tool which Hrvoje thought having written some time ago.
Or if someone of the people above have heard something about that.

Otherwise I'd have to write sth like that myself :P .
The other way round, converting OF Data to Fluent, seems to loose the specified boundary conditions.
Until now I didn't manage to find a solution in this forum nor in the other articles playing google.

Someone must have had this problem before!
If so, I'd be grateful for a post :-)


Wassja

Hrvoje Jasak on Monday, July 31, 2006
wassja is offline   Reply With Quote

Old   November 12, 2009, 13:47
Default any progress on the fluendDataToFoam converter?
  #19
New Member
 
Michael Lawson
Join Date: Apr 2009
Location: NREL - Boulder, CO
Posts: 11
Rep Power: 8
mlawson is on a distinguished road
Hi,

I'm curious if there has been any progress on locating/writing the elusive fluentDataToFoam converter. I have a large amount of data I would like to get into OpenFOAM without having to re-run everything.

Thanks in advance,

-Mike
mlawson is offline   Reply With Quote

Old   February 2, 2010, 10:18
Default FluentDataToFoam
  #20
New Member
 
Jason Ryon
Join Date: Oct 2009
Posts: 17
Rep Power: 7
jason.ryon is on a distinguished road
Could somebody please let me know where I can find this fluentDataToFoam utility? I am using OF 1.6.

Thanks,
Jason
jason.ryon is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM native format data visualization and workflow zeliboba OpenFOAM Post-Processing 0 September 12, 2008 08:44
C OpenFOAM data structures maka OpenFOAM 6 March 6, 2008 08:20
how to convert 2Dimage of airfoil into data points Muhammad Usman Qureshi Main CFD Forum 3 June 19, 2007 06:54
How to generate OpenFOAM grid from DEM data rcpoudel OpenFOAM Pre-Processing 1 May 22, 2006 13:41
IDEAS universal file convert to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 0 April 18, 2006 13:57


All times are GMT -4. The time now is 06:54.