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

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

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By fs82
  • 1 Post By fs82

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2012, 14: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: 14
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, 08:30
Default
  #2
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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
6863523 likes this.
fs82 is offline   Reply With Quote

Old   June 6, 2012, 10:55
Default
  #3
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 14
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, 11:53
Default
  #4
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 11:57
Default
  #5
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 14
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, 12:02
Default
  #6
New Member
 
Hannes
Join Date: Oct 2011
Posts: 19
Rep Power: 15
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, 12:06
Default
  #7
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 14
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, 12:07
Default
  #8
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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.
6863523 likes this.
fs82 is offline   Reply With Quote

Old   June 6, 2012, 12:08
Default
  #9
New Member
 
Hannes
Join Date: Oct 2011
Posts: 19
Rep Power: 15
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, 12:12
Default
  #10
Senior Member
 
Dr. Fabian Schlegel
Join Date: Apr 2009
Location: Dresden, Germany
Posts: 222
Rep Power: 18
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, 12:29
Default
  #11
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 14
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, 11:33
Default
  #12
New Member
 
Jay Patel
Join Date: Feb 2012
Posts: 8
Rep Power: 14
jaypatel is on a distinguished road
Thanks Hanes..
jaypatel is offline   Reply With Quote

Old   December 5, 2016, 12:29
Default
  #13
New Member
 
Honey
Join Date: Jun 2015
Posts: 9
Rep Power: 11
ansab is on a distinguished road
Quote:
Originally Posted by jaypatel View Post
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
Hello, can you please specify the process how to set the environment variable. I am quite new to this stuff. Thanks in advance
ansab is offline   Reply With Quote

Old   November 9, 2017, 08:44
Default
  #14
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by ansab View Post
Hello, can you please specify the process how to set the environment variable. I am quite new to this stuff. Thanks in advance
If anyone still stumbles across this, in the latest 18.2 version, you can set this from
Code:
Tools->Options->Export->"Format of Input File" and select ASCII
in the ANSYS Meshing module.
deepbandivadekar 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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57
2.0.x on Mac OSX niklas OpenFOAM Installation 74 March 28, 2012 17: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 02:07


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