2012年4月25日星期三

Prepare stl file with separated surface parts for snappyHexMesh

One of the way to get a stl file with separated surface parts:
1. Create geometry using Freecad and exported as stl file;
2. Import the stl file to EnGrid, define surfaces, view the boundary code by name, then save each surface as a vtu file;
3. Open each vtu file to EnGrid, then export this face to stl file;
4. Edit the title of the stl files (all the separated surfaces), then combine the stl files to a single stl;
5. Employ snappyHexMesh to create the grid.

An alternative way is to use Blender to create the geometry, then open in EnGrid, then follow the step 2~5 as above

2012年4月6日星期五

snappyHexMesh for OpenFOAM.

To generate a mesh within a domain defined by a stl file, we can take the following steps:
1. Create the geometry in SALOME, then export the faces into individual stl files.
2. Edit the stl files according to the motorBike case in the tutorial, combine them into a single stl file, and then put it in the folder 'constant/triSurface'.
3. Create the blockMeshDict and leave the patches to be empty, and run blockMesh.
4. Put decomposeParDict and snappyHexMeshDict into the folder 'system', edit snappyHexMeshDict according the motorBike tutorial.
5. Run snappyHexMesh and the mesh will be ready for OpenFOAM.

2012年4月5日星期四

Mesh generation using SALOME

I found the information from the internet.

STEP1 Create groups of faces for all patches (undefined surfaces will became in OpenFOAM as defaultFaces patch). For example, for internal simulation, we need 3 groups: inlet, outlet and walls.

STEP2 Mesh geometry.

STEP3 Create group of faces for mesh. This is done by using Create group command in SMESH module and selecting checkbox faces. In the appeared dialog box we must enter name for group (or patch in OpenFOAM), e.g., inlet, outlet, walls. Then, we must select Group using geometry option and click on interesting group in tree view of meshed solid.

STEP4 Export your mesh to I-DEAS format file (filename.unv). This file should be saved to the root of OpenFOAM case (where directories 0, constant, system).

STEP5 Run utility ideasUnvToFoam. For example, if we are using terminal in case root, we should type:

Code:
ideasUnvToFoam filename.unv
STEP6 Check mesh. run:
Code:
checkMesh
STEP7 If checkMesh reports no error, change dimensions. To convert from mm to m, we must type
Code:
transformPoints -scale '(0.001 0.001 0.001)'
STEP8 Change physical boundaries: enter file constant/polyMesh/boundaries and edit entries according to your case