Problem 1865

Summary: fMassOfMolecule is not calculated in G4Material::AddElement(G4Element* element, G4double fraction) and G4Material::AddMaterial(G4Material* material, G4double fraction)
Product: Geant4 Reporter: Olivier Delaune <olivier.delaune>
Component: materialsAssignee: Marc.Verderi
Status: RESOLVED INVALID    
Severity: normal    
Priority: P5    
Version: 10.2   
Hardware: All   
OS: All   

Description Olivier Delaune 2016-06-03 10:58:39 CEST
Hi, in the method AddElement and AddMaterial of the G4Material class, fMassOfMolecule is not calculated. I guess it should be calculated exactly the same way as in the G4Material::AddElement(G4Element* element, G4int nAtoms) method, i.e. "fMassOfMolecule = Amol/Avogadro;" just before "ComputeDerivedQuantities();"
Comment 1 Marc.Verderi 2016-09-16 14:22:32 CEST
Sorry for the very long silence and thank you for the report.

In the material class it is mentioned:

G4double fMassOfMolecule; // for materials built by atoms count

When building by fraction of mass, the molecule concept might not apply as a material may be a mixture of several molecule species. When built by atoms count, we can assign the numbers to a molecule type.
In other words, when doing a material construction by fraction of mass, the material is assumed to be a mixture of several molecules.

I still need to further verify, but your report will likely be considered as invalid.
Comment 2 Marc.Verderi 2017-02-01 16:00:42 CET
Bug is considered as invalid, given the molecule masses are calculated only when adding elements by atoms count. Computing the molecule masses in general would mean considering any material mixture as made of a single molecule type.