CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] How to create patch after snappyHexMesh (https://www.cfd-online.com/Forums/openfoam-meshing/61510-how-create-patch-after-snappyhexmesh.html)

hsieh August 8, 2008 09:00

How to create patch after snappyHexMesh
 
Hi,

snappyHexMesh is a great tool. Save me lots of time creating meshes. However, I do run into a problem with some situations. I am wondering if anyone has encounter the same isssue and have ways to resolve it.

As seen in the picture, I want to create a mesh "inside" the cup. I have stl file of the geometry. So, I create a simple block to contain the cup. After snappyHexMesh, I got the mesh inside the cup. But, at the point, there is only 1 patch, that is the wall of the whole geometry. I need to separate this 1 patch into: inlet, wall1, wall2, and atmospheric. How to achieve this? Sometimes, the patch I am interested in may be curved surfaces, so that patch is not always flat. Suggestions will be highly appreciated.

Pei

hsieh August 8, 2008 09:01

press send too fast before add
 
press send too fast before adding the picture.

\image{cup};

Pei

hsieh August 8, 2008 09:02

OK, let me try this again.
 
OK, let me try this again.

http://www.cfd-online.com/OpenFOAM_D...ges/1/8680.jpg

eugene August 8, 2008 10:08

We do this by either: 1. Usin
 
We do this by either:
1. Using separate STL surfaces for each region
2. Using STL or NASTRAN surfaces with multiple internal regions.

You can also get additional patches from the original blockMesh by intersecting the surface geometry with the block boundary.

hsieh August 8, 2008 11:59

Hi, Eugene, Thanks. I thin
 
Hi, Eugene,

Thanks. I think I understand approach #1, but, can you explain approach #2? It is not clear to me what STL/Nastran surfaces with multiple internal regions means. How to create that?

Pei

PS: I use SolidWorks to create geometries.

bastil August 10, 2008 16:28

Thanks Eugene, I was not aw
 
Thanks Eugene,

I was not aware that the file may also be in Nastran format? This is quite helpful. I am also wondering how you make snappyhexmesh to use multiple stl-Files at one time? Is it sufficant to place them into the trisurface dictionary?

Thanks.

eugene August 11, 2008 06:12

Hi Bastil, We use CATIA/ANS
 
Hi Bastil,

We use CATIA/ANSA to make surfaces and these tools provides the capability of exporting multi-regioned surfaces. I have never personally used solidWorks, so I cannot comment on that.

To use multiple surfaces just add more surfaces to the geometry and refinementSurfaces sections of the snappyHexMesh dict. Of course they need to be in the triSurface directory as well.

hsieh August 11, 2008 08:10

Hi, Eugene, My understandin
 
Hi, Eugene,

My understanding is that, the geometry has to "close". For example, say, a cube. It has 6 sides, top, bottom, left, right, front, back. When exporting to STL, the STL file consists of several triangulates, and we no longer have patch name, such as top/bottom/front/back/left/right associate with the STL file. In snappyHexMesh, all 6 surfaces got lumpped into 1 surface, say called cubeWall. Is ther a way to keep the the original patch names in STL?

In SolidWorks, it can select a surface, split it into two surfaces (can be any shape). But, once exporting to STL, there is no name assocates with the surface. I can export specific patch surface to STL, but, can it be used in snappyHexMesh?

Pei

eugene August 11, 2008 11:40

Like I said, I don't know soli
 
Like I said, I don't know solidWorks. But in our regioned STL files regions look something like this:

solid top
'triangle stuff'
endsolid top
solid bottom
'more triangle stuff'
endsolid bottom
etc.

I don't think this kind of regioning is a standard STL feature. However, NASTRAN does support regions by default.

bastil August 11, 2008 11:43

Eugene, thanks once more. I
 
Eugene,

thanks once more. I also do not use SolidWorks. I guess from CATIA your way is multi-part stl? What about ANSA? I do not know ANSA, do you use stl there, too? The other question was if nastran-Format is possible, too. This seems to be the case.

Regards

eugene August 12, 2008 05:13

These days we mostly use NASTR
 
These days we mostly use NASTRAN with and without multi-regions.

bastil September 1, 2008 11:53

Hi all, I have problems exp
 
Hi all,

I have problems exporting multi-region Nastran files from Hypermesh. It seems HM has different Nastan formats (long, CFD, standard,..) OF only reads "standard" option. However, regions are not discovered and I have some warnings about unrecognised NASTRAN-commands. I see HM has written regions into the file, but obviously the format is wrong. What does it have to look like?

Regards.

nitsud September 13, 2008 13:57

Hey all, What I've found to w
 
Hey all,
What I've found to work in solidwork is to generate individual solid bodies for each patch that you'd like to generate, then save them as individual, ASCII .stl files (not allowing solidworks to translate them to positive space, so you insure relative positioning is correct), then concatenate the .stl files, and apply the snappyHexMesh to that.

This worked OK for me, and actually sort of makes sense with the way that my solidworks assemblies work.
Thanks,
D

hsieh September 22, 2008 17:41

Hi, Eugene, I am wondering
 
Hi, Eugene,

I am wondering if you can post a complete multi-part stl (simple geometries will do). I am wondering if I can edit my stl file from SolidWorks to try out snappyHexMesh.

thanks!

Pei

bastil September 23, 2008 04:05

Pei, you can have a look at
 
Pei,

you can have a look at the Motorbike Tutorial. This is exactly what you are looking for.
However, I would be interested in a example Nastran-File from a simple geometry that works (remain both patches and patch-names). I am struggeling with the Hypermesh-Export so far. Thanks.

Regards Basti

linnemann November 25, 2008 02:45

Hey all just an FYI.. If yo
 
Hey all just an FYI..

If you are using Salome to create your geometry. (CAElinux is a live dvd with salome installed if you want to try it out)

You have the option to explode your geometry into faces give them names like vel_inlet press_outlet etc.. and export each face to their own .stl file.

exporting to an ASCII .stl will allow you to edit the text and give each solid names.

You can then use these multiple files in snappyHexMesh (haven't tried this so don't know if it handles multiple files).

The other way is to combine the face .stl files into a fully defined solid by appending each separate .stl file into one by for example using a command like this. (assuming it is a cylinder)

cat inlet.stl >> assembly.stl
cat outlet.stl >> assembly.stl
cat walls.stl >> assembly.stl

Then you have a fully defined solid and provided you have given the three solids names these will be added to your final boundaries file and you can specify the inlet/oulet conditions as usual after running snappyHexMesh.

Hope this helps anyone.

Regards

bholbek December 12, 2008 04:39

Hi, i'm trying to create a
 
Hi,

i'm trying to create a mesh inside a geometry with the snappyHexMesh utility.
The mesh seems ok but i can get the patch i want. I have different stl surfaces and i would like to have a patch for each of them. However, I just have the patchs related to my initial background hex mesh and one, corresponding to te complete geometry...

Is using different stl surfaces not sufficient?

Thank you

Bastien

bholbek December 12, 2008 05:19

Last thing, what should i d
 
Last thing,

what should i do with the boundaries of my background hex mesh. I don't simulate anything outside the geometry. Put empty for example?

Thank you

Bastien

fra76 December 12, 2008 07:28

It's enough that you put all y
 
It's enough that you put all your patches in one STL file. At the end you will have different patches in your mesh, where the mesh has been built. Using multiple stl files is fine as well. Check that you saved your STL as ascii, as in binary files patch names are not written.

I cannot understand your last question. If you need to mesh inside your geometry, you should not have any mesh between it and your background mesh, as your keep point must be inside.
If you have a mesh on both sides, it means that you have a hole in your geometry.

Hope this helps,
Francesco

bholbek December 12, 2008 11:37

Hi, Thank you for your answ
 
Hi,

Thank you for your answer.
actually, i don't have mesh outside my geometry, it's ok. However, snappyHexMesh creates a defaultFaces patch, which comes from my background hex mesh, i think.
Is it normal?

Thanks

Eric

bholbek December 15, 2008 08:14

Hi, an other problem relate
 
Hi,

an other problem related to the patch concerns curved surfaces. For example, i have an inlet which is a curved sufrace. Using snappyHexMesh, i can see that a important part of my inlet is made of holes! I think it comes form hexahedral cells which have been removed when 50% or more of their volume lies out of the region of interest.
Could it be due to bad snapping parameters?
I'm using this ones:
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;

//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;

//- Number of mesh displacement relaxation iterations.
nSolveIter 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
}

