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

question concerning the OpenFOAM utility: plot3dToFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 24, 2013, 18:47
Default question concerning the OpenFOAM utility: plot3dToFoam
  #1
New Member
 
Dr. Chatur Ramalingum
Join Date: Jul 2012
Posts: 5
Rep Power: 5
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, 01:07
Default
  #2
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 4
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, 01:12
Default
  #3
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 4
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, 14:20
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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, 22:30
Default
  #5
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 4
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, 17:15
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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, 18:22
Default
  #7
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 4
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, 16:52
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,526
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
General OpenFOAM question Madeleine P. Vincent OpenFOAM 1 May 5, 2011 13:12
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 05:56
The OpenFOAM extensions project mbeaudoin OpenFOAM 16 October 9, 2007 09:33
Utility question mrangitschdowcom OpenFOAM Post-Processing 0 September 5, 2007 11:22
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 22:07


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