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 "MassFreeBC.h" 11 : #include "MooseMesh.h" 12 : 13 : registerMooseObject("NavierStokesApp", MassFreeBC); 14 : 15 : InputParameters 16 0 : MassFreeBC::validParams() 17 : { 18 0 : InputParameters params = IntegratedBC::validParams(); 19 0 : params.addRequiredCoupledVar("vel_x", "x-component of velocity"); 20 0 : params.addCoupledVar("vel_y", "y-component of velocity"); 21 0 : params.addCoupledVar("vel_z", "z-component of velocity"); 22 0 : params.addClassDescription( 23 : "Implements free advective flow boundary conditions for the mass equation."); 24 0 : return params; 25 0 : } 26 : 27 0 : MassFreeBC::MassFreeBC(const InputParameters & parameters) 28 : : IntegratedBC(parameters), 29 0 : _vel_x(coupledValue("vel_x")), 30 0 : _vel_y(_mesh.dimension() >= 2 ? coupledValue("vel_y") : _zero), 31 0 : _vel_z(_mesh.dimension() >= 3 ? coupledValue("vel_z") : _zero) 32 : { 33 0 : } 34 : 35 : Real 36 0 : MassFreeBC::computeQpResidual() 37 : { 38 0 : RealVectorValue vel_vec(_vel_x[_qp], _vel_y[_qp], _vel_z[_qp]); 39 0 : return _u[_qp] * vel_vec * _normals[_qp] * _test[_i][_qp]; 40 : }