
      <summary>Cuando se invalida en una clase derivada, se desplaza al nodo con un atributo de tipo ID cuyo valor coincide con el <see cref="T:System.String" /> especificado.</summary>
      <returns>true si el desplazamiento de <see cref="T:System.Xml.XPath.XPathNavigator" /> se realiza correctamente; en caso contrario, es false.Si es false, no cambia la posición del explorador.</returns>
      <param name="id">
        <see cref="T:System.String" /> que representa el valor del ID del nodo al que se#### Hydraulic Turbine Report Template

COMMAND FILE:
  CFX Post Version = 12.0
END


#### Report Description

REPORT:
  Excluded Report Items = /COMMENT:User Data
  REPORT PROPERTIES:
    Report Template Name = Hydraulic Turbine Report
    Keywords = turbo, axial, radial, turbine, rotor
    Report Template Description = A report for a hydraulic turbine analysis.
  END
  PUBLISH:
    Default Report Name = Hydraulic Turbine Report
    Report Path = ./HydraulicTurbineReport.htm
  END
  FILE INFORMATION OPTIONS: 
    Include In Report = false
  END
  MESH STATISTICS OPTIONS: 
    Include In Report = false
  END
  PHYSICS SUMMARY OPTIONS: 
    Include In Report = false
  END
END
TITLE PAGE:
  Report Title = Hydraulic Turbine Report
END


! use PlotToolsExt;
! use TurboSystemExt;
! use TurboStageExt;
! use BladeLoadingChartExt;
! use StreamwiseChartExt;
! use SpanwiseChartExt;
! use strict;
! no warnings qw(redefine);


#### runCCL - Needed to run CCL from the perl modules

! sub runCCL
! {
!   my ($ccl, $echoOnly) = @_;
!   my @list = split('\n', $ccl);
!   my $line;
!   foreach $line (@list) {
#!     print $line,"\n";
!     if (!$echoOnly) {
$line
!     }
!   }
! }


#### 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" }
! }

# Run the Post turbo initialization
> turbo init
> turbo more_vars

# Set the default span locations for plots and charts
! my @spanLoc = (0.5);

# Select the active case to post-process
! my $case_name = getValue('DATA READER', 'Active Case Name');

# Create and initialize the TurboSystem object
! my $ts = new TurboSystemExt($case_name);
! $ts->InitializeFromPostTurboInfo();
! $ts->CreateLocators();
! $ts->SortComponents();

# Assume incompressible flow
! $ts->FlowType('Incompressible');

#! $ts->Dump();

# Determine the stages for a turbine, where each stage begins with a nozzle
! sub DetermineTurbineStages {
!   my ($system) = @_;
!   my @stageList = ();
#   Label the stages as 'Stage 1', 'Stage 2', etc.
!   my $label = 'Stage ';
!   my $i = 1;
!   my $stage = new TurboStageExt( 'Stage ' . $i );
!   foreach my $comp (@{$system->Components()}) {
!     if ( $comp->Type() eq 'Stator' && $stage->NumComponents() > 0) {
!       push(@stageList, $stage);
!       $i++;
!       $stage = new TurboStageExt( 'Stage ' . $i );
!     }
!     $stage->AddComponent($comp);
!   }
!   push(@stageList, $stage);
!   return @stageList;
! }
! my @stages = DetermineTurbineStages($ts);


#### Define the default expressions for all machine types

# The second (optional) argument (+/-1) specifies the sign convention for the
# tangential direction.  If left unspecified, it will be computed based on the
# sign of omega for the first rotor.  If no rotor exists, it will be 1.
! PlotToolsExt::CreateCommonCEL($ts);


#### Complete Meridional View

COMMENT:Introduction
  Comment Heading = Introduction
  Heading Level = 1
  Comment Text = \
  <p>This report summarizes the results of a CFD analysis performed for the turbine geometry shown in Figure 1.  In the following sections both quantitative and qualitative results are presented in the form of tables, charts and plots.</p>
END

!   PlotToolsExt::CreateMeridionalGeometryView( 'Complete', $ts->Components() );


#### Performance Results

