Skip to content

Commit

Permalink
Merge pull request #24 from febrifahmi/dev
Browse files Browse the repository at this point in the history
update: adding full support for RMR14 calculation and update coverage
  • Loading branch information
febrifahmi authored Feb 21, 2023
2 parents 0099f41 + 338cce2 commit 8cc974a
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 10 deletions.
Binary file modified .coverage
Binary file not shown.
115 changes: 114 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ A python module for geotechnic analysis.
### Installation

`pip install geotekppu==0.0.2`

### How to use

`from geotekppu import *`


This Python module is developed based on [1], [2].

### Rock Mass Rating (RMR89)

Rock Mass Rating (RMR) is a rating system proposed by Bieniawski (1989) to classify rock based on five classification parameters.

This Python module is developed based on [1], [2].

```
Parameters:
Expand All @@ -36,6 +39,116 @@ RMR89 / rock mass rating value which consists of:
- Description (Very good rock, Good rock, Fair rock, Poor rock, Very poor rock)
```

```
Function r1:
r1(idx, value)
Strength of intact rock material rating.
Parameters:
-----------
idx : selected index either 'pls' for point-loads strength or 'ucs' for uniaxial compressive strength
value : strength of intact rock material (in MPa)
Return:
-------
val_r1 : rating value of strength of rock
```

```
Function r2:
r2(drillcoreRQD)
Drill core RQD rating.
Parameter:
----------
drillcoreRQD : drill core quality or rock quality designation (in percent)
Return:
-------
val_r2 : RQD rating
```

```
Function r3:
r3(spacing)
Space of discontinuity rating.
Parameters:
-----------
Value of rock spacing : spacing of rock (in m, float)
Return:
=======
val_r3 : space of discontinuity rating
```

```
Function discontinuity_class:
discontinuity_class(dl, sep, rough, gouge, weather)
Classification of discontinuity condition.
Parameters:
-----------
- dl: discontinuity length (persistence) in m (<1m; 1-3m; 3-10m; 10-20m; >20m) (type: Int)
- sep: separation (aperture) in mm (None; <0.1mm; 0.1-1.0mm; 1-5mm; >5mm) (type: None, Float)
- rough: roughness (very_rough; rough; slightly_rough; smooth; slickensided) (type: String)
- gouge: infilling (None; hl<5; hl>5; sl<5; sl>5) (type: None, String)
- weather: weathering (unweathered; slightly_weathered; moderately_weathered; highly_weathered; decomposed) (type: String)
Return:
-------
totalrating: total rating calculated from five parameters of discontinuity condition
```

```
Groundwater condition.
Parameters:
-----------
inflow - inflow per 10 m tunnel length (i/m)
wpress - joint water pressure / major principal
cond - general conditions (dry, damp, wet, dripping, or flowing)
Return:
-------
val_r5 : groundwater rating
```





### Rock Mass Rating basic (RMRb)







References
----------

Expand Down
4 changes: 2 additions & 2 deletions coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified requirements.txt
Binary file not shown.
114 changes: 107 additions & 7 deletions src/geotekppu/rmr/rmr__celada_etal2014.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
import math

