Skip to content

Commit a6637ad

Browse files
Fix NZ code density units
1 parent 3cbe091 commit a6637ad

File tree

5 files changed

+45
-36
lines changed

5 files changed

+45
-36
lines changed

docs/examples/nzs3101.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"outputs": [],
106106
"source": [
107107
"print(steel_300e.name)\n",
108-
"print(f\"Density = {steel_300e.density} kg/m^3\")\n",
108+
"print(f\"Density = {steel_300e.density} kg/mm^3\")\n",
109109
"ult_strain = steel_300e.stress_strain_profile.get_ultimate_tensile_strain()\n",
110110
"print(f\"Ultimate Tensile Strain = {ult_strain}\")\n",
111111
"print(f\"Overstrength Factor = {steel_300e.phi_os}\")\n",
@@ -695,7 +695,7 @@
695695
"# moment-curvature analysis\n",
696696
"concrete_25_prob = Concrete(\n",
697697
" name=\"Mander Concrete\",\n",
698-
" density=2300,\n",
698+
" density=2.3e-6,\n",
699699
" stress_strain_profile=ModifiedMander(\n",
700700
" elastic_modulus=design_code.e_conc(prob_compressive_strength),\n",
701701
" compressive_strength=prob_compressive_strength,\n",
@@ -737,7 +737,7 @@
737737
"outputs": [],
738738
"source": [
739739
"print(steel_275.name)\n",
740-
"print(f\"Density = {steel_275.density} kg/m^3\")\n",
740+
"print(f\"Density = {steel_275.density} kg/mm^3\")\n",
741741
"print(\n",
742742
" f\"Probable yield strength = {steel_275.stress_strain_profile.get_yield_strength()}\"\n",
743743
" f\" MPa\"\n",

docs/user_guide/design_codes/nzs3101.rst

+8-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ created it must be assigned to the design code::
2121
.. automethod:: concreteproperties.design_codes.nzs3101.NZS3101.assign_concrete_section
2222
:noindex:
2323

24-
.. note::
24+
.. warning::
2525

26-
To maintain unit consistency, the cross-section dimensions should be entered in
27-
*[mm]*.
26+
To maintain unit consistency, length dimensions must be entered in *[mm]*, force
27+
dimensions entered in *[N]* and density dimensions entered |dunits|, unless otherwise
28+
specified in the documentation.
29+
30+
.. |dunits| raw:: html
31+
32+
<em>[kg/mm<sup>3</sup>]</em>
2833

2934

3035
Creating Material Properties

src/concreteproperties/design_codes/as3600.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def create_steel_material( # pyright: ignore [reportIncompatibleMethodOverride]
163163
164164
.. admonition:: Material assumptions
165165
166-
- *Density*: 7850 kg/m\ :sup:`3`
166+
- *Density*: 7850 kg/m\ :sup:`3` (7.85 x 10\ :sup:`-6` kg/mm\ :sup:`3`)
167167
168168
- *Elastic modulus*: 200000 MPa
169169

src/concreteproperties/design_codes/nzs3101.py

+21-20
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ def create_concrete_material( # pyright: ignore [reportIncompatibleMethodOverri
841841
842842
.. admonition:: Material assumptions
843843
844-
- *Density*: Defaults to 2300 kg/m\ :sup:`3` unless supplied as user input
844+
- *Density*: Defaults to 2300 kg/m\ :sup:`3`
845+
(2.3 x 10\ :sup:`-6` kg/mm\ :sup:`3`), unless supplied as user input
845846
846847
- *Elastic modulus*: Calculated from NZS3101:2006 Eq. 5-1
847848
@@ -883,7 +884,7 @@ def create_concrete_material( # pyright: ignore [reportIncompatibleMethodOverri
883884

884885
return Concrete(
885886
name=name,
886-
density=density,
887+
density=density / 1e9,
887888
stress_strain_profile=ssp.ConcreteLinearNoTension(
888889
elastic_modulus=elastic_modulus,
889890
ultimate_strain=ultimate_strain,
@@ -984,7 +985,7 @@ def create_steel_material( # pyright: ignore [reportIncompatibleMethodOverride]
984985
985986
.. admonition:: Material assumptions
986987
987-
- *Density*: 7850 kg/m\ :sup:`3`
988+
- *Density*: 7850 kg/m\ :sup:`3` (7.85 x 10\ :sup:`-6` kg/mm\ :sup:`3`)
988989
989990
- *Elastic modulus*: 200000 MPa
990991
@@ -1043,13 +1044,13 @@ def create_steel_material( # pyright: ignore [reportIncompatibleMethodOverride]
10431044
**NZS3101:2006 characteristic yield strength based predefined
10441045
materials:**
10451046
1046-
- ``""300e""`` - Use for design to NZS3101:2006 provisions
1047+
- ``"300e"`` - Use for design to NZS3101:2006 provisions
10471048
10481049
- Characteristic yield strength :math:`f_y` = 300 MPa
10491050
- Fracture strain :math:`\varepsilon_{su}` = 15% or 0.15
10501051
- Overstrength factor :math:`\phi_{o,f_y}` = 1.35
10511052
1052-
- ``""500e""`` - Use for design to NZS3101:2006 provisions
1053+
- ``"500e"`` - Use for design to NZS3101:2006 provisions
10531054
10541055
- Characteristic yield strength :math:`f_y` = 500 MPa
10551056
- Fracture strain :math:`\varepsilon_{su}` = 10% or 0.10
@@ -1058,84 +1059,84 @@ def create_steel_material( # pyright: ignore [reportIncompatibleMethodOverride]
10581059
**NZSEE C5 guidelines probable yield strength based predefined
10591060
materials:**
10601061
1061-
- ``""pre_1945""``- Use for probable strength design to NZSEE C5
1062+
- ``"pre_1945"``- Use for probable strength design to NZSEE C5
10621063
assessment guidelines
10631064
10641065
- Probable yield strength :math:`f_{yp}` = 280 MPa
10651066
- Fracture strain :math:`\varepsilon_{su}` = 10% or 0.10
10661067
- Overstrength factor :math:`\phi_{f_o}` = 1.25
10671068
1068-
- ``""33""`` - Use for probable strength design to NZSEE C5 assessment
1069+
- ``"33"`` - Use for probable strength design to NZSEE C5 assessment
10691070
guidelines
10701071
10711072
- Probable yield strength :math:`f_{yp}` = 280 MPa
10721073
- Fracture strain :math:`\varepsilon_{su}` = 10% or 0.10
10731074
- Overstrength factor :math:`\phi_{f_o}` = 1.25
10741075
1075-
- ``""40""`` - Use for probable strength design to NZSEE C5 assessment
1076+
- ``"40"`` - Use for probable strength design to NZSEE C5 assessment
10761077
guidelines
10771078
10781079
- Probable yield strength :math:`f_{yp}` = 324 MPa
10791080
- Fracture strain :math:`\varepsilon_{su}` = 15% or 0.15
10801081
- Overstrength factor :math:`\phi_{f_o}` = 1.25
10811082
1082-
- ``""275""`` - Use for probable strength design to NZSEE C5 assessment
1083+
- ``"275"`` - Use for probable strength design to NZSEE C5 assessment
10831084
guidelines
10841085
10851086
- Probable yield strength :math:`f_{yp}` = 324 MPa
10861087
- Fracture strain :math:`\varepsilon_{su}` = 15% or 0.15
10871088
- Overstrength factor :math:`\phi_{f_o}` = 1.25
10881089
1089-
- ``""hy60""`` - Use for probable strength design to NZSEE C5 assessment
1090+
- ``"hy60"`` - Use for probable strength design to NZSEE C5 assessment
10901091
guidelines
10911092
10921093
- Probable yield strength :math:`f_{yp}` = 455 MPa
10931094
- Fracture strain :math:`\varepsilon_{su}` = 12% or 0.12
10941095
- Overstrength factor :math:`\phi_{f_o}` = 1.5
10951096
1096-
- ``""380""`` - Use for probable strength design to NZSEE C5 assessment
1097+
- ``"380"`` - Use for probable strength design to NZSEE C5 assessment
10971098
guidelines
10981099
10991100
- Probable yield strength :math:`f_{yp}` = 455 MPa
11001101
- Fracture strain :math:`\varepsilon_{su}` = 12% or 0.12
11011102
- Overstrength factor :math:`\phi_{f_o}` = 1.5
11021103
1103-
- ``""430""`` - Use for probable strength design to NZSEE C5 assessment
1104+
- ``"430"`` - Use for probable strength design to NZSEE C5 assessment
11041105
guidelines
11051106
11061107
- Probable yield strength :math:`f_{yp}` = 464 MPa
11071108
- Fracture strain :math:`\varepsilon_{su}` = 12% or 0.12
11081109
- Overstrength factor :math:`\phi_{f_o}` = 1.25
11091110
1110-
- ``""300""`` - Use for probable strength design to NZSEE C5 assessment
1111+
- ``"300"`` - Use for probable strength design to NZSEE C5 assessment
11111112
guidelines
11121113
11131114
- Probable yield strength :math:`f_{yp}` = 324 MPa
11141115
- Fracture strain :math:`\varepsilon_{su}` = 15% or 0.15
11151116
- Overstrength factor :math:`\phi_{f_o}` = 1.25
11161117
1117-
- ``""500n""`` - Use for probable strength design to NZSEE C5 assessment
1118+
- ``"500n"`` - Use for probable strength design to NZSEE C5 assessment
11181119
guidelines
11191120
11201121
- Probable yield strength :math:`f_{yp}` = 500 MPa
11211122
- Fracture strain :math:`\varepsilon_{su}` = 5% or 0.05
11221123
- Overstrength factor :math:`\phi_{f_o}` = 1.5
11231124
1124-
- ``""500""`` - Use for probable strength design to NZSEE C5 assessment
1125+
- ``"500"`` - Use for probable strength design to NZSEE C5 assessment
11251126
guidelines
11261127
11271128
- Probable yield strength :math:`f_{yp}` = 540 MPa
11281129
- Fracture strain :math:`\varepsilon_{su}` = 10% or 0.10
11291130
- Overstrength factor :math:`\phi_{f_o}` = 1.25
11301131
1131-
- ``""cd_mesh""`` - Use for probable strength design to NZSEE C5
1132+
- ``"cd_mesh"`` - Use for probable strength design to NZSEE C5
11321133
assessment guidelines
11331134
11341135
- Probable yield strength :math:`f_{yp}` = 600 MPa
11351136
- Fracture strain :math:`\varepsilon_{su}` = 1.5% or 0.015
11361137
- Overstrength factor :math:`\phi_{f_o}` = 1.2
11371138
1138-
- ``""duc_mesh""`` - Use for probable strength design to NZSEE C5
1139+
- ``"duc_mesh"`` - Use for probable strength design to NZSEE C5
11391140
assessment guidelines
11401141
11411142
- Probable yield strength :math:`f_{yp}` = 500 MPa
@@ -1197,7 +1198,7 @@ def create_steel_material( # pyright: ignore [reportIncompatibleMethodOverride]
11971198
return NZS3101.SteelBarNZ(
11981199
name=name,
11991200
steel_grade=steel_grade,
1200-
density=density,
1201+
density=density / 1e9,
12011202
phi_os=phi_os,
12021203
stress_strain_profile=ssp.SteelElasticPlastic(
12031204
yield_strength=yield_strength,
@@ -1463,7 +1464,7 @@ def create_os_section(
14631464
compressive_strength=prev_compressive_strength
14641465
+ add_compressive_strength,
14651466
ultimate_strain=prev_ultimate_strain,
1466-
density=prev_density,
1467+
density=prev_density * 1e9,
14671468
colour=prev_colour_conc,
14681469
)
14691470

@@ -1557,7 +1558,7 @@ def create_prob_section(
15571558
conc_geom.material = self.create_concrete_material(
15581559
compressive_strength=prob_compressive_strength,
15591560
ultimate_strain=prev_ultimate_strain,
1560-
density=prev_density,
1561+
density=prev_density * 1e9,
15611562
colour=prev_colour_conc,
15621563
)
15631564

tests/test_nzs3101.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def test_nzs3101_create_steel_material_meshed_valueerror():
477477
# create concrete material
478478
concrete = Concrete(
479479
name="50 MPa Concrete",
480-
density=2300,
480+
density=2.3e-6,
481481
stress_strain_profile=ssp.ConcreteLinearNoTension(
482482
elastic_modulus=design_code.e_conc(50),
483483
ultimate_strain=0.003,
@@ -496,7 +496,7 @@ def test_nzs3101_create_steel_material_meshed_valueerror():
496496
# create meshed steel material
497497
steel = Steel(
498498
name="Meshed Steel",
499-
density=7850,
499+
density=7.85e-6,
500500
stress_strain_profile=ssp.SteelElasticPlastic(
501501
yield_strength=300,
502502
elastic_modulus=200e3,
@@ -589,7 +589,7 @@ def test_nzs3101_create_concrete_material(
589589
concrete_mat = design_code.create_concrete_material(
590590
compressive_strength, ultimate_strain, density
591591
)
592-
assert pytest.approx(concrete_mat.__getattribute__("density")) == density
592+
assert pytest.approx(concrete_mat.__getattribute__("density")) == density * 1e-9
593593
assert (
594594
pytest.approx(
595595
concrete_mat.__getattribute__("flexural_tensile_strength"), rel=0.001
@@ -707,7 +707,7 @@ def test_nzs3101_create_os_section(
707707
conc_geom.material.ultimate_stress_strain_profile.__setattr__(
708708
"ultimate_strain", ultimate_strain
709709
)
710-
conc_geom.material.__setattr__("density", density)
710+
conc_geom.material.__setattr__("density", density * 1e-9)
711711

712712
concrete_os_section = design_code.create_os_section()
713713
# check steel overstrength properties
@@ -736,7 +736,10 @@ def test_nzs3101_create_os_section(
736736

737737
# check concrete overstrength properties
738738
for conc_geom in concrete_os_section.concrete_geometries:
739-
assert pytest.approx(conc_geom.material.__getattribute__("density")) == density
739+
assert (
740+
pytest.approx(conc_geom.material.__getattribute__("density"))
741+
== density * 1e-9
742+
)
740743
assert (
741744
pytest.approx(
742745
conc_geom.material.__getattribute__("flexural_tensile_strength"),
@@ -863,7 +866,7 @@ def test_nzs3101_create_prob_section(
863866
conc_geom.material.ultimate_stress_strain_profile.__setattr__(
864867
"ultimate_strain", ultimate_strain
865868
)
866-
conc_geom.material.__setattr__("density", 2300)
869+
conc_geom.material.__setattr__("density", 2.3e-6)
867870

868871
concrete_prob_section = design_code.create_prob_section()
869872
# check steel overstrength properties
@@ -1012,7 +1015,7 @@ def test_nzs3101_create_prob_os_section(
10121015
conc_geom.material.ultimate_stress_strain_profile.__setattr__(
10131016
"ultimate_strain", ultimate_strain
10141017
)
1015-
conc_geom.material.__setattr__("density", 2300)
1018+
conc_geom.material.__setattr__("density", 2.3e-6)
10161019

10171020
concrete_prob_section = design_code.create_prob_section(os_design=True)
10181021
# check steel overstrength properties
@@ -1463,7 +1466,7 @@ def test_nzs3101_create_section_with_non_steelbarnz_material():
14631466
# create concrete material
14641467
concrete = Concrete(
14651468
name="50 MPa Concrete",
1466-
density=2300,
1469+
density=2.3e-6,
14671470
stress_strain_profile=ssp.ConcreteLinearNoTension(
14681471
elastic_modulus=design_code.e_conc(50),
14691472
ultimate_strain=0.003,
@@ -1482,7 +1485,7 @@ def test_nzs3101_create_section_with_non_steelbarnz_material():
14821485
# create non SteelBarNZ steel material
14831486
steel = SteelBar(
14841487
name="Meshed Steel",
1485-
density=7850,
1488+
density=7.85e-6,
14861489
stress_strain_profile=ssp.SteelElasticPlastic(
14871490
yield_strength=300,
14881491
elastic_modulus=200e3,

0 commit comments

Comments
 (0)