COMMENT:Performance Results
  Comment Heading = Performance Results
  Heading Level = 1
  Comment Text = \
  <p>The quantitative results are summarized in the following tables.  The first table shows the overall performance.  The next series of tables shows the performance results for each stage.</p>
END


#### Overall Performance Results

COMMENT:Overall Performance Results
  Comment Heading = Overall Performance Results
  Heading Level = 2
  Comment Text = \
  <p>The following table gives the overall performance for the machine.</p>
END

!sub CreateOverallTable {
!  my ($system) = @_;

!  my $hasRotor = $system->HasRotor();
!  my $firstName = $system->FirstComponent()->Name();
!  my $lastName = $system->LastComponent()->Name();
!  my $lastOut = $system->LastComponent()->OutletName();
!  my @list = ();

# Create the expresssions
LIBRARY:
  CEL:
    EXPRESSIONS:

!  if ( $hasRotor ) {
!    my @rotors = ();
!    foreach my $comp (@{$system->Components}) {
!      if ( $comp->Type() eq 'Rotor' ) {
!        push(@rotors, $comp->Name());
!      }
!    }
     Inlet Volume Flow Rate = $firstName mfr / $firstName rho in
!    push(@list, 'Inlet Volume Flow Rate', 'Inlet Volume Flow Rate', '%7.4f');
!    push(@list, 'Reference Density', $firstName . ' rho in', '%7.4f');
     Total Head = $firstName H in - $lastName H out 
!    push(@list, 'Head', 'Total Head', '%7.4f');
!    my $power = join(' Shaft Power + ', @rotors) . ' Shaft Power';
     Output Power = $power
!    push(@list, 'Output Power', 'Output Power', '%7.4f');
!  }
!  else {
     Inlet Volume Flow Rate = $firstName mfr / $firstName rho in
!    push(@list, 'Inlet Volume Flow Rate', 'Inlet Volume Flow Rate', '%7.4f');
     Head Loss = $firstName H in - $lastName H out
!    push(@list, 'Head Loss', 'Head Loss', '%7.4f');
!  }

    END
  END
END

!  PlotToolsExt::CreateResultsTable('Overall Performance Results Table', 'Overall Performance Results Table', @list);
!}

! CreateOverallTable($ts);


#### Stage Performance Results

COMMENT:Stage Performance Results
  Comment Heading = Stage Performance Results
  Heading Level = 2
  Comment Text = \
  <p>The following table(s) give a summary of the performance results for each stage.</p>
END

