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 : // Navier-Stokes includes 11 : #include "NSStagnationTemperatureBC.h" 12 : #include "NS.h" 13 : 14 : // FluidProperties includes 15 : #include "IdealGasFluidProperties.h" 16 : 17 : registerMooseObject("NavierStokesApp", NSStagnationTemperatureBC); 18 : 19 : InputParameters 20 0 : NSStagnationTemperatureBC::validParams() 21 : { 22 0 : InputParameters params = NSStagnationBC::validParams(); 23 0 : params.addClassDescription("This Dirichlet condition imposes the condition T_0 = T_0_desired."); 24 0 : params.addRequiredCoupledVar(NS::temperature, "temperature"); 25 0 : params.addRequiredParam<Real>("desired_stagnation_temperature", ""); 26 0 : return params; 27 0 : } 28 : 29 0 : NSStagnationTemperatureBC::NSStagnationTemperatureBC(const InputParameters & parameters) 30 : : NSStagnationBC(parameters), 31 0 : _temperature(coupledValue(NS::temperature)), 32 0 : _desired_stagnation_temperature(getParam<Real>("desired_stagnation_temperature")) 33 : { 34 0 : } 35 : 36 : Real 37 0 : NSStagnationTemperatureBC::computeQpResidual() 38 : { 39 : // T_0 = T*(1 + 0.5*(gam-1)*M^2) 40 : Real computed_stagnation_temperature = 41 0 : _temperature[_qp] * (1. + 0.5 * (_fp.gamma() - 1.) * _mach[_qp] * _mach[_qp]); 42 : 43 : // Return the difference between the current solution's stagnation temperature 44 : // and the desired. The Dirichlet condition asserts that these should be equal. 45 0 : return computed_stagnation_temperature - _desired_stagnation_temperature; 46 : }