rotor_class Derived Type

type, public :: rotor_class

Rotor class


Components

Type Visibility Attributes Name Initial
character(len=2), public :: id
integer, public :: nb
integer, public :: ns
integer, public :: nc
integer, public :: nNwake
integer, public :: nFwake
integer, public :: nbConvect
integer, public :: nNwakeEnd
integer, public :: nFwakeEnd
type(blade_class), public, allocatable, dimension(:) :: blade
real(kind=dp), public :: Omega
real(kind=dp), public :: omegaSlow
real(kind=dp), public, dimension(3) :: shaftAxis
real(kind=dp), public, dimension(3) :: xAxisBody
real(kind=dp), public, dimension(3) :: yAxisBody
real(kind=dp), public, dimension(3) :: zAxisBody
real(kind=dp), public, dimension(3) :: hubCoords
real(kind=dp), public, dimension(3) :: cgCoords
real(kind=dp), public, dimension(3) :: fromCoords
real(kind=dp), public :: radius
real(kind=dp), public :: chord
real(kind=dp), public :: root_cut
real(kind=dp), public :: preconeAngle
real(kind=dp), public :: dpitch
real(kind=dp), public :: flap0
real(kind=dp), public :: flapC
real(kind=dp), public :: flapS
real(kind=dp), public :: flapInitial
real(kind=dp), public :: dflapInitial
real(kind=dp), public :: Iflap
real(kind=dp), public :: cflap
real(kind=dp), public :: kflap
real(kind=dp), public :: MflapConstant
real(kind=dp), public, dimension(3) :: forceInertial
real(kind=dp), public, dimension(3) :: lift
real(kind=dp), public, dimension(3) :: liftPrev
real(kind=dp), public, dimension(3) :: drag
real(kind=dp), public, dimension(3) :: dragInduced
real(kind=dp), public, dimension(3) :: dragProfile
real(kind=dp), public, dimension(3) :: liftUnsteady
real(kind=dp), public, dimension(3) :: dragUnsteady
real(kind=dp), public, dimension(3) :: liftUnitVec
real(kind=dp), public, dimension(3) :: dragUnitVec
real(kind=dp), public, dimension(3) :: sideUnitVec
real(kind=dp), public, dimension(3) :: controlPitch
real(kind=dp), public :: thetaTwist
real(kind=dp), public :: pivotLE
real(kind=dp), public :: flapHinge
real(kind=dp), public, dimension(3) :: velBody
real(kind=dp), public, dimension(3) :: omegaBody
real(kind=dp), public, dimension(3) :: velBodyPrev
real(kind=dp), public, dimension(3) :: omegaBodyPrev
real(kind=dp), public, allocatable, dimension(:, :) :: velBodyHistory
real(kind=dp), public, allocatable, dimension(:, :) :: omegaBodyHistory
real(kind=dp), public :: psi
real(kind=dp), public, dimension(3) :: pts
character(len=1), public :: streamwiseCoreSwitch
real(kind=dp), public :: spanwiseCore
real(kind=dp), public, allocatable, dimension(:) :: streamwiseCoreVec
real(kind=dp), public, allocatable, dimension(:, :) :: AIC
real(kind=dp), public, allocatable, dimension(:, :) :: AIC_inv
real(kind=dp), public, allocatable, dimension(:) :: gamVec
real(kind=dp), public, allocatable, dimension(:) :: gamVecPrev
real(kind=dp), public, allocatable, dimension(:) :: RHS
real(kind=dp), public, allocatable, dimension(:) :: camberSectionLimit
real(kind=dp), public, allocatable, dimension(:) :: airfoilSectionLimit
real(kind=dp), public, allocatable, dimension(:) :: alpha0
real(kind=dp), public :: initWakeVel
real(kind=dp), public :: psiStart
real(kind=dp), public :: skewLimit
real(kind=dp), public :: apparentViscCoeff
real(kind=dp), public :: decayCoeff
real(kind=dp), public :: wakeDispLimitFactor
real(kind=dp), public :: rollupStartRadius
real(kind=dp), public :: rollupEndRadius
integer, public :: propConvention
integer, public :: spanSpacing
integer, public :: chordSpacing
integer, public :: overrideTauSpan
integer, public :: symmetricTau
integer, public :: wakeTruncateNt
integer, public :: prescWakeNt
integer, public :: prescWakeAfterTruncNt
integer, public :: prescWakeGenNt
integer, public :: rollupStart
integer, public :: rollupEnd
integer, public :: suppressFwakeSwitch
integer, public :: forceCalcSwitch
integer, public :: skewPlotSwitch
integer, public :: inflowPlotSwitch
integer, public :: bladeDynamicsSwitch
integer, public :: pitchDynamicsSwitch
integer, public :: bodyDynamicsSwitch
integer, public :: bodyDynamicsIOVars
integer, public :: spanwiseLiftSwitch
integer, public :: customTrajectorySwitch
integer, public :: gammaPlotSwitch
integer, public :: rowNear
integer, public :: rowFar
integer, public :: nCamberFiles
integer, public :: nAirfoils
integer, public :: imagePlane
integer, public :: imageRotorNum
integer, public :: surfaceType
integer, public :: ductSwitch
integer, public :: axisymmetrySwitch
character(len=30), public, allocatable, dimension(:) :: camberFile
character(len=30), public, allocatable, dimension(:) :: airfoilFile
character(len=30), public :: geometryFile
real(kind=dp), public :: nonDimforceDenominator

