CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Internal faces from gmsh how to create patches in OpenFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2008, 11:21
Default Good morning, I created a s
  #1
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Good morning,

I created a simple geometry with gmsh which represents a box
with a tube inside. As suggested by Takuya, the geometry is made
with 2 volumes so all faces are recognized by gmsh2ToFoam.
Those inner faces are removed by gmsh2ToFoam but saved ("sets" directory).

Is there a way to import those internal faces as patches ?

Best regards,

Pierre-Olivier

(how can I post the geo file ?)
podallaire is offline   Reply With Quote

Old   June 6, 2008, 06:00
Default Hi Pierre-Olivier, For severa
  #2
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi Pierre-Olivier,
For several reasons I also wanted a testcase with baffles so I changed your .geo to inlets.geo and as you mentioned applying createBaffles to FanCenter and FanShell did the trick.

I assigned wall boundary conditions to the outer surfaces ("Inlet," "Outlet" and "Room"), and assigned inlet- and outlet- conditions to each side of the fan baffle (I'm not an axial fan expert so there should be the correct way though). Trying the case a bit with simpleFoam it seems to be working:


Takuya
7islands is offline   Reply With Quote

Old   June 6, 2008, 06:07
Default Sorry for the typo in the file
  #3
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Sorry for the typo in the file name. The inlets.geo in the post above is the corrected one.
7islands is offline   Reply With Quote

Old   June 6, 2008, 07:10
Default Thanks a lot Takuya, I will tr
  #4
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Thanks a lot Takuya, I will try this today.
Really appreciated.

Have a good day

PO
podallaire is offline   Reply With Quote

Old   June 6, 2008, 08:26
Default Takuya, did you modify your
  #5
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Takuya,

did you modify your boundary file in order to use createBaffles ?

Regards,

PO
podallaire is offline   Reply With Quote

Old   June 6, 2008, 08:58
Default Yes, I think you have to creat
  #6
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Yes, I think you have to create the target patch with nFaces 0 in polyMesh/boundary.

In fact at first I thought I could post the case here with some sort of tutorial-ish makeMesh scripts, but had to give up the idea since it involved a good amount of hand-editing and mesh manipulation. For example it seems you have to recreate faceSets from faceZones using the faceSet command before the second run of createBaffles, since createBaffles writes the updated faceZones with the new mesh but does not write faceSets.

Further if you would like to employ separate boundary conditions on each side of FanCenter (like I did), I think you have to select each side of FanCenter faces with faceSet using the directions of the face normals as clue and run createPatches.

T.
7islands is offline   Reply With Quote

Old   June 6, 2008, 09:42
Default Thanks for those infos, it wor
  #7
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Thanks for those infos, it worked !

What I did :

1) Modified boundary file and added new patch nFaces 0 in polyMesh/boundary
2) Modified all files in 0
3) createBaffles root case set patch
4) created a faceSetDict to select a second faceZone
5) faceSet root case
6) Moved my mesh from 0 to constant
7) ... restart at 1) to 3)

Regards,

PO
podallaire is offline   Reply With Quote

Old   June 10, 2008, 21:25
Default Hi Takuya, I'd like to have
  #8
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Hi Takuya,

I'd like to have more details on how to create two different patches (inlet/outlet) for one surface (FanCenter). The createBaffles procedure was successful - I want to understand how to run createPatches.

Thanks !

PO
podallaire is offline   Reply With Quote

Old   June 11, 2008, 02:39
Default Hi Pierre-Olivier, If I rem
  #9
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi Pierre-Olivier,

If I remember correctly, the procedure continues as follows after 7) of your post.

8) Move your mesh from 0 to constant after a second createBaffles run
9) Create a faceSetDict to select FanCenter
10) faceSet root case
11) Create another faceSetDict to select a subset of FanCenter according to normalToFace<pre>name FanCenter;
action subset;
topoSetSources
(
normalToFace
{
normal (1 0 0); // Vector
cos 0.01; // Tolerance (max cos of angle)
}
);</pre>12) faceSet root case
13) Create a createPatchDict to create a patch FanCenter2 from the faceSet<pre>patches
(
{
name FanCenter2;
type patch;
constructFrom set;
set FanCenter;
}
);</pre>14) createPatch root case

And you will see FanCenter and FanCenter2 separated by their normal directions, with FanCenter2 being the intake-side of the fan.

Takuya
7islands is offline   Reply With Quote

Old   June 12, 2008, 08:44
Default Ok, thanks Takuya ! About c
  #10
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Ok, thanks Takuya !

About createBaffles - by default, it generates double-sided walls - right ? Can you confirm that the following procedure is not needed :

http://openfoamwiki.net/index.php/Howto_importing_fluent_mesh_with_internal_wall s

I want to be sure that each side of the shell is considered to be a wall - not only one side.

Best regards,

PO
podallaire is offline   Reply With Quote

Old   June 12, 2008, 09:28
Default Hi Pierre-Olivier, Yes crea
  #11
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi Pierre-Olivier,

Yes createBaffles does create dobule-sided walls. So for example if you see the baffle patch (before splitting) having 50 faces when displayed with ParaView you can confirm the nFaces entry of the patch in polyMesh/boundary is in fact 100.

splitMesh may work as written in the Wiki you mentioned (and things will be simpler if it does work), but I was not able to find how splitMesh determines which side of the wall belongs to which patch (i. e. the notion of master/slave patches).

Takuya
7islands is offline   Reply With Quote

