diff --git a/Prowim_Wing_Propeller/deformGeo.sh b/Prowim_Wing_Propeller/deformGeo.sh deleted file mode 100755 index 415dd9cb..00000000 --- a/Prowim_Wing_Propeller/deformGeo.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [ -z "$WM_PROJECT" ]; then - echo "OpenFOAM environment not found, forgot to source the OpenFOAM bashrc?" - exit -fi - -# Generate Input Geometry -echo "Generating Input Geometry..." -(cd deformIGS && python generate_wing.py) - - -# Copy Necessary Files -echo "Copying Files..." -cp ./deformIGS/wing.igs . -cp ./deformIGS/OptRef_Example.json . - -# Run Script to Deform the Geometry -echo "Deforming Geometry..." -python runScript.py --task=deformIGS - -echo "Geometry Deformation... Done!" \ No newline at end of file diff --git a/Prowim_Wing_Propeller/genWingMesh.py b/Prowim_Wing_Propeller/genWingMesh.py deleted file mode 100755 index 08883764..00000000 --- a/Prowim_Wing_Propeller/genWingMesh.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -This script reads a surfaceMesh.cgns and extrude a 3D volume mesh using pyHyp, -available at https://github.com/mdolab/pyhyp -""" - -from pyhyp import pyHyp - -fileName = "surfaceMesh.cgns" - -options = { - # --------------------------- - # Input Parameters - # --------------------------- - "inputFile": fileName, - "fileType": "CGNS", - "unattachedEdgesAreSymmetry": True, - "outerFaceBC": "farfield", - "autoConnect": True, - "BC": {}, - "families": "wall", - # --------------------------- - # Grid Parameters - # --------------------------- - "N": 49, # number of layers to march - "s0": 1.0e-3, # first layer thickness - "marchDist": 10.0, # distance to march - # --------------------------- - # Pseudo Grid Parameters - # --------------------------- - "ps0": -1.0, - "pGridRatio": -1.0, - "cMax": 0.5, - # --------------------------- - # Smoothing parameters - # --------------------------- - "epsE": 1.0, - "epsI": 2.0, - "theta": 3.0, - "volCoef": 0.25, - "volBlend": 0.0005, - "volSmoothIter": 100, - "kspreltol": 1e-4, -} - -hyp = pyHyp(options=options) -hyp.run() -hyp.writePlot3D("volumeMesh.xyz") - diff --git a/Prowim_Wing_Propeller/preProcessing.sh b/Prowim_Wing_Propeller/preProcessing.sh index fffdc4b1..8e3cf80e 100755 --- a/Prowim_Wing_Propeller/preProcessing.sh +++ b/Prowim_Wing_Propeller/preProcessing.sh @@ -6,23 +6,20 @@ if [ -z "$WM_PROJECT" ]; then fi # pre-processing - -if [ -f "prowim_wing_surface_mesh.cgns.tar.gz" ]; then - echo "Surface mesh prowim_wing_surface_mesh.cgns.tar.gz already exists." +if [ -f "triSurface.tar.gz" ]; then + echo "Surface geometry triSurface.tar.gz already exists." else - echo "Downloading surface mesh prowim_wing_surface_mesh.cgns.tar.gz" - wget https://github.com/dafoam/files/releases/download/v1.0.0/prowim_wing_surface_mesh.cgns.tar.gz + echo "Downloading surface geometry triSurface.tar.gz" + wget https://github.com/dafoam/files/releases/download/v1.0.0/triSurface.tar.gz fi -rm prowim_wing_surface_mesh.cgns -tar -xvf prowim_wing_surface_mesh.cgns.tar.gz -# coarsen the surface mesh three times -cgns_utils coarsen prowim_wing_surface_mesh.cgns surfaceMesh.cgns -cgns_utils coarsen surfaceMesh.cgns +tar -xvf triSurface.tar.gz +mv triSurface constant/ + # generate mesh echo "Generating mesh.." -python genWingMesh.py &> logMeshGeneration.txt -plot3dToFoam -noBlank volumeMesh.xyz >> logMeshGeneration.txt -autoPatch 60 -overwrite >> logMeshGeneration.txt +blockMesh &> logMeshGeneration.txt +surfaceFeatureExtract >> logMeshGeneration.txt +snappyHexMesh -overwrite >> logMeshGeneration.txt createPatch -overwrite >> logMeshGeneration.txt renumberMesh -overwrite >> logMeshGeneration.txt echo "Generating mesh.. Done!" diff --git a/Prowim_Wing_Propeller/system/blockMeshDict b/Prowim_Wing_Propeller/system/blockMeshDict index 7c837f75..d49f2e21 100755 --- a/Prowim_Wing_Propeller/system/blockMeshDict +++ b/Prowim_Wing_Propeller/system/blockMeshDict @@ -14,10 +14,10 @@ FoamFile object blockMeshDict; } -L1 20; -L2 -20; -N 20; -M 10; +L1 12; +L2 -12; +N 8; +M 4; convertToMeters 1; diff --git a/Prowim_Wing_Propeller/system/controlDict b/Prowim_Wing_Propeller/system/controlDict index f0523a90..93533e54 100755 --- a/Prowim_Wing_Propeller/system/controlDict +++ b/Prowim_Wing_Propeller/system/controlDict @@ -18,16 +18,16 @@ FoamFile startFrom startTime; startTime 0; stopAt endTime; -endTime 3000; +endTime 2000; deltaT 1; writeControl timeStep; -writeInterval 3000; +writeInterval 2000; purgeWrite 0; writeFormat ascii; -writePrecision 16; +writePrecision 10; writeCompression on; timeFormat general; -timePrecision 16; +timePrecision 10; runTimeModifiable true; DebugSwitches diff --git a/Prowim_Wing_Propeller/system/createPatchDict b/Prowim_Wing_Propeller/system/createPatchDict index 34b399b0..07922362 100755 --- a/Prowim_Wing_Propeller/system/createPatchDict +++ b/Prowim_Wing_Propeller/system/createPatchDict @@ -19,21 +19,6 @@ pointSync false; // Patches to create. patches ( - { - // Name of new patch - name wing; - - // Dictionary to construct new patch from - patchInfo - { - type wall; - } - - // How to construct: either from 'patches' or 'set' - constructFrom patches; - patches ( "wing_.*" auto0 auto3 ); - } - { // Name of new patch name inout; @@ -46,9 +31,8 @@ patches // How to construct: either from 'patches' or 'set' constructFrom patches; - patches ( "farfield_.*" auto2); + patches ( "farfield_.*"); } - { // Name of new patch name sym; diff --git a/Prowim_Wing_Propeller/system/fvSchemes b/Prowim_Wing_Propeller/system/fvSchemes index 627c1c0a..68080727 100755 --- a/Prowim_Wing_Propeller/system/fvSchemes +++ b/Prowim_Wing_Propeller/system/fvSchemes @@ -58,7 +58,7 @@ snGradSchemes wallDist { - method meshWaveFrozen; + method meshWave; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/Prowim_Wing_Propeller/system/snappyHexMeshDict b/Prowim_Wing_Propeller/system/snappyHexMeshDict new file mode 100644 index 00000000..c21567ef --- /dev/null +++ b/Prowim_Wing_Propeller/system/snappyHexMeshDict @@ -0,0 +1,225 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.3.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location system; + object snappyHexMeshDict; +} + + castellatedMesh true; + snap true; + addLayers true; + geometry + { + wing_lower.stl + { + type triSurfaceMesh; + name wing_lower; + } + wing_upper.stl + { + type triSurfaceMesh; + name wing_upper; + } + wing_tip.stl + { + type triSurfaceMesh; + name wing_tip; + } + wing_te.stl + { + type triSurfaceMesh; + name wing_te; + } + + propeller + { + type searchableBox; + min (-0.25 -0.25 0.0); + max ( 0.00 0.25 0.8); + } + + wake + { + type searchableBox; + min (-0.3 -0.3 0.0); + max ( 1.0 0.3 0.9); + } + wake1 + { + type searchableBox; + min (-0.5 -0.5 0.0); + max (3.0 0.5 1.5); + + } + + wake2 + { + type searchableBox; + min (-1.0 -0.8 0.0); + max (10.0 0.8 2.0); + + } + } + + castellatedMeshControls + { + features + ( + { + file "wing_lower.eMesh"; + level 11; + } + + { + file "wing_upper.eMesh"; + level 11; + } + + { + file "wing_tip.eMesh"; + level 10; + } + + { + file "wing_te.eMesh"; + level 12; + } + ); + refinementSurfaces + { + wing_upper + { + level ( 9 9 ); + } + + wing_lower + { + level ( 9 9 ); + } + + wing_te + { + level ( 12 12 ); + } + + wing_tip + { + level ( 9 9 ); + } + + } + + refinementRegions + { + + propeller + { + mode inside; + levels ((8 8)); + } + wake + { + mode inside; + levels ((6 6)); + } + wake1 + { + mode inside; + levels ((5 5)); + } + + wake1 + { + mode inside; + levels ((4 4)); + } + } + + locationInMesh ( 5 5 5 ); + maxLocalCells 10000000; + maxGlobalCells 200000000; + minRefinementCells 0; + nCellsBetweenLevels 5; + resolveFeatureAngle 10; + allowFreeStandingZoneFaces true; + planarAngle 30; + maxLoadUnbalance 0.10; + } + + snapControls + { + nSolveIter 50; + nSmoothPatch 3; + tolerance 2.0; + nRelaxIter 5; + nFeatureSnapIter 10; + implicitFeatureSnap false; + explicitFeatureSnap true; + multiRegionFeatureSnap false; + } + + addLayersControls + { + layers + { + "wing.*" + {nSurfaceLayers 4;} + } + + relativeSizes true; + expansionRatio 1.3; + finalLayerThickness 0.5; + minThickness 0.001; + nGrow 0; + featureAngle 180; + slipFeatureAngle 80; + 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 60; + maxBoundarySkewness 4; + maxInternalSkewness 4; + maxConcave 80; + minFlatness 0.5; + minVol 1.00E-13; + minTetQuality -1e30; + minArea -1; + minTwist 0.03; + minDeterminant 0.01; + minFaceWeight 0.03; + minVolRatio 0.01; + minTriangleTwist -1; + nSmoothScale 4; + errorReduction 0.75; + relaxed {maxNonOrtho 65; maxBoundarySkewness 5; } + + } + + debug 0; + mergeTolerance 1E-6; + autoBlockMesh false; diff --git a/Prowim_Wing_Propeller/system/surfaceFeatureExtractDict b/Prowim_Wing_Propeller/system/surfaceFeatureExtractDict new file mode 100644 index 00000000..b691e3c8 --- /dev/null +++ b/Prowim_Wing_Propeller/system/surfaceFeatureExtractDict @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1812 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +wing_upper.stl +{ + extractionMethod extractFromSurface; + includedAngle 150; + geometricTestOnly yes; + intersectionMethod none; + // Tolerance for surface intersections + // tolerance 1e-3; + writeObj no; +} + +wing_lower.stl +{ + extractionMethod extractFromSurface; + includedAngle 150; + geometricTestOnly yes; + intersectionMethod none; + // Tolerance for surface intersections + // tolerance 1e-3; + writeObj no; +} + +wing_tip.stl +{ + extractionMethod extractFromSurface; + includedAngle 150; + geometricTestOnly yes; + intersectionMethod none; + // Tolerance for surface intersections + // tolerance 1e-3; + writeObj no; +} + +wing_te.stl +{ + extractionMethod extractFromSurface; + includedAngle 150; + geometricTestOnly yes; + intersectionMethod none; + // Tolerance for surface intersections + // tolerance 1e-3; + writeObj no; +} diff --git a/Prowim_Wing_Propeller/triSurface.tar.gz b/Prowim_Wing_Propeller/triSurface.tar.gz new file mode 100644 index 00000000..1bbce040 Binary files /dev/null and b/Prowim_Wing_Propeller/triSurface.tar.gz differ