Type-Bound Procedures

procedure, public :: readGeom => rotor_readGeom

  • public subroutine rotor_readGeom(this, filename, outputFilename)

    Read rotor geometry from geomXX.nml in namelist format

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    character(len=*), intent(in) :: filename
    character(len=*), intent(in), optional :: outputFilename

procedure, public :: init => rotor_init

  • public subroutine rotor_init(this, rotorNumber, density, dt, nt, switches, sourceRotor)

    Initialize variables of rotor geometry and wake

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    integer, intent(in) :: rotorNumber
    real(kind=dp), intent(in) :: density
    real(kind=dp), intent(inout) :: dt
    integer, intent(inout) :: nt
    type(switches_class), intent(inout) :: switches
    type(rotor_class), optional :: sourceRotor

procedure, public :: deinit => rotor_deinit

  • public subroutine rotor_deinit(this, switches)

    Deinitialise rotor variables

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    type(switches_class), intent(in) :: switches

procedure, public :: plot3dtoblade => rotor_plot3dtoblade

  • public subroutine rotor_plot3dtoblade(this, PLOT3Dfilename)

    Read blade geometry from PLOT3D formatted file

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    character(len=*), intent(in) :: PLOT3Dfilename

procedure, public :: stltoblade => rotor_stltoblade

  • public subroutine rotor_stltoblade(this, stlfilename)

    Read ASCII stl file for non-lifting surface geometry

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    character(len=*), intent(in) :: stlfilename

procedure, public :: getCamber => rotor_getCamber

  • public function rotor_getCamber(this, x, y)

    Get z coordinate on wing from x, y values

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in), dimension(:) :: x
    real(kind=dp), intent(in), dimension(:) :: y

    Return Value real(kind=dp), dimension(size(x), size(y))

procedure, public :: gettheta => rotor_gettheta

  • public function rotor_gettheta(this, psi, ib)

    Get pitch angle corresponding to blade azimuthal location

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in) :: psi
    integer, intent(in) :: ib

    Return Value real(kind=dp)

procedure, public :: getthetadot => rotor_getthetadot

  • public function rotor_getthetadot(this, psi, ib)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in) :: psi
    integer, intent(in) :: ib

    Return Value real(kind=dp)

procedure, public :: getflap => rotor_getflap

  • public function rotor_getflap(this, psi, ib)

    Prescribed flap [rad]: flap0 + flapCcos(psi) + flapSsin(psi)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in) :: psi
    integer, intent(in) :: ib

    Return Value real(kind=dp)

procedure, public :: getflapdot => rotor_getflapdot

  • public function rotor_getflapdot(this, psi, ib)

    Prescribed flap rate: d(flap)/dt = Omega * d(flap)/d(psi) [rad/s]

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in) :: psi
    integer, intent(in) :: ib

    Return Value real(kind=dp)

procedure, public :: move => rotor_move

  • public subroutine rotor_move(this, dshift)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class) :: this
    real(kind=dp), intent(in), dimension(3) :: dshift

