robbievanleeuwen / concrete-properties

Calculate section properties for reinforced concrete sections.
https://concrete-properties.rtfd.io
MIT License
160 stars 47 forks source link

Fix NZ code density units #147

Closed robbievanleeuwen closed 4 days ago

robbievanleeuwen commented 3 weeks ago

Closes #146.

Addresses density being stored inconsistently in the NZ code material objects as kg/m^3 rather than the consistent kg/mm^3. Only the mass per unit length was affected.

robbievanleeuwen commented 3 weeks ago

Hi @Agent6-6-6, sorry for the extended absence here. I'm trying to start to tackle some of the outstanding issues and noticed #146. If you have a chance to cast your eye quickly over this I'd appreciate it :) Otherwise I'll probably merge in ~1 week.

Agent6-6-6 commented 3 weeks ago

I did it that way on purpose because that is the units used in the NZ design code and is most familiar to those working in SI units for density. From memory it is used for calculating E of concrete in kg/m3, so if it must be changed then further code updates may be required (I quickly flicked through the code changes you've proposed on my phone but didn't see if that had been changed).

My preference would be it is kept as kg/m3, as this is the proper/official SI units for density even if it isn't strictly compatible with the mm used elsewhere. https://www.google.com/search?q=si+units+for+density.&oq=si+units+for+density.&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCDU3ODlqMGo5qAIAsAIB&client=ms-android-samsung-ss&sourceid=chrome-mobile&ie=UTF-8

Maybe density is used elsewhere in the world in kg/mm3 though, but I didn't think so. In my view it just avoids a units input issue as you'd expect kg/m3 in design directly without having to modify it in the code back to kg/m3 to use it?

Thoughts?

robbievanleeuwen commented 3 weeks ago

I agree that it is best to maintain the input as the more commonly adopted kg/m^3. This proposed pull request does not change the units that the user inputs, however just modifies the back-end such that when the Material object is created the units are converted such that they are consistent.

The main reason for this PR is that the reported results for mass/length are incorrect. As concreteproperties is unit independent the values stored in Material should be consistent with the rest of the units used in the analysis (the design code assumes [mm]).

Let me know if this makes sense :)