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

How to Create .msh file so that when converted to OpenFOAM will have some BC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2012, 13:49
Default How to Create .msh file so that when converted to OpenFOAM will have some BC
  #1
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
Hi all, I am a beginner in OpenFOAM. I want to know how we can create .msh (Fluent mesh file) so that it contains some details about Boundary Conditions. On OpenFOAM website it is told that Fluent BC may not have complete decoding using OpenFOAM. If I am Creating any mesh file in the Boundary file of case problem, I am having following output:
1
(
wall-solid
{
type wall;
nFaces 640;
startFace 1930;
}
)


I want it to be something like this automatically:
3
(
movingWall
{
type wall;
nFaces 20;
startFace 760;
}
fixedWalls
{
type wall;
nFaces 60;
startFace 780;
}
frontAndBack
{
type empty;
nFaces 800;
startFace 840;
}
)


Hoping for solution
Thanks,
Jay
jaypatel is offline   Reply With Quote

Old   June 6, 2012, 07:30
Default
  #2
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 180
Rep Power: 8
fs82 is on a distinguished road
As far as I know it is not a good idea to define a specific boundary conditions when creating the Fluent Mesh file. You should define all boundaries you would like to have as wall when creating the Fluent Mesh file. After conversion with fluentMeshToFoam you will have your boundaries available in OF named like you defined it in your Fluent mesh file. Then change the ones which are no walls to type "patch" and apply the BC in the specific field file (U,p, and so on).

Kind regards,
Fabian
fs82 is offline   Reply With Quote

Old   June 6, 2012, 09:55
Default
  #3
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
Hi Fabian,

Thanks for quick reply. I didn't get you when you say "OF named". I tried name selection after I created the mesh to name various surfaces which I am going to give special BCs and what it does is creation of new file (.mshdb, which is a mesh database file). I don't know any way by which I can have these informations written on .msh file itself.

As I told in earlier post that by default I am getting only one Boundary and that to with a Boundary condition of wall. I want to know the way I can get more Boundaries and then I can change there BC's using patch option.

Thanks,
Jay
jaypatel is offline   Reply With Quote

Old   June 6, 2012, 10:53
Default
  #4
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 180
Rep Power: 8
fs82 is on a distinguished road
Which program do you use to create the mesh?
fs82 is offline   Reply With Quote

Old   June 6, 2012, 10:57
Default
  #5
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
I used ANSYS Fluent, so I have .msh file. I change the environmental variable AWP_WRITE_FLUENT_MESH_ASCII=1, so I am getting output .msh file in ASCII instead of Binary.

Thanks,
Jay
jaypatel is offline   Reply With Quote

Old   June 6, 2012, 11:02
Default
  #6
New Member
 
Hannes
Join Date: Oct 2011
Posts: 19
Rep Power: 5
falke126 is on a distinguished road
As far as I know, Fluent is no meshing program...

Did you mean ANsys Meshing?
falke126 is offline   Reply With Quote

Old   June 6, 2012, 11:06
Default
  #7
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
Yes, I used ANSYS Meshing. But we have various output formats of mesh in ANSYS itself. I used the mesh generated by ANSYS Meshing for Fluent Solver and not for CFX or Polyflow solver. So I used the term Fluent Mesh.

Thaks,
Jay
jaypatel is offline   Reply With Quote

Old   June 6, 2012, 11:07
Default
  #8
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 180
Rep Power: 8
fs82 is on a distinguished road
Mmh I only know Gambit, but the basic principle should be the same. You create your geometry, mesh it and define your BCs with ANSYS Fluent. Define every BC you need, e.g. a for a cube each of the six sides. Define each BC of type "Wall" and give it a unique name, e.g. "side 1", "side2" and so on. Do not use the other Fluent BCs, only walls. Export the mesh as Fluent 5/6 .msh file and convert it with fluentMeshToFoam. Then you should have a look into the file <OF-case-dir>/constant/polyMesh/boundary
There should be a list of all boundaries with the unique name you specified when created the BCs in ANSYS Fluent. But all of them are of type "wall". It should look like this:

bottom
{
type wall;
nFaces 90000;
startFace 32238000;
}
top
{
type wall;
nFaces 90000;
startFace 32328000;
}
So change the type by hand to "patch" for every BC which is not a wall and your done. The type "patch" could be every boundary condition you would like to specifiy in a volVectorField. Look into the handbook for more details.
fs82 is offline   Reply With Quote

Old   June 6, 2012, 11:08
Default
  #9
New Member
 
Hannes
Join Date: Oct 2011
Posts: 19
Rep Power: 5
falke126 is on a distinguished road
Quote:
Originally Posted by jaypatel View Post
Thanks for quick reply. I didn't get you when you say "OF named". I tried name selection after I created the mesh to name various surfaces which I am going to give special BCs and what it does is creation of new file (.mshdb, which is a mesh database file). I don't know any way by which I can have these informations written on .msh file itself.
I guess that you use Ansys Meshing...

You have to define Named Selections. Then use the export function to export the *.msh.
You will see that the named selections are available as patches in OF.
falke126 is offline   Reply With Quote

Old   June 6, 2012, 11:12
Default
  #10
Senior Member
 
Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 180
Rep Power: 8
fs82 is on a distinguished road
Ah ok this seems to be a problem with Ansys Meshing and not with the conversion of the mesh between Ansys and OpenFoam. So I am out :-D because I never used Ansys Meshing.

kind regards,
Fabian
fs82 is offline   Reply With Quote

Old   June 6, 2012, 11:29
Default
  #11
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
I got it. The solution is name the surfaces first and then create mesh.
Thanks for your help Fab.
Jay
jaypatel is offline   Reply With Quote

Old   June 7, 2012, 10:33
Default
  #12
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 5
jaypatel is on a distinguished road
Thanks Hanes..
jaypatel 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
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
2.0.x on Mac OSX niklas OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 74 March 28, 2012 16:46
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 01:07


All times are GMT -4. The time now is 03:15.