LCOV - code coverage report
Current view: top level - src/bcs - BoundaryFlux1PhaseBaseBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 27 28 96.4 %
Date: 2026-05-29 20:41:18 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 "BoundaryFlux1PhaseBaseBC.h"
      11             : #include "MooseVariable.h"
      12             : 
      13             : InputParameters
      14       11214 : BoundaryFlux1PhaseBaseBC::validParams()
      15             : {
      16       11214 :   InputParameters params = ADOneDIntegratedBC::validParams();
      17             : 
      18       22428 :   params.addRequiredCoupledVar("A_linear", "Cross-sectional area, linear");
      19       22428 :   params.addRequiredCoupledVar("rhoA", "Conserved variable: rho*A");
      20       22428 :   params.addRequiredCoupledVar("rhouA", "Conserved variable: rho*u*A");
      21       22428 :   params.addRequiredCoupledVar("rhoEA", "Conserved variable: rho*E*A");
      22             : 
      23       22428 :   params.addRequiredParam<UserObjectName>("boundary_flux", "Name of boundary flux user object");
      24             : 
      25       11214 :   return params;
      26           0 : }
      27             : 
      28        8691 : BoundaryFlux1PhaseBaseBC::BoundaryFlux1PhaseBaseBC(const InputParameters & parameters)
      29             :   : ADOneDIntegratedBC(parameters),
      30             : 
      31        8691 :     _A_linear(adCoupledValue("A_linear")),
      32             : 
      33       17382 :     _rhoA(getADMaterialProperty<Real>("rhoA")),
      34       17382 :     _rhouA(getADMaterialProperty<Real>("rhouA")),
      35       17382 :     _rhoEA(getADMaterialProperty<Real>("rhoEA")),
      36             : 
      37        8691 :     _rhoA_var(coupled("rhoA")),
      38        8691 :     _rhouA_var(coupled("rhouA")),
      39        8691 :     _rhoEA_var(coupled("rhoEA")),
      40             : 
      41       17382 :     _flux(getUserObject<ADBoundaryFluxBase>("boundary_flux"))
      42             : {
      43        8691 : }
      44             : 
      45             : void
      46        8415 : BoundaryFlux1PhaseBaseBC::initialSetup()
      47             : {
      48        8415 :   ADOneDIntegratedBC::initialSetup();
      49             : 
      50        8415 :   const auto jmap = getIndexMapping();
      51        8415 :   _equation_index = jmap.at(_var.number());
      52        8415 : }
      53             : 
      54             : ADReal
      55      343718 : BoundaryFlux1PhaseBaseBC::computeQpResidual()
      56             : {
      57      343718 :   const auto & flux = _flux.getFlux(
      58      687436 :       _current_side, _current_elem->id(), fluxInputVector(), MetaPhysicL::raw_value(_normals[_qp]));
      59             : 
      60      687436 :   return flux[_equation_index] * _normal * _test[_i][_qp];
      61             : }

Generated by: LCOV version 1.14