/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  6                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

epsilonFactorMaster        2.0;
tipSpeedRatioMaster        7.26;
rotorRadiusMaster          63.0;
freeStreamVelocityMaster   11.0;
HubOverhang                5.0;
NegativeHubHeight          -90.0;
HubHeight                  90.0;
tiltAngleMaster            5.0;
axisXMaster                0.9962;
axisZMaster                -0.0872;


turbineUp
{
    type            axialFlowTurbineALSource;
    active          on;

    axialFlowTurbineALSourceCoeffs
    {
        fieldNames          (U);
        selectionMode       cellSet; // cellSet || points || cellZone
        cellSet             turbineUp;
        origin              (0.0 0.0 0.0);'
        originOrig          (0.0 0.0 0.0);
        axis                (1 0 0);
        verticalDirection   (0 0 1);
        freeStreamVelocity  ($freeStreamVelocityMaster 0 0);
        tipSpeedRatio       $tipSpeedRatioMaster;
        rotorRadius         $rotorRadiusMaster;
        epsilonFactor       $epsilonFactorMaster;
        tiltAngle           $tiltAngleMaster;

        dynamicStall
        {
            active          off;
            dynamicStallModel LeishmanBeddoes;
        }

        endEffects
        {
            active          on;
            endEffectsModel Glauert; // Glauert || Shen || liftingLine
            GlauertCoeffs
            {
                tipEffects  on;
                rootEffects on;
            }
            ShenCoeffs
            {
                c1          0.125;
                c2          21;
                tipEffects  on;
                rootEffects on;
            }
        }

        blades
        {
            blade1
            {
                writePerf   true;
                writeElementPerf true;
                nElements   40;
                elementProfiles
                (
                    #include "sectionsNREL"
                );
                elementData
                (
                    #include "elementDataNREL"
                );
            }
            blade2
            {
                $blade1;
                writePerf   false;
                writeElementPerf false;
                azimuthalOffset 120.0;
            }
            blade3
            {
                $blade2;
                azimuthalOffset 240.0;
            }
        }

        tower
        {
            includeInTotalDrag  false; // default is false
            nElements   60;
            elementProfiles (cylinder);
            elementData
            ( // axial distance (turbine axis), height, diameter
                ($HubOverhang -2.4000 3.8700)
                ($HubOverhang -11.1600 4.0830)
                ($HubOverhang -19.9200 4.2960)
                ($HubOverhang -28.6800 4.5090)
                ($HubOverhang -37.4400 4.7220)
                ($HubOverhang -46.2000 4.9350)
                ($HubOverhang -54.9600 5.1480)
                ($HubOverhang -63.7200 5.3610)
                ($HubOverhang -72.4800 5.5740)
                ($HubOverhang -81.2400 5.7870)
                ($HubOverhang $NegativeHubHeight 6.0)
            );
        }
        //(1.5*1.5*pi*0.8) / (3*2*x*1.1) = 1
        hub
        {
            nElements   2;
            elementProfiles (cylinder);
            elementData
            ( // axial distance, height, diameter
                (0  0.8570 3.0000)
                (0  0.0000 3.0000)
                (0 -0.8570 3.0000)
            );
        }

        profileData
        {
            #include "profileDataNREL"
            cylinder
            {
                data ((-180 0 1.1)(180 0 1.1));
            }
        }
        sixDofData  
        {
            data 
                  (
                    #include "F0_079577A16Dis"
                  );
        }
    }
}

turbineDown
{
    type            axialFlowTurbineALSource;
    active          on;

    axialFlowTurbineALSourceCoeffs
    {
        fieldNames          (U);
        selectionMode       cellSet; // cellSet || points || cellZone
        cellSet             turbineDown;
        origin              (378.0 0.0 0.0);
        originOrig          (378.0 0.0 0.0);
        axis                (1 0 0);
        verticalDirection   (0 0 1);
        freeStreamVelocity  ($freeStreamVelocityMaster 0 0);
        tipSpeedRatio       $tipSpeedRatioMaster;
        rotorRadius         $rotorRadiusMaster;
        epsilonFactor       $epsilonFactorMaster;
        tiltAngle           $tiltAngleMaster;

        dynamicStall
        {
            active          off;
            dynamicStallModel LeishmanBeddoes;
        }

        endEffects
        {
            active          on;
            endEffectsModel Glauert; // Glauert || Shen || liftingLine
            GlauertCoeffs
            {
                tipEffects  on;
                rootEffects on;
            }
            ShenCoeffs
            {
                c1          0.125;
                c2          21;
                tipEffects  on;
                rootEffects on;
            }
        }

        blades
        {
            blade1
            {
                writePerf   true;
                writeElementPerf true;
                nElements   40;
                azimuthalOffset 60.0;
                elementProfiles
                (
                    #include "sectionsNREL"
                );
                elementData
                (
                    #include "elementDataNREL"
                );
            }
            blade2
            {
                $blade1;
                writePerf   false;
                writeElementPerf false;
                azimuthalOffset 180.0;
            }
            blade3
            {
                $blade2;
                azimuthalOffset 300.0;
            }
        }

        tower
        {
            includeInTotalDrag  false; // default is false
            nElements   60;
            elementProfiles (cylinder);
            elementData
            ( // axial distance (turbine axis), height, diameter
                ($HubOverhang -2.4000 3.8700)
                ($HubOverhang -11.1600 4.0830)
                ($HubOverhang -19.9200 4.2960)
                ($HubOverhang -28.6800 4.5090)
                ($HubOverhang -37.4400 4.7220)
                ($HubOverhang -46.2000 4.9350)
                ($HubOverhang -54.9600 5.1480)
                ($HubOverhang -63.7200 5.3610)
                ($HubOverhang -72.4800 5.5740)
                ($HubOverhang -81.2400 5.7870)
                ($HubOverhang $NegativeHubHeight 6.0)
            );
        }


        hub
        {
            nElements   2;
            elementProfiles (cylinder);
            elementData
            ( // axial distance, height, diameter
                (0  0.8570 3.0000)
                (0  0.0000 3.0000)
                (0 -0.8570 3.0000)
            );
        }


        profileData
        {
            #include "profileDataNREL"
            cylinder
            {
                data ((-180 0 1.1)(180 0 1.1));
            }
        }
        sixDofData  
        {
            data 
                  (
                    #include "F0_079577A16Dis"
                  );
        }
    }
}

// ************************************************************************* //
