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 : #pragma once 11 : 12 : #include "NSIntegratedBC.h" 13 : 14 : // Forward Declarations 15 : 16 : // Specialization required of all user-level Moose objects 17 : 18 : /** 19 : * This is the base class for "weakly-imposed" stagnation boundary 20 : * conditions, that is the relevant boundary integrals are evaluated 21 : * based on valued implied by fixed stagnation temperature and pressure 22 : * values and specified flow direction (but not magnitude). 23 : */ 24 : class NSWeakStagnationBaseBC : public NSIntegratedBC 25 : { 26 : public: 27 : // Constructor 28 : static InputParameters validParams(); 29 : 30 : NSWeakStagnationBaseBC(const InputParameters & parameters); 31 : 32 : // Destructor, better be virtual 33 132 : virtual ~NSWeakStagnationBaseBC() {} 34 : 35 : protected: 36 : /** 37 : * Must be implemented in derived classes. 38 : */ 39 : // virtual Real computeQpResidual(); 40 : // virtual Real computeQpJacobian(); 41 : // virtual Real computeQpOffDiagJacobian(unsigned jvar); 42 : 43 : // Required parameters 44 : Real _stagnation_pressure; 45 : Real _stagnation_temperature; 46 : 47 : // Specified flow direction. Should be the components of 48 : // a unit vector. TODO: Test reading RealVectorValue objects 49 : // directly? 50 : Real _sx; 51 : Real _sy; 52 : Real _sz; // only required in 3D 53 : 54 : // 55 : // Helper functions... 56 : // 57 : 58 : // Given |u|, p_0, and T_0, compute static quantities. Each 59 : // on depends on the previous, so it makes sense to compute them 60 : // all even if you don't need them all... 61 : void staticValues(Real & T_s, Real & p_s, Real & rho_s); 62 : 63 : // Nicer interface if you actually only want one of the static values. 64 : // Note that they will all still be computed! 65 : Real rhoStatic(); 66 : 67 : // The velocity magnitude, squared 68 : Real velmag2(); 69 : 70 : // The specified flow direction, s, dotted with the outward unit normal 71 : // normal vector 72 : Real sdotn(); 73 : };