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] question concerning the OpenFOAM utility: plot3dToFoam (https://www.cfd-online.com/Forums/openfoam-meshing/118315-question-concerning-openfoam-utility-plot3dtofoam.html)

Chatur Ramalingum May 24, 2013 18:47

question concerning the OpenFOAM utility: plot3dToFoam
 
Dear FOAMers,
Have any of you been "successful" in converting structured grids from plot3D format to OpenFOAM format using the OpenFOAM utility plot3dToFoam. By "successful" I mean not merely converting the multiblock plot3D grid to a foam format grid (I can do that too), but being able to use the resulting foam mesh to do simulations using any of the OpenFOAM solvers? I ask because, the Plot3D grid format does not specify any boundary conditions. As a result, the plot3dToFoam converted grid does not have any boundary information in the resulting constant/polyMesh/boundary file. Here is an example boundary file I get after I convert a single block plot3D file to an OpenFOAM format mesh:



/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
defaultFaces
{
type wall;
nFaces 419648;
startFace 416864;
}
)

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

The thing you notice right away is that all of the faces are considered to be of "type wall". And, I do not know how to identify which of these faces could be tagged as, say, "inlet", "outlet", and "wall".

So, the real question, if any of you have been successful (or have any ideas) is: how does one generate a correct boundary file that can be used with the plot3dToFoam converted mesh file? Also, do you have any examples that you could share with me?

Thanks,
Chatur

Abracurcix May 27, 2013 01:07

Hello Chatur,
I also tried the plot3dToFoam mesh conversion tool. I get the following constant/polyMesh/boundary file

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
defaultFaces
{
type wall;
nFaces 419648;
startFace 416864;
}
)

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

There are six faces in my geometry with inflow, outflow and wall boundary conditions. As you point out, there is no way to indicate the boundaries in the plot3d mesh. In the boundary files that I get, I see only the wall type boundary condition. If you figure out how to put in the other boundary conditions in the boundary file, please post.

Thanks,
Albert

Abracurcix May 27, 2013 01:12

I made a stupid mistake. I just cut and paste Chatur's boundary file. Here is the one I see, very similar to the one Chatur has posted.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
defaultFaces
{
type wall;
nFaces 2222;
startFace 4139;
}
)

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

Albert

wyldckat June 10, 2013 14:20

Greetings to all!

You'll have to use createPatch: http://openfoamwiki.net/index.php/CreatePatch

Best regards,
Bruno

Abracurcix June 16, 2013 22:30

Thanks, Bruno! Is there an example you could share with me, please? Have you tried this with a sample plot3D grid file?

Cheers,
Albert

wyldckat June 17, 2013 17:15

Hi Albert,

I don't have a plot3D file to test this on, but the link I gave does give indications on where are the examples that show how to use createPatch!

Does the plot3D file have any indication of the patch each surface vertex belongs to? Or is there any auxiliary file that identifies the relation between patches and vertexes?

Best regards,
Bruno

Abracurcix June 18, 2013 18:22

Hello Bruno,
Here is an example file for subsonic flow past a circular cylinder http://cfl3d.larc.nasa.gov/Cfl3dv6/c....html#cylinder. The tarball has a plot3D file that has 2 grid points in the spanwise direction. From what I can see, there isn't any auxiliary file that establishes a relation between the patches and vertices. Its the absence of this information that makes the problem of converting the plot3D grid to Foam a challenge. I would appreciate if you could give me pointers, on how to proceed with createPatch, based on this concrete case.

Thanks,
Albert

wyldckat June 20, 2013 16:52

Hi Albert,

I took a quick look into the mesh you indicated and it's... well... everything is either a wall or an inlet/outlet and it looks like it doesn't matter what the cylinder really is...
The actual boundary conditions seem to be defined in the "*.inp" files, but it's rather cryptic what the values actually stand for. It would be necessary to study the source code of the program that uses these "inp" files.


If it were me, I would simply run after conversion:
Code:

autoPatch -overwrite 15
It will create patches automatically and assign names like "auto0" and "auto1" and so on. Then I would manually edit the file "constant/polyMesh/boundary", while looking at the boundary names in ParaView (run paraFoam) and rename the boundaries "auto*" to names that make sense.

For more information:
Code:

autoPatch -help
Best regards,
Bruno


All times are GMT -4. The time now is 22:11.