def f0(strike_orientation, dip_angle):
"""
Expand All @@ -27,24 +28,123 @@ def f0(strike_orientation, dip_angle):
val_f0 = 0
if strike_orientation == "dwd":
if dip_angle >= 20 and dip_angle < 45:
pass
val_f0 = -2
elif dip_angle >= 45 and dip_angle <=90:
pass
val_f0 = 0
elif dip_angle < 20:
val_f0 = None
elif dip_angle > 90:
val_f0 = None
elif strike_orientation == "dad":
if dip_angle >= 20 and dip_angle < 45:
pass
val_f0 = -10
elif dip_angle >= 45 and dip_angle <=90:
pass
val_f0 = -5
elif dip_angle < 20:
val_f0 = None
elif dip_angle > 90:
val_f0 = None
elif strike_orientation == "parallel":
if dip_angle >= 20 and dip_angle < 45:
pass
val_f0 = -5
elif dip_angle >= 45 and dip_angle <=90:
pass
val_f0 = -12
elif dip_angle < 20:
val_f0 = None
elif dip_angle > 90:
val_f0 = None
elif strike_orientation == "irrespective":
if dip_angle >= 0 and dip_angle <= 20:
pass
val_f0 = -5
elif dip_angle > 20:
val_f0 = None
return val_f0


def f_excavation(rmrb):
"""
Adjusment factor for RMR considering excavation method (Tunneling Bore Method/TBM or Drill and Blast/D+B).
Parameters:
-----------
- rmrb: RMRb rating value before adjustments (for rmrb > 40 and rmrb < 40)
Return:
-------
val_fe: value of adjustments factor based on excavation method
"""
val_fe = 0
if rmrb < 40 and rmrb >= 0:
val_fe = 1 + (2 * (rmrb / 100)**2)
elif rmrb >= 40 and rmrb <= 100:
val_fe = 1.32 - (math.sqrt(rmrb-40)/25)
return val_fe


def ice(rmrb,ucs,k0,H,F):
"""
"Índice de Comportamiento Elástico" (ICE) as proposed by Bieniawski and Celada (2011).
Parameters:
-----------
- rmrb: value of RMRb
- ucs: uniaxial compressive strength of intact rock (in MPa)
- k0: ratio of the horizontal to vertical virgin stress
- H: tunnel depth (in meter)
- F: shape coefficient (circular tunnel d = 6 m -> F 1.3 ; circular tunnel d = 10 m -> F 1.0 ; coventional tunnel 14 m wide -> F 0.75 ; caverns 25 m wide x 60 m high -> F 0.55)
Return:
-------
val_ice: value of ICE
"""
val_ice = 0
e = 2.71828183
if k0 <= 1:
val_ice = ((3704*ucs*(e**((rmrb-100)/24)))/((3-k0)*H))*F
elif k0 >1:
val_ice = ((3704*ucs*(e**((rmrb-100)/24)))/(((3*k0)-1)*H))*F
return val_ice


def f_stresstrain(ice):
"""
Adjustment factor of stress-strain based on "Índice de Comportamiento Elástico" (ICE) value.
Parameters:
-----------
- ice: "Índice de Comportamiento Elástico" (ICE) value.
Return:
-------
val_fs: adjustment factor for stress-strain.
"""
val_fs = 0
if ice < 15:
val_fs = 1.3
elif ice >= 15 and ice < 70:
val_fs = (2.3*math.sqrt((100-ice)))/(7.1+math.sqrt((100-ice)))
elif ice >= 70:
val_fs = 1

return val_fs


def rmrb_adj(rmrb,f0):
return rmrb + f0


def rmr14(rmrb_adj, val_fe, val_fs):
__rmr14 = rmrb_adj * val_fe * val_fs
return __rmr14
77 changes: 77 additions & 0 deletions tests/test_rmr14.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import unittest
from src.geotekppu.rmr.rmr__celada_etal2014 import f0, f_excavation, ice, f_stresstrain, rmrb_adj, rmr14


class TestRMR14(unittest.TestCase):
# Test f0 function
def test_f0_1(self):
self.assertEqual(f0("dwd",30),-2)

def test_f0_2(self):
self.assertEqual(f0("dwd",20),-2)

def test_f0_3(self):
self.assertEqual(f0("dwd",44),-2)

def test_f0_4(self):
self.assertEqual(f0("dwd",45),0)

def test_f0_5(self):
self.assertEqual(f0("dwd",90),0)

# test value < 20 and > 90 with "dwd" as strike orientation ()
def test_f0_6(self):
self.assertEqual(f0("dwd",91),None)

def test_f0_7(self):
self.assertEqual(f0("dwd",19),None)

def test_f0_8(self):
self.assertEqual(f0("dad",91),None)

def test_f0_9(self):
self.assertEqual(f0("dad",19),None)

def test_f0_10(self):
self.assertEqual(f0("parallel",91),None)

def test_f0_11(self):
self.assertEqual(f0("parallel",19),None)

def test_f0_12(self):
self.assertEqual(f0("irrespective",21),None)

# Test f_excavation function
def test_f_excav_1(self):
self.assertEqual(f_excavation(39),1.3042)

def test_f_excav_2(self):
self.assertEqual(f_excavation(41),1.28)

def test_f_excav_3(self):
self.assertEqual(f_excavation(40),1.32)

# Test function ice
def test_ice_1(self):
self.assertEqual(round(ice(50,251,2,20,1.3),4),1504.9008)

# Test function f_stressstrain
def test_f_stressstrain_1(self):
self.assertEqual(f_stresstrain(1504.9008),1)

def test_f_stressstrain_2(self):
self.assertEqual(f_stresstrain(14),1.3)

def test_f_stressstrain_3(self):
self.assertEqual(round(f_stresstrain(17),4),1.2926)

# Test function rmrb_adj
def test_rmrb_adj_1(self):
self.assertEqual(rmrb_adj(50,-5),45)

# Test function rmr14
def test_rmr14_1(self):
self.assertEqual(round(rmr14(45,1.32,1.3),2),77.22)

if __name__ == '__main__':
unittest.main()

0 comments on commit 8cc974a

Please sign in to comment.