1

Previous: Test case: Wind Turbine Up: Test case: Wind Turbine Next: Mesh of rotating part

This is an automatically generated documentation by LaTeX2HTML utility. In case of any issue, please, contact us at info@cfdsupport.com.

Mesh generation

  • In this section there are described all important steps of mesh generation. However, the case is already preset, one can work on the assumption that one has got only stl files of a wind turbine.
  • Please note, that all stl files are in mm units (millimeters) in this case. OpenFOAM shall get the computational mesh in SI units (in meters), so the final mesh has to be scaled from millimeters to meters in the end of its generation.
  • The mesh generation process is composed of three main steps.
    1. At first there will be created a mesh of the rotating part
    2. The second step is a generation of a mesh of the non-rotating part.
    3. And finally both meshes will be merged together into the final mesh which shall be scaled then.
  • The non-rotating part of the resulting mesh contains stationary parts of the wind turbine (nacelle, tower) and its surroundings.
  • The rotating part contains all the rotating parts (blades and hub).
  • Stl files of a rotating part of the model (nacelle, tower) can be found in directory:
    # cd $FOAM_RUN/windTurbine/mesh/nonRotatingPart/constant/triSurface
  • and stl files of a non-rotating part (blades, hub) in directory:
    # cd $FOAM_RUN/windTurbine/mesh/rotatingPart/constant/triSurface
  • There has to be an interface between these two parts in the final mesh. Therefore also the rotBox stl files can be found in directories mentioned above – these STLs become interfaces between rotating and non-rotating part – namely the cyclicAMI boundary conditions will be used for them later.
  • The procedure of mesh generation can be done by makeMesh.sh script in case directory.

    # cd $FOAM_RUN/windTurbine/

    # ./makeMesh.sh 6

  • The number (6) behind the command # ./makeMesh.sh stands for the number of used processors/cores to run the mesh generation in parallel.
  • The listing of the makeMesh.sh follows:
    #!/bin/bash
    # --------------------------------------------------------------------------- #
    #   ==   ===  ==                                                              #
    #  ||   ||=  || ))  support s. r. o. 2017, www.cfdsupport.com                 #
    #   ==  ||    ==                                                              #
    # --------------------------------------------------------------------------- #
    
    
    if [[ "$1" -eq "" ]] ; then
        numProcs=6
    else
        numProcs=$1
    fi
    
    
    sed -i "s/\(.*numberOfSubdomains[ \t]*\)[0-9].*;/numberOfSubdomains $numProcs;/g" mesh/nonRotatingPart/system/decomposeParDict
    sed -i "s/\(.*numberOfSubdomains[ \t]*\)[0-9].*;/numberOfSubdomains $numProcs;/g" mesh/rotatingPart/system/decomposeParDict
    sed -i "s/\(.*n[ \t]*\)(.*;/\1(1 1 $numProcs);/g" mesh/nonRotatingPart/system/decomposeParDict
    
    echo "Creating mesh of rotating part..."
       cd  mesh/rotatingPart
       blockMesh > ../../log.rotatingPart-blockMesh  2>&1
       surfaceFeatureExtract > ../../log.rotatingPart-surfaceFeatureExtract 2>&1
       decomposePar > ../../log.rotatingPart-decomposePar  2>&1
       mpiexec -np $numProcs transformPoints -parallel -rotate '( (1 0 0) (0.993572 0 0.113203) )'> ../../log.rotatingPart-transformPoints  2>&1
       mpiexec -np $numProcs snappyHexMesh -overwrite -parallel > ../../log.rotatingPart-snappyHexMesh  2>&1
       reconstructParMesh -constant > ../../log.rotatingPart-reconstructParMesh  2>&1
       topoSet > ../../log.rotatingPart-topoSet 2>&1 # creating 'rotor' zone
       checkMesh  -constant > ../../log.rotatingPart-checkMesh  2>&1
       cd ..
    
    echo "Creating mesh of non rotating part..."
       cd  nonRotatingPart
       blockMesh > ../../log.nonRotatingPart-blockMesh  2>&1
       surfaceFeatureExtract > ../../log.nonRotatingPart-surfaceFeatureExtract 2>&1
       decomposePar > ../../log.nonRotatingPart-decomposePar  2>&1
       mpiexec -np $numProcs snappyHexMesh -overwrite -parallel > ../../log.nonRotatingPart-snappyHexMesh  2>&1
       reconstructParMesh -constant > ../../log.nonRotatingPart-reconstructParMesh  2>&1
       topoSet > ../../log.nonRotatingPart-topoSet 2>&1  # creating 'Co1_zone' zone
       checkMesh  -constant > ../../log.nonRotatingPart-checkMesh  2>&1
       cd ..
    
    echo "Merging meshes..."
       mkdir final
       cp -rv nonRotatingPart/constant final/ > ../log.finalMesh-cp 2>&1
       cp -rv nonRotatingPart/system final/ >> ../log.finalMesh-cp 2>&1
       cp ../system/changeDictionaryDict final/system/ >> ../log.finalMesh-cp 2>&1
       mergeMeshes final rotatingPart -overwrite > ../log.finalMesh-mergeMeshes 2>&1
       cd final
       createPatch -overwrite > ../../log.finalMesh-createPatch 2>&1
       changeDictionary > ../../log.caseMesh-changeDictionary 2>&1
       transformPoints -scale '(0.001 0.001 0.001)' > ../../log.finalMesh-transformPoints 2>&1
       cd ../..
    
    echo "Copying mesh into case directory..."
       cp -rv mesh/final/constant/polyMesh constant > log.finalMesh-cpMeshToCase 2>&1
    
  • Lines 1 – 7 is just the header of the file that does nothing.
  • Lines 9 – 13 read the number of processors/cores parameter for parallel meshing. When none is provided then it is 6 processors/cores by default.
  • Lines 16 – 19 substitute provided number of processors/cores in the system/decomposeParDict file.
  • Lines 20 – 30 belong to the meshing of rotating part.
  • Lines 32 – 41 belong to the meshing of non-rotating part.
  • Lines 43 – 53 belong to the merging of meshes and scaling from millimeters to meters.
  • And the command on last line copies the final mesh to the case directory.
  • The individual steps of meshing of the rotating and non-rotating parts and merging are described more precisely in following sections.

Subsections