|
[Sponsors] |
[snappyHexMesh] Why doesn't SnappyHexMesh retain patches from BlockMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 17, 2019, 17:32 |
Why doesn't SnappyHexMesh retain patches from BlockMesh
|
#1 |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Hi,
I have the following blockMeshDict, with a defined inlet, outlet and walls. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices ( (0 0 400) (0 400 400) (400 400 400) (400 0 400) (0 0 0) (0 400 0) (400 400 0) (400 0 0) ); blocks ( hex (0 1 2 3 4 5 6 7) square (100 100 100) simpleGrading (1 1 1) ); edges ( ); patches ( patch xmin ( (0 1 5 4) ) patch xmax ( (3 2 6 7) ) patch ymin ( (0 3 4 7) ) patch ymax ( (1 5 6 2) ) patch zmin ( (0 3 2 1) ) patch zmax ( (4 5 6 7) ) ); mergePatchPairs ( ); // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Which of the steps to run castellatedMesh true; snap true; addLayers false; // Geometry. Definition of all surfaces. All surfaces are of class // searchableSurface. // Surfaces are used // - to specify refinement for any mesh cell intersecting it // - to specify refinement for any mesh cell inside/outside/near // - to 'snap' the mesh boundary to the surface geometry { Exo5.stl { type triSurfaceMesh; name interiorWalls; } }; // Settings for the castellatedMesh generation. castellatedMeshControls { maxLocalCells 90000000; maxGlobalCells 90000000; minRefinementCells 10; maxLoadUnbalance 0.10; nCellsBetweenLevels 3; features ( ); refinementSurfaces { interiorWalls { // Surface-wise min and max refinement level level (3 3); } } refinementRegions { } resolveFeatureAngle 30; locationInMesh (0 7.628 0); // Whether any faceZones (as specified in the refinementSurfaces) // are only on the boundary of corresponding cellZones or also allow // free-standing zone faces. Not used if there are no faceZones. allowFreeStandingZoneFaces false; } // 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 2.0; //- Number of mesh displacement relaxation iterations. nSolveIter 200; //- Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 5; // Feature snapping //- Number of feature edge snapping iterations. // Leave out altogether to disable. nFeatureSnapIter 10; //- Detect (geometric only) features by sampling the surface // (default=false). implicitFeatureSnap false; //- Use castellatedMeshControls::features (default = true) explicitFeatureSnap true; //- Detect points on multiple surfaces (only for explicitFeatureSnap) multiRegionFeatureSnap false; } // Settings for the layer addition. addLayersControls { // Are the thickness parameters below relative to the undistorted // size of the refined cell outside layer (true) or absolute sizes (false). relativeSizes true; // Per final patch (so not geometry!) the layer information layers { "interiorWalls.*" { nSurfaceLayers 1; } } // Expansion factor for layer mesh expansionRatio 1.15; // Wanted thickness of final added cell layer. If multiple layers // is the thickness of the layer furthest away from the wall. // Relative to undistorted size of cell outside layer. // See relativeSizes parameter. finalLayerThickness 0.1; // Minimum thickness of cell layer. If for any reason layer // cannot be above minThickness do not add layer. // Relative to undistorted size of cell outside layer. minThickness 0.1; // If points get not extruded do nGrow layers of connected faces that are // also not grown. This helps convergence of the layer addition process // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings // When not to extrude surface. 0 is flat surface, 90 is when two faces // are perpendicular featureAngle 60; // At non-patched sides allow mesh to slip if extrusion direction makes // angle larger than slipFeatureAngle. slipFeatureAngle 30; // Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals nSmoothSurfaceNormals 1; // Number of smoothing iterations of interior mesh movement direction nSmoothNormals 3; // Smooth layer thickness over surface patches nSmoothThickness 10; // Stop layer growth on highly warped cells maxFaceThicknessRatio 0.5; // Reduce layer growth where ratio thickness to medial // distance is large maxThicknessToMedialRatio 0.3; // Angle used to pick up medial axis points // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x. minMedianAxisAngle 90; // Create buffer region for new layer terminations nBufferCellsNoExtrude 0; // Overall max number of layer addition iterations. The mesher will exit // if it reaches this number of iterations; possibly with an illegal // mesh. nLayerIter 50; } // Generic mesh quality settings. At any undoable phase these determine // where to undo. meshQualityControls { #include "meshQualityDict" // Advanced //- Number of error distribution iterations nSmoothScale 4; //- Amount to scale back displacement at error points errorReduction 0.75; } // Advanced // Write flags writeFlags ( scalarLevels layerSets layerFields // write volScalarField for layer coverage ); // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1e-06; // ************************************************************************* // IMPORTANT NOTE: When I open my BlockMesh the patches do show. when I run snappyHexMesh, the patches exist in the boundary file but all of them have 0 faces. Thank you! |
|
June 22, 2022, 15:23 |
|
#2 | |
New Member
|
Quote:
i am trying to simulate combustion in a fire stove using fireFoam, i don’t know why after the blockmesh are still there along with my stove and wood geometry boundary conditions |
||
June 22, 2022, 15:28 |
|
#3 |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Can you explain further? do you mean you want to delete patches or do you have a patch between blocks that you want to remove
|
|
June 22, 2022, 15:30 |
|
#4 |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Resolved: by making sure to run surfaceFeatures before running SHM, this way you get an output of the exact bounds of the STL and you can make sure that the STL sits inside the blocks created.
|
|
June 22, 2022, 15:35 |
|
#5 |
New Member
|
Thank you, also one more thing, sorry. My geometry contains two volumes;
Volume1- Wood Stove, Volume2- wood log, (2 in inside 1 as a separate geometry) two surfaces from each volume touches, will snappy hex mesh would snap them properly or will it be an error ? |
|
June 22, 2022, 15:40 |
|
#6 | |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Quote:
|
||
June 22, 2022, 15:45 |
|
#7 |
New Member
|
My Geometry and blockMeshfile
|
|
June 22, 2022, 15:57 |
|
#8 |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
This is way too complex for a geometry, if you are able to remove any unnecessary details that would help. The problem is that you need to create more than 1 block to get a good mesh here. I would look into creating 4 blocks, one for the bottom part, one for the fins, the next block and then for the tube. This way you can get the result you are looking for. I hope this helps
|
|
June 22, 2022, 16:04 |
|
#9 |
New Member
|
since i am creating multiple blocks can i split my geometry into multiple stl files ? i mean will it be easier, multiple stl files and 2 separate volumes placed one inside anothervolumes ?
Now I have onle (Stove volume + Inlet, Outlet, Wall) and (Wood volume + Wood sides) |
|
February 19, 2023, 23:06 |
|
#10 | |
New Member
Join Date: Feb 2023
Posts: 3
Rep Power: 3 |
Quote:
Could you solve this problem? I am running a case now and facing the same problem. I might be needing your help. Thank you |
||
February 20, 2023, 09:48 |
|
#11 |
New Member
Nidal
Join Date: Nov 2018
Posts: 17
Rep Power: 8 |
Check the comments above. Run surfaceFeatures, it will give you the bounding domain of your STL and make sure your blockMesh is within the correct domain.
|
|
Tags |
boundary, mesh, patch, patches, snappyhexmesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem using AMI | vinz | OpenFOAM Running, Solving & CFD | 298 | November 13, 2023 09:19 |
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." | lethu | OpenFOAM Meshing & Mesh Conversion | 1 | June 3, 2020 08:49 |
[snappyHexMesh] Creating baffes with snappyHexMesh | BBack | OpenFOAM Meshing & Mesh Conversion | 0 | September 22, 2019 06:10 |
[snappyHexMesh] snappyHexMesh does not create boundary patches from .stl files | bug_or_feature | OpenFOAM Meshing & Mesh Conversion | 7 | August 30, 2016 20:18 |
Possible bug with stitchMesh and cyclics in OpenFoam | Jack001 | OpenFOAM Pre-Processing | 0 | May 21, 2016 09:00 |