LCOV - code coverage report
Current view: top level - src/bcs - INSFEFluidWallMomentumBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 22 24 91.7 %
Date: 2025-08-14 10:14:56 Functions: 5 5 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 "INSFEFluidWallMomentumBC.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", INSFEFluidWallMomentumBC);
      13             : registerMooseObjectRenamed("NavierStokesApp",
      14             :                            FluidWallMomentumBC,
      15             :                            "02/01/2024 00:00",
      16             :                            INSFEFluidWallMomentumBC);
      17             : 
      18             : InputParameters
      19          82 : INSFEFluidWallMomentumBC::validParams()
      20             : {
      21          82 :   InputParameters params = INSFEFluidIntegratedBCBase::validParams();
      22          82 :   params.addClassDescription("Implicitly sets normal component of velocity to zero if the "
      23             :                              "advection term of the momentum equation is integrated by parts");
      24         164 :   params.addRequiredParam<unsigned>("component", "the velocity component");
      25          82 :   return params;
      26           0 : }
      27             : 
      28          44 : INSFEFluidWallMomentumBC::INSFEFluidWallMomentumBC(const InputParameters & parameters)
      29             :   : INSFEFluidIntegratedBCBase(parameters),
      30          44 :     _mu(getMaterialProperty<Real>("dynamic_viscosity")),
      31          88 :     _mu_t(getMaterialProperty<Real>("turbulence_viscosity")),
      32         132 :     _component(getParam<unsigned>("component"))
      33             : {
      34          44 : }
      35             : 
      36             : Real
      37     4614400 : INSFEFluidWallMomentumBC::computeQpResidual()
      38             : {
      39     4614400 :   Real porosity = _has_porosity ? _porosity[_qp] : 1.0;
      40             :   Real tau_w = (porosity > 0.99)
      41     4614400 :                    ? -(_mu[_qp] + _mu_t[_qp]) * _grad_u[_qp](_component) * _normals[_qp](_component)
      42             :                    : 0;
      43             : 
      44     4614400 :   return (porosity * _pressure[_qp] * _normals[_qp](_component) + tau_w) * _test[_i][_qp];
      45             : }
      46             : 
      47             : Real
      48       97280 : INSFEFluidWallMomentumBC::computeQpJacobian()
      49             : {
      50       97280 :   Real porosity = _has_porosity ? _porosity[_qp] : 1.0;
      51       97280 :   Real jac = (porosity > 0.99) ? -(_mu[_qp] + _mu_t[_qp]) * _grad_phi[_j][_qp](_component) *
      52           0 :                                      _normals[_qp](_component) * _test[_i][_qp]
      53             :                                : 0;
      54             : 
      55       97280 :   return jac;
      56             : }
      57             : 
      58             : Real
      59      291840 : INSFEFluidWallMomentumBC::computeQpOffDiagJacobian(unsigned int jvar)
      60             : {
      61      291840 :   if (jvar == _pressure_var_number)
      62             :   {
      63       97280 :     Real porosity = _has_porosity ? _porosity[_qp] : 1.0;
      64       97280 :     return porosity * _phi[_j][_qp] * _normals[_qp](_component) * _test[_i][_qp];
      65             :   }
      66             :   else
      67             :     return 0.0;
      68             : }

Generated by: LCOV version 1.14