LCOV - code coverage report
Current view: top level - src/kernels - MassConvectiveFlux.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 18 19 94.7 %
Date: 2025-08-14 10:14: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 "MassConvectiveFlux.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", MassConvectiveFlux);
      13             : 
      14             : InputParameters
      15          86 : MassConvectiveFlux::validParams()
      16             : {
      17          86 :   InputParameters params = Kernel::validParams();
      18         172 :   params.addRequiredCoupledVar("vel_x", "x-component of the velocity vector");
      19         172 :   params.addCoupledVar("vel_y", "y-component of the velocity vector");
      20         172 :   params.addCoupledVar("vel_z", "z-component of the velocity vector");
      21          86 :   params.addClassDescription("Implements the advection term for the Navier Stokes mass equation.");
      22             : 
      23          86 :   return params;
      24           0 : }
      25             : 
      26          44 : MassConvectiveFlux::MassConvectiveFlux(const InputParameters & parameters)
      27             :   : Kernel(parameters),
      28          44 :     _vel_x(coupledValue("vel_x")),
      29          44 :     _vel_y(isCoupled("vel_y") ? coupledValue("vel_y") : _zero),
      30          88 :     _vel_z(isCoupled("vel_z") ? coupledValue("vel_z") : _zero)
      31             : {
      32          44 : }
      33             : 
      34             : Real
      35      295600 : MassConvectiveFlux::computeQpResidual()
      36             : {
      37      295600 :   RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]);
      38      295600 :   return -_u[_qp] * vel_vec * _grad_test[_i][_qp];
      39             : }
      40             : 
      41             : Real
      42      126400 : MassConvectiveFlux::computeQpJacobian()
      43             : {
      44      126400 :   RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]);
      45      126400 :   return -_phi[_j][_qp] * vel_vec * _grad_test[_i][_qp];
      46             : }

Generated by: LCOV version 1.14