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

[snappyHexMesh] Demage the background mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2022, 18:15
Default Demage the background mesh
  #1
New Member
 
Christian Pinzón
Join Date: Apr 2022
Posts: 6
Rep Power: 4
davcrisp is on a distinguished road
Hi everyone

I'm trying to mesh a a jet in cross flow.
First I have created the main domain in blockMesh with 4 blocks, three block for the main channel, an one for the incline channel, (figure 1).
Second I used snappyHexMesh to mesh a step (figure2) in upstream direction.
When sHM finish the domain near to the intersection area is deforme as is showed figure3.

Could you give me an advise how to do that sHM only meshing the step and not affect the downstream channel intersection? and not affect areas that are not specify in SHM file?? Thanks
figure1.jpg figure2Step.pngfigure3.pngfigure4.png

SnappyHexMesh Code:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"

castellatedMesh on;
snap            on;
addLayers       off;

geometry
{
       step_triangle
    {
        type triSurfaceMesh;
        file "step_triangle.stl";
        name step;    
    }
};

castellatedMeshControls
{
    maxLocalCells           3000000;
    maxGlobalCells          3000000;
    minRefinementCells      10;// Motorbike 10
    maxLoadUnbalance        0.10; //
    nCellsBetweenLevels     2; // buffer cells.
    resolveFeatureAngle     10;// 60?
    gapLevelIncrement       1;
 features
 ( 
        {file "step_triangle.eMesh"; levels ((0.025 0));}
   );

    refinementSurfaces // Surface-wise min and max refinement level
    {
    step {level (1 1); patchInfo {type wall;};gapLevelIncrement 2;} //(3 3)
	
     }
   refinementRegions
    {  
  }

    locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid
    //nCellsBetweenLevels 3;
    allowFreeStandingZoneFaces false;
    }
snapControls
{
    implicitFeatureSnap         false;
    explicitFeatureSnap         true;
    nSmoothPatch                2;
    nSmoothInternal             $nSmoothPatch;
    tolerance                   2.0;
    nSolveIter                  90;
    nRelaxIter                  15;
    // Feature snapping
    //- Number of feature edge snapping iterations.
    //  Leave out altogether to disable.
    nFeatureSnapIter            10;
    detectBaffles               true;
    multiRegionFeatureSnap      false;
}
BlockMesh code:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

backgroundMesh
{
 //block_1
    x_b1_Min    -0.198;
    x_b1_Max    -0.006538;           // xMax     0.595;
    y_b1_Min     0;                 //-0.120;
    y_b1_Max     0.120;
    z_b1_Min    -0.0150;
    z_b1_Max     0.0150;

//block_2
    x_b2_Min    -0.006538;
    x_b2_Max     0.006538;       // xMax     0.595;
    y_b2_Min     0;		//-0.120;
    y_b2_Max     0.120;
    z_b2_Min    -0.015;
    z_b2_Max     0.015;
    
//block_3
    x_b3_Min    0.006538;
    x_b3_Max     0.3;       // xMax     0.595;
    y_b3_Min     0;		//-0.120;
    y_b3_Max     0.120;
    z_b3_Min    -0.015;
    z_b3_Max     0.015;

    zMaxP    0.015;
 

    xCells 334;  //xCells  240;
    yCells  80; //80;//70
    zCells  16;//13*/
    
    x_1 80;
    y_1 75;
       
    x_2 40;
    y_2 75;
       
    x_3 120;
    y_3 75;
    
    z_0 44;
    z_1 22;
}

