I agree with professor Alain Celzard. It's no relation with quartz and porosity for rock. The porosity of rock is determined by the type of rock, pressure and temperature during rock forming.
You should be more specific on the material you are talking about. Is-it alluvium, beach sands, consolidated sandstones, or else? However, You should be aware that (for sedimentary deposits) there is no simple correlation between quartz content and porosity. The original porosity of sediments before deposit is not preserved (only 2% approximately can be preserved under certain condition of pressure). In fact the first order parameters influencing the porosity of sandstones are age of burial of the original sediment, detrital quartz content, depth of burial (max) and sorting of the sediment. Regards, Anicet