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 "PKAEmpiricalBase.h" 10 : 11 : InputParameters 12 150 : PKAEmpiricalBase::validParams() 13 : { 14 150 : InputParameters params = PKAGeneratorBase::validParams(); 15 150 : return params; 16 : } 17 : 18 83 : PKAEmpiricalBase::PKAEmpiricalBase(const InputParameters & parameters) 19 83 : : PKAGeneratorBase(parameters) 20 : { 21 83 : } 22 : 23 : void 24 123468 : PKAEmpiricalBase::appendPKAs(std::vector<MyTRIM_NS::IonBase> & ion_list, 25 : const MyTRIMRasterizer::PKAParameters & pka_parameters, 26 : const MyTRIMRasterizer::AveragedData &) const 27 : { 28 123468 : const auto dt = pka_parameters._dt; 29 123468 : const auto vol = pka_parameters._volume; 30 123468 : const auto recoil_rate_scaling = pka_parameters._recoil_rate_scaling; 31 : 32 : mooseAssert(dt >= 0, "Passed a negative time window into PKAEmpiricalBase::appendPKAs"); 33 : mooseAssert(vol >= 0, "Passed a negative volume into PKAEmpiricalBase::appendPKAs"); 34 : 35 123468 : const Real Z = getZ(); 36 123468 : const Real m = getM(); 37 123468 : const Real E = getE(); 38 : 39 123468 : int tag = ionTag(pka_parameters, Z, m); 40 : 41 : unsigned int num_pka = 42 123468 : std::floor(recoil_rate_scaling * dt * vol * getPKARate() + getRandomReal()); 43 : 44 234201 : for (unsigned i = 0; i < num_pka; ++i) 45 : { 46 : // each fission event generates a pair of recoils 47 110733 : MyTRIM_NS::IonBase pka; 48 : 49 : // set charge, mass, energy 50 110733 : pka._Z = Z; 51 110733 : pka._m = m; 52 110733 : pka._E = E; 53 : 54 : // the tag is the element this PKA get registered as upon stopping 55 : // -1 means the PKA will be ignored 56 110733 : pka._tag = tag; 57 : 58 : // set stopping criteria 59 110733 : pka.setEf(); 60 : 61 : // set origin of the PKA 62 110733 : setPosition(pka); 63 : 64 : // set a random direction for the PKA 65 110733 : setRandomDirection(pka); 66 : 67 : // add PKA to list 68 110733 : ion_list.push_back(pka); 69 : } 70 123468 : }