Changeset 1228 for trunk/source/processes/hadronic/models/abrasion
- Timestamp:
- Jan 8, 2010, 11:56:51 AM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/abrasion
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/abrasion/include/G4WilsonAbrasionModel.hh
r819 r1228 40 40 // MODULE: G4WilsonAbrasionModel.hh 41 41 // 42 // Version: B.143 // Date: 15/04/0442 // Version: 1.0 43 // Date: 08/12/2009 44 44 // Author: P R Truscott 45 45 // Organisation: QinetiQ Ltd, UK … … 57 57 // 15 March 2004, P R Truscott, QinetiQ Ltd, UK 58 58 // Beta release 59 // 60 // 08 December 2009, P R Truscott, QinetiQ Ltd, Ltd 61 // ver 1.0 62 // Variable fradius defined. See .cc file for more details. 59 63 // 60 64 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 119 123 G4double B; 120 124 G4double third; 125 G4double fradius; 121 126 }; 122 127 //////////////////////////////////////////////////////////////////////////////// -
trunk/source/processes/hadronic/models/abrasion/src/G4WilsonAbrasionModel.cc
r819 r1228 38 38 // MODULE: G4WilsonAbrasionModel.cc 39 39 // 40 // Version: B.241 // Date: 18/01/0540 // Version: 1.0 41 // Date: 08/12/2009 42 42 // Author: P R Truscott 43 43 // Organisation: QinetiQ Ltd, UK … … 60 60 // handler deleted to prevent memory leaks. Also particle change of projectile 61 61 // fragment previously not properly defined. 62 // 63 // 08 December 2009, P R Truscott, QinetiQ Ltd, Ltd 64 // ver 1.0 65 // There was originally a possibility of the minimum impact parameter AFTER 66 // considering Couloumb repulsion, rm, being too large. Now if: 67 // rm >= fradius * (rP + rT) 68 // where fradius is currently 0.99, then it is assumed the primary track is 69 // unchanged. Additional conditions to escape from while-loop over impact 70 // parameter: if the loop counter evtcnt reaches 1000, the primary track is 71 // continued. 72 // Additional clauses have been included in 73 // G4WilsonAbrasionModel::GetNucleonInducedExcitation 74 // Previously it was possible to get sqrt of negative number as Wilson algorithm 75 // not properly defined if either: 76 // rT > rP && rsq < rTsq - rPsq) or (rP > rT && rsq < rPsq - rTsq) 62 77 // 63 78 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 151 166 B = 10.0 * MeV; 152 167 third = 1.0 / 3.0; 168 fradius = 0.99; 153 169 conserveEnergy = false; 154 170 conserveMomentum = true; … … 197 213 B = 10.0 * MeV; 198 214 third = 1.0 / 3.0; 215 fradius = 0.99; 199 216 conserveEnergy = false; 200 217 conserveMomentum = true; … … 208 225 // The destructor doesn't have to do a great deal! 209 226 // 210 delete theExcitationHandler; 211 delete theExcitationHandlerx; 227 if (theExcitationHandler) delete theExcitationHandler; 228 if (theExcitationHandlerx) delete theExcitationHandlerx; 229 if (useAblation) delete theAblation; 230 // delete theExcitationHandler; 231 // delete theExcitationHandlerx; 212 232 } 213 233 //////////////////////////////////////////////////////////////////////////////// … … 304 324 G4double rPT = rP + rT; 305 325 G4double rPTsq = rPT * rPT; 326 // 327 // 328 // This is a "catch" to make sure we don't go into an infinite loop because the 329 // energy is too low to overcome nuclear repulsion. PRT 20091023. If the 330 // value of rm < fradius * rPT then we're unlikely to sample a small enough 331 // impact parameter (energy of incident particle is too low). Return primary 332 // and don't complete nuclear interaction analysis. 333 // 334 if (rm >= fradius * rPT) { 335 theParticleChange.SetStatusChange(isAlive); 336 theParticleChange.SetEnergyChange(theTrack.GetKineticEnergy()); 337 theParticleChange.SetMomentumChange(theTrack.Get4Momentum().vect().unit()); 338 if (verboseLevel >= 2) { 339 G4cout <<"Particle energy too low to overcome repulsion." <<G4endl; 340 G4cout <<"Event rejected and original track maintained" <<G4endl; 341 G4cout <<"########################################" 342 <<"########################################" 343 <<G4endl; 344 } 345 return &theParticleChange; 346 } 347 // 348 // 349 // Now sample impact parameter until the criterion is met that projectile 350 // and target overlap, but repulsion is taken into consideration. 351 // 352 G4int evtcnt = 0; 306 353 r = 1.1 * rPT; 307 while (r > rPT )354 while (r > rPT && ++evtcnt < 1000) 308 355 { 309 356 G4double bsq = rPTsq * G4UniformRand(); 310 357 r = (rm + std::sqrt(rm*rm + 4.0*bsq)) / 2.0; 311 358 } 359 // 360 // 361 // We've tried to sample this 1000 times, but failed. Assume nuclei do not 362 // collide. 363 // 364 if (evtcnt >= 1000) { 365 theParticleChange.SetStatusChange(isAlive); 366 theParticleChange.SetEnergyChange(theTrack.GetKineticEnergy()); 367 theParticleChange.SetMomentumChange(theTrack.Get4Momentum().vect().unit()); 368 if (verboseLevel >= 2) { 369 G4cout <<"Particle energy too low to overcome repulsion." <<G4endl; 370 G4cout <<"Event rejected and original track maintained" <<G4endl; 371 G4cout <<"########################################" 372 <<"########################################" 373 <<G4endl; 374 } 375 return &theParticleChange; 376 } 377 378 312 379 rsq = r * r; 313 380 // … … 764 831 if (r > rT) Cl = 2.0*std::sqrt(rPsq + 2.0*r*rT - rsq - rTsq); 765 832 else Cl = 2.0*rP; 766 767 G4double bP = (rPsq+rsq-rTsq)/2.0/r; 768 G4double Ct = 2.0*std::sqrt(rPsq - bP*bP); 833 // 834 // 835 // The next lines have been changed to include a "catch" to make sure if the 836 // projectile and target are too close, Ct is set to twice rP or twice rT. 837 // Otherwise the standard Wilson algorithm should work fine. 838 // PRT 20091023. 839 // 840 G4double Ct = 0.0; 841 if (rT > rP && rsq < rTsq - rPsq) Ct = 2.0 * rP; 842 else if (rP > rT && rsq < rPsq - rTsq) Ct = 2.0 * rT; 843 else { 844 G4double bP = (rPsq+rsq-rTsq)/2.0/r; 845 G4double x = rPsq - bP*bP; 846 if (x < 0.0) { 847 G4cerr <<"########################################" 848 <<"########################################" 849 <<G4endl; 850 G4cerr <<"ERROR IN G4WilsonAbrasionModel::GetNucleonInducedExcitation" 851 <<G4endl; 852 G4cerr <<"rPsq - bP*bP < 0.0 and cannot be square-rooted" <<G4endl; 853 G4cerr <<"Set to zero instead" <<G4endl; 854 G4cerr <<"########################################" 855 <<"########################################" 856 <<G4endl; 857 } 858 Ct = 2.0*std::sqrt(x); 859 } 769 860 770 861 G4double Ex = 13.0 * Cl / fermi;
Note: See TracChangeset
for help on using the changeset viewer.