#### Turbine Rotor Report Template

COMMAND FILE:
  CFX Post Version = 11.0
END

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


#### Report Description

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


#### 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:
      Output Power = mfr * (H in - H out)
      R ref = U te / n
      Inlet Flow Coefficient = Cm le / U le
      Exit Flow Coefficient = Cm te / U le
      Sw = 1 - H out / H in
      Reaction = 1 - (Cu out + Cu in)/(2 * U te)
      Total Pressure Ratio = Pt in / Pt out
      Total Temperature Ratio = Tt in / Tt out

!if ( objectExists('/SCALAR VARIABLE:Isentropic Expansion Efficiency') )
!{
   Effs out = 100 * massFlowAve(Isentropic Expansion Efficiency)@$regionOutlet
   Effp out = 100 * massFlowAve(Polytropic Expansion Efficiency)@$regionOutlet
!}
!elsif ( objectExists('/SCALAR VARIABLE:Specific Heat Capacity at Constant Pressure') && objectExists('/SCALAR VARIABLE:Specific Heat Capacity at Constant Volume'))
!{
   Cp ave = volumeAve(Cp)@$domain
   Cv ave = volumeAve(Cv)@$domain
   Rgas ave = Cp ave - Cv ave 
   Gamma ave = Cp ave / Cv ave
   Effs out = 100 * ((Pt in / Pt out)^((Gamma ave - 1)/Gamma ave) - 1) / (Tt in / Tt out - 1)
   Effp out = 100 * (1 - (s out - s in)*(Tt in - Tt out)/(ln(Tt in/Tt out) * (H in - H out)))
!}
    END
  END
END


#### User Variables


#### 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',
!              'Mass Flow Rate', 'mfr', '%7.4f',
!              'Inlet Volume Flow Rate', 'Q0 in', '%7.4f',
!              'Output Power', 'Output Power', '%7.4f',
!              'Reference Radius', 'R ref', '%7.4f',
!              'Inlet Flow Coefficient', 'Inlet Flow Coefficient', '%7.4f',
!              'Exit Flow Coefficient', 'Exit Flow Coefficient', '%7.4f',
!              'Power Ratio', 'Sw', '%7.4f',
!              'Reaction', 'Reaction', '%7.4f',
!              'Total Pressure Ratio', 'Total Pressure Ratio', '%7.4f',
!              'Total Temperature Ratio', 'Total Temperature Ratio', '%7.4f',
!              'Total Isentropic Efficiency %', 'Effs out', '%7.4f',
!              'Total Polytropic Efficiency %', 'Effp out', '%7.4f');

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

#### Summary Data Table


!summaryDataTable();


#### Blade Loading Chart


!shortheader1("Blade Loading Charts");

!bladeLoadingChart( "Blade Loading", "Pressure", $locSpanLow );
!bladeLoadingChart( "Blade Loading", "Pressure", $locSpanMid );
!bladeLoadingChart( "Blade Loading", "Pressure", $locSpanHigh );


#### Streamwise Charts


!shortheader1("Streamwise Charts");

!streamwiseChart( "Streamwise Plot of Pt and P", 10, "Total Pressure in Stn Frame", "Pt", "mass", "Pressure", "P", "area" );
!streamwiseChart( "Streamwise Plot of Tt and T", 10, "Total Temperature in Stn Frame", "Tt", "mass", "Temperature", "T", "mass" );
!streamwiseChart( "Streamwise Plot of Absolute and Relative Mach Number", 10, "Mach Number in Stn Frame", "M abs", "area", "Mach Number", "M rel", "area" );
#!streamwiseChart( "Streamwise Plot of Alpha and Beta", 10, "Velocity Alpha", "Alpha", "area", "Velocity Beta", "Beta", "area" );
!streamwiseChart( "Streamwise Plot of Static Entropy", 10, "Static Entropy", "s", "mass" );


#### Spanwise Charts


!shortheader1("Spanwise Charts");

!spanwiseChart( "Spanwise Plot of Alpha and Beta", "at LE", $locStreamLE, 20, "Velocity Alpha", "Alpha", "area", "Velocity Beta", "Beta", "area" );
!spanwiseChart( "Spanwise Plot of Relative Mach Number", "at LE", $locStreamLE, 20, "Mach Number", "M rel", "area" );
!spanwiseChart( "Spanwise Plot of Alpha and Beta", "at TE", $locStreamTE, 20, "Velocity Alpha", "Alpha", "area", "Velocity Beta", "Beta", "area" );
!spanwiseChart( "Spanwise Plot of Relative Mach Number", "at TE", $locStreamTE, 20, "Mach Number", "M rel", "area" );
!spanwiseChart( "Spanwise Plot of Absolute Mach Number", "at TE", $locStreamTE, 20, "Mach Number in Stn Frame", "M abs", "area" );
!spanwiseChart( "Spanwise Plot of Meridional Velocity", "at TE", $locStreamTE, 20, "Velocity Meridional", "Cm", "area" );