Could someone help me?

Thank you

Bastien

idrama January 15, 2010 17:09

Hello bholbek,

you mentioned an interesting point. What is supposed to to with defualtPatches defined by the blockMeshDict. Have you already gotten some answer or how you have solved this problem.

kind rigards

Elise February 17, 2012 09:14

help on creating patches
 
2 Attachment(s)
I'm trying to create patches from multiple stl files
I tried as posted in the previous post
but I get the error:

keyword castellatedMeshControl is undefined
Is there something wrong with the file?

danvica March 11, 2012 05:23

2 Attachment(s)
Dear All,
I'm new to snappyhexmesh and me too I hit the same problem (holes into the patches).

See pictures.


I'm still doing tests but if someone knows the solution I appreciate, thanks.

Daniele

Elise March 11, 2012 06:21

This is strange, did you set up different levels at the inlet?
Maybe try the same level of refinement and a bit higher level of refinement?

danvica March 11, 2012 09:45

Even with the same refinement setup I've got the same problem.

A little explanation of what I'm doing:

I'm trying to setup patches using a stl files.
It's just a simple pipe with an inlet and an outlet (oh, yes, what else...;))

I defined the faces in Salome and exported three different files: one is for full geometry, one for the inlet face and the other for the outlet one.

In snappyHexMeshDict I use:

