LCOV - code coverage report
Current view: top level - src/fvbcs - FVConstantScalarOutflowBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 12 13 92.3 %
Date: 2025-07-17 01:28:37 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 "FVConstantScalarOutflowBC.h"
      11             : 
      12             : registerMooseObject("MooseApp", FVConstantScalarOutflowBC);
      13             : 
      14             : InputParameters
      15       15727 : FVConstantScalarOutflowBC::validParams()
      16             : {
      17       15727 :   InputParameters params = FVFluxBC::validParams();
      18       15727 :   params.addClassDescription(
      19             :       "Constant velocity scalar advection boundary conditions for finite volume method.");
      20       15727 :   params.addRequiredParam<RealVectorValue>("velocity", "Constant advection velocity");
      21       15727 :   return params;
      22           0 : }
      23             : 
      24         736 : FVConstantScalarOutflowBC::FVConstantScalarOutflowBC(const InputParameters & parameters)
      25         736 :   : FVFluxBC(parameters), _velocity(getParam<RealVectorValue>("velocity"))
      26             : {
      27         736 : }
      28             : 
      29             : ADReal
      30      653603 : FVConstantScalarOutflowBC::computeQpResidual()
      31             : {
      32             :   mooseAssert(_normal * _velocity >= 0,
      33             :               "This boundary condition is for outflow but the flow is in the opposite direction of "
      34             :               "the boundary normal");
      35             : 
      36      653603 :   const auto boundary_face = singleSidedFaceArg();
      37      653603 :   const auto state = determineState();
      38             : 
      39             :   // This will either be second or first order accurate depending on whether the user has asked
      40             :   // for a two term expansion in their input file
      41     1307206 :   return _normal * _velocity * _var(boundary_face, state);
      42             : }

Generated by: LCOV version 1.14