# Define the expressions specific to axial compressors
!sub CreateStageTable {
!  my ($stage) = @_;

!  my $name = $stage->Name();
!  my $firstComp = $stage->FirstComponent();

# Find the nozzle
!  my $nozzle = undef;
!  foreach my $comp (@{$stage->Components()}) {
!    if ( $comp->Type() eq 'Stator' ) {
!      $nozzle = $comp;
!      last;
!    }
!  }

# Find the rotor, if it exists
!  my $rotor = $stage->Rotor();

!  my @list = ();

# Create the expresssions
LIBRARY:
  CEL:
    EXPRESSIONS:

!  if ( $nozzle && $rotor ) { # Nozzle and Rotor
!    my $nozzleName = $nozzle->Name();
!    my $rotorName = $rotor->Name();
!    my $rotorOut = $rotor->OutletName();

!    push(@list, 'Rotation Speed', $rotorName . ' omega', '%7.4f');
     $name Q in = $nozzleName mfr / $name rho ref
!    push(@list, 'Inlet Volume Flow Rate', $name . ' Q in', '%7.4f');
     $name rho ref = $nozzleName rho in
!    push(@list, 'Reference Density', $name . ' rho ref', '%7.4f');
     $name D ref = $rotorName D te * 0.5
!    push(@list, 'Reference Diameter', $name . ' D ref', '%7.4f');
     $name Output Power = $rotorName Shaft Power
!    push(@list, 'Output Power', $name . ' Output Power', '%7.4f');
     $name Capacity Coefficient = $name Q in/($rotorName n * $name D ref^3)
!    push(@list, 'Capacity Coefficient', $name . ' Capacity Coefficient', '%7.4f');
     $name Head Coefficient = g * ($nozzleName H in - $rotorName H out) / ($rotorName n * $name D ref)^2
!    push(@list, 'Head Coefficient', $name . ' Head Coefficient', '%7.4f');
     $name Power Coefficient = abs($rotorName Shaft Power) / ($name rho ref * $rotorName n^3 * $name D ref^5)
!    push(@list, 'Power Coefficient', $name . ' Power Coefficient', '%7.4f');
     $name Head tt = $nozzleName H in - $rotorName H out
!    push(@list, 'Total-to-Total Head', $name . ' Head tt', '%7.4f');
     $name Head ts = $nozzleName H in - $rotorName Hp out
!    push(@list, 'Total-to-Static Head', $name . ' Head ts', '%7.4f');
     $name Eff tt = $name Q in * ($nozzleName Pt in - $rotorName Pt out) / $rotorName Shaft Power * 100
!    push(@list, 'Total-to-Total Efficiency %', $name . ' Eff tt', '%7.4f');
     $name Eff ts = $name Q in * ($nozzleName Pt in - $rotorName P out) / $rotorName Shaft Power * 100
!    push(@list, 'Total-to-Static Efficiency %', $name . ' Eff ts', '%7.4f');
     $name Nozzle Loss Coefficient = ($nozzleName Pt in - $nozzleName Pt out)/($nozzleName Pt in - $nozzleName P in)
!    push(@list, 'Nozzle Loss Coefficient', $name . ' Nozzle Loss Coefficient', '%7.4f');
     $name Nozzle Efficiency = 100 * (1 - ($nozzleName Pt in - $nozzleName Pt out)/($nozzleName P in - $nozzleName P out))
!    push(@list, 'Nozzle Efficiency %', $name . ' Nozzle Efficiency', '%7.4f');
!  }
!  elsif ( $rotor ) { # Rotor only
!    my $firstName = $firstComp->Name();
!    my $rotorName = $rotor->Name();
!    my $rotorOut = $rotor->OutletName();
!    push(@list, 'Rotation Speed', $rotorName . ' omega', '%7.4f');
     $name Q in = $firstName mfr / $name rho ref
!    push(@list, 'Inlet Volume Flow Rate', $name . ' Q in', '%7.4f');
     $name rho ref = $firstName rho in
!    push(@list, 'Reference Density', $name . ' rho ref', '%7.4f');
     $name D ref = $rotorName D te * 0.5
!    push(@list, 'Reference Diameter', $name . ' D ref', '%7.4f');
     $name Output Power = $rotorName Shaft Power
!    push(@list, 'Output Power', $name . ' Output Power', '%7.4f');
     $name Capacity Coefficient = $name Q in/($rotorName n * $name D ref^3)
!    push(@list, 'Capacity Coefficient', $name . ' Capacity Coefficient', '%7.4f');
     $name Head Coefficient = g * ($firstName H in - $rotorName H out) / ($rotorName n * $name D ref)^2
!    push(@list, 'Head Coefficient', $name . ' Head Coefficient', '%7.4f');
     $name Power Coefficient = abs($rotorName Shaft Power) / ($name rho ref * $rotorName n^3 * $name D ref^5)
!    push(@list, 'Power Coefficient', $name . ' Power Coefficient', '%7.4f');
     $name Head tt = $firstName H in - $rotorName H out
!    push(@list, 'Total-to-Total Head', $name . ' Head tt', '%7.4f');
     $name Head ts = $firstName H in - $rotorName Hp out
!    push(@list, 'Total-to-Static Head', $name . ' Head ts', '%7.4f');
     $name Eff tt = $name Q in * ($firstName Pt in - $rotorName Pt out) / $rotorName Shaft Power * 100
!    push(@list, 'Total-to-Total Efficiency %', $name . ' Eff tt', '%7.4f');
     $name Eff ts = $name Q in * ($firstName Pt in - $rotorName P out) / $rotorName Shaft Power * 100
!    push(@list, 'Total-to-Static Efficiency %', $name . ' Eff ts', '%7.4f');
!    if ( $firstName ne $rotorName ) {
       $name Inlet Loss Coefficient = ($firstName Pt in - $rotorName Pt in)/($firstName Pt in - $firstName P in)
!      push(@list, 'Inlet Loss Coefficient', $name . ' Inlet Loss Coefficient', '%7.4f');
       $name Inlet Efficiency = 100 * (1 - ($firstName Pt in - $rotorName Pt in)/($firstName P in - $firstName P out))
!      push(@list, 'Inlet Efficiency %', $name . ' Inlet Efficiency', '%7.4f');
!    }
!  }
!  elsif ( $nozzle ) { # Nozzle only
!    my $nozzleName = $nozzle->Name();
     $name Q in = $nozzleName mfr / $name rho ref
!    push(@list, 'Inlet Volume Flow Rate', $name . ' Q in', '%7.4f');
     $name rho ref = $nozzleName rho in
!    push(@list, 'Reference Density', $name . ' rho ref', '%7.4f');
     $name Head Loss = $nozzleName H in - $nozzleName H out
!    push(@list, 'Head Loss', $name . ' Head Loss', '%7.4f');
     $name Nozzle Loss Coefficient = ($nozzleName Pt in - $nozzleName Pt out)/($nozzleName Pt in - $nozzleName P in)
!    push(@list, 'Nozzle Loss Coefficient', $name . ' Nozzle Loss Coefficient', '%7.4f');
     $name Nozzle Efficiency = 100 * (1 - ($nozzleName Pt in - $nozzleName Pt out)/($nozzleName P in - $nozzleName P out))
!    push(@list, 'Nozzle Efficiency %', $name . ' Nozzle Efficiency', '%7.4f');
!  }

    END
  END
END

!  PlotToolsExt::CreateResultsTable("$name Performance Results", "$name Performance Results", @list);
!}

