CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   creating interface in openfoam (http://www.cfd-online.com/Forums/openfoam/84027-creating-interface-openfoam.html)

vinnithepooh January 18, 2011 12:32

creating interface in openfoam
 
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

prashant.A January 18, 2011 18:02

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...

Mojtaba.a August 16, 2012 17:12

Quote:

Originally Posted by prashant.A (Post 291025)
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?

phsieh2005 August 17, 2012 18:54

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

Mojtaba.a August 17, 2012 21:27

Quote:

Originally Posted by phsieh2005 (Post 377571)
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"

phsieh2005 August 17, 2012 21:42

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

Mojtaba.a August 17, 2012 21:51

Quote:

Originally Posted by phsieh2005 (Post 377578)
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.

phsieh2005 August 17, 2012 23:34

Hi,

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

Pei-ying

Mojtaba.a August 18, 2012 08:32

2 Attachment(s)
Quote:

Originally Posted by phsieh2005 (Post 377586)
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:

http://www.cfd-online.com/Forums/att...1&d=1345291125

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.

http://www.cfd-online.com/Forums/att...1&d=1345291132

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

phsieh2005 August 18, 2012 08:43

Hi,

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

Peiying

ChrisA February 5, 2013 00:03

Hi,

Was there any conclusion to the issue? I'm faced with the same problem with the mesh I would like to use.

cutter February 8, 2013 12:16

1 Attachment(s)
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

Mojtaba.a February 8, 2013 12:47

Quote:

Originally Posted by cutter (Post 406765)
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.

olivierG February 11, 2013 05:02

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

cutter February 11, 2013 05:19

2 Attachment(s)
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:

Mojtaba.a February 11, 2013 16:21

Quote:

Originally Posted by olivierG (Post 407070)
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 (Post 407073)
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

cutter February 12, 2013 04:39

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"



All times are GMT -4. The time now is 07:27.