CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... (http://www.cfd-online.com/Forums/openfoam-meshing-other/)
-   -   Converting meshes that includes interfaces (http://www.cfd-online.com/Forums/openfoam-meshing-other/61716-converting-meshes-includes-interfaces.html)

ham May 31, 2006 04:40

Hello dear FOAM users. I am
 
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

gschaider May 31, 2006 08:45

Hello Marcus! @1: If your
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif (I've done that, but never for interfaces)

anne May 31, 2006 09:51

Hello Berhard, I take advan
 
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

ham June 1, 2006 02:13

Thank you I will try this.
 
Thank you
I will try this.

/Marcus

gschaider June 1, 2006 16:47

Hi Anne! 3.49% seems to be
 
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 ....")

anne June 2, 2006 03:28

Hi Bernhard, First, thanks
 
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

gschaider June 2, 2006 05:01

Hi Anne! I assume that the
 
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.

anne June 2, 2006 05:41

Hello again, I need a littl
 
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 June 2, 2006 10:31

HI Bernhard, I have finally
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
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

ham June 7, 2006 03:44

Using splitMesh what is: fac
 
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

gschaider June 7, 2006 10:26

Hi Anne. Problem could be,
 
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?

gschaider June 7, 2006 10:36

Hi Marcus! For OpenFOAM a f
 
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"

ham June 7, 2006 10:44

Hi! Thanks, now I understan
 
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 rookiehttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

/Marcus

gschaider June 7, 2006 11:30

Hi Marcus! First converter,
 
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?

ham June 8, 2006 01:59

Good morning. The error was
 
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:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
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

hjasak June 8, 2006 02:48

This message says you have man
 
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

ham June 8, 2006 03:15

Okey, Yes, I built the mesh u
 
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 June 8, 2006 04:02

Hmm, I dont know what to do no
 
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

hjasak June 8, 2006 04:09

OK, send it over here, I will
 
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

ham June 8, 2006 04:23

http://www.cfd-online.com/Open
 
http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
I have sent you an email.

/Marcus


All times are GMT -4. The time now is 14:13.