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 : #ifdef GSL_ENABLED 9 : 10 : #pragma once 11 : 12 : #include "GeneralUserObject.h" 13 : 14 : class DPAUserObjectBase : public GeneralUserObject 15 : { 16 : public: 17 : static InputParameters validParams(); 18 : 19 : DPAUserObjectBase(const InputParameters & parameters); 20 : 21 : ///@{ get the 22 16 : Real getDPA() const { return _dpa; } 23 : Real getPartialDPA(unsigned int Z, Real A) const; 24 : ///@} 25 : 26 4 : void initialize() override {} 27 : 28 : protected: 29 : void prepare(); 30 : bool changed() const; 31 : std::vector<unsigned int> getAtomicNumbers() const; 32 : std::vector<Real> getMassNumbers() const; 33 : std::vector<Real> getNumberFractions() const; 34 : Real getMaxEnergy() const; 35 : 36 : /// accumulated dpa 37 : void accumulateDamage(); 38 : 39 : /// a helper function that sets _ns and checks consistency of A, Z, N 40 : void initAZNHelper(); 41 : 42 : /// a helper function that computes the neutron damage efficiency 43 : Real 44 : neutronDamageEfficiency(unsigned int i, unsigned int j, unsigned int g, unsigned int x) const; 45 : 46 : /// a virtual function computing the integral damage function 47 : virtual Real integralDamageFunction(Real T, unsigned int i, unsigned int j) const = 0; 48 : 49 : /// callback that is executed when composition changed and damage functions must be recomputed 50 : virtual void onCompositionChanged() = 0; 51 : 52 : /// a helper that assigns a unique string to a Z, A pair 53 : std::string zaidHelper(unsigned int Z, Real A) const; 54 : 55 : /// tolerance for recomputing the displacement function 56 : Real _tol = 1e-10; 57 : 58 : /// the computed dose rates 59 : Real _dpa = 0; 60 : 61 : /// the computed dose rate by species; this is a map because presence of (Z,A) can change dynamically 62 : std::map<std::string, Real> _partial_dpa; 63 : 64 : /// is damage accumulated during a transient or computed for steady state 65 : bool _is_transient_irradiation; 66 : 67 : /// irradiation_time used when dpa is estimated from steady-state calculations 68 : Real _irradiation_time; 69 : 70 : /// the neutron reaction types considered for computing dpa 71 : MultiMooseEnum _neutron_reaction_types; 72 : 73 : /// number of reaction types creating radiation damage 74 : unsigned int _nr; 75 : 76 : ///@{ data used for computing dpa value 77 : std::vector<Real> _atomic_numbers; 78 : std::vector<Real> _mass_numbers; 79 : std::vector<Real> _number_densities; 80 : std::vector<Real> _energy_group_boundaries; 81 : std::vector<Real> _scalar_flux; 82 : std::vector<std::vector<std::vector<Real>>> _cross_sections; 83 : ///@} 84 : 85 : /// Q values for each reaction type and isotope 86 : std::vector<std::vector<Real>> _q_values; 87 : 88 : ///@{ the "old" versions of the data; used for determining if disp function update is required 89 : std::vector<Real> _atomic_numbers_old; 90 : std::vector<Real> _mass_numbers_old; 91 : std::vector<Real> _number_densities_old; 92 : ///@} 93 : 94 : /// number of neutron energy groups 95 : unsigned int _ng; 96 : }; 97 : 98 : #endif // GSL_ENABLED