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

[Commercial meshers] Converting meshes that includes interfaces

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2006, 05:40
Default Converting meshes that includes interfaces
  #1
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Hello dear FOAM users.

I am a beginner at foam (but i have some experience with fluent etc.) and I have a few questions.

1. Is there anyway I can convert my .msh file which includes an interface?
I have read that it is not possible but I cant be the only one with this problem so I figured maybe there is a solution anyway?

2. What solver should I use? I have lowspeed turbulent flow past a blunt body, so my guess is simpleFoam?

3. What boundary conditions should i use if I in fluent used[inside brackets is my guess]: velocity inlet[inlet]
pressure farfiel[outlet]
wall (for the blunt body) [wall]
top and bottow boundary wall [moving wall with the same speed as inlet]
?

Thank you very much

/ham
ham is offline   Reply With Quote

Old   May 31, 2006, 09:45
Default Hello Marcus! @1: If your
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hello Marcus!

@1:
If your "interface" (Gambit nomenclature) is one patch which "looks" at both sides simply change it's type in Gambit to "interior" and write the .msh. fluentMeshToFoam can then handle it (see discussion elsewhere). Depending on what you want to do with the interface you'll have to manipulate (splitMesh etc) the mesh.
If it's two patches that happen to be in the same place, each "seeing" only one side (and the meshes on the patches possibly non-conforming) then you can change the mesh type to "wall", convert the .msh. From then on it depends on what you want to do with that mesh.

PS: If you don't have a Gambit handy you can change the types of boundaries in the msh-file with a text editor (I've done that, but never for interfaces)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 31, 2006, 10:51
Default Hello Berhard, I take advan
  #3
Member
 
anne dejoan
Join Date: Mar 2009
Location: madrid, spain
Posts: 66
Rep Power: 17
anne is on a distinguished road
Hello Berhard,

I take advantage of this new topic on fluent mesh convertors to ask you if you could help me in the following:

I want to convert a .msh file into a foam.
while doing it the fluentMeshTofoam does not
recognize the patch "periodic" in the .msh.
So, I declared it differently and convert the file.
The I modified the "boundary" file in the polymesh directory and declared them as cyclic.
However when running it (with icoFoam)
I have the error:
-> FOAM FATAL ERROR : face 0 and 216 areas do not match by 3.49993%
-- possible face ordering problem
From function cyclicFvPatch::makeWeights(scalarField& w) const
in file
fvMesh/fvPatches/derivedFvPatches/cyclicFvPatch/cyclicFvPatch.C at
line 58.

So I used after this couplPatch but it didn't write any new polymesh directory.


Well, perhaps you can help ?

Thanks you

Anne
anne is offline   Reply With Quote

Old   June 1, 2006, 03:13
Default Thank you I will try this.
  #4
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Thank you
I will try this.

/Marcus
ham is offline   Reply With Quote

Old   June 1, 2006, 17:47
Default Hi Anne! 3.49% seems to be
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Anne!

3.49% seems to be an awful lot. I can't be bothered to look at the sources now, but if I remember it corrrectly cyclic boundary conditiions in OF assume, that the boundaries are either translatory related or that they share a rotation axis that goes through (0,0,0). But I may be wrong.

