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 19 : NSEnergyInviscidSpecifiedPressureBC::validParams() 16 : { 17 19 : InputParameters params = NSEnergyInviscidBC::validParams(); 18 19 : return params; 19 : } 20 : 21 10 : NSEnergyInviscidSpecifiedPressureBC::NSEnergyInviscidSpecifiedPressureBC( 22 10 : const InputParameters & parameters) 23 20 : : NSEnergyInviscidBC(parameters), _specified_pressure(getParam<Real>("specified_pressure")) 24 : { 25 10 : } 26 : 27 : Real 28 77056 : NSEnergyInviscidSpecifiedPressureBC::computeQpResidual() 29 : { 30 : // Velocity vector object 31 77056 : RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]); 32 : 33 : // Normal component 34 77056 : Real un = vel * _normals[_qp]; 35 : 36 77056 : return qpResidualHelper(_specified_pressure, un); 37 : } 38 : 39 : Real 40 46848 : NSEnergyInviscidSpecifiedPressureBC::computeQpJacobian() 41 : { 42 46848 : return computeJacobianHelper(/*on-diagonal variable is energy=*/4); 43 : } 44 : 45 : Real 46 140544 : NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(unsigned jvar) 47 : { 48 140544 : if (isNSVariable(jvar)) 49 140544 : return computeJacobianHelper(mapVarNumber(jvar)); 50 : else 51 : return 0.0; 52 : } 53 : 54 : Real 55 187392 : NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper(unsigned var_number) 56 : { 57 : // Velocity vector object 58 187392 : RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]); 59 : 60 : // Normal component of velocity 61 187392 : Real un = vel * _normals[_qp]; 62 : 63 : // For specified pressure, term "C" is zero, see base class for details. 64 187392 : return qpJacobianTermA(var_number, _specified_pressure) + qpJacobianTermB(var_number, un); 65 : }