vertices
(
//vertices canal principal
    ($:backgroundMesh.x_b1_Min $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b1_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b1_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b1_Min $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Min)

    ($:backgroundMesh.x_b1_Min $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Max)
    ($:backgroundMesh.x_b1_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Max)
    ($:backgroundMesh.x_b1_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Max)
    ($:backgroundMesh.x_b1_Min $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Max)
    
    ($:backgroundMesh.x_b2_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b3_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b3_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Min)
    ($:backgroundMesh.x_b2_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Min)

    
    ($:backgroundMesh.x_b2_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Max)
    ($:backgroundMesh.x_b3_Max $:backgroundMesh.y_b1_Min $:backgroundMesh.z_b1_Max)
    ($:backgroundMesh.x_b3_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Max)    
    ($:backgroundMesh.x_b2_Max $:backgroundMesh.y_b1_Max $:backgroundMesh.z_b1_Max)

 //vertices canal secundario    
    (-0.161594 -0.108572 -0.0075)
    (-0.157292 -0.114715 -0.0075)
    (0.006538 0 -0.0075)
    (-0.006538 0 -0.0075)

    (-0.161594 -0.108572 0.0075)
    (-0.157292 -0.114715 0.0075)
    (0.006538 0 0.0075)
    (-0.006538 0 0.0075)

);

blocks
(
    hex (0 1 2 3 4 5 6 7) 
    
    (
     $:backgroundMesh.x_1
     $:backgroundMesh.y_1     
     $:backgroundMesh.z_0
     ) 
     simpleGrading (
	    (
	    	(1 1 0.07)
	    )
            (
            	(0.05 0.30 1)        
            	(0.95 0.70 19)	
            ) 
            	1
            	 )
    hex (1 8 11 2 5 12 15 6)
     (
     $:backgroundMesh.x_2 
     $:backgroundMesh.y_2
     $:backgroundMesh.z_0
     )
      simpleGrading (
	    (
	    	1
	    )
            (
            	(0.05 0.30 1)        
            	(0.95 0.70 19)	
            ) 
            	1
            	 )
    hex (8 9 10 11 12 13 14 15)
    (
    $:backgroundMesh.x_3 
    $:backgroundMesh.y_3 
    $:backgroundMesh.z_0
    )
     simpleGrading (
	    (
	    	(1 1 12)
	    )
            (
            	(0.05 0.30 1)        
            	(0.95 0.70 19)	
            ) 
            	1
            	 )
    hex (16 17 18 19 20 21 22 23) 
    (
    $:backgroundMesh.x_2 
    70 
    $:backgroundMesh.z_1)   simpleGrading (1 0.08 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 4 7 3)

        );
    }

    outlet{

        type patch;
        faces
        (
            //(17 18 22 21)
            (9 10 14 13)
        );
    }

    front
    {
        type patch;
        faces
        (
            (4 5 6 7)
            (5 12 15 6)
            (12 13 14 15)
            //(20 21 22 23)
         );
    }

    back
    {
        type patch;
        faces
        (
            (0 3 2 1)
            (1 2 11 8)
            (8 11 10 9)
           // (16 19 18 17)
        );
    }

    top
    {
        type patch;
        faces
        (
            (3 7 6 2)
            (2 6 15 11)
            (11 15 14 10)
            //(19 23 22 18)
        );
    }


    dummy
    {
        type wall;
        faces
        (
            (0 1 5 4)
            (1 8 12 5)
            (8 9 13 12)
            //(16 17 21 20)
        );

    }

    channel
    {
        type wall;
        faces
        ( 
   	     (16 19 18 17)
   	     (16 20 23 19)
   	     (20 21 22 23)
   	     (17 18 22 21)            
        );
    }

 dummy_inlet
    {
        type wall;
        faces
        (
           (19 18 22 23)
         );
    }

 inlet_channel
    {
        type wall;
        faces
        (
            (16 17 21 20)
         );

    }

);


mergePatchPairs
(

(dummy dummy_inlet)
);
davcrisp 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
[snappyHexMesh] non uniform mesh near the stl object vava10 OpenFOAM Meshing & Mesh Conversion 0 January 31, 2021 14:41
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Problems with stl from dem and background mesh VLima OpenFOAM Meshing & Mesh Conversion 1 May 4, 2020 12:04
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 21:22.