CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] question concerning the OpenFOAM utility: plot3dToFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2013, 19:47
Default question concerning the OpenFOAM utility: plot3dToFoam
  #1
New Member
 
Dr. Chatur Ramalingum
Join Date: Jul 2012
Posts: 5
Rep Power: 14
Chatur Ramalingum is on a distinguished road
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
Chatur Ramalingum is offline   Reply With Quote

Old   May 27, 2013, 02:07
Default
  #2
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
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 is offline   Reply With Quote

Old   May 27, 2013, 02:12
Default
  #3
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
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
Abracurcix is offline   Reply With Quote

Old   June 10, 2013, 15:20
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

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

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 16, 2013, 23:30
Default
  #5
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
Thanks, Bruno! Is there an example you could share with me, please? Have you tried this with a sample plot3D grid file?

Cheers,
Albert
Abracurcix is offline   Reply With Quote

Old   June 17, 2013, 18:15
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   June 18, 2013, 19:22
Default
  #7
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
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
Abracurcix is offline   Reply With Quote

Old   June 20, 2013, 17:52
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 04:19
OpenFOAM 4.0 sample utility Bazinga OpenFOAM Running, Solving & CFD 0 August 30, 2016 11:36
OpenFOAM Training: Programming CFD Course 12-13 and 19-20 April 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 14, 2016 11:19
Question on transient simulation in OpenFOAM and FLUENT nicklj OpenFOAM Running, Solving & CFD 4 May 8, 2014 23:30


All times are GMT -4. The time now is 17:23.