Old   June 12, 2008, 09:49
Default Hi Takuya, perfect, I wante
  #12
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Hi Takuya,

perfect, I wanted to be sure.

I tried to use splitMesh because checkMesh complains about "multiply connected surface (shared edge)" but the procedure from the Wiki did not work for me - trying to split the shell (selected again using faceSet) returns an error saying it is not an internal face. I guess that's not a big deal since I already have double-sided walls.

Best regards,

PO
podallaire is offline   Reply With Quote

Old   July 20, 2008, 18:45
Default Hi, Takuya, I am interested
  #13
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Takuya,

I am interested in modeling a "fan" inside fluid domain too. I am wondering if you are willing to send the me the simple test case that you posted picture above (axial fan inside a box)? I am curious about how you setup BCs expecially. Thanks!

Pei
hsieh is offline   Reply With Quote

Old   July 21, 2008, 14:15
Default Hi, Pierre-Olivier, I am tr
  #14
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Pierre-Olivier,

I am trying to follow your steps, but, has a couple of questions. It will be appreciated if you can clarify:

1. After generating the inlet.msh (using inlet.geo posted above), boundary has 6 patches, FanCenter (nFaces =0), inlet (nFaces =1932), Oulet (nFaces = 1976), Room (nFaces = 10174), FanShell (nFaces = 0), defaultFaces (nFaces = 0). Also, in sets directory, I have faceZone_4 and Fluid.
2. In step #1, do I need to add a new patch (say I give it a patch name, fanInletOutlet) in boundary with nFaces = 0?
3. In step 3, exactly what do I type in the terminal window? Is it "createBaffles root case set fanInletOut"?
4. can you post the createSetDict in step 4?
5. In step 7, why you say "restart at 1) to 3)?

Thanks!

Pei
hsieh is offline   Reply With Quote

Old   July 21, 2008, 20:03
Default Hi Pei, The inlet/outlet BCs
  #15
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi Pei,
The inlet/outlet BCs I used were a verbatim copy of simpleFoam/pitzDaily case where fixedValue (1 0 0)/zeroGradient for U and zeroGradient/fixedValue 0 for p. But I don't think these were physically correct for emulating an axial fan as far as reading another thread [1].

My main purpose was to obtain a baffle case to test my ParaView3-reader so I didn't elaborated more. Maybe Pierre-Olivier could give you a better suggestion.

[1] http://www.cfd-online.com/OpenFOAM_D...es/1/8239.html

T
7islands is offline   Reply With Quote

Old   July 21, 2008, 20:55
Default Hey guys, 2. -> Since Fance
  #16
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
Hey guys,

2. -> Since Fancenter is considered as a wall, it should be splitted in two patches using the command createPatch (as described by Takuya).
3. -> Should be something like "createBaffle root case nameofset patchname" where the nameofset was FanCenter or FanShell (if I remember correctly...)
4. -> Could be something like :

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "system";
local "";

class dictionary;
object createPatcheDict;
}

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

patches
(
{
// Name of new patch
name FanCenter2;

// Type of new patch
type patch;

// How to construct: either 'patches' or 'set'
constructFrom set;
set FanCenter;
}

);

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

An example of this dictionnary is avaible in applications/utilities/mesh/manipulation/createPatch

5. Because I had to apply the createBaffle command for two internal patches: FanCenter and FanShell.


Now, for the boundary conditions, I have working on this in the last few weeks. On each face on the fan,
a fixed velocity can be used coupled with zero-gradient on pressure. For the room inlet and outlet, pressureInlet and
pressureInletOutlet physical patches are possibilities. It really depends of your case.

Hope this helps,

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 21:39
Default Hi, Takuya and Pierre-Olivier,
  #17
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Takuya and Pierre-Olivier,

Thanks a lot for the answer!

I am mostly interested in the fan BCs. Can you commend on whether the following is correct?

The original FanCenter (imported from gmsh) is now split into FanCenter and FanCenter2 (two sides of the same patch). Fixed velocity (say, (1 0 0)) and zeroGradient are applied to both FanCenter and FanCenter2, correct?

In OF-1.5, a new "fan type" BC was implemented (basically a cyclic BC with pressure jump). Will it be more appropriated for this? I did some testing of the fan type BC, but, still are not quite sure about whether I did it correctly.

Pei
hsieh is offline   Reply With Quote

Old   July 22, 2008, 08:40
Default Hi Pei, The attached applic
  #18
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Hi Pei,

The attached application creates an internal cyclic boundary usable for jump conditions using a circular cutting disk as input.

createJump.tgz
eugene is offline   Reply With Quote

Old   July 22, 2008, 08:52
Default sounds interesting - will it c
  #19
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 185
Rep Power: 8
podallaire is on a distinguished road
sounds interesting - will it compile under 1.5 ?
Thanks
PO
podallaire is offline   Reply With Quote

Old   July 22, 2008, 09:12
Default Not sure, I haven't tried yet.
  #20
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Not sure, I haven't tried yet.
eugene 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
Internal patches with fluentMeshToFoam sega OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 12 October 29, 2009 09:11
GMSH and OpenFOAM derath OpenFOAM Mesh Utilities 44 September 4, 2008 05:09
Salome creating patches within faces hoogland OpenFOAM Pre-Processing 1 November 8, 2007 02:51
Taging boundary faces with gmsh hamdaoui Main CFD Forum 0 October 9, 2007 13:02
Undefined internal faces becoming default patches hjasak OpenFOAM Pre-Processing 1 June 16, 2006 10:25


All times are GMT -4. The time now is 05:40.