CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Other] Plot3dToFoam mesh conversion error (https://www.cfd-online.com/Forums/openfoam-meshing/61776-plot3dtofoam-mesh-conversion-error.html)

rcpoudel December 21, 2006 13:34

Plot3dToFoam mesh conversion error
 
While trying to convert a plot3d volume mesh generated in Overgrid using Hypgen, I encounter the following error:
---------------------------------------------------
Exec : plot3dToFoam .. cavity /home/rcpoudel/aubrey/av80fsn.p3d
Date : Dec 21 2006
Time : 10:32:25
Host : venus
PID : 10975
Root : ..
Case : cavity
Nprocs : 1
Create time

Reading 93 blocks


--> FOAM FATAL IO ERROR : wrong token type - expected int found on line 2 the doubleScalar 368860

file: /home/rcpoudel/aubrey/av80fsn.p3d at line 2.

From function operator>>(Istream&, int&)
in file primitives/int/intIO.C at line 74.

FOAM exiting
---------------------------------------------------

Few lines of the p3d volume grid file I want to convert to Foam format are as follows:
93 133 51
0.3688602E+06 0.3690820E+06 0.3693038E+06 0.3695257E+06 0.3697475E+06
0.3699694E+06 0.3701912E+06 0.3704131E+06 0.3706349E+06 0.3708568E+06
0.3710786E+06 0.3713004E+06 0.3715223E+06 0.3717441E+06 0.3719660E+06
0.3721878E+06 0.3724097E+06 0.3726315E+06 0.3728533E+06 0.3730752E+06
0.3732970E+06 0.3735189E+06 0.3737407E+06 0.3739626E+06 0.3741844E+06
0.3744063E+06 0.3746281E+06 0.3748499E+06 0.3750718E+06 0.3752936E+06
0.3755154E+06 0.3757373E+06 0.3759591E+06 0.3761810E+06 0.3764028E+06
0.3766247E+06 0.3768465E+06 0.3770684E+06 0.3772902E+06 0.3775120E+06
0.3777339E+06 0.3779557E+06 0.3781776E+06 0.3783994E+06 0.3786213E+06
--------------------------------------------------

Any help to fix this error will be highly appreciated.

Thanks in advance,

Ram

mattijs December 21, 2006 18:43

from the Description field of
 
from the Description field of the source plot3dToFoam.C):
- multi block ascii by default
- expects blanking

Does your mesh have 93 blocks? Your first line looks more like a Ni x Nj x Nk block dimension.

What happens if you run plot3dToFoam in single-block mode?

rcpoudel December 22, 2006 14:42

Mattijs, The volume grid is
 
Mattijs,

The volume grid is a single block with no iblanks.
Yes the first line is xDim:93 yDim:133 zDim:51

When I try to execute:
[rcpoudel@venus turbFoam]$ plot3dToFoam -singleBlock -noBlank . cavity ~/aubrey/av80fsn.p3d > log & cat log
[1] 26719

The log file displays thousands of lines like:
(1) Cannot determine orientation of cell 35 128 0 since has base vectors (221.8 0 41.371)(0 275 -12.065)(0 0 0)

(2) Checking mesh
--> FOAM Warning :
From function bool primitiveMesh::checkPoints(const bool, labelHashSet*) const
in file meshes/primitiveMesh/primitiveMeshCheck.C at line 884
Point 7613 not used by any faces.

3) And the following lines appear on the display:

Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
Foam::sigSegv::sigSegvHandler(int)
/lib64/tls/libc.so.6 [0x35b9a2e410]
Foam::cell::labels(Foam::UList<foam::face> const&) const
Foam::primitiveMesh::calcPointCells() const
Foam::primitiveMesh::pointCells() const
Foam::primitiveMesh::checkPoints(bool, Foam::HashSet<int,> >*) const
Foam::primitiveMesh::checkTopology(bool) const
Foam::primitiveMesh::checkMesh(bool) const
plot3dToFoam [0x406a50]
__libc_start_main
__gxx_personality_v0
---------------------------------------------------

Regards,
Ram

rcpoudel December 25, 2006 12:32

All, I convert a plot3d Mes
 
All,

I convert a plot3d Mesh to Foam. Viewing it on paraFoam looks okey.

How can I identify the nFaces and startFace number as required by boundary file of /constant/polyMesh directory to specify inlet, outlet and wall and slip wall etc. My "boundary" file contain only one face for wall as follows:
(
defaultFaces
{
type wall;
nFaces 46688;
startFace 1798256;
}
)


My domain is somewhat cuboid.

------------------------------------
velocity-inlet
{
type patch;
nFaces ????;
startFace ?????;
}

pressure-outlet
{
type patch;
nFaces ????;
startFace ????;
}
)
--------------------------------------
How to identify the numbers "?????"..

Is there any mesh manipulation utility (e.g. autoPatch) that can do this job for me?

Thanks,

Ram Poudel

rcpoudel December 25, 2006 12:34

All, I convert a plot3d Mes
 
All,

