LCOV - code coverage report
Current view: top level - src/auxkernels - ShaftConnectedTurbine1PhaseAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 26 28 92.9 %
Date: 2025-07-30 13:02:48 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "ShaftConnectedTurbine1PhaseAux.h"
      11             : #include "ADShaftConnectedTurbine1PhaseUserObject.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", ShaftConnectedTurbine1PhaseAux);
      14             : 
      15             : InputParameters
      16         552 : ShaftConnectedTurbine1PhaseAux::validParams()
      17             : {
      18         552 :   InputParameters params = AuxKernel::validParams();
      19             : 
      20         552 :   params.addClassDescription("Computes various quantities for a ShaftConnectedTurbine1Phase.");
      21             : 
      22             :   MooseEnum quantity(
      23        1104 :       "delta_p flow_coefficient driving_torque friction_torque moment_of_inertia power");
      24        1104 :   params.addRequiredParam<MooseEnum>("quantity", quantity, "Which quantity to compute");
      25        1104 :   params.addRequiredParam<UserObjectName>("turbine_uo", "Turbine user object name");
      26             : 
      27         552 :   return params;
      28         552 : }
      29             : 
      30         294 : ShaftConnectedTurbine1PhaseAux::ShaftConnectedTurbine1PhaseAux(const InputParameters & parameters)
      31             :   : AuxKernel(parameters),
      32         294 :     _quantity(this->template getParam<MooseEnum>("quantity").template getEnum<Quantity>()),
      33         588 :     _turbine_uo(this->template getUserObject<ADShaftConnectedTurbine1PhaseUserObject>("turbine_uo"))
      34             : {
      35         294 : }
      36             : 
      37             : Real
      38        5130 : ShaftConnectedTurbine1PhaseAux::computeValue()
      39             : {
      40        5130 :   switch (_quantity)
      41             :   {
      42         855 :     case Quantity::DELTA_P:
      43         855 :       return MetaPhysicL::raw_value(_turbine_uo.getTurbineDeltaP());
      44             :       break;
      45         855 :     case Quantity::FLOW_COEFFICIENT:
      46         855 :       return MetaPhysicL::raw_value(_turbine_uo.getFlowCoefficient());
      47             :       break;
      48         855 :     case Quantity::DRIVING_TORQUE:
      49         855 :       return MetaPhysicL::raw_value(_turbine_uo.getDrivingTorque());
      50             :       break;
      51         855 :     case Quantity::FRICTION_TORQUE:
      52         855 :       return MetaPhysicL::raw_value(_turbine_uo.getFrictionTorque());
      53             :       break;
      54         855 :     case Quantity::MOMENT_OF_INERTIA:
      55         855 :       return MetaPhysicL::raw_value(_turbine_uo.getMomentOfInertia());
      56             :       break;
      57         855 :     case Quantity::POWER:
      58         855 :       return MetaPhysicL::raw_value(_turbine_uo.getTurbinePower());
      59             :       break;
      60           0 :     default:
      61           0 :       mooseError("Invalid 'quantity' parameter.");
      62             :   }
      63             : }

Generated by: LCOV version 1.14