LCOV - code coverage report
Current view: top level - src/userobjects - AdvectiveFluxCalculatorConstantVelocity.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 17 18 94.4 %
Date: 2025-09-04 07:55:56 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 "AdvectiveFluxCalculatorConstantVelocity.h"
      11             : #include "Assembly.h"
      12             : 
      13             : registerMooseObject("PorousFlowApp", AdvectiveFluxCalculatorConstantVelocity);
      14             : 
      15             : InputParameters
      16         856 : AdvectiveFluxCalculatorConstantVelocity::validParams()
      17             : {
      18         856 :   InputParameters params = AdvectiveFluxCalculatorBase::validParams();
      19         856 :   params.addClassDescription(
      20             :       "Compute K_ij (a measure of advective flux from node i to node j) "
      21             :       "and R+ and R- (which quantify amount of antidiffusion to add) in the "
      22             :       "Kuzmin-Turek FEM-TVD multidimensional scheme.  Constant advective velocity is assumed");
      23        1712 :   params.addRequiredCoupledVar("u", "The variable that is being advected");
      24        1712 :   params.addRequiredParam<RealVectorValue>("velocity", "Velocity vector");
      25         856 :   return params;
      26           0 : }
      27             : 
      28         553 : AdvectiveFluxCalculatorConstantVelocity::AdvectiveFluxCalculatorConstantVelocity(
      29         553 :     const InputParameters & parameters)
      30             :   : AdvectiveFluxCalculatorBase(parameters),
      31         551 :     _velocity(getParam<RealVectorValue>("velocity")),
      32         551 :     _u_at_nodes(coupledDofValues("u")),
      33         551 :     _phi(_assembly.fePhi<Real>(getVar("u", 0)->feType())),
      34        1104 :     _grad_phi(_assembly.feGradPhi<Real>(getVar("u", 0)->feType()))
      35             : {
      36         551 : }
      37             : 
      38             : Real
      39    36131104 : AdvectiveFluxCalculatorConstantVelocity::computeVelocity(unsigned i, unsigned j, unsigned qp) const
      40             : {
      41    36131104 :   return (_grad_phi[i][qp] * _velocity) * _phi[j][qp];
      42             : }
      43             : 
      44             : Real
      45     1440782 : AdvectiveFluxCalculatorConstantVelocity::computeU(unsigned i) const
      46             : {
      47     1440782 :   return _u_at_nodes[i];
      48             : }

Generated by: LCOV version 1.14