#### Stator 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 = Stator Report
    Keywords = turbo, stator
    Report Template Description = A report for a single domain stator analysis.
  END
  PUBLISH:
    Default Report Name = Stator Report
    Report Path = ./StatorReport.htm
  END
END
TITLE PAGE:
  Report Title = Stator 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 = 0;

#### Get Domain Information


!getDomainInfo();
!setDomainTransform();


#### Define Expressions

!commonCEL();

LIBRARY:
  CEL:
    EXPRESSIONS:
      Blade Torque = ($rotAxis[0]*torque_x()@$regionBlade + $rotAxis[1]*torque_y()@$regionBlade + $rotAxis[2]*torque_z()@$regionBlade ) * numComponents
      Q = numComponents * massFlow()@$regionInlet/rho in
# The following expressions are from Whitfield and Baines:
      Area Ratio = area()@$regionOutlet / area()@$regionInlet
      Loss Coefficient = (Pt in - Pt out) / ( Pt in - P in)
      CPi = Sigma in - Sigma out / (Area Ratio)^2
      CP = CPi - Loss Coefficient
    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 stator.  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 angle Beta is relative to the meridional plane; a positive angle implies that the tangential velocity is the same direction as theta.</p>
END

!{
!  my @list = ('Volume Flow Rate', 'Q', '%7.4f',
!              'Total Blade Torque', 'Blade Torque', '%7.4f',
!              'Area Ratio (A out / A in)', 'Area Ratio', '%7.4f',
!              'Total Pressure Loss Coefficient', 'Loss Coefficient', '%7.4f',
!              'Pressure Recovery Factor', 'CP', '%7.4f',
!              'Ideal Pressure Recovery Factor', 'CPi', '%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", "Pt", "mass", "Pressure", "Ps", "area" );
!streamwiseChart( "Streamwise Plot of C", 10, "Velocity", "C", "area" );
!streamwiseChart( "Streamwise Plot of Beta", 10, "Velocity Beta", "Beta", "area" );


#### Spanwise Charts


!shortheader1("Spanwise Charts");

!spanwiseChart( "Spanwise Plot of Beta", "at LE", $locStreamLE, 20, "Velocity Beta", "Beta", "area" );
!spanwiseChart( "Spanwise Plot of Velocity", "at LE", $locStreamLE, 20, "Velocity", "C", "area" );
!spanwiseChart( "Spanwise Plot of Beta", "at TE", $locStreamTE, 20, "Velocity Beta", "Beta", "area" );
!spanwiseChart( "Spanwise Plot of Velocity", "at TE", $locStreamTE, 20, "Velocity", "C", "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", "Pt", $locSpanLow, 20 );
!bladetobladeContourPlot( "Total Pressure", "Pt", $locSpanMid, 20 );
!bladetobladeContourPlot( "Total Pressure", "Pt", $locSpanHigh, 20 );

!bladetobladeContourPlot( "Pressure", "P", $locSpanLow, 20 );
!bladetobladeContourPlot( "Pressure", "P", $locSpanMid, 20 );
!bladetobladeContourPlot( "Pressure", "P", $locSpanHigh, 20 );

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


#### Meridional Plots


!shortheader1("Meridional Plots");

!meridionalContourPlot("Total Pressure", "Pt", 20);
!meridionalContourPlot("Velocity", "C", 20);
!meridionalVectorPlot( "Velocity Meridional", "Cm");


#### Circumferential Plots


!shortheader1("Circumferential Plots");

!circContourPlot( "Total Pressure", "Pt", $locStreamLE, "Blade LE", 20, -1 );
!circContourPlot( "Velocity", "C", $locStreamLE, "Blade LE", 20, -1 );
!circContourPlot( "Total Pressure", "Pt", $locStreamTE, "Blade TE", 20, 1 );
!circContourPlot( "Velocity", "C", $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

