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

Generated by: LCOV version 1.14