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 "NSInflowThermalBC.h" 11 : 12 : // FluidProperties includes 13 : #include "IdealGasFluidProperties.h" 14 : 15 : registerMooseObject("NavierStokesApp", NSInflowThermalBC); 16 : 17 : InputParameters 18 0 : NSInflowThermalBC::validParams() 19 : { 20 0 : InputParameters params = NodalBC::validParams(); 21 : 22 0 : params.addClassDescription("This class is used on a boundary where the incoming flow values " 23 : "(rho, u, v, T) are all completely specified."); 24 : // Boundary condition values, all required except for velocity which defaults to zero. 25 0 : params.addRequiredParam<Real>("specified_rho", "Density of incoming flow"); 26 0 : params.addRequiredParam<Real>("specified_temperature", "Temperature of incoming flow"); 27 0 : params.addParam<Real>("specified_velocity_magnitude", 0., "Velocity magnitude of incoming flow"); 28 0 : params.addRequiredParam<UserObjectName>("fluid_properties", 29 : "The name of the user object for fluid properties"); 30 : 31 0 : return params; 32 0 : } 33 : 34 0 : NSInflowThermalBC::NSInflowThermalBC(const InputParameters & parameters) 35 : : NodalBC(parameters), 36 0 : _specified_rho(getParam<Real>("specified_rho")), 37 0 : _specified_temperature(getParam<Real>("specified_temperature")), 38 0 : _specified_velocity_magnitude(getParam<Real>("specified_velocity_magnitude")), 39 0 : _fp(getUserObject<IdealGasFluidProperties>("fluid_properties")) 40 : { 41 0 : } 42 : 43 : Real 44 0 : NSInflowThermalBC::computeQpResidual() 45 : { 46 : // For the total energy, the essential BC is: 47 : // rho*E = rho*(c_v*T + 0.5*|u|^2) 48 : // 49 : // or, in residual form, (In general, this BC is coupled to the velocity variables.) 50 : // rho*E - rho*(c_v*T + 0.5*|u|^2) = 0 51 : // 52 : // ***at a no-slip wall*** this further reduces to (no coupling to velocity variables): 53 : // rho*E - rho*cv*T = 0 54 0 : return _u[_qp] - 55 0 : _specified_rho * (_fp.cv() * _specified_temperature + 56 0 : 0.5 * _specified_velocity_magnitude * _specified_velocity_magnitude); 57 : }