#### Hydraulic Turbine Rotor Report Template

COMMAND FILE:
  CFX Post Version = 11.0
END


#### Report Description

REPORT:
  REPORT PROPERTIES:
    Report Template Name = Hydraulic Turbine Rotor Report
    Keywords = turbo, hydraulic, turbine
    Report Template Description = A report for a single domain hydraulic turbine rotor analysis.
  END
  PUBLISH:
    Default Report Name = Hydraulic Turbine Rotor Report
    Report Path = ./HydraulicTurbineReport.htm
  END
END
TITLE PAGE:
  Report Title = Hydraulic Turbine Rotor Report
END


! $dataDir = $ENV{CUE_LOCAL_DATA_DIR};
> readsession filename=$dataDir/PostReports/turboReportCommon.cse


#### Turbo Initialization

# Determine if solution contains TBR data (Fourier Storage)
! if ( objectExists('Velocity.Trnavg') ) {
!   my $error = 'Transient Blade Row data exists.  This report is not suitable for transient data.';
!   if (defined(&CUEPost::reportError)) { CUEPost::reportError($error) }
!   else { print $error, "\n" }
! }

!initTurbo();

! $isRotor = 1;

#### Get Domain Information


!getDomainInfo();
!setDomainTransform();


#### Define Expressions

!commonCEL();

LIBRARY:
  CEL:
    EXPRESSIONS:
      Capacity Coefficient = Q/(n * D te^3)
      H = Total Pressure in Stn Frame / (g * Density )
      H in = massFlowAve(Head)@$regionInlet
      H in to out = H in - H out
      H le = massFlowAve(Head)@$regionStreamLE
      H le to te = H le - H te
      H out = massFlowAve(Head)@$regionOutlet
      H te = massFlowAve(Head)@$regionStreamTE
      Head Coefficient = g*H in to out/(n * D te)^2
      Hp = Pressure / (g * Density )
      Hp in = massFlowAve(Static Head)@$regionInlet
      Hp le = massFlowAve(Static Head)@$regionStreamLE
      Hp out = massFlowAve(Static Head)@$regionOutlet
      Hp te = massFlowAve(Static Head)@$regionStreamTE
      Power Coefficient = Shaft Power/(rho * n^3 * D te^5)
      Q = mfr / rho
      Total Efficiency in to out = 100 * Shaft Power / (Q * H in to out * g * rho)
      rho = rho in
    END
  END
END


#### User Variables


USER SCALAR VARIABLE:Head
  Boundary Values = Conservative
  Calculate Global Range = Off
  Expression = H
  Recipe = Expression
  Variable to Copy = Pressure
END
USER SCALAR VARIABLE:Static Head
  Boundary Values = Conservative
  Calculate Global Range = Off
  Expression = Hp
  Recipe = Expression
  Variable to Copy = Pressure
END


#### Results Tables


COMMENT:Tabulated Results
  Comment Heading = Tabulated Results
  Heading Level = 1
  Comment Text = \
  <p>The first table below gives a summary of the performance results for the turbine rotor.  The second table lists the mass or area averaged solution variables and derived quantities computed at the inlet, leading edge (LE Cut), trailing edge (TE Cut) and outlet locations.  The flow angles Alpha and Beta are relative to the meridional plane; a positive angle implies that the tangential velocity is the same direction as the machine rotation.</p>
END

!{
!  my @list = (
!              'Rotation Speed', 'omega', '%7.4f',
!              'Reference Diameter', 'D te', '%7.4f',
!              'Volume Flow Rate', 'Q', '%7.4f',
!              'Head (LE-TE)', 'H le to te', '%7.4f',
!              'Head (IN-OUT)', 'H in to out', '%7.4f',
!              'Flow Coefficient', 'Capacity Coefficient', '%7.4f',
!              'Head Coefficient (IN-OUT)', 'Head Coefficient', '%7.4f',
!              'Shaft Power', 'Shaft Power', '%7.4f',
!              'Power Coefficient', 'Power Coefficient', '%7.4f',
!              'Total Efficiency (IN-OUT) %', 'Total Efficiency in to out', '%7.4f');

!  computedResultsTable("Performance Results", @list);
!}


! $dataDir = $ENV{CUE_LOCAL_DATA_DIR};
> readsession filename=$dataDir/PostReports/IncompressibleRotorCommon.cse