I convert a plot3d Mesh to Foam. Viewing it on paraFoam looks okey.

How can I identify the nFaces and startFace number as required by boundary file of /constant/polyMesh directory to specify inlet, outlet and wall and slip wall etc. My "boundary" file contain only one face for wall as follows:
(
defaultFaces
{
type wall;
nFaces 46688;
startFace 1798256;
}
)


My domain is somewhat cuboid.

------------------------------------
velocity-inlet
{
type patch;
nFaces ????;
startFace ?????;
}

pressure-outlet
{
type patch;
nFaces ????;
startFace ????;
}
)
--------------------------------------
How to identify the numbers "?????"..

Is there any mesh manipulation utility (e.g. autoPatch) that can do this job for me?

Thanks,

Ram Poudel

mattijs January 1, 2007 09:19

- autoPatch if you have sharp
 
- autoPatch if you have sharp features (e.g. for cube it will create 6 patches)
- use faceSet to collect faces you want to make into a patch and run createPatch.

dinonettis April 1, 2008 07:50

Hi everybody, I'm trying to
 
Hi everybody,

I'm trying to import a 2d naca profile written in Plot3d but I get the following error:

Exec : plot3dToFoam /home/dino/OpenFOAM/dino-1.4.1/run/tutorials/potentialFoam/ nacaPotential naca_0012.xyz
Date : Mar 29 2008
Time : 11:51:46
Host : ime054
PID : 5316
Root : /home/dino/OpenFOAM/dino-1.4.1/run/tutorials/potentialFoam/
Case : nacaPotential
Nprocs : 1
Create time

Reading 1 blocks
xDim:257 yDim:129 zDim:1
Reading block points
block 0:


--> FOAM FATAL IO ERROR : Attempt to get back from bad stream

file: naca_0012.xyz at line 5.

From function void Istream::getBack(token& t)
in file db/IOstreams/IOstreams/Istream.C at line 44.

FOAM exiting

I don't know if this utilities needs a 3d mesh to convert, but if I remember correctly openfoam automatically introduce a third dimension. Moreover I've tried with a 3d mesh as well and I get the same message.
Thank you in advance for any support.

dino

mattijs April 1, 2008 15:39

Is it a single block case? Any
 
Is it a single block case? Any of the options help? -noBlank, -singleBlock.

dinonettis April 2, 2008 04:47

yes it is a single block case.
 
yes it is a single block case. anyway if it can help you this is the initial part of the file:


1
257 129 2
51.0000000000000 42.1102600097656 34.8004417419434 28.7897491455078 23.8472995758057 19.7832393646240 16.4414691925049 13.6935997009277 11.4341001510620 9.57616806030273 8.04843330383301 6.79221296310425 5.75925302505493 4.90987491607666 4.21145200729370 3.63715505599976 3.16492509841919 2.77662110328674 2.45732808113098 2.19478106498718 1.97889494895935 1.80137705802917 1.65540897846222 1.53538203239441 1.43668699264526 1.35553205013275 1.28880095481873 1.23392903804779 1.18880999088287 1.15170896053314 1.12120199203491 1.09611594676971 1.07548904418945 1.05852794647217 1.04458200931549 1.03311395645142 1.02368402481079 1.01593005657196 1.00955402851105 1.00431096553802 1.00000000000000 0.995899498462677 0.991405487060547 0.986484289169312 0.981100320816040



thank you in advance

dino

mattijs April 2, 2008 05:29

Can you attach the file here o
 
Can you attach the file here or send it to me? m dot janssens at the opencfd.co.uk domain.

mattijs April 3, 2008 15:21

Attached a version of plot3DTo
 
Attached a version of plot3DToFoam which handles 2D files. Specify a thickness with the -2D option.

plot3dToFoam root case file -noBlank -2D 1

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif plot3dToFoam.tgz

dinonettis April 4, 2008 08:41

Hi Mattijs, the new version
 
Hi Mattijs,
the new version works good with 2d mesh, but when I run the checkmesh this is the message that I get. Do you think that this issue, concerning high aspect ratio cells, can be ignored??
Thanks

dino


Exec : checkMesh /home/nettis/OpenFOAM/nettis-1.4.1/run/tutorials/potentialFoam nacaPotential
Date : Apr 04 2008
Time : 13:29:40
Host : ime171
PID : 11008
Root : /home/nettis/OpenFOAM/nettis-1.4.1/run/tutorials/potentialFoam
Case : nacaPotential
Nprocs : 1
Create time

Create polyMesh for time = constant

Time = constant

Mesh stats
points: 66224
edges: 164872
faces: 131416
internal faces: 65192
cells: 32768
boundary patches: 1
point zones: 0
face zones: 0
cell zones: 0

Number of cells of each type:
hexahedra: 32768
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Point usage OK.
Upper triangular ordering OK.
Topological cell zip-up check OK.
Face vertices OK.
Face-face connectivity OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface
defaultFaces 66224 66224 ok (closed singly connected surface)

