Difference between He @ 0 atm and vacuum

_Geant4 Version: 10.04.p03
_Operating System:_Ubuntu 16.04
_Compiler/Version:_gcc 5.4
_CMake Version:_3.5.2

Hello all, long time no speak.

I’m trying to ionise (heavy) daughter products emitted from a source by passing them through a very diffuse gas (Helium). As a control I set the pressure of the gas to 0 and I see ionised primaries! However if I use G4_Galactic as a cross-check for the control I see no ionised primaries/daughters which is to be expected.

I’m creating N2 gas thus:

density = 0.12506*mg/cm3; // STP

temperature = STP_Temperature;
pressure = 1.0e-0STP_Pressure; //1.0e-0STP_Pressure;

G4Material* N2 = new G4Material(name=“Nitrogen_Gas” , density, ncomponents=1,
N2->AddElement(elN, 2);

My application is derived from the field02 example.

Why should I see different results for N2 at 0 atm and G4_Galactic?



Your code example (which really needs to have the backticks!) has

    pressure = 1.0e-0 * STP_Pressure;

which means “1 times”, not “zero times”. First, why do you think you’re setting the pressure to zero? Second, I’m not 100% sure that setting density to the STP value, but pressure to something else, works.

Hi Mike,

thanks again for helping me. Sorry, that was a typo (dumb cut and paste) on my part. It should have read:

pressure = 0.000e-0 * STP_Pressure.

However setting the density to zero does give the same results as G4_Galactic which is an approach with which I am uneasy.



Hmmm. I’ve always been skeptical (or at least confused) about the interaction of density/temperature/pressure when kStateGas is used. After all, if you’re specifying the molar mass, then giving all three of them overdetermines the system. So which one gets ignored? It’s not obvious to me from the documentation, so in my personal configurations, I just don’t. I compute what the density is “supposed to be”, and put that in directly.

Thanks Mike. So you and I are equally confused. Changing the molar mass seems to be a brutal and unsophisticated approach. I think it’s ok for the 0 atm but I’m very loath to use it for any other variations of pressure.

Please notice :
1- density must be strictly positive. Null density is forbidden; a check of that is done in G4Material constructor.
Galactic is an example of such vacuum.

2- G4Material constructor itself does nothing with (temperature, pressure). It is the user responsability to define a density coherent with its (temperature, pressure) .

Many thanks for your help Maire.