The interesting thing is: What did coupleMesh say (I assume it didn't say "Writing morphed mesh to time ....")
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 2, 2006, 04:28
Default Hi Bernhard, First, thanks
  #6
Member
 
anne dejoan
Join Date: Mar 2009
Location: madrid, spain
Posts: 66
Rep Power: 17
anne is on a distinguished road
Hi Bernhard,

First, thanks to help me !
Here is the following message returned by
couplPatch


----------------
Mesh has coupled patches .

Doing dummy mesh morph to correct face ordering ...
--> FOAM Serious Error :
From function cyclicPolyPatch::geometricOrder
in file
meshes/polyMesh/polyPatches/derivedPolyPatches/cyclicPolyPatch/cyclicPolyPatch.C at line 541
patch:inlet : Patch inlet gets decomposed in two zones ofinequal
size: 432 and 0
This means that the patch is either not two separate regions or one
region where the angle between the different regions is not
sufficiently sharp.
Please use topological matching or adapt the featureCos() setting
Continuing with incorrect face ordering from now on!
--> FOAM Serious Error :
From function cyclicPolyPatch::geometricOrder
in file
meshes/polyMesh/polyPatches/derivedPolyPatches/cyclicPolyPatch/cyclicPolyPatch.C at line 541
patch:outlet : Patch outlet gets decomposed in two zones ofinequal
size: 432 and 0
This means that the patch is either not two separate regions or one
region where the angle between the different regions is not
sufficiently sharp.
Please use topological matching or adapt the featureCos() setting
Continuing with incorrect face ordering from now on!
Mesh ordering ok. Nothing changed.
End
-------------------------------------


So couplePatch, indeed, does not write anything.

However, I have checked with fluent that the two
periodic conditions were superimposed (in the first tests they were not).
The problem is also that the "periodic" declaration
from the .msh file is not recognised
by fluenToMeshFoam so that I modify it
to another type BC and apply the fluentToMesh converter and
thus have the problem of 3.9% etc ..

Thanks,

Anne
anne is offline   Reply With Quote

Old   June 2, 2006, 06:01
Default Hi Anne! I assume that the
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Anne!

I assume that the inlet and the outlet patch are to be coupled.

Let's open the UserGuide at Page U-141 and look at the definition of the cyclic patch there. What it says in essence is that the coupled patches are topologically separate, but have to be in one "logical Patch" (see figure 6.4 for further enlightenment). So what you do is use the createPatch utility to create a new patch named goingRound from the patches inlet and outlet (their sizes become zero during that operation). The patch goingRound is then defined as cyclic.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 2, 2006, 06:41
Default Hello again, I need a littl
  #8
Member
 
anne dejoan
Join Date: Mar 2009
Location: madrid, spain
Posts: 66
Rep Power: 17
anne is on a distinguished road
Hello again,

I need a little help on how to use createpatchDict file.
I have copied one in my system directory but I am confused on how to declare correctely the patches I want to couple.

The creatPatchDict looks like:
-------------------------------------------
patches
(
{
// Name of new patch
name leftRight0;

// Type of new patch
type cyclic;

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

// If constructFrom = patches : names of patches
patches (half0 half1);

// If constructFrom = set : name of faceSet
set f0;
}

{
name bottom;
type patch;

constructFrom set;

patches (half0 half1);

set bottomFaces;
}

);
----------------------------

The patches I want to couple are named:

inlet and outlet, suppose I call
getround the new patch, what I did is:

replace leftright0 by getrond
replace half0 by inlet
replace half1 by outlet

But it is not the way to do it in view of my message erro.


Thanks again,

Anne
anne is offline   Reply With Quote

Old   June 2, 2006, 11:31
Default HI Bernhard, I have finally
  #9
Member
 
anne dejoan
Join Date: Mar 2009
Location: madrid, spain
Posts: 66
Rep Power: 17
anne is on a distinguished road
HI Bernhard,

I have finally succeeded in applying createPatch but
I am not sure it is the good way because I still have an error when running an application olver on my geometry.

First: I commented in createPatch Dict all the
lines related to "set" so that it looks like:
----------------------
patches
(
{
// Name of new patch
name leftRight0;

// Type of new patch
type cyclic;

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

// If constructFrom = patches : names of patches
patches (inlet outlet);

// If constructFrom = set : name of faceSet
// set f0;
}

// {
// name bottom;
// type patch;

// constructFrom set;

// patches (half0 half1);

// set bottomFaces;
// }

);
--------------------------------------

so it creates me a new polymesh directory but
when I run the application icoFoam on my case
I still have the error message:

------------------------

--> FOAM FATAL ERROR : face 0 and 216 areas do not match by 3.49993% -- possible face ordering problem

From function cyclicFvPatch::makeWeights(scalarField& w) const
in file fvMesh/fvPatches/derivedFvPatches/cyclicFvPatch/cyclicFvPatch.C at l ine 58.

FOAM aborting

Foam::error::printStack(Foam:stream&)
Foam::error::abort()
Foam::cyclicFvPatch::makeWeights(Foam::Field<doubl e>&) const
Foam::surfaceInterpolation::makeWeights() const
Foam::surfaceInterpolation::weights() const
Foam::fvMesh::constructAndClear() const
Foam::regIOobject::write(Foam::IOstream::streamFor mat, Foam::IOstream::versionNu mber, Foam::IOstream::compressionType) const
__libc_start_main
__gxx_personality_v0
Aborted
-------------------------------------------

Is there abything to do with the comments I have done ?
when keeping the "set" related lines, I couldn't run
createaPatch.



I don know if you can help me ...

anyway, thanks

Anne
anne is offline   Reply With Quote

Old   June 7, 2006, 04:44
Default Using splitMesh what is: fac
  #10
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Using splitMesh
what is:
faceSet? is it the name/numbering of the faces where the split is beeing made?

what is master and slavePatch?

A partial printout of the .msh file(where interface1 and interface2 are the faces where the split should be:

(0 "Zones:")
(45 (2 fluid fluid)())
(45 (3 wall plate)())
(45 (4 wall lowerwall)())
(45 (5 wall upperwall)())
(45 (6 pressure-outlet pressure.outlet.5)())
(45 (7 vel-inlet velocity.inlet.4)())
(45 (8 interior interface2)())
(45 (9 interior interface1)())
(45 (11 interior default-interior)())


Thank you!

/Marcus
ham is offline   Reply With Quote

Old   June 7, 2006, 11:26
Default Hi Anne. Problem could be,
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Anne.

Problem could be, that when you use createMesh it takes the mesh from constant (which implicitly is time 0) but writes the modified mesh to 0+dt (dt from the controlDict), for instance the directory 0.005 (there should be a polyMesh-directory in there). When you start the solver he usually (depends on the controlDict) reads the mesh from time 0 (which he finds in constant) and ignores the new mesh in 0.005. Have you moved the 0.005/polyMesh-directory to constant and then removed the 0.005-directory?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 7, 2006, 11:36
Default Hi Marcus! For OpenFOAM a f
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Marcus!

For OpenFOAM a faceSet is a set of faces ;) They have no special meaning and are used for "adminstrative" purposes

The fluentMeshToFoam-converter creates a faceSet for every interior-boundary he finds (in your case there should be a subdirectory sets in the polyMesh directory with two files interface1 and interface2 in them).

master- and slavePatch are needed for sliding meshes. If you don't do that it is sufficient to think of them as "patch on one side of the interface" and "patch on the other side of the interface"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 7, 2006, 11:44
Default Hi! Thanks, now I understan
  #13
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Hi!

Thanks, now I understand.

But the problem is that fluentMeshToFoam doesnot work due to an error, which I thought was the reason I needed splitMesh in the first place. (did that make sense?) Maybe I had this all wrong then.

So I should first successfully convert the .msh, then I should run splitMesh?

Thanks for teaching a rookie

/Marcus
ham is offline   Reply With Quote

Old   June 7, 2006, 12:30
Default Hi Marcus! First converter,
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Marcus!

First converter, then split mesh: Yep. SplitMesh needs an OpenFOAM-native mesh which only the converter can provide.

What was the error message of the converter?
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 8, 2006, 02:59
Default Good morning. The error was
  #15
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Good morning.

The error was:

dimension of grid: 2
Grid is 2-D. Extruding in z-direction by: 67.8823
Creating shapes for 2-D cells
Creating patch for zone: 3 start: 1 end: 100 type: wall name: plate
Creating patch for zone: 4 start: 101 end: 140 type: wall name: new_upperwall
Creating patch for zone: 5 start: 141 end: 180 type: wall name: upperwall
Creating patch for zone: 6 start: 181 end: 220 type: pressure-outlet name: pressure_outlet.5
Creating patch for zone: 7 start: 221 end: 260 type: velocity-inlet name: velocity_inlet.4
Creating patch for zone: 8 start: 261 end: 938 type: interior name: interface2
Patch 8 contains solid or internal faces. Not added to boundary
Adding to internal boundaries
Creating patch for zone: 9 start: 939 end: 1204 type: interior name: interface1
Patch 9 contains solid or internal faces. Not added to boundary
Adding to internal boundaries
Creating patch for zone: 11 start: 1205 end: 77551 type: interior name: default-interior
Patch 11 contains solid or internal faces. Not added to boundary
Not adding to internal boundaries
Creating patch for front and back planes

Default patch type set to empty


--> FOAM FATAL ERROR : Trying to specify a boundary face 4(16 30 35302 35288) on the face on cell 11659 which is either an internal face or already belongs to some other patch. This is face 0 of patch 0 named plate.

From function polyMesh::polyMesh
(
const IOobject& io,
const pointField& points,
const cellShapeList& cellsAsShapes,
const faceListList& boundaryFaces,
const wordList& boundaryPatchTypes,
const wordList& boundaryPatchNames,
const word& defaultBoundaryPatchType
)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 481.

FOAM aborting

Foam::error::printStack(Foam:stream&)
Foam::error::abort()
Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Field<foam::vector<double> > const&, Foam::List<foam::cellshape> const&, Foam::List<foam::list<foam::face> > const&, Foam::List<foam::word> const&, Foam::List<foam::word> const&, Foam::word const&, Foam::List<foam::word> const&)
fluentMeshToFoam [0x8057b3b]
__libc_start_main
__gxx_personality_v0
Aborted


