|
[Sponsors] |
[Other] vtk to OpenFoam (or something else that can reach after OpenFoam) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 22, 2011, 10:42 |
vtk to OpenFoam (or something else that can reach after OpenFoam)
|
#1 |
New Member
Join Date: Mar 2011
Posts: 13
Rep Power: 15 |
Hi,
I have a vtk file - unstructered grid type (with points and cells - I don't no exactly if it is mesh or only geometry and I should to obtain the mesh firstly - I'm beginer). However I want to do a simulation with OpenFoam - but no idea how to change the .vtk file in .OpenFoam file - I tryed many ways, but is to complicated. Last time I tried to obtain .stl from .vtk with vtkSTLWriter and after that I would change .stl in gambit to OpenFoam. But it seems to me that I can't write the unstructured grid to a .stl file (it requires vtkPolyData and I see I can't obtain this - it pass the compilation step but it has problems at running). If I generate the mesh with blockMesh then I need a blockMeshDict and i don't know how to obtain it from the vtk file... Cristina |
|
March 23, 2011, 03:20 |
|
#2 |
Senior Member
|
Hi,
i wrote a pythonvtk script to convert unstructuredgrid vtk-files into STL-files. If you send me your VTK-file in an email elvis-the-pelvis (at) hotmail dot de i will try to convert your vtk-file into an STL-file. I will also post my script here when i come back from work. From the STL-file you can take several ways to get a mesh for CFD-simulations with Openfoam. =>SnappyHexMesh (SHM) http://www.openfoam.com/docs/user/sn...#x26-1490005.4 =>Engrid http://engits.eu/en/documentation =>discretizer (Discretizer-Setup) http://www.discretizer.org/node/21 (a screencast) and lots of other ways (salome , blender, calculix) there used to be some descriptions on the http://www.openfoamworkshop.org but the milano workshop`s page is broken! maybe you look through http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/ |
|
March 23, 2011, 13:35 |
|
#3 |
Senior Member
|
#!/usr/bin/env python
# -*- coding: utf-8 -*- import vtk reader = vtk.vtkUnstructuredGridReader() reader.SetFileName("/home/elvis/VTK_unstr.vtk") filter = vtk.vtkDataSetSurfaceFilter() filter.SetInput(reader.GetOutput()) clean = vtk.vtkCleanPolyData() clean.SetInputConnection(filter.GetOutputPort()) triangles = vtk.vtkTriangleFilter() triangles.SetInputConnection(clean.GetOutputPort() ) write = vtk.vtkSTLWriter() write.SetInputConnection(triangles.GetOutputPort() ) #write.SetFileTypeToASCII() write.SetFileTypeToBinary() write.SetFileName("/home/elvis/STL_bin.stl") write.Write() |
|
March 23, 2011, 14:04 |
what mesh generator to use for huge .stl file?
|
#4 |
New Member
Join Date: Mar 2011
Posts: 13
Rep Power: 15 |
Hi,
Thank you for help. I resolved with vtkGeometryFilter and it's works :P Now I have a .stl file but I don't know how to generate the mesh. I tried with Discretizer but it seems that the file is to large(I have a complex geometry there) and sometimes it blocks - even when it works I didn't find exactly the comand to generate the mesh. I tried to install Harpoon (I read it is for complex geometries) but I don't find a version for linux x86... It is only for linux 64 bit and for windows (and in windows I don't have installed any solver and I receive an error when I try to open it). Do you know where can I find harpoon for linux x86 or a solver for it to install on windows? Or what other mesh generator for complex geometry do you know? I tried also with engrid but it's horrible to install it on ubuntu ... Cristina |
|
March 24, 2011, 09:22 |
parser for vtk file to obtain blockMeshDict or vtkDealuny3D it's enough to obtain mes
|
#5 |
New Member
Join Date: Mar 2011
Posts: 13
Rep Power: 15 |
Hi,
It doesn't seem to useful to have the .stl format... To obtain the mesh I still need to construct the blockMeshDict for the blockMesh utility and I really don't know how to do because I have a huge geometry with 4 buildings (and I don't know how to identify exactly the corners and the edges of the buildings only from the vtk file - there is a large list of points). If someone has already write a parser for vtk files(ubstructured grid) in order to obtain the dictionary for block mesh can please give me some clues? Now I'm trying with Delauny3D algorithm - as I understood it generates somehow a mesh... It's good for my future simulation? (I will aply after that a solver on my mesh) Cristina |
|
March 25, 2011, 03:39 |
|
#6 |
Senior Member
|
Dear Cristina,
there are some publications and discusions related to terrain meshing http://hig.diva-portal.org/smash/get...936/FULLTEXT01 =>Modelling of wind flow over complex terrain using OpenFoam , Xabier Pedruelo Tapia June 2009 Master’s Thesis in Energy Systems ===>Take a look at page 81 to understand what SHM makes for meshing you have two volumes (Volume Blockmesh=Rectangle) - (Volume STL=Terrain surface) this is your CFD-simulation-Mesh http://www.aij.or.jp/jpn/publish/cfdguide/index_e.htm Guidebook for Practical Applications of CFD to Pedestrian Wind Environment around Buildings http://oshima.eng.niigata-u.ac.jp/Op...ingDivided.pdf A blockMeshDict for a rectangle (8 points) is not a big challange! there is even a tutorial with terrain meshing http://www.cfd-online.com/Forums/ope...-openfoam.html elvis Last edited by elvis; March 25, 2011 at 04:00. |
|
July 26, 2014, 21:43 |
|
#7 | |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Quote:
I currently have the same problem with the conversion my vtk mesh to OpenFoam, but my vtk format is xml, does your script accept this kind of format? Cheers, Kan |
||
July 28, 2014, 10:06 |
|
#8 |
Senior Member
|
Hi,
if paraview can load/visualize your file, you should be able to write STL-file from Paraview http://www.paraview.org/Wiki/The_ParaView_Tutorial http://www.paraview.org/Wiki/ParaView http://www.paraview.org/Wiki/Convert...rom_PLY_to_VTP just a starter http://www.vtk.org/doc/release/6.0/html/classes.html => http://www.vtk.org/doc/release/6.0/h...ataReader.html or what kind of Data http://www.vtk.org/doc/release/6.0/h...STLWriter.html |
|
July 19, 2019, 09:28 |
Paraview to Fluent?
|
#9 | |
Senior Member
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10 |
Quote:
Hello Elvis, I have done some operations in Paraview. Now I am left with the remaining domain after these operations. I want to take this domain back to Fluent for further analysis. I request your suggestion on which of the following is better and HOW TO ACHIEVE THEM!!!? 1) If I want to export the mesh of the remaining domain to Fluent 2) If I have to export only outer surfaces and filling the interior and then meshing before exporting to Fluent. Thanks & Regards, Vidyadhar Last edited by vidyadhar; July 19, 2019 at 09:29. Reason: Adding Title |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM course for beginners | Jibran | OpenFOAM Announcements from Other Sources | 2 | November 4, 2019 09:51 |
OpenFOAM 4.0 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 2 | October 6, 2017 06:40 |
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | September 14, 2016 04:19 |
OpenFOAM crash at runtime when writing vtk surfaces | McFly | OpenFOAM Running, Solving & CFD | 3 | September 19, 2013 07:39 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |