Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #include "HeatTransferCoefficientAux.h" 20 : #include "UserObject.h" 21 : 22 : registerMooseObject("CardinalApp", HeatTransferCoefficientAux); 23 : 24 : InputParameters 25 8 : HeatTransferCoefficientAux::validParams() 26 : { 27 8 : InputParameters params = AuxKernel::validParams(); 28 16 : params.addRequiredParam<UserObjectName>("heat_flux", 29 : "User object containing the wall-average heat flux"); 30 16 : params.addRequiredParam<UserObjectName>("wall_T", 31 : "User object containing the wall-averaged temperature"); 32 16 : params.addRequiredParam<UserObjectName>("bulk_T", 33 : "User object containing the averaged bulk temperature"); 34 8 : params.addClassDescription("Helper auxiliary kernel to compute a heat transfer coefficient given " 35 : "user objects for heat flux, wall temperature, and bulk temperature."); 36 8 : return params; 37 0 : } 38 : 39 4 : HeatTransferCoefficientAux::HeatTransferCoefficientAux(const InputParameters & parameters) 40 : : AuxKernel(parameters), 41 4 : _heat_flux(getUserObject<UserObject>("heat_flux")), 42 4 : _wall_T(getUserObject<UserObject>("wall_T")), 43 8 : _bulk_T(getUserObject<UserObject>("bulk_T")) 44 : { 45 4 : } 46 : 47 : Real 48 480000 : HeatTransferCoefficientAux::computeValue() 49 : { 50 : Real q; 51 : Real Tw; 52 : Real Tinf; 53 : 54 480000 : if (isNodal()) 55 : { 56 480000 : auto p = *_current_node; 57 480000 : q = _heat_flux.spatialValue(p); 58 480000 : Tw = _wall_T.spatialValue(p); 59 480000 : Tinf = _bulk_T.spatialValue(p); 60 : } 61 : else 62 : { 63 0 : auto p = _current_elem->vertex_average(); 64 0 : q = _heat_flux.spatialValue(p); 65 0 : Tw = _wall_T.spatialValue(p); 66 0 : Tinf = _bulk_T.spatialValue(p); 67 : } 68 : 69 480000 : return q / (Tw - Tinf); 70 : }