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