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 42 : MassConvectiveFlux::validParams() 16 : { 17 42 : InputParameters params = Kernel::validParams(); 18 84 : params.addRequiredCoupledVar("vel_x", "x-component of the velocity vector"); 19 84 : params.addCoupledVar("vel_y", "y-component of the velocity vector"); 20 84 : params.addCoupledVar("vel_z", "z-component of the velocity vector"); 21 42 : params.addClassDescription("Implements the advection term for the Navier Stokes mass equation."); 22 : 23 42 : return params; 24 0 : } 25 : 26 20 : MassConvectiveFlux::MassConvectiveFlux(const InputParameters & parameters) 27 : : Kernel(parameters), 28 20 : _vel_x(coupledValue("vel_x")), 29 20 : _vel_y(isCoupled("vel_y") ? coupledValue("vel_y") : _zero), 30 40 : _vel_z(isCoupled("vel_z") ? coupledValue("vel_z") : _zero) 31 : { 32 20 : } 33 : 34 : Real 35 162400 : MassConvectiveFlux::computeQpResidual() 36 : { 37 162400 : RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]); 38 162400 : return -_u[_qp] * vel_vec * _grad_test[_i][_qp]; 39 : } 40 : 41 : Real 42 83200 : MassConvectiveFlux::computeQpJacobian() 43 : { 44 83200 : RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]); 45 83200 : return -_phi[_j][_qp] * vel_vec * _grad_test[_i][_qp]; 46 : }