Checking geometry...
Domain bounding box: (-48.2397 -51.0969 0) (51 51.0969 1)
Boundary openness (1.96518e-18 -7.86073e-19 0) OK.
***High aspect ratio cells found, Max aspect ratio: 7.07665e+06, number of cells 14028
<<Writing 14028 cells with high aspect ratio to set highAspectRatioCells
Minumum face area = 5.44474e-10. Maximum face area = 49.7139. Face area magnitudes OK.
Min volume = 5.44474e-10. Max volume = 49.7139. Total volume = 8860.64. Cell volumes OK.
Mesh non-orthogonality Max: 87.6327 average: 8.50995
*Number of severely non-orthogonal faces: 422.
Non-orthogonality check OK.
<<Writing 422 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 0.188965 OK.
*Edges too small, min/max edge length = 1.24797e-06 8.88974, number too small: 19422
<<Writing 19854 points on short edges to set shortEdges
All angles in faces OK.
Face flatness (1 = flat, 0 = butterfly) : average = 1 min = 1
All face flatness OK.

Failed 1 mesh checks.

End

Actually I can use the empty bc in the third direction, is it correct?

dinonettis April 4, 2008 10:13

ps: since this is the first ti
 
ps: since this is the first time I work with plot3d format (up to now I created .msh files with gambit) I don't know how to impose certain boundary conditions on specific patches. In fact once I import the mesh with plot3dto Foam, all the faces are added to a default patch whilst when I work with gambit I can specify the boundary type in gambit and then thay are imported in OF. Could you give me some advices??
This is the warning message I get:

Creating boundary patches
--> FOAM Warning :
From function polyMesh::polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
Found 66224 undefined faces in mesh; adding to default patch.

Thank you in advance.

dino

peter73 November 4, 2008 16:48

I had the same problem when I
 
I had the same problem when I converted the plot3d file to the openfoam file. Does anyone have a solution?

Mattijs suggested autoPatch. But I still cannot get the right files.


Peter

wshawnw November 10, 2008 13:42

Hi, I have the same issues. M
 
Hi, I have the same issues. Many plot3d grids that I would like to use but not sure how to go about setting the boundary conditions after running plot3dToFoam. Is there any way in paraFoam to see the face/node indexing?
Thanks,
Shawn

hm86 July 11, 2010 18:18

Plot3Dtofoam
 
Hey all,
I am trying to convert a plot3d mesh file for use in openFOAM. I get the following when I use

plot3dtofoam mesh.p3d -noBlank

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.7.0-279cc8e8233b
Exec : plot3dToFoam mesh.p3d -noBlank
Date : Jul 11 2010
Time : 09:30:49
Host : remote-desktop
PID : 3755
Case : /home/remote/OpenFOAM/remote-1.7.0/run/test/test
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Reading 5 blocks
block 0 nx:201 ny:211 nz:1
block 1 nx:201 ny:211 nz:1
block 2 nx:201 ny:211 nz:1
block 3 nx:201 ny:211 nz:1
block 4 nx:100 ny:100 nz:1
Reading block points
block 0:
Reading 42411 x coordinates...
Reading 42411 y coordinates...
Reading 42411 z coordinates...
--> FOAM Warning :
From function hexBlock::hexBlock::setHandedness()
in file hexBlock.C at line 89
Cannot determine orientation of block. Continuing as if right handed.

block 1:
Reading 42411 x coordinates...
Reading 42411 y coordinates...
Reading 42411 z coordinates...
--> FOAM Warning :
From function hexBlock::hexBlock::setHandedness()
in file hexBlock.C at line 89
Cannot determine orientation of block. Continuing as if right handed.

block 2:
Reading 42411 x coordinates...
Reading 42411 y coordinates...
Reading 42411 z coordinates...
--> FOAM Warning :
From function hexBlock::hexBlock::setHandedness()
in file hexBlock.C at line 89
Cannot determine orientation of block. Continuing as if right handed.

block 3:
Reading 42411 x coordinates...
Reading 42411 y coordinates...
Reading 42411 z coordinates...
--> FOAM Warning :
From function hexBlock::hexBlock::setHandedness()
in file hexBlock.C at line 89
Cannot determine orientation of block. Continuing as if right handed.

block 4:
Reading 10000 x coordinates...
Reading 10000 y coordinates...
Reading 10000 z coordinates...
--> FOAM Warning :
From function hexBlock::hexBlock::setHandedness()
in file hexBlock.C at line 89
Cannot determine orientation of block. Continuing as if right handed.

Merged points within 1e-15 distance. Merged from 179644 down to 177672 points.
Creating cells
Creating boundary patches
Writing polyMesh
End

When I open the owner file in constant/polyMesh, i get

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class labelList;
note "nPoints: 177672 nCells: 0 nFaces: 0 nInternalFaces: 0";
location "constant/polyMesh";
object owner;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

0()

// ************************************************** *********************** //

I dont know why there are no cells or faces. Anyone encounter similar problems or have any ideas on why this might be happening? or any solutions?

Thanks!


All times are GMT -4. The time now is 00:13.