#### Blade Geometry Plots


!shortheader1("Blade Geometry Plots");

!bladeGeometryPlots();


#### Blade Mesh Plot


!shortheader1("Blade Mesh Plot");

!bladeMeshPlot( $locSpanMid );


#### Blade to Blade Plots


!shortheader1("Blade to Blade Plots");

#!bladetobladeContourPlot( "Total Pressure in Stn Frame", "Pt", $locSpanMid, 20 );
#!bladetobladeContourPlot( "Total Pressure", "Ptr", $locSpanMid, 20 );
#!bladetobladeContourPlot( "Total Temperature in Stn Frame", "Tt", $locSpanMid, 20 );

!bladetobladeContourPlot( "Mach Number", "M rel", $locSpanLow, 20 );
!bladetobladeContourPlot( "Mach Number", "M rel", $locSpanMid, 20 );
!bladetobladeContourPlot( "Mach Number", "M rel", $locSpanHigh, 20 );

!bladetobladeVectorPlot( $locSpanLow );
!bladetobladeVectorPlot( $locSpanMid );
!bladetobladeVectorPlot( $locSpanHigh );

!bladetobladeContourPlot( "Static Entropy", "s", $locSpanLow, 20 );
!bladetobladeContourPlot( "Static Entropy", "s", $locSpanMid, 20 );
!bladetobladeContourPlot( "Static Entropy", "s", $locSpanHigh, 20 );

#!if ( $solverEff )
#!{
#!  bladetobladeContourPlot( "Isentropic Compression Efficiency", "Effs", $locSpanLow, 20 );
#!  bladetobladeContourPlot( "Isentropic Compression Efficiency", "Effs", $locSpanMid, 20 );
#!  bladetobladeContourPlot( "Isentropic Compression Efficiency", "Effs", $locSpanHigh, 20 );
#!}


#### Meridional Plots


!shortheader1("Meridional Plots");

#!meridionalContourPlot( "Total Pressure in Stn Frame", "Pt", 20 );
#!meridionalContourPlot( "Total Pressure", "Ptr", 20 );
!meridionalContourPlot( "Pressure", "P", 20 );
#!meridionalContourPlot( "Total Temperature in Stn Frame", "Tt", 20 );
!meridionalContourPlot( "Mach Number", "M rel", 20 );
!meridionalVectorPlot( "Velocity Meridional", "Cm");


#### Circumferential Plots


!shortheader1("Circumferential Plots");

#!circContourPlot( "Total Pressure in Stn Frame", "Pt", $locStreamLE, "Blade LE", 20, -1 );
#!circContourPlot( "Total Pressure", "Ptr", $locStreamLE, "Blade LE", 20, -1 );
#!circContourPlot( "Total Temperature in Stn Frame", "Tt", $locStreamLE, "Blade LE", 20, -1 );
!circContourPlot( "Pressure", "P", $locStreamLE, "Blade LE", 20, -1 );
!circContourPlot( "Mach Number", "M rel", $locStreamLE, "Blade LE", 20, -1 );
!circContourPlot( "Static Entropy", "s", $locStreamLE, "Blade LE", 20, -1 );
#!circContourPlot( "Total Pressure in Stn Frame", "Pt", $locStreamTE, "Blade TE", 20, 1 );
#!circContourPlot( "Total Pressure", "Ptr", $locStreamTE, "Blade TE", 20, 1 );
#!circContourPlot( "Total Temperature in Stn Frame", "Tt", $locStreamTE, "Blade TE", 20, 1 );
!circContourPlot( "Pressure", "P", $locStreamTE, "Blade TE", 20, 1 );
!circContourPlot( "Mach Number", "M rel", $locStreamTE, "Blade TE", 20, 1 );
!circContourPlot( "Static Entropy", "s", $locStreamTE, "Blade TE", 20, 1 );


#### 3D Streamline Plots


!shortheader1("Streamline Plot");

!circStreamPlot( $locStreamTE, "Blade TE" );


#### End


# Set view to blade geometry view
>setViewportView cmd=set, view=/VIEW:Blade Geometry Isometric 3D View, viewport=1
>centerview 1

