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

creating interface in openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vinnithepooh
  • 1 Post By Mojtaba.a

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2011, 12:32
Default creating interface in openfoam
  #1
New Member
 
vinesh
Join Date: Nov 2010
Posts: 2
Rep Power: 0
vinnithepooh is on a distinguished road
hello everyone,

Question1:
I want to solve a simple problem with multiple meshes for example one mesh part is having inlet condition and other mesh region composed of out let.

Let me know how to create "interface" for intended contact surfaces to transfer the flow data.

We are generating mesh files in third party preprocessor. Fluent mesh files "****.msh"

Question2:

Multiple zones were created in ICEM CFD and mesh file exported in Fluent format " *.msh"

Problem Description: Two ducts were connected as Y junction and after mixing the two streams, main stream has to pass through porous region.

Query: separating faces between two successive zones are acting like walls. How can I convert them as interior or interface for such cases.

thanks in advance
jr33 likes this.
vinnithepooh is offline   Reply With Quote

Old   January 18, 2011, 18:02
Default
  #2
New Member
 
Join Date: Dec 2010
Posts: 26
Rep Power: 15
prashant.A is on a distinguished road
Send a message via Skype™ to prashant.A
Pretty easy if the mesh is coming from Fluent,

Open the .msh file, Goto header "Zone Sections", search the part name to be set as interior and change its prefix from wall to interior.

Import the file to OpenFoam, and this part should now disappear out of boundary file...
prashant.A is offline   Reply With Quote

Old   August 16, 2012, 18:12
Default
  #3
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by prashant.A View Post
Pretty easy if the mesh is coming from Fluent,

Open the .msh file, Goto header "Zone Sections", search the part name to be set as interior and change its prefix from wall to interior.

Import the file to OpenFoam, and this part should now disappear out of boundary file...
Hi prashant.A
I am trying to do a similar task as vinesh said. actually I am converting a *.msh file which I have created with GAMBIT. I set boundary type of faces which I want to be interface as "interior" in GAMBIT and imported the mesh file using "fluent3DMeshToFoam" command into an openFOAM case. now my boundary file includes my 2 interface faces and type of them is considered as "patch". when I use checkMesh utility there is messages which says:
"The mesh has multiple regions which are not connected by any face."
now I want to connect multiple regions to each other. I tried to use
splitMeshRegions -cellZones
in order to split my mesh into multiple zones, but openFOAM needs the interface patches to be defined in 0 directory.
1) Is there any boundary type as interface in openFoam that I can use?
2) or is there any tool that can combine 2 faces on 2 different regions to be a single interface?

briefly, how can I use interfaces (fluid to fluid) in openFOAM by importing an external mesh file?
Mojtaba.a is offline   Reply With Quote

Old   August 17, 2012, 19:54
Default
  #4
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Hi,

Try "mergeOrSplitBaffles" to see if it converts the interface into interior faces. This will write out the new mesh to a new time folder. Make sure you replace the old mesh with the new mesh.

Pei-Ying
phsieh2005 is offline   Reply With Quote

Old   August 17, 2012, 22:27
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by phsieh2005 View Post
Hi,

Try "mergeOrSplitBaffles" to see if it converts the interface into interior faces. This will write out the new mesh to a new time folder. Make sure you replace the old mesh with the new mesh.

Pei-Ying
Thanks, are you sure it can merge 2 faces which are in 2 different regions? I tried to use it, but no faces were detected:
"Writing 0 duplicate faces to faceSet"
Mojtaba.a is offline   Reply With Quote

Old   August 17, 2012, 22:42
Default
  #6
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Hi,

I thought that you have two regions and you wanted to merge the interface between the two regions so that there is only one region at the end.

I guess this will not help you.

Pei-ying
phsieh2005 is offline   Reply With Quote

Old   August 17, 2012, 22:51
Default
  #7
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by phsieh2005 View Post
Hi,

I thought that you have two regions and you wanted to merge the interface between the two regions so that there is only one region at the end.

I guess this will not help you.

Pei-ying
Well I actually have two regions and I want to merge them so there is only one region ! but the problem is that I haven't merged 2 faces of 2 regions into one interface yet.
Mojtaba.a is offline   Reply With Quote

Old   August 18, 2012, 00:34
Default
  #8
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Hi,

Now, I am really confused what you are trying to do. Can you post pictures or send me the mesh?