procedure, public :: rot_pts => rotor_rot_pts

  • public subroutine rotor_rot_pts(this, pts, origin, order)

    Rotate using pts => phi theta psi Warning: This rotation is about the global reference frame

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in), dimension(3) :: pts
    real(kind=dp), intent(in), dimension(3) :: origin
    integer, intent(in) :: order

procedure, public :: rot_advance => rotor_rot_advance

  • public subroutine rotor_rot_advance(this, dpsi, nopitch)

    Rotate rotor by dpsi angle about axis

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: dpsi
    logical, optional :: nopitch

procedure, public :: rot_flap => rotor_rot_flap

  • public subroutine rotor_rot_flap(this)

    Rotate blades by flap angle

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: assignshed => rotor_assignshed

  • public subroutine rotor_assignshed(this, edge)

    Assign coordinates to first rowNear of wake from last row of blade

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    character(len=2), intent(in) :: edge

procedure, public :: map_gam => rotor_map_gam

  • public subroutine rotor_map_gam(this)

    Map gam from vector to matrix format

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: age_wake => rotor_age_wake

  • public subroutine rotor_age_wake(this, dt, wakeType)

    Update age of wake filaments

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: dt
    character(len=1), intent(in) :: wakeType

procedure, public :: dissipate_wake => rotor_dissipate_wake

  • public subroutine rotor_dissipate_wake(this, dt, kinematicViscosity, wakeType)

    Dissipation model based on the paper: Generalized Viscous Vortex Model for Application to Free-Vortex Wake Calculations,Bhagwat and Leishman (2002) The apparent viscosity coefficient is 'delta' and kept a constant value. delta has to be 100 for small-scale rotors and around 1000 for large-scale rotors

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: dt
    real(kind=dp), intent(in) :: kinematicViscosity
    character(len=1), intent(in) :: wakeType

procedure, public :: dissipate_wake2 => rotor_dissipate_wake2

  • public subroutine rotor_dissipate_wake2(this, dt, kinematicViscosity, wakeType)

    Dissipation model based on the paper: Generalized Viscous Vortex Model for Application to Free-Vortex Wake Calculations,Bhagwat and Leishman (2002) The apparent viscosity coefficient is 'a1' known as Squire's app. viscosity parameter and this allows the dissipation to be dependent on the vortex strength The apparent viscosity is kinematic viscosity plus the turbulent viscosity (a1*|gamma|)) a1 has to be O(1e-4) for rotary wings (usually set to 2e-4) and O(1e-5) for fixed wings

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: dt
    real(kind=dp), intent(in) :: kinematicViscosity
    character(len=1), intent(in) :: wakeType

procedure, public :: strain_wake => rotor_strain_wake

procedure, public :: calcAIC => rotor_calcAIC

  • public subroutine rotor_calcAIC(this)

    Compute AIC matrix for rotor

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: vind_bywing => rotor_vind_bywing

  • public function rotor_vind_bywing(this, P)

    Compute induced velocity by all wing vortices at P

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(in) :: this
    real(kind=dp), intent(in), dimension(3) :: P

    Return Value real(kind=dp), dimension(3)

procedure, public :: vind_bywing_boundVortices => rotor_vind_bywing_boundVortices

  • public function rotor_vind_bywing_boundVortices(this, P)

    Compute induced velocity by bound vortices at P

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(in) :: this
    real(kind=dp), intent(in), dimension(3) :: P

    Return Value real(kind=dp), dimension(3)

procedure, public :: vind_bywake => rotor_vind_bywake

  • public function rotor_vind_bywake(this, P, optionalChar)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(in) :: this
    real(kind=dp), intent(in), dimension(3) :: P
    character(len=1), optional :: optionalChar

    Return Value real(kind=dp), dimension(3)

procedure, public :: shiftwake => rotor_shiftwake

  • public subroutine rotor_shiftwake(this)

    Shift wake locations on rollup

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: shiftFwake => rotor_shiftFwake

  • public subroutine rotor_shiftFwake(this)

    Shift wake locations of Fwake for truncation

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: rollup => rotor_rollup

  • public subroutine rotor_rollup(this)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this