I believe Ive seen similar error somewhere here. Checking it out...
thanx
ham is offline   Reply With Quote

Old   June 8, 2006, 03:48
Default This message says you have man
  #16
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
This message says you have managed to specify 2 boundary conditions on the same face. This is an error and it should be fixed: a face can belong to only one patch.

If you cannot fix it in any other way, read the mesh into Fluent and write it aout again (ascii!) - Fluent will quietly fix the error for you. I suspect you've built the mesh using Gambit, right?

As usual, nothing wrong with the Fluent mesh converter...

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 8, 2006, 04:15
Default Okey, Yes, I built the mesh u
  #17
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Okey,
Yes, I built the mesh using Gambit.

The mesh has(should have) two boundaries on two different, but infinitely close to each other, faces. (I did this on purpose for some grid-intensity reasons which maybe isnt important)


Anyway, I will try to fix it following your recommendations.

Thanks
ham is offline   Reply With Quote

Old   June 8, 2006, 05:02
Default Hmm, I dont know what to do no
  #18
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road
Hmm, I dont know what to do now. Have tried a few things without success.

What I normally would do is to redo the mesh some other way that hopefully would not generate this error. But since I am doing this to learn rather than doing it to get some results I will not give up yet.

Is there anyone who can have a closer look on my mesh? I send it by email(3300kB). I would be so greatful.

/Marcus
ham is offline   Reply With Quote

Old   June 8, 2006, 05:09
Default OK, send it over here, I will
  #19
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
OK, send it over here, I will convert it for you (just to prove the point) - you can get my E-mail address from the signature.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 8, 2006, 05:23
Default http://www.cfd-online.com/Open
  #20
ham
Member
 
Marcus Hammar
Join Date: Mar 2009
Posts: 33
Rep Power: 17
ham is on a distinguished road

I have sent you an email.

/Marcus
ham 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
[ANSYS Meshing] Merging multiple meshes into one (so that there are no more interfaces) RaiderDoctor ANSYS Meshing & Geometry 0 June 22, 2018 15:37
[Salome] IdeasUnvToFoam is very slow when converting meshes armitatz OpenFOAM Meshing & Mesh Conversion 1 May 2, 2017 13:48
Interfaces for combining meshes rbarrett ANSYS 0 July 6, 2011 12:40
meshes interfaces 2 ? amine CFX 0 March 7, 2008 14:59
[Commercial meshers] Converting Gambit Neutral Meshes gschaider OpenFOAM Meshing & Mesh Conversion 1 May 12, 2005 13:13


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