CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... (http://www.cfd-online.com/Forums/openfoam-meshing-other/)
-   -   plot3dToFoam beginner (http://www.cfd-online.com/Forums/openfoam-meshing-other/120886-plot3dtofoam-beginner.html)

stophank July 16, 2013 18:05

plot3dToFoam beginner
 
Hello all,

I am new to OpenFOAM and am trying to convert a mesh in plot3d format to OpenFOAM format. I am trying to use the built in grid converter: plot3dToFoam. Here is the output:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
| \\ / O peration | Version: 1.6-ext |
| \\ / A nd | Web: www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6-ext-1fac933c6108
Exec : plot3dToFoam ../../../../iso-q-4in.p3d
Date : Jul 16 2013
Time : 14:58:40
Host : pfe21
PID : 34244
Case : /../OpenFOAM/OpenFOAM-1.6-ext/../constant
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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



--> FOAM FATAL IO ERROR:
cannot open file

file: /../OpenFOAM/OpenFOAM-1.6-ext/../constant/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 62.

FOAM exiting

Thanks in advance!

Hank

wyldckat July 16, 2013 18:13

Greetings Hank and welcome to the forum!

The problem is very simple: when converting a mesh to OpenFOAM format, you first need a base case folder to be already prepared, which is why the application is complaining about the missing "system/controlDict" files. You can use the "cavity" case from the first tutorial to use as a basis.

If you do not know which case I'm talking about, I suggest that you look at the OpenFOAM User Guide: http://www.openfoam.org/docs/user/ ;)

Best regards,
Bruno

stophank July 16, 2013 18:25

Thanks Bruno for your fast reply!

I have a "system/controlDict" file.

Maybe I should elaborate more on my question:

I am running a tutorial where everything is provided and runs well. All I want to do is change the mesh with a grid generated by plot3d. So do I have to remove/update some files before I try to import the new mesh?

Hank

wyldckat July 21, 2013 08:21

Hi Hank,

You were a bit lucky the other day, because I saw your thread a bit before I logged out. And only now did I manage to look into this again.

I vaguely remember having looked into not too long ago. The idea is that:
  1. You use a tutorial case as basis.
  2. Then you should run plot3dToFoam instead of blockMesh.
  3. Then you can use autoPatch for generating patches automatically, although there are some limitations to this utility, since it can only figure out "what's a patch" based on sharp edges it can see, based on the given feature angle.
  4. Then you have to edit the boundary files at "0" manually and adjust where necessary. You might also want to rename patches in the file "constant/polyMesh/boundary".
Best regards,
Bruno

Abracurcix August 6, 2013 01:05

Hello Hank,
Did Bruno's suggestion work for you? I'd be curious if autoPatch did the trick for you?

Hello Bruno,
Sometime back, I had asked a similar question, and of course, your suggestion regarding running plot3dToFoam followed by autoPatch was helpful. Unfortunately, when I viewed the resulting file, the boundary conditions were not quite correct. So, I had to do plot3dToFoam followed by foamMeshToFluent, read in the resulting Fluent file into a grid generator, set the boundary conditions, export the modified file as a Fluent file, and, finally convert the Fluent file to Foam. It was quite a roundabout. I hope Hank had better luck with his meshes.

Cheers,
Albert

wyldckat August 17, 2013 08:14

Hi Albert,

Isn't Fluent able to import plot3d meshes?

I forgot back then a few other ways as well:
Quote:

Originally Posted by wyldckat (Post 345083)
@Elise: You can with createPatch. You can find several examples by running:
Code:

find $WM_PROJECT_DIR -name createPatchDict

And there is also surfaceToPatch:
Code:

surfaceToPatch -help
And you can trick it into telling you which formats it accepts:
Code:

surfaceToPatch constant/RASProperties
should tell you:
Code:

--> FOAM FATAL ERROR:
unknown file extension . Supported extensions are '.ftr', '.stl', '.stlb', '.gts', '.obj', '.ac', '.off', '.nas', '.tri' and '.vtk'

You can even use the following command to export the surface mesh into the base STL file that you can then edit:
Code:

foamToSurface initialPatches.stl
It provides for each STL solid the name of the respective patch/wall.

Best regards,
Bruno

kovamaniac May 29, 2014 11:50

Total begineer issue
 
Hi.

I am trying to do run the flat plate case based on the grids from NASA, which come with plot3d format. Specifically, I want to work with the 2D grids downloaded from HERE.

I run the 2D case with all the options I want:
Code:

plot3dToFoam -2D 0 -singleBlock -noBlank -noFunctionObjects flatplate_clust2_4levelsdown_35x25.p2dfmt
The error is the following:
Code:

Reading 2D case by extruding points by 0 in z direction.
Create time
Reading 1 blocks
block 0 nx:1 ny:35 nz:25
Reading block points
block 0:
Reading 875 x coordinates...
Reading 875 y coordinates...
Reading 875 z coordinates...
 
--> FOAM FATAL IO ERROR:
Attempt to get back from bad stream
file: flatplate_clust2_4levelsdown_35x25.p2dfmt at line 588.
From function void Istream::getBack(token&)
in file db/IOstreams/IOstreams/Istream.C at line 56.
FOAM exiting

For some reason I cannot understand, changing 0 to 1, the code runs creating points in z.
Code:

plot3dToFoam -2D 1 -singleBlock -noBlank -noFunctionObjects flatplate_clust2_4levelsdown_35x25.p2dfmt
The result is the following:
Code:

Reading 2D case by extruding points by 1 in z direction.
Create time
Reading 1 blocks
block 0 nx:1 ny:35 nz:2
Reading block points
block 0:
Reading 35 x coordinates...
Reading 35 y coordinates...
Extruding 35 points in z direction...
--> 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 70 down to 70 points.
Creating cells
Creating boundary patches
Writing polyMesh
End

Then, I run:
Code:

autoPatch 80
The result is:
Code:

Create time
Create polyMesh for time = 0
--> FOAM Warning :
From function polyMesh(const IOobject&)
in file meshes/polyMesh/polyMesh.C at line 312
no cells in mesh
Mesh read in = 0.01 s
 
Feature:80
minCos :6.12323e-17
End

Inside the case file a new folder 0.005 is created, having exactly what the constant/polyMesh includes, in addtion with some other files named *zones.

In the end, paraFoam does not even recognises it and I have instead of 2D a 3D mesh which is useless.

Can you help me, please???

wyldckat August 16, 2014 06:54

Greetings Anastasios,

Sorry, I only now finally managed to have a look at your question.
But since almost 3 months have gone by already, can you let me/us know if you've managed to solve this issue?
And if you did, can you share how you solved it?

Best regards,
Bruno

kovamaniac August 20, 2014 03:11

Quote:

Originally Posted by wyldckat (Post 506230)
Greetings Anastasios,

Sorry, I only now finally managed to have a look at your question.
But since almost 3 months have gone by already, can you let me/us know if you've managed to solve this issue?
And if you did, can you share how you solved it?

Best regards,
Bruno

Hi.

I finally used the grids with CGNS format which I imported into ANSA and exported it in OpenFOAM format.


All times are GMT -4. The time now is 08:14.