procedure, public :: calc_force => rotor_calc_force

  • public subroutine rotor_calc_force(this, density, dt)

    Compute force from circulation

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: density
    real(kind=dp), intent(in) :: dt

procedure, public :: calc_force_alpha => rotor_calc_force_alpha

  • public subroutine rotor_calc_force_alpha(this, density, velSound)

    Compute force from sec alpha

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: density
    real(kind=dp), intent(in) :: velSound

procedure, public :: calc_force_alphaGamma => rotor_calc_force_alphaGamma

  • public subroutine rotor_calc_force_alphaGamma(this, density, velSound, dt)

    Compute force from sec alpha

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: density
    real(kind=dp), intent(in) :: velSound
    real(kind=dp), intent(in) :: dt

procedure, public :: calc_secAlpha => rotor_calc_secAlpha

procedure, public :: convectwake => rotor_convectwake

  • public subroutine rotor_convectwake(this, iter, dt, wakeType)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(in) :: iter
    real(kind=dp), intent(in) :: dt
    character(len=1), intent(in) :: wakeType

procedure, public :: burst_wake => rotor_burst_wake

procedure, public :: calc_skew => rotor_calc_skew

procedure, public :: dirLiftDrag => rotor_dirLiftDrag

procedure, public :: sumBladeToNetForces => rotor_sumBladeToNetForces

procedure, public :: mirrorGamma => rotor_mirrorGamma

  • public subroutine rotor_mirrorGamma(this, fromRotor)

    Mirrors gamma from another rotor

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    class(rotor_class), intent(in) :: fromRotor

procedure, public :: mirrorVelCP => rotor_mirrorVelCP

  • public subroutine rotor_mirrorVelCP(this, fromRotor)

    Mirrors velCP, velCPm from another rotor (flip velocity component in mirror plane)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    class(rotor_class), intent(in) :: fromRotor

procedure, public :: mirrorWake => rotor_mirrorWake

  • public subroutine rotor_mirrorWake(this, fromRotor, wakeType)

    Mirrors wake positions from another rotor

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    class(rotor_class), intent(in) :: fromRotor
    character(len=1), intent(in) :: wakeType

procedure, public :: toChordsRevs => rotor_toChordsRevs

  • public subroutine rotor_toChordsRevs(this, nsteps, dt)

    Converts -ve nsteps to nsteps for corresponding no. of chords or revs

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(inout) :: nsteps
    real(kind=dp), intent(in) :: dt

procedure, public :: eraseNwake => rotor_eraseNwake

  • public subroutine rotor_eraseNwake(this, rowErase)

    Erase a near wake row by setting gamma to zero

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(in) :: rowErase

procedure, public :: eraseFwake => rotor_eraseFwake

  • public subroutine rotor_eraseFwake(this, rowErase)

    Erase a far wake row by setting gamma to zero

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(in) :: rowErase

procedure, public :: updatePrescribedWake => rotor_updatePrescribedWake

  • public subroutine rotor_updatePrescribedWake(this, dt, wakeType)

    Attaches prescribed far wake

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: dt
    character(len=1), intent(in) :: wakeType

procedure, public :: computeBladeDynamics => rotor_computeBladeDynamics

procedure, public :: getdw

  • public function getdw(this, w, thrust)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    real(kind=dp), intent(in) :: w
    real(kind=dp), intent(in) :: thrust

    Return Value real(kind=dp)

procedure, public :: computeBodyDynamics => rotor_computeBodyDynamics

procedure, public :: rotor_write

  • public subroutine rotor_write(this, unit, iostat, iomsg)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(in) :: this
    integer, intent(in) :: unit
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg

generic, public :: write(unformatted) => rotor_write

  • public subroutine rotor_write(this, unit, iostat, iomsg)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(in) :: this
    integer, intent(in) :: unit
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg

procedure, public :: rotor_read

  • public subroutine rotor_read(this, unit, iostat, iomsg)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(in) :: unit
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg

generic, public :: read(unformatted) => rotor_read

  • public subroutine rotor_read(this, unit, iostat, iomsg)

    Arguments

    Type IntentOptional Attributes Name
    class(rotor_class), intent(inout) :: this
    integer, intent(in) :: unit
    integer, intent(out) :: iostat
    character(len=*), intent(inout) :: iomsg