/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // In the case system/blockMeshDict, set the following variables: /* nBlades 4; // Number of rotor blades rHub 0.005; // Radius of the hub rTip 0.02; // Radius of the blade tips rFreestream 0.1; // Radius of the freestream boundary halfDepth 0.005; // Half-depth of the 2-D slab nCellsHubTip 6; // Number of cells radially from hub to blade tip nCellsTipFreestream 24; // Number of cells radially from blade tip to the // freestream boundary nCellsBladeBlade 24; // Number of cells tangentially between blades */ // Then #include this file: /* #include "$FOAM_TUTORIALS/resources/blockMesh/rotor2D" */ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // vertices #codeStream { codeInclude #{ #include "pointField.H" #include "SubField.H" #include "transformField.H" #}; code #{ // Get the radii. Note using $rHub instead of $rHub means that // rHub can change without needing to recompile this code. The same is // true for access of other settings throughout this file. const scalarField rs ({ $rHub, $rHub, $rTip, $rFreestream }); // Create points for the blade aligned with the X-axis pointField points(4, point(0, 0, -$halfDepth)); points.replace(0, -rs); // Create equivalent points for other blades by rotating for (label i = 1; i < $