When the material is constructed by G4NistMaterialBuilder::ConstructNewIdealGasMaterial() and the number of atoms (nbAtoms) increases, its density also increase in spite of the same temperature and pressure. I think that its density must be divided by the total number of atoms. However the type of this argument is <int>, so I cannot control at all.
Dear Shoichiro, thank you very much for this post. When we introduced a fix for your problem report 2133 we also extend example code $G4INSTALL/examples/extended/electromagnetic/TestEm8, where we test now all material constructors. From this test the density and other parameters seems to be as expected, so the method seems to be correct. You may do an independent test: define material by different methods and compare results printing material properties. best regards, Vladimir
Dear Vladimir, thank you for the confirmation and comment. I'm very sorry, but now I understand that my usage of this function might be wrong. I want to construct Kr-He mixture gas, so the vector, vector<int> v_n_atoms = {4,6}; was used. However, the constructor ConstructNewIdealGasMaterial supports for compound gas (e.g. CH4), not for mixture gas. I wish a new constructor for mixture gas would be developed in the future. (Maybe I should use ConstructNewMaterial. or the constructor for mixture gas has already implemented?) best regards, Shoichiro (In reply to Vladimir.Ivantchenko from comment #1) > Dear Shoichiro, > > thank you very much for this post. When we introduced a fix for your problem > report 2133 we also extend example code > $G4INSTALL/examples/extended/electromagnetic/TestEm8, where we test now all > material constructors. From this test the density and other parameters seems > to be as expected, so the method seems to be correct. > > You may do an independent test: define material by different methods and > compare results printing material properties. > > best regards, > Vladimir
Dear Shoichiro, If you need an extra constructor then you may propose a signature of such new material constructor. You need to take into account, that we have two type of constructors: via number of atoms and via mass fraction. In the case of mass fraction, it is not possible internally recompute the number of molecules. Simple example: CH and C2H2 molecules have the same mass fraction of C and H atoms but different pressure for the same density. The ideal gas condition requires knowledge on number of atoms. In general, construction via number of atoms is needed for gases, for mass fractions - for compound solids and liquids where we do not care about pressure. Vladimir