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 "ThermalSolidPropertiesPostprocessor.h" 11 : #include "ThermalSolidProperties.h" 12 : 13 : registerMooseObject("SolidPropertiesApp", ThermalSolidPropertiesPostprocessor); 14 : 15 : InputParameters 16 114 : ThermalSolidPropertiesPostprocessor::validParams() 17 : { 18 114 : InputParameters params = GeneralPostprocessor::validParams(); 19 : 20 228 : params.addRequiredParam<UserObjectName>("solid_properties", "Solid properties object to query"); 21 228 : params.addRequiredParam<PostprocessorName>( 22 : "T", "Temperature post-processor at which to evaluate property"); 23 228 : MooseEnum property("density=0 specific_heat=1 thermal_conductivity=2"); 24 228 : params.addRequiredParam<MooseEnum>("property", property, "Which property to compute."); 25 : 26 114 : params.addClassDescription("Computes a property from a ThermalSolidProperties object."); 27 : 28 114 : return params; 29 114 : } 30 : 31 57 : ThermalSolidPropertiesPostprocessor::ThermalSolidPropertiesPostprocessor( 32 57 : const InputParameters & parameters) 33 : : GeneralPostprocessor(parameters), 34 57 : _solid_properties(getUserObject<ThermalSolidProperties>("solid_properties")), 35 57 : _T(getPostprocessorValue("T")), 36 171 : _property(getParam<MooseEnum>("property").getEnum<Property>()) 37 : { 38 57 : } 39 : 40 : void 41 42 : ThermalSolidPropertiesPostprocessor::initialize() 42 : { 43 42 : } 44 : 45 : void 46 42 : ThermalSolidPropertiesPostprocessor::execute() 47 : { 48 42 : } 49 : 50 : PostprocessorValue 51 42 : ThermalSolidPropertiesPostprocessor::getValue() const 52 : { 53 42 : switch (_property) 54 : { 55 14 : case Property::DENSITY: 56 14 : return _solid_properties.rho_from_T(_T); 57 : break; 58 14 : case Property::SPECIFIC_HEAT: 59 14 : return _solid_properties.cp_from_T(_T); 60 : break; 61 14 : case Property::THERMAL_CONDUCTIVITY: 62 14 : return _solid_properties.k_from_T(_T); 63 : break; 64 0 : default: 65 0 : mooseError("Invalid property option."); 66 : } 67 : }