LCOV - code coverage report
Current view: top level - src/auxkernels - ShaftConnectedTurbine1PhaseAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 26 28 92.9 %
Date: 2026-05-29 20:41:18 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         252 : ShaftConnectedTurbine1PhaseAux::validParams()
      17             : {
      18         252 :   InputParameters params = AuxKernel::validParams();
      19             : 
      20         252 :   params.addClassDescription("Computes various quantities for a ShaftConnectedTurbine1Phase.");
      21             : 
      22             :   MooseEnum quantity(
      23         504 :       "delta_p flow_coefficient driving_torque friction_torque moment_of_inertia power");
      24         504 :   params.addRequiredParam<MooseEnum>("quantity", quantity, "Which quantity to compute");
      25         504 :   params.addRequiredParam<UserObjectName>("turbine_uo", "Turbine user object name");
      26             : 
      27         252 :   return params;
      28         252 : }
      29             : 
      30         132 : ShaftConnectedTurbine1PhaseAux::ShaftConnectedTurbine1PhaseAux(const InputParameters & parameters)
      31             :   : AuxKernel(parameters),
      32         132 :     _quantity(this->template getParam<MooseEnum>("quantity").template getEnum<Quantity>()),
      33         264 :     _turbine_uo(this->template getUserObject<ADShaftConnectedTurbine1PhaseUserObject>("turbine_uo"))
      34             : {
      35         132 : }
      36             : 
      37             : Real
      38        3276 : ShaftConnectedTurbine1PhaseAux::computeValue()
      39             : {
      40        3276 :   switch (_quantity)
      41             :   {
      42         546 :     case Quantity::DELTA_P:
      43         546 :       return MetaPhysicL::raw_value(_turbine_uo.getTurbineDeltaP());
      44             :       break;
      45         546 :     case Quantity::FLOW_COEFFICIENT:
      46         546 :       return MetaPhysicL::raw_value(_turbine_uo.getFlowCoefficient());
      47             :       break;
      48         546 :     case Quantity::DRIVING_TORQUE:
      49         546 :       return MetaPhysicL::raw_value(_turbine_uo.getDrivingTorque());
      50             :       break;
      51         546 :     case Quantity::FRICTION_TORQUE:
      52         546 :       return MetaPhysicL::raw_value(_turbine_uo.getFrictionTorque());
      53             :       break;
      54         546 :     case Quantity::MOMENT_OF_INERTIA:
      55         546 :       return MetaPhysicL::raw_value(_turbine_uo.getMomentOfInertia());
      56             :       break;
      57         546 :     case Quantity::POWER:
      58         546 :       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