Code:

geometry
{
    CFD_TUBO.stl
    {
        type triSurfaceMesh;
        name tubo;
    }
 
    inlet.stl
    {
        type triSurfaceMesh;
        name inlet;
    }
 
    outlet.stl
    {
        type triSurfaceMesh;
        name outlet;
    }
};

and

Code:

refinementSurfaces
  {
        tubo
        {
            level (2 3);
        }
        inlet
        {
            level (2 3);
        }
        outlet
        {
            level (2 3);
        }
    }

This way the meshing goes without errors and parafoam let me see the patches (but with the holes).

Maybe the holes are caused by the file of the full geometry that already contains the faces included in the inlet/outlet stl files.

I do this way because, in general, I think it would be more comfortable to define just the patches and leave the other faces undefined.

I don't know whether I was able to explain...
In order to define patches in stl geometry, do I have to export all and only the surfaces (sure, grouped by their function, in my case still 3 files) ?


Daniele

danvica March 11, 2012 10:17

Yes, you have to define a stl file for each of the patches.

No overlapping faces seem to be allowed.

This way I solved the holes problem.

Daniele

mihaipruna March 13, 2012 09:42

Quote:

Originally Posted by danvica (Post 348793)
Yes, you have to define a stl file for each of the patches.

No overlapping faces seem to be allowed.

This way I solved the holes problem.

Daniele

Does that mean that the option of having a single STL file with multiple solids does not work?

danvica March 13, 2012 10:06

Well, I'm just a beginner so be carefull with my advices.

Anyway ,my problem was having several overlapping surfaces.

I think there's no problem in having multiple not-overlapping patches.

Daniele

mihaipruna March 13, 2012 10:51

thanks Daniele

tjliang April 30, 2014 07:19

hi,Pei. I have the same problem with you. Have you solved your problem at last. If so, could you please tell me how is that solved?

student666 May 6, 2014 13:06

Hi Daniele,

I'm facing same problem, do you mean work-flow should be like this?

- realize your CAD geometry
- explode into faces
- make group of faces (inlet, outlet, walls)
- export every single group of faces as STL ascii
- write every geometry file into SHM dict.

sounds correct to you?

danvica May 6, 2014 14:49

Yes. These are the steps I follow.

Yeru July 17, 2017 08:15

Non-closedness after removing patch surfaces
 
1 Attachment(s)
Dear all,

2014 is long gone - still, I am thankful for your thread since I have the same issues: a fractured patch, just like user danvicas images show.

I have compressed a minimal working example (MWE) below.

Yes, I use individual .stl files for each patch.
Yes, I use the same refinement levels.

But geometrically speaking, it is impossible to remove overlapping surfaces - and that's a problem:
I have the whole geometry (wall+inlet+outlet) as an .stl file.

When I try to remove the outlet face in the whole file manually, e.g. by using blender, I create a non-closed geometry.
Code:

snappyHexMesh -checkGeometry
complains and cannot run.

I even tried redistributing the nodes in the whole geometry:
  1. compare whole.stl with inlet.stl (or outlet.stl)
    save difference in diff.stl
    (contains all inlet nodes)
  2. erase lines in diff.stl from whole.stl
    (s.t. whole.stl contains only non-inlet nodes)
  3. append diff.stl to whole.stl
    (s.t. all inlet nodes are in their own "solid/endsolid" wrapping.
And still, it doesn't work :(


How did you all get past this?
Thanks again for the previous discussion!
Yeru


All times are GMT -4. The time now is 06:50.