Message: How to add thermal neutron scattering to code? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to add thermal neutron scattering to code? 

Forum: Hadronic Processes
Date: 09 Mar, 2018
From: Florian Stummer <Florian Stummer>

First of all, thank you for reading my request! I get a "negative energy" error when I add thermal neutron scattering to my code. Currently I am working with Geant4-10.2.1. I already read the other information about this topic

and used the given instructions to adjust my physics list and material definitions. My adjustments are written right below this text.

I want to simulate neutrons passing a wall of Polyethylene create out of "TS_H_of_Polyethylene"

	G4Element *H = new G4Element("TS_H_of_Polyethylene", "H", 1., 1.0079 * g / mole);

instead of the original "Hydrogen":

	G4Element *H = new G4Element("Hydrogen", "H", 1., 1.01 * g / mole);

The temperature of the wall is changed after each run because I want to see the effect of that. The temperature change happens through a change of material; the properties of the different materials are all identically except the temperature. Everything works just fine, when I use "Hydrogen", but when I use "TS_H_of_Polyethylene" after a random number of events/runs an Error Message occurs, that looks like this:

	[2018-03-08 17:55:21> Run #1 started
	[2018-03-08 17:55:21> WARNING: No current scene handler.
	[2018-03-08 17:55:21> Number of planned Events: 100
	Final state energy was: E = -7.34869e-09
	[2018-03-08 17:55:21> In /home/Downloads/geant4.10.02.p01/source/processes/hadronic/util/src/, line 45: 
	[2018-03-08 17:55:21> ===> G4HadFinalState: fatal - negative energy
	[2018-03-08 17:55:21> 
	-------- EEEE ------- G4Exception-START -------- EEEE -------
	*** G4Exception : had006
	      issued by : G4HadronElasticProcess::PostStepDoIt
	In /home/Downloads/geant4.10.02.p01/source/processes/hadronic/util/src/, line 45: 
	===> G4HadFinalState: fatal - negative energy
	Call for NeutronHPThermalScattering
	Target element TS_H_of_Polyethylene  Z= 1  A= 1
	Unrecoverable error in the method ApplyYourself of hadElastic
	TrackID= 1  ParentID= 0  neutron
	Ekin(GeV)= 2.22622e-11;  direction= (0.322877,0.044865,0.945377)
	Position(mm)= (218.89,64.7463,-2.06644);  material POLYMAT
	PhysicalVolume  <PE_wall>
	ApplyYourself failed

	*** Fatal Exception *** core dump ***
	-------- EEEE -------- G4Exception-END --------- EEEE -------

	[2018-03-08 17:55:21> 
	[2018-03-08 17:55:21> *** G4Exception: Aborting execution ***
	Aborted (core dumped)

I was not able to figure out what I did wrong here. Using "TS_H_of_Polyethylene" is the essential point in my work. That is why just taking the original Hydrogen is not an option. Hopefully one of you is able to help me solve that problem.

The relevant parts of my code are:

-----in PhysicsList::ConstructProcess()-----

	G4ParticleDefinition* nPD = G4Neutron::Definition();
	G4ProcessVector* pvec = nPD->GetProcessManager()->GetProcessList();
	G4HadronicProcess* nElastic = 0;
	for (G4int i=0; i<pvec->size(); i++) {
	  if ((*pvec)[i]->GetProcessSubType() != fHadronElastic) continue;
	  nElastic = dynamic_cast<G4HadronicProcess*>((*pvec)[i]);
	assert(nElastic != 0);

	// Get the "regular" HP elastic scattering model, exclude thermal scattering region
	G4HadronicInteraction* nElasticHP = G4HadronicInteractionRegistry::Instance()->FindModel("NeutronHPElastic");
	assert(nElasticHP != 0);

	G4NeutronHPThermalScattering *thermaln = new G4NeutronHPThermalScattering;

	// Attach HP thermal scattering model and data files to process
	nElastic->AddDataSet(new G4NeutronHPThermalScatteringData);

-----definition of polyethylene at 5mK-----

	G4Material *PE_5mK = new G4Material("PE_5mK", 0.94 * g / cm3, 2, kStateSolid, 0.005 * kelvin);
	G4Element *H = new G4Element("TS_H_of_Polyethylene", "H", 1., 1.0079 * g / mole);
	G4Element *C = new G4Element("Carbon", "C", 6., 12.01 * g / mole);
	PE_5mK.Material->AddElement(H, 0.143711);
	PE_5mK.Material->AddElement(C, 0.856289);

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: How to add thermal neutron scattering to code?   (Holger Kluck - 18 Apr, 2018)
 Add Message Add Message
to: "How to add thermal neutron scattering to code?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]