|
[Sponsors] |
[snappyHexMesh] Simulation of flow around a cylinder in OpenFOAM in 2D case |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2024, 11:22 |
Simulation of flow around a cylinder in OpenFOAM in 2D case
|
#1 |
New Member
Martin Mathew
Join Date: Nov 2023
Posts: 4
Rep Power: 3 |
I tried to make a domain for my simulation for a 2d case. But when I import my stl file and execute snappyHexMesh, the stl file is split up into 4 cells in z-direction and the base mesh is 1 cell (which is desired as for a 2d case).
How can I resolve this issue with the stl file. The images and snappyHexMeshDict are shown here below. ************************************************** ************* /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2212 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location system; object snappyHexMeshDict; } //************************************************** ******************// castellatedMesh true; snap true; addLayers false; geometry { fish.stl { type triSurfaceMesh; name fish; } refinementeBox { type searchableBox; min (0.9 0 0); max (2.4 0.75 0.01); } fishRefinementBox { type searchableBox; min (1.38 0.33 0); max (1.72 0.42 0.01); } } castellatedMeshControls { features ( { file "fish.eMesh"; level 2 ; //refineFeatureEdgesOnly false; } ); refinementSurfaces { fish { level (2 2); patchInfo { type wall; } } } refinementRegions { /*fish { mode outside; levels ((0.01 1)); }*/ /*refinementeBox { mode inside; levels ((1 1)); }*/ fishRefinementBox { mode inside; levels ((1 1)); } } locationInMesh (1.2 0.54 0.0009); //(0.2 0.2 0.1); maxLocalCells 100000; maxGlobalCells 200000; minRefinementCells 0; nCellsBetweenLevels 1; resolveFeatureAngle 20; allowFreeStandingZoneFaces true; planarAngle 30.0; maxLoadUnbalance 0.1; } snapControls { nSolveIter 300; nSmoothPatch 5; tolerance 2.0; nRelaxIter 25; nFeatureSnapIter 20; implicitFeatureSnap false; explicitFeatureSnap true; multiRegionFeatureSnap true; } addLayersControls { layers { //"patch_inlet-fancoil.*" //{ //nSurfaceLayers 10; //} } relativeSizes true; expansionRatio 1.05; finalLayerThickness 0.5; minThickness 0.05; nGrow 0; featureAngle 130; slipFeatureAngle 60; nRelaxIter 5; nSmoothSurfaceNormals 1; nSmoothNormals 3; nSmoothThickness 10; maxFaceThicknessRatio 0.5; maxThicknessToMedialRatio 0.3; minMedialAxisAngle 90; nBufferCellsNoExtrude 0; nLayerIter 50; nRelaxedIter 20; writeVTK false; noErrors false; layerRecovery 1; growZoneLayers false; projectGrownUp 0.0; } meshQualityControls { maxNonOrtho 65.0; maxBoundarySkewness 3; maxInternalSkewness 3; maxConcave 65.0; minFlatness 0.5; minVol 1.0E-13; minTetQuality 1.0E-15; minArea -1.0; minTwist 0.02; minDeterminant 0.001; minFaceWeight 0.05; minVolRatio 0.01; minTriangleTwist -1.0; nSmoothScale 4; errorReduction 0.75; relaxed { maxNonOrtho 65; } } debug 0; mergeTolerance 1.0E-2; autoBlockMesh true; |
|
January 23, 2024, 11:44 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Martin,
Due to the way snappy refines the mesh (octree structure), it cannot mesh 2D cases out of the box since it also refines the 3rd dimension. However, you can mesh your geometry in snappy as you already did, then use the extrudeMesh utility to extrude one of the face of your mesh and get the proper one-cell thickness mesh you need for your 2D case. I didn't search for it but you should be able to find examples in the tutorials or on the forum. Regards, Yann |
|
January 23, 2024, 12:32 |
|
#3 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Extrude a one-cell layer of the front or back patch and throw away the original mesh.
|
|
January 24, 2024, 08:34 |
|
#4 | |
New Member
Martin Mathew
Join Date: Nov 2023
Posts: 4
Rep Power: 3 |
Quote:
Thank you for your reply and suggestion. Good news is, it worked the way you suggested and I was able to extrude my mesh. Much thanks and regards. Martin |
||
Tags |
cfd, meshing 2d, openfoam, simulation, snappyhexmesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
Issues on the simulation of high-speed compressible flow within turbomachinery | dowlee | OpenFOAM Running, Solving & CFD | 11 | August 6, 2021 07:40 |
Turning the Tutorial propeller case into a flow driven case with 6Dof | efirvida | OpenFOAM | 0 | March 7, 2017 10:45 |
Running a feedback control simulation of the flow around a cylinder | gasagna | OpenFOAM Running, Solving & CFD | 0 | July 16, 2014 11:03 |
[Other] OpenFoam Flow over a Circular Cylinder | WolfgangS. | OpenFOAM Meshing & Mesh Conversion | 12 | March 3, 2014 11:53 |