LCOV - code coverage report
Current view: top level - src/bcs - NSEnergyInviscidSpecifiedPressureBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 20 20 100.0 %
Date: 2025-08-14 10:14:56 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 "NSEnergyInviscidSpecifiedPressureBC.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", NSEnergyInviscidSpecifiedPressureBC);
      13             : 
      14             : InputParameters
      15          41 : NSEnergyInviscidSpecifiedPressureBC::validParams()
      16             : {
      17          41 :   InputParameters params = NSEnergyInviscidBC::validParams();
      18          41 :   return params;
      19             : }
      20             : 
      21          22 : NSEnergyInviscidSpecifiedPressureBC::NSEnergyInviscidSpecifiedPressureBC(
      22          22 :     const InputParameters & parameters)
      23          44 :   : NSEnergyInviscidBC(parameters), _specified_pressure(getParam<Real>("specified_pressure"))
      24             : {
      25          22 : }
      26             : 
      27             : Real
      28      114240 : NSEnergyInviscidSpecifiedPressureBC::computeQpResidual()
      29             : {
      30             :   // Velocity vector object
      31      114240 :   RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
      32             : 
      33             :   // Normal component
      34      114240 :   Real un = vel * _normals[_qp];
      35             : 
      36      114240 :   return qpResidualHelper(_specified_pressure, un);
      37             : }
      38             : 
      39             : Real
      40       69888 : NSEnergyInviscidSpecifiedPressureBC::computeQpJacobian()
      41             : {
      42       69888 :   return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
      43             : }
      44             : 
      45             : Real
      46      209664 : NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(unsigned jvar)
      47             : {
      48      209664 :   if (isNSVariable(jvar))
      49      209664 :     return computeJacobianHelper(mapVarNumber(jvar));
      50             :   else
      51             :     return 0.0;
      52             : }
      53             : 
      54             : Real
      55      279552 : NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper(unsigned var_number)
      56             : {
      57             :   // Velocity vector object
      58      279552 :   RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
      59             : 
      60             :   // Normal component of velocity
      61      279552 :   Real un = vel * _normals[_qp];
      62             : 
      63             :   // For specified pressure, term "C" is zero, see base class for details.
      64      279552 :   return qpJacobianTermA(var_number, _specified_pressure) + qpJacobianTermB(var_number, un);
      65             : }

Generated by: LCOV version 1.14