Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "IsotopeRecoilRate.h" 10 : #include "MyTRIMRasterizer.h" 11 : #include "NeutronicsSpectrumSamplerBase.h" 12 : #include "mytrim/ion.h" 13 : 14 : registerMooseObject("MagpieApp", IsotopeRecoilRate); 15 : 16 : InputParameters 17 0 : IsotopeRecoilRate::validParams() 18 : { 19 0 : InputParameters params = GeneralPostprocessor::validParams(); 20 0 : params.addRequiredParam<std::string>( 21 : "target_isotope", "The isotope name that you want to get the total recoil rate for"); 22 0 : params.addRequiredParam<unsigned int>("point_id", "The index of the point in neutronics_sampler"); 23 0 : params.addRequiredParam<UserObjectName>( 24 : "neutronics_sampler", "The neutronics sampler object that the data is retrieved from"); 25 0 : params.addParam<PostprocessorName>( 26 0 : "scaling_factor", 1, "A scaling factor multiplying the isotope recoil rate"); 27 0 : params.addClassDescription("Gets the total recoil rate from target_isotope at point point_id " 28 : "contained in the neutronics_sampler"); 29 0 : return params; 30 0 : } 31 : 32 0 : IsotopeRecoilRate::IsotopeRecoilRate(const InputParameters & params) 33 : : GeneralPostprocessor(params), 34 0 : _target_isotope(getParam<std::string>("target_isotope")), 35 0 : _point_id(getParam<unsigned int>("point_id")), 36 0 : _neutronics_sampler(getUserObject<NeutronicsSpectrumSamplerBase>("neutronics_sampler")), 37 0 : _scaling_factor(getPostprocessorValue("scaling_factor")) 38 : { 39 0 : if (_neutronics_sampler.getNumberOfPoints() < _point_id) 40 0 : mooseError("The provided neutronics sampler object only has", 41 0 : _neutronics_sampler.getNumberOfPoints(), 42 : " points"); 43 : 44 0 : if (!_neutronics_sampler.hasIsotope(_target_isotope)) 45 0 : mooseError("Target isotope ", _target_isotope, " not preset in neutronics sampler object"); 46 0 : } 47 : 48 : Real 49 0 : IsotopeRecoilRate::getValue() const 50 : { 51 0 : return _scaling_factor * _neutronics_sampler.totalRecoilRate(_point_id, _target_isotope); 52 : }