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/)
-   -   [snappyHexMesh] Boundaries condition in a sHM mesh (32770 undesired patches) (https://www.cfd-online.com/Forums/openfoam-meshing/154055-boundaries-condition-shm-mesh-32770-undesired-patches.html)

MartinBlx June 9, 2015 13:33

Boundaries condition in a sHM mesh (32770 undesired patches)
 
Hi everyone!

I'm a newbie to OpenFOAM and I'm facing a problem when trying to run one of my first cases.

Basically what I'm aiming to do is to simulate the flow inside a curved channel. I created the CAD geometry with Inventor then exporting it in a .stl file.

I managed to mesh inside my channel using sHM but now I would like to apply boundaries conditions to it, basically a velocity inlet and oulet and the rest of the channel faces should be walls, so I could finally execute simpleFoam on my case.

But I don't know how I'm supposed to select the good faces to create the inlet and outlet patches.
And sHM created 32770 patches, called channel_patch0 etc. until channel_patch32768...

Any ideas?

Cheers

alexB June 9, 2015 16:21

Hi Martin,

I have found a good tutorial for sHM https://www.youtube.com/watch?v=ObsFQUiVi1U .
I hope it helps. ;)

regards
Alex

MartinBlx June 12, 2015 08:39

1 Attachment(s)
Hi,

the tutorial helped a lot, many thanks!

However, I didn't manage to make my simulation work. When running simpleFoam on my new sHM mesh (with now boundaries on it), I get the following errror message at t=16s:

"Time = 16

DILUPBiCG: Solving for Ux, Initial residual = 0.68764051, Final residual = 0.011333324, No Iterations 19
DILUPBiCG: Solving for Uy, Initial residual = 0.68577598, Final residual = 0.0081194435, No Iterations 16
DILUPBiCG: Solving for Uz, Initial residual = 0.66073159, Final residual = 0.020511581, No Iterations 21
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:?
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#5
at ??:?
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7
at ??:?
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 17171 on node xxxxx-All-Series exited on signal 8 (Floating point exception)."



I can't figure out what is wrong?

For my simulation, I decided to try first on a basic channel (see picture, it cannot be more simple!).

I think my problem comes from extracting the boundary regions from my original CAD model.

I used AutoDesk Inventor to design the channel. Then, I used the "slice" tool to create separately solids from the channel: an inlet, an outlet and the "middle" of the channel (so 3 new CAD files). When concatenating the three, it should give the overall channel, as it is explained in Douglas' tutorial. I try to show you what I've done in the attached picture.

I think I did this part wrong. So how am I supposed to extract these surfaces from my original CAD model? This part is not detailed in the tutorial. (I'm also a newbie to Autodesk)

regards
Martin

MartinBlx June 15, 2015 10:16

Anyone?

I'm blocked with the solving of my case because of this boundary extraction issue.

alexB June 17, 2015 10:11

Hi Martin,

sorry for the late reply, I was busy and lost this thread out of sight.

I could sketch how I extract the sufrace.
I built up one file of the whole volumetric body and saved it as .stl-file decoded as ASCII (because every other programm should be able to handle this format).

Then I used meshlab (freeware) and deleted everything except for the inlet surface and saved it as another .stl-file (ASCII), and so on for all other surfaces. (bit time consuming)

From then I stuck again to the tutorial.



To your picture:
if the bodies in your picture should be connected there must not be sufraces between them. So the bodies shouldn't be blocks with 6 surfaces (for me it seems like they are whole hexahedra ;) ) .

regards
Alex

MartinBlx June 17, 2015 10:28

Thanks for the reply, I will try to use MeshLab in the future when working with more sophisticated shapes than the basic ones.

I managed to fit to the tutorial by indeed locating my inlet and outlet in the ASCII .stl file of my hexahedra body (indeed I made a mistake when trying to identify my inlet and outlet as hexahedra). It was easy since the ASCII file gives 12 triangles (2 by faces) and the components of the normals made it easy to identify my patches.

But I think that when working with more complex solid, this method won't work because the number of triangles would be just too high. So I'll try to delete the undesired surfaces with MeshLab. :)


All times are GMT -4. The time now is 12:00.