LCOV - code coverage report
Current view: top level - src/kernels - ADOneD3EqnMomentumFormLoss.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 15 16 93.8 %
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 "ADOneD3EqnMomentumFormLoss.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnMomentumFormLoss);
      14             : 
      15             : InputParameters
      16          43 : ADOneD3EqnMomentumFormLoss::validParams()
      17             : {
      18          43 :   InputParameters params = ADKernel::validParams();
      19          86 :   params.addRequiredCoupledVar("A", "Cross-sectional area");
      20          86 :   params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
      21          86 :   params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
      22          43 :   params.addClassDescription(
      23             :       "Computes a volumetric form loss for the momentum equation for 1-phase flow");
      24             : 
      25          43 :   return params;
      26           0 : }
      27             : 
      28          23 : ADOneD3EqnMomentumFormLoss::ADOneD3EqnMomentumFormLoss(const InputParameters & parameters)
      29             :   : ADKernel(parameters),
      30          23 :     _A(adCoupledValue("A")),
      31          46 :     _rho(getADMaterialProperty<Real>("rho")),
      32          46 :     _vel(getADMaterialProperty<Real>("vel")),
      33          69 :     _K_prime(getADMaterialProperty<Real>("K_prime"))
      34             : {
      35          23 : }
      36             : 
      37             : ADReal
      38       34687 : ADOneD3EqnMomentumFormLoss::computeQpResidual()
      39             : {
      40             :   using std::abs;
      41       69374 :   return _K_prime[_qp] * 0.5 * _rho[_qp] * _vel[_qp] * abs(_vel[_qp]) * _A[_qp] * _test[_i][_qp];
      42             : }

Generated by: LCOV version 1.14