# Create a performance results table for each stage
! foreach my $stage (@stages) { CreateStageTable($stage) }


#### Component Summary Data

COMMENT:Component Summary Data
  Comment Heading = Component Summary Data
  Heading Level = 1
  Comment Text = \
  <p>The table(s) below give a summary of 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.</p>
END

# Create a data table for each component
! foreach my $comp (@{$ts->Components()}) { PlotToolsExt::CreateComponentDataTable($comp) }


#### Meanline 1D Charts

COMMENT:Meanline 1D Charts
  Comment Heading = Meanline 1-D Charts
  Heading Level = 1
  Comment Text = \
  <p>The following charts show streamwise mass or area averaged quantities from the inlet to the outlet of the full machine.</p>
END

! my $streamchart1 = new StreamwiseChartExt( 'Streamwise Velocity Chart' );
! if ( $streamchart1 ) {
!   $streamchart1->Caption( 'Chart showing streamwise, area averaged Cm versus averaged normalized M.' );
!   $streamchart1->AddLine( 'Velocity Meridional', 'area', 5, 'Cm' );
!   $streamchart1->Plot();
! }


#### Stage Plots

COMMENT:Stage Plots
  Comment Heading = Stage Plots
  Heading Level = 1
  Comment Text = \
  <p>The following plots show, for each stage, a meridional view of the geometry, blade-to-blade contour and vector views, and circumferentially averaged meridional views.</p>
END

! foreach my $stage (@stages) {
!   my $label = $stage->Name();

COMMENT:$label Plots
  Comment Heading = $label Plots
  Heading Level = 2
  Comment Text =
END

#   Meridional Geometry View
!   PlotToolsExt::CreateMeridionalGeometryView( $stage->Name(), $stage->Components(), 1 );

#   Blade-to-blade views for each span location in @spanLoc
!   foreach my $loc (@spanLoc) {
!     PlotToolsExt::CreateBladetoBladeContourView( $stage->Name(), $stage->Components(), 'Pressure', 'P', $loc );
!   }
!   foreach my $loc (@spanLoc) {
!     PlotToolsExt::CreateBladetoBladeVectorView( $stage->Name(), $stage->Components(), $loc );
!   }
!   foreach my $loc (@spanLoc) {
!     PlotToolsExt::CreateBladetoBladeContourView( $stage->Name(), $stage->Components(), 'Total Pressure', 'Ptr', $loc );
!   }

#   Meridional Contour views
!   PlotToolsExt::CreateMeridionalContourView( $stage->Name(), $stage->Components(), 'Pressure', 'P' );
!   PlotToolsExt::CreateMeridionalContourView( $stage->Name(), $stage->Components(), 'Velocity Meridional', 'Cm' );

!}