Pei-ying
phsieh2005 is offline   Reply With Quote

Old   August 18, 2012, 09:32
Default
  #9
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by phsieh2005 View Post
Hi,

Now, I am really confused what you are trying to do. Can you post pictures or send me the mesh?

Pei-ying
Thanks for help,
Here is the image of what I am doing:



There are two volumes, one surrounding another. The bigger volume has its own interior faces which I have named them "interface_big" and the smaller one again has its own interior faces which I have named them "interface_small" in boundary file. they have been defined as patches.



As you can see in the above image I have refined the mesh within the small volume.
I want to merge these two volumes (stitching two interior faces of two volumes) into one by defining interface in openFOAM. Therefore I run the following command:
Quote:
stitchMesh -partial interface_big interface_small
but openFOAM gives error to this:
Quote:
Zero length edge detected. Probable projection error: slave patch probably does not project onto master. Please switch on enriched patch debug for more info
and when I run this command as suggested by you:

Quote:
mergeOrSplitBaffles -detectOnly
I get messages in openFOAM:
Quote:
Writing 0 duplicate faces to faceSet "/home/mojtaba/OpenFOAM/mojtaba-2.0.1/run/stitchMesh/constant/polyMesh/sets/duplicateFaces"
It worths saying that if I split interfaces into 4 faces, then I can stitch just one pair of faces to each other successfully, and when I try to stitch more openFOAM gives error.

checkMesh result:

Quote:
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.1
Exec : checkMesh
Date : Aug 18 2012
Time : 16:03:43
Host : x
PID : 3452
Case : /home/x/OpenFOAM/x-2.0.1/run/stitchMesh
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 8097
faces: 21000
internal faces: 18000
cells: 6500
boundary patches: 4
point zones: 0
face zones: 1
cell zones: 1

Overall number of cells of each type:
hexahedra: 6500
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
*Number of regions: 2
The mesh has multiple regions which are not connected by any face.
<<Writing region information to "0/cellToRegion"


Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
interface_big 250 276 ok (non-closed singly connected)
interface_small 1000 1051 ok (non-closed singly connected)
symmetry_plane 600 687 ok (non-closed singly connected)
wall 1150 1222 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-1 0 -1) (1 1.5 0)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (1.0215594e-17 1.6190752e-17 -4.3753581e-17) OK.
Max cell openness = 1.7347235e-16 OK.
Max aspect ratio = 1 OK.
Minumum face area = 0.0025. Maximum face area = 0.01. Face area magnitudes OK.
Min volume = 0.000125. Max volume = 0.001. Total volume = 3. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 2.000034e-11 OK.

Mesh OK.

End
you can download my sample case from this link:
amiraslanpoor.persiangig.com/stitchMesh.tar.gz
Attached Images
File Type: jpg 1.jpg (27.8 KB, 2258 views)
File Type: jpg 2.jpg (72.2 KB, 2249 views)
fly_light likes this.
Mojtaba.a is offline   Reply With Quote

Old   August 18, 2012, 09:43
Default
  #10
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Hi,

This is interesting. I will try to play with the mesh tomorrow.

Peiying
phsieh2005 is offline   Reply With Quote

Old   February 5, 2013, 00:03
Default
  #11
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14
ChrisA is on a distinguished road
Hi,

Was there any conclusion to the issue? I'm faced with the same problem with the mesh I would like to use.
ChrisA is offline   Reply With Quote

Old   February 8, 2013, 12:16
Default
  #12
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

I'm currently facing the same problem too, with a much more complex geometry consisting of several parts though. Has any one of you found a solution yet?

I checked Mojtaba.a's simple geometry and reproduced the same problem. One of my colleagues suggested splitting the interfaces into four separate planes.

Hanging nodes seem to work just fine. I just checked that a few minutes ago with two differently discretized hexas (only mergeMeshes and stitchMesh; no simulation yet). Where can I upload the resulting pictures and case directories? Feel free to ask for them by mail!

cutter
Attached Images
File Type: jpg blocks.jpg (35.3 KB, 214 views)

Last edited by cutter; February 11, 2013 at 04:55. Reason: fixed typo; added image
cutter is offline   Reply With Quote

Old   February 8, 2013, 12:47
Default
  #13
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by cutter View Post
Hi,

I'm currently facing the same problem too, with a much more complex geometry consisting of several parts though. Has any one of you found a solution yet?

