Upgrade to Pro — share decks privately, control downloads, hide ads and more …

バスケットボール メッシュ生成

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for kamakiri1225 kamakiri1225
November 25, 2021

バスケットボール メッシュ生成

Avatar for kamakiri1225

kamakiri1225

November 25, 2021
Tweet

More Decks by kamakiri1225

Other Decks in Science

Transcript

  1. バスケットボールのモデル作成 • FreeCAD メッシュ作成 • blockMesh • snappyHexMesh 解析設定 •

    OpenFOAM 計算実行 • OpenFOAM 結果処理 • Paraview プリ処理 ソルバ ポスト処理
  2. /opt/OpenFOAM/OpenFOAM- v2012/tutorials/incompressible/simpleFoam/motorbike から作業ディレクトリにチュートリアルをコピーする。 mnt/c/work/openfoam/20211010_basketball_flow/002_mesh_create |--motorBike | |--0.orig | | |--U

    | | |--include | | | |--fixedInlet | | | |--frontBackUpperPatches | | | |--initialConditions | | |--k | | |--nut | | |--omega | | |--p | |--Allclean | |--Allrun | |--constant | | |--transportProperties | | |--triSurface | | | |--README | | |--turbulenceProperties | |--system | | |--blockMeshDict | | |--controlDict | | |--cuttingPlane | | |--decomposeParDict.6 | | |--ensightWrite | | |--forceCoeffs | | |--fvSchemes | | |--fvSolution | | |--meshQualityDict | | |--snappyHexMeshDict | | |--streamLines | | |--surfaceFeatureExtractDict | | |--topoSetDict | | |--wallBoundedStreamLines ファイル構成
  3. /*--------------------------------*- C++ -*----------------------------------*¥ ========= | ¥¥ / F ield |

    OpenFOAM: The Open Source CFD Toolbox ¥¥ / O peration | Website: https://openfoam.org ¥¥ / A nd | Version: 8 ¥¥/ M anipulation | ¥*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices ( ( -0.20 -0.20 -0.20) //0 /400mm ( 0.60 -0.20 -0.20) //1 ( 0.60 0.20 -0.20) //2 ( -0.20 0.20 -0.20) //3 ( -0.20 -0.20 0.20) //4 ( 0.60 -0.20 0.20) //5 ( 0.60 0.20 0.20) //6 ( -0.20 0.20 0.20) //7 ); blocks ( hex (0 1 2 3 4 5 6 7) (80 80 80) simpleGrading (1 1 1) //1mesh_5mm ); edges ( ); blocks ( hex (0 1 2 3 4 5 6 7) (80 80 80) simpleGrading (1 1 1) //1mesh_5mm ); edges ( ); boundary ( //patch x_min_1 { type patch; faces ((0 4 7 3)); } x_max_1 { type patch; faces ((1 2 6 5)); } Constant/blockMeshDict y_min_1 { type symmetryPlane; faces ((0 1 5 4)); } y_max_1 { type symmetryPlane; faces ((3 7 6 2)); } z_min_1 { type symmetryPlane; faces ((0 3 2 1)); } z_max_1 { type symmetryPlane; faces ((4 5 6 7)); } ); // *********************************************** ************************** //
  4. /*--------------------------------*- C++ -*--------------------------------- -*¥ | ========= | | | ¥¥

    / F ield | OpenFOAM: The Open Source CFD Toolbox | | ¥¥ / O peration | Version: v2012 | | ¥¥ / A nd | Website: www.openfoam.com | | ¥¥/ M anipulation | | ¥*-------------------------------------------------------------------------- -*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Which of the steps to run castellatedMesh true; snap true; addLayers true; geometry { basketball { type triSurfaceMesh; file "basketball_mm.stl"; } refinementBox { type box; min (-0.1 -0.1 -0.1); max ( 0.3 0.1 0.1); } } castellatedMeshControls { maxLocalCells 100000; maxGlobalCells 2000000; minRefinementCells 10; maxLoadUnbalance 0.10; nCellsBetweenLevels 3; features ( ); refinementSurfaces { basketball { // Surface-wise min and max refinement level level (1 1); } } // Resolve sharp angles resolveFeatureAngle 60; refinementRegions { // refinementBox // { // } } locationInMesh (0.5 0.0 0.0); // Inside point allowFreeStandingZoneFaces true; } constant/snappyHexMeshDict
  5. constant/snappyHexMeshDict snapControls { nSmoothPatch 3; tolerance 2.0; //- Number of

    mesh displacement relaxation iterations. nSolveIter 300; nRelaxIter 5; 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 { "basketball" { nSurfaceLayers 5; } } // Expansion factor for layer mesh expansionRatio 1.0; finalLayerThickness 0.3; minThickness 0.1; nGrow 0; featureAngle 150; slipFeatureAngle 30; 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; maxThicknessToMedialRatio 0.3; minMedialAxisAngle 90; nBufferCellsNoExtrude 0; nLayerIter 50; }
  6. constant/snappyHexMeshDict // 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-6;