#### Component Charts

COMMENT:Component Charts
  Comment Heading = Component Charts
  Heading Level = 1
  Comment Text = \
  <p>The following charts show blade loading and spanwise-averaged quantities for each component.</p>
END


#### Blade Loading Charts

COMMENT:Blade Loading Charts
  Comment Heading = Blade Loading Charts
  Heading Level = 2
  Comment Text = \
  <p>The following charts show the blade loading for each component.</p>
END

! foreach my $comp (@{$ts->Components()}) {
!   if ( $comp->HasBlade() ) {
!     my $name = $comp->Name();
!     my $chart = new BladeLoadingChartExt( $name . ' Blade Loading Chart', 'Pressure', 'P' );
!     if ( $chart ) {
!       $chart->Caption( $name . ' blade loading chart' );
!       foreach my $loc (@spanLoc) {
!         $chart->AddLine( $comp, $loc );
!       }
!       $chart->Plot();
!     }
!   }
! }


#### Spanwise Charts

COMMENT:Spanwise Charts
  Comment Heading = Spanwise Charts
  Heading Level = 2
  Comment Text = \
  <p>The following charts show circumferentially averaged quantities along hub-to-shroud lines located at the leading and trailing edges of the blade.</p>
END

!sub spancharts {
!   my $comp = shift;
!
!   if ( $comp->HasBlade() ) {
!     my $name = $comp->Name();
!     my $leLoc = $comp->LEStreamLoc();
!     my $chart = new SpanwiseChartExt( $name . ' Spanwise Flow Angles at LE Chart' );
!     if ( $chart ) {
!       $chart->Caption( $name . ' chart showing circumferentially averaged flow angle at the LE' );
!       if ( $comp->Type() eq 'Rotor' ) {
!         $chart->AddLine( "$name Flow Angle Alpha", $leLoc, 'area', 20, 'Alpha' );
!         $chart->AddLine( "$name Flow Angle Beta", $leLoc, 'area', 20, 'Beta' );
!       }
!       else {
!         $chart->AddLine( "$name Flow Angle Beta", $leLoc, 'area', 20, 'Beta' );
!       }
!       $chart->Plot();
!     }
!     my $teLoc = $comp->TEStreamLoc();
!     $chart = new SpanwiseChartExt( $name . ' Spanwise Flow Angles at TE Chart' );
!     if ( $chart ) {
!       $chart->Caption( $name . ' chart showing circumferentially averaged flow angle at the TE' );
!       if ( $comp->Type() eq 'Rotor' ) {
!         $chart->AddLine( "$name Flow Angle Alpha", $teLoc, 'area', 20, 'Alpha' );
!         $chart->AddLine( "$name Flow Angle Beta", $teLoc, 'area', 20, 'Beta' );
!       }
!       else {
!         $chart->AddLine( "$name Flow Angle Beta", $teLoc, 'area', 20, 'Beta' );
!       }
!       $chart->Plot();
!     }
!     $chart = new SpanwiseChartExt( $name . ' Spanwise Meridional Velocity at TE Chart' );
!     if ( $chart ) {
!       $chart->Caption( $name . ' chart showing circumferentially averaged Cm at the TE' );
!       $chart->AddLine( 'Velocity Meridional', $teLoc, 'area', 20, 'Cm' );
!       $chart->Plot();
!     }
!   }
! }

# Create spanwise charts for each component
! foreach my $comp (@{$ts->Components()}) { spancharts($comp) }

# Set initial view to first stage geometry view
! my $firstStage = $stages[0]->Name();
>setViewportView cmd=set, view=/VIEW:$firstStage Geometry Meridional View, viewport=1
>centerview 1

