LCOV - code coverage report
Current view: top level - src/userobjects - AEFVFreeOutflowBoundaryFlux.C (source / functions) Hit Total Coverage
Test: idaholab/moose rdg: #31405 (292dce) with base fef103 Lines: 17 18 94.4 %
Date: 2025-09-04 07:56:15 Functions: 6 6 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 "AEFVFreeOutflowBoundaryFlux.h"
      11             : 
      12             : registerMooseObject("RdgApp", AEFVFreeOutflowBoundaryFlux);
      13             : 
      14             : InputParameters
      15         116 : AEFVFreeOutflowBoundaryFlux::validParams()
      16             : {
      17         116 :   InputParameters params = BoundaryFluxBase::validParams();
      18         232 :   params.addParam<Real>("velocity", 1.0, "Advective velocity");
      19         116 :   params.addClassDescription("Free outflow BC based boundary flux user object for the advection "
      20             :                              "equation using a cell-centered finite volume method.");
      21         116 :   return params;
      22           0 : }
      23             : 
      24          67 : AEFVFreeOutflowBoundaryFlux::AEFVFreeOutflowBoundaryFlux(const InputParameters & parameters)
      25         134 :   : BoundaryFluxBase(parameters), _velocity(getParam<Real>("velocity"))
      26             : {
      27          67 : }
      28             : 
      29         134 : AEFVFreeOutflowBoundaryFlux::~AEFVFreeOutflowBoundaryFlux() {}
      30             : 
      31             : void
      32         948 : AEFVFreeOutflowBoundaryFlux::calcFlux(unsigned int /*iside*/,
      33             :                                       dof_id_type /*ielem*/,
      34             :                                       const std::vector<Real> & uvec1,
      35             :                                       const RealVectorValue & dwave,
      36             :                                       std::vector<Real> & flux) const
      37             : {
      38             :   mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
      39             : 
      40             :   // assume the velocity vector is constant
      41             :   RealVectorValue uadv1(_velocity, 0.0, 0.0);
      42             : 
      43             :   // assign the size of flux vector, e.g. = 1 for the advection equation
      44         948 :   flux.resize(1);
      45             : 
      46             :   // finally calculate the flux
      47         948 :   flux[0] = (uadv1 * dwave) * uvec1[0];
      48         948 : }
      49             : 
      50             : void
      51         122 : AEFVFreeOutflowBoundaryFlux::calcJacobian(unsigned int /*iside*/,
      52             :                                           dof_id_type /*ielem*/,
      53             :                                           const std::vector<Real> & libmesh_dbg_var(uvec1),
      54             :                                           const RealVectorValue & dwave,
      55             :                                           DenseMatrix<Real> & jac1) const
      56             : {
      57             :   mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
      58         122 :   jac1.resize(1, 1);
      59             :   // assume the velocity vector is constant
      60             :   const RealVectorValue uadv1(_velocity, 0.0, 0.0);
      61         122 :   jac1(0, 0) = uadv1 * dwave;
      62         122 : }

Generated by: LCOV version 1.14