LCOV - code coverage report
Current view: top level - src/postprocessors - MomentumFluxIntegral.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 21 22 95.5 %
Date: 2025-07-30 13:02:48 Functions: 4 4 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 "MomentumFluxIntegral.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", MomentumFluxIntegral);
      13             : 
      14             : InputParameters
      15         342 : MomentumFluxIntegral::validParams()
      16             : {
      17         342 :   InputParameters params = SideIntegralPostprocessor::validParams();
      18         342 :   params.addClassDescription("Computes the integral of the momentum flux over a boundary");
      19         684 :   params.addRequiredCoupledVar("arhouA", "Momentum equation variable");
      20         684 :   params.addRequiredCoupledVar("vel", "Velocity");
      21         684 :   params.addRequiredCoupledVar("p", "Pressure");
      22         684 :   params.addRequiredCoupledVar("A", "Area");
      23         684 :   params.addCoupledVar("alpha", 1.0, "Volume fraction (two-phase only)");
      24         342 :   return params;
      25           0 : }
      26             : 
      27         126 : MomentumFluxIntegral::MomentumFluxIntegral(const InputParameters & parameters)
      28             :   : SideIntegralPostprocessor(parameters),
      29         126 :     _arhouA(coupledValue("arhouA")),
      30         126 :     _velocity(coupledValue("vel")),
      31         126 :     _pressure(coupledValue("p")),
      32         126 :     _area(coupledValue("A")),
      33         252 :     _alpha(coupledValue("alpha"))
      34             : {
      35         126 : }
      36             : 
      37             : void
      38          18 : MomentumFluxIntegral::threadJoin(const UserObject & y)
      39             : {
      40             :   const auto & pps = static_cast<const MomentumFluxIntegral &>(y);
      41          18 :   _integral_value += pps._integral_value;
      42          18 : }
      43             : 
      44             : Real
      45          48 : MomentumFluxIntegral::computeQpIntegral()
      46             : {
      47          48 :   return _arhouA[_qp] * _velocity[_qp] + _alpha[_qp] * _pressure[_qp] * _area[_qp];
      48             : }

Generated by: LCOV version 1.14