I checked Mojtaba.a's simple geometry and reproduced the same problem. One of my colleagues suggested splitting the interfaces into four separate planes.

Hanging nodes seem to work just fine. I just checked that a few minutes ago with two differently discretized hexas (only mergeMeshes and stitchMesh; no simulation yet). Where can I upload the resulting pictures and case directories? Feel free to ask for them per mail!

cutter
Hi Cutter,
Well unfortunately I haven't found any solution yet. In fact I didn't follow it anymore. Is there any luck to run the simulation by separating the interfaces?
By the way you can upload your resulting pictures as attachments in your post.
Mojtaba.a is offline   Reply With Quote

Old   February 11, 2013, 05:02
Default
  #14
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
hello,

how did you import your mesh ?
because you need to know the name of the face you want to stitch, en each zone.
the following may work (but depend how you import mesh), so not sure:
1) setToZones -noFlipMap
2) check if the boundary (so 2 boundary, one for each volume) you want to stitch are in polymesh/boundary. If not, add them with nFace =0 and startFace = nface+starFace of the last entry, and update the number, or use the "createPatch" tools.
3) createBaffles name_interface "(name_face_vol1 name_face_vol2)"
4) mergeOrSplitBaffles -split

You may use AMI at your interface.

regards,
olivier

Last edited by olivierG; February 11, 2013 at 05:04. Reason: add things
olivierG is offline   Reply With Quote

Old   February 11, 2013, 05:19
Default
  #15
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Oh, tanks, it's that easy. I only noticed the button that allows to link external resources...

Yes, splitting the interfaces did the trick. I tried it with a simple L-shape and a cube:
Attached Images
File Type: jpg L-Shape.jpg (34.1 KB, 191 views)
Attached Files
File Type: gz L-Shape_2interfaces.tar.gz (2.3 KB, 104 views)
cutter is offline   Reply With Quote

Old   February 11, 2013, 16:21
Default
  #16
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by olivierG View Post
hello,

how did you import your mesh ?
olivier
I import it from a .msh file And I can find the desired face name in paraview. I will proceed your procedure and report the result.

Quote:
Originally Posted by cutter View Post
Oh, tanks, it's that easy. I only noticed the button that allows to link external resources...

Yes, splitting the interfaces did the trick. I tried it with a simple L-shape and a cube:
This is interesting ! I will play with your sample case and see how it works,
Tnx cutter
Mojtaba.a is offline   Reply With Quote

Old   February 12, 2013, 04:39
Default
  #17
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Sorry, but the above sample was a little bit oversimplified. It worked like a charm due to the perfectly matching faces of both parts.

After refining the discretization of the cube I'm facing the same problems that have been observed in http://www.cfd-online.com/Forums/ope...o-patches.html . Executing mergeMeshes an running stitchMesh for the first time works without problems, the second run of stitchMesh fails:

Code:
--> FOAM FATAL ERROR: 
Face 20350 reduced to less than 3 points.  Topological/cutting error B.
Old face: 2(7470 7486) new face: 2(7470 7486)

    From function void slidingInterface::coupleInterface(polyTopoChange& ref) const
    in file slidingInterface/coupleSlidingInterface.C at line 1795.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libdynamicMesh.so"
#3  Foam::polyTopoChanger::topoChangeRequest() const in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libdynamicMesh.so"
#4  Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libdynamicMesh.so"
#5  
 in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/stitchMesh"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  
 in "/opt/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/stitchMesh"
cutter is offline   Reply With Quote

Old   June 20, 2022, 07:58
Default
  #18
New Member
 
Xiaowei
Join Date: Sep 2017
Location: Melbourne
Posts: 1
Rep Power: 0
ShaunXU is on a distinguished road
Hi Mojtaba,

I am encounter the same problem as what you descriped, i.e.
The mesh has multiple regions which are not connected by any face.

I am also want to use the interface for the same (fluid to fluid) reason. Could you please tell me how you solve this problem ?

Thanks so much !!

Best
ShaunXU 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 interface a Fortran thermodynamic tool with OpenFOAM? Cyp OpenFOAM Programming & Development 31 June 9, 2014 15:30
Sliding Interface in OpenFoam? lordvon OpenFOAM 19 January 7, 2011 18:32
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 06:33
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25
CFX Solver Memory Error mike CFX 1 March 19, 2008 08:22


All times are GMT -4. The time now is 10:48.