|
[Sponsors] |
problem with using a curve for mesh refinement |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 1, 2022, 16:17 |
problem with using a curve for mesh refinement
|
#1 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 260
Rep Power: 6 |
Hi,
It's been a while since I used OF, so of course I'm having a problem with something I've done before. I want to use a curve on a body to refine the mesh. The way I did it before, was a sequence in Paraview, as follows: - use filter 'feature edges' and apply - use tiny icon 'select cells' to capture the desired edge - use the icon 'extract selection' and apply - go to File-Save Data, name the file, and save in ascii format - this saves the file in vtk format Then, in a terminal, I run the command surfaceFeatureConvert filename.vtk filename.eMesh However, this time I get the result: "Fatal File IO. Wrong token type - expected int32_t, found the word 'OFFSETS' A search in this forum and elsewhere, hasn't provided any info. Has anyone seen (and I hope solved) this? Alan w |
|
February 1, 2022, 17:42 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
You should write it as obj file rather than VTK. There were a variety of changes in VTK I think. You can simply check if this works by using an eMesh and convert it to an vtk first. Open the vtk file and check the file-syntax. After that you can compare it with your vtk syntax written by paraview. Maybe you can simply resolve it or if possible, use the obj export (if possible).
Alternatively, if you have your surface and you know where the edge is located (e.g., by intersecting with a plan), you can use surfaceBooleanFeatures and create the edge on the fly.
__________________
Keep foaming, Tobias Holzmann |
|
February 2, 2022, 11:49 |
Thank You Tobi
|
#3 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 260
Rep Power: 6 |
What an honor it is to be helped by one of the stars of CFD! I will run with this help, and I have also benefited from your videos!
It was interesting in how you used Salome in the smoking pipe example, and I will likely have a similar scenario, in which case I will query you for sure. Alan w |
|
February 2, 2022, 11:58 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
Quote:
Probably not your first thought, but VTK legacy format has actually been updated to accommodate changes in the underling vtkCellArray class. These files are not version "2.0", but more like "5.1" in the header. Should be supported with OpenFOAM-v2106 and later: https://develop.openfoam.com/Develop.../-/issues/2094 |
||
February 2, 2022, 13:57 |
|
#5 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 260
Rep Power: 6 |
Thanks Olesen,
In Paraview I tried to save the curve data in obj format, but that option isn't available. So I still out of luck. Regarding v2106, I am using OpenFoam 8, so that would not apply? To expand on my problem, the terminal error message reads: Header : "# vtk DataFile Version 5.1" Title : "vtk output" dataType : "ASCII" line:4 tagATASET geomType : UNSTRUCTURED_GRID line:5 tag:POINTS Reading 2 numbers representing 2 coordinates. line:7 tag:METADATA line:14 tag:CELLS Reading 2 cells or faces. --> FOAM FATAL IO ERROR: wrong token type - expected int32_t, found on line 15 the word 'OFFSETS' file: edge1.vtk at line 15. From function Foam::Istream& Foam:perator>>(Foam::Istream&, int32_t&) in file primitives/ints/int32/int32IO.C at line 62. And here is the edge1.vtk text: # vtk DataFile Version 5.1 vtk output ASCII DATASET UNSTRUCTURED_GRID POINTS 2 double 0.54138797522 -0.19449999928 0.33799999952 0.54138797522 0.19449999928 0.33799999952 METADATA INFORMATION 2 NAME L2_NORM_RANGE LOCATION vtkDataArray DATA 2 0.667215 0.667215 NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray DATA 2 0.667215 0.667215 CELLS 2 2 OFFSETS vtktypeint64 0 2 CONNECTIVITY vtktypeint64 0 1 CELL_TYPES 1 3 CELL_DATA 1 SCALARS STLSolidLabeling float LOOKUP_TABLE default 0 METADATA INFORMATION 0 FIELD FieldData 1 vtkOriginalCellIds 1 1 vtkIdType 27 POINT_DATA 2 FIELD FieldData 1 vtkOriginalPointIds 1 2 vtkIdType 28 29 Quite frustrating, as this process worked for me a couple of months ago! |
|
February 2, 2022, 14:37 |
|
#6 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 260
Rep Power: 6 |
Would this problem be resolved by upgrading to OpenFOAM 9?
|
|
February 3, 2022, 03:04 |
|
#7 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
No using the openfoam.org version will not do it, perhaps time to try using the openfoam.com version?
Also consider reading my post about the OpenFOAM Foundation Ltd (https://olesenm.github.io/2020/11/11...de-provenance/) |
|
February 3, 2022, 16:24 |
|
#8 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 260
Rep Power: 6 |
Curve for mesh refinement problem solved!
Thanks for the help Olesen, but installing OpenFOAM 9 was the key. However, you didn't know the history of my situation. I can't recall why, but a couple of months ago I installed the latest version of ParaView, and started using it in lieu of the canned version in OF8. Until the current problem, everything was fine. Prior to this, I was using successfully using curves for mesh refinement, but it seems that the vtk files produced by the newer standalone ParaView were no longer compatible with OF8. By using the ParaView included with OF9, the convert utility works, and I am back in business! So I will be removing OF8, unless you can give me a reason not to. Your supporting of the openfoam.com version notwithstanding, I have learned on and have been using the .org version, and am accustomed to it. But I have noted you as a resource, so stay tuned. Alan w |
|
February 3, 2022, 17:41 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Haaaa ... I was thinking that, you Mark, are the guy which knows about that stuff. A question, so the VTK was updated (so my assumption was right). However, we also updated the VTK stuff in the v21xx versions, right? Hence, extracting the line in Paraview as *.obj file and us our version (ESI-OpenCFD), it should work, right?
__________________
Keep foaming, Tobias Holzmann |
|
February 4, 2022, 08:47 |
|
#10 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
Quote:
Actually the process you had working a few months ago very likely involved an older version of paraview/VTK. If you have newer version of these, you automatically get the updated legacy format when writing, or at least until this has bee adopted (https://discourse.vtk.org/t/can-we-w...mat-with-vtk-9). If you cannot use OpenFOAM-v2106 or OpenFOAM-v2112 for your main workflow, you can also use it for that operation only. Assuming, for example, that you either have the ubuntu or rpm packages installed, or can use docker. Example, Code:
$ openfoam-docker / surfaceFeatureConvert file1.vtk file.eMesh // OR (for system installed version) $ openfoam2112 / surfaceFeatureConvert file1.vtk file.eMesh Or downgrade your paraview... |
||
February 4, 2022, 08:50 |
|
#11 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
Quote:
Yes, the handling of reading VTK legacy files was updated in the v21xx versions before the OpenFOAM users really noticed there was going to be a problem. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SU2-7.0.1 on ubuntu 18.04 | hyunko | SU2 Installation | 7 | March 16, 2020 04:37 |
OpenFOAM error | Vinay Kumar V | Main CFD Forum | 0 | February 20, 2020 09:17 |
[Gmsh] Extrude on gmsh | Pedro Felix | OpenFOAM Meshing & Mesh Conversion | 0 | October 30, 2019 12:33 |
[snappyHexMesh] sHM refinement away from surface | nholt | OpenFOAM Meshing & Mesh Conversion | 1 | June 14, 2016 14:36 |
[snappyHexMesh] problems using snappyHexMesh 2.1.0 on a supercomputer | Sunxing | OpenFOAM Meshing & Mesh Conversion | 9 | September 20, 2014 09:30 |