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 "IntegratedBC.h" 13 : 14 : class HeatFluxFromHeatStructureBaseUserObject; 15 : 16 : /** 17 : * Base class for handling heat flux between flow channels and heat structures 18 : * 19 : * Since variables on flow channels and heat structures are subdomain restricted and 20 : * they do not share mesh elements, we cannot use the usual MOOSE computeOffDiagJacobian 21 : * method. To enable this flow channel/heat structure coupling, the heat flux and its 22 : * Jacobians are first computed in HeatFluxFromHeatStructureBaseUserObject. This, class 23 : * pulls the data from the user object and puts the residuals and Jacobians into the right 24 : * spots. For this to properly work, the child class has to implement getOffDiagVariableNumbers 25 : * and computeQpOffDiagJacobianNeighbor methods. 26 : */ 27 : class HeatFluxBaseBC : public IntegratedBC 28 : { 29 : public: 30 : HeatFluxBaseBC(const InputParameters & parameters); 31 : 32 : virtual void initialSetup() override; 33 : 34 : virtual void computeJacobian() override; 35 : virtual void computeOffDiagJacobian(unsigned jvar) override; 36 : 37 0 : bool checkVariableBoundaryIntegrity() const override { return false; } 38 : 39 : protected: 40 : /** 41 : * Get the list of variable numbers that are used in off-diagonal Jacobian blocks 42 : */ 43 : virtual std::vector<unsigned int> getOffDiagVariableNumbers() = 0; 44 : 45 : /** 46 : * Compute the off-diagonal Jacobian w.r.t. the variable jvar on the neighboring element 47 : */ 48 : virtual Real computeQpOffDiagJacobianNeighbor(unsigned int jvar) = 0; 49 : 50 : /// shape function values (in QPs) 51 : const VariablePhiValue & _phi_neighbor; 52 : 53 : /// User object that computes the heat flux 54 : const HeatFluxFromHeatStructureBaseUserObject & _q_uo; 55 : /// Perimeter of a single unit of heat structure 56 : const Real _P_hs_unit; 57 : /// Number of units of heat structure 58 : const unsigned int _n_unit; 59 : /// Is the heat structure coordinate system cylindrical? 60 : const bool _hs_coord_system_is_cylindrical; 61 : /// Coordinate transformation 62 : const Real _hs_coord; 63 : /// Factor by which to scale term on the flow channel side for the heat structure side 64 : const Real _hs_scale; 65 : /// Variable numbers for the off-diagonal jacobian computation 66 : std::vector<unsigned int> _off_diag_var_nums; 67 : 68 : public: 69 : static InputParameters validParams(); 70 : };