Skip to content

Commit

Permalink
Merge pull request #2160 from JacquesCarette/Issue#2156_III
Browse files Browse the repository at this point in the history
Update Stress to NormStress + Implement TangStress + Update Dependencies
  • Loading branch information
JacquesCarette authored Jun 3, 2020
2 parents d39f73b + 84910d3 commit 704e334
Show file tree
Hide file tree
Showing 6 changed files with 342 additions and 99 deletions.
57 changes: 34 additions & 23 deletions code/drasil-example/Drasil/SSP/DataDefs.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Drasil.SSP.DataDefs (dataDefs, intersliceWtrF, angleA, angleB, lengthB,
lengthLb, lengthLs, slcHeight, stressDD, ratioVariation, convertFunc1,
convertFunc2, nrmForceSumDD, watForceSumDD) where
lengthLb, lengthLs, slcHeight, normStressDD, tangStressDD, ratioVariation,
convertFunc1, convertFunc2, nrmForceSumDD, watForceSumDD) where

import Prelude hiding (cos, sin, tan)
import Language.Drasil
Expand All @@ -17,20 +17,20 @@ import Drasil.SSP.Defs (slice)
import Drasil.SSP.References (chen2005, fredlund1977, karchewski2012, huston2008)
import Drasil.SSP.Unitals (baseAngle, baseLngth, baseWthX, constF, fricAngle,
fs, genericA, intNormForce, indxn, inx, inxi, inxiM1, midpntHght,
fn, mobShrC, normToShear, scalFunc, shrResC, slipDist, slipHght, slopeDist,
slopeHght, surfAngle, surfLngth, totStress, nrmForceSum, watForceSum,
sliceHghtRight, sliceHghtLeft, waterHght, waterWeight, watrForce)
fn, ft, mobShrC, normToShear, scalFunc, shrResC, slipDist, slipHght, slopeDist,
slopeHght, surfAngle, surfLngth, totNormStress, tangStress, nrmForceSum,
watForceSum, sliceHghtRight, sliceHghtLeft, waterHght, waterWeight, watrForce)

------------------------
-- Data Definitions --
------------------------

dataDefs :: [DataDefinition]
dataDefs = [intersliceWtrF, angleA, angleB, lengthB, lengthLb, lengthLs,
slcHeight, stressDD, torqueDD, ratioVariation, convertFunc1,
slcHeight, normStressDD, tangStressDD, torqueDD, ratioVariation, convertFunc1,
convertFunc2, nrmForceSumDD, watForceSumDD, sliceHghtRightDD, sliceHghtLeftDD]

--DD4
--DD intersliceWtrF: interslice normal water forces

intersliceWtrF :: DataDefinition
intersliceWtrF = dd intersliceWtrFQD [makeCite fredlund1977] Nothing "intersliceWtrF"
Expand All @@ -51,7 +51,7 @@ intersliceWtrFEqn = completeCase [case1,case2,case3]

case3 = (0, inxi waterHght $<= inxi slipHght)

--DD5
--DD angleA: base angles

angleA :: DataDefinition
angleA = dd angleAQD [makeCite fredlund1977] Nothing "angleA"
Expand All @@ -70,7 +70,7 @@ angleANotes = foldlSent [S "This", phrase equation, S "is based on the",
phrase assumption, S "that the base of a", phrase slice,
S "is a straight line", sParen (makeRef2S assumpSBSBISL)]

--DD6
--DD angleB: surface angles

angleB :: DataDefinition
angleB = dd angleBQD [makeCite fredlund1977] Nothing "angleB"
Expand All @@ -89,7 +89,7 @@ angleBNotes = foldlSent [S "This", phrase equation, S "is based on the",
phrase assumption, S "that the surface of a", phrase slice,
S "is a straight line", sParen (makeRef2S assumpSBSBISL)]

--DD7
--DD lengthB: base width of slices

lengthB :: DataDefinition
lengthB = dd lengthBQD [makeCite fredlund1977] Nothing "lengthB" []--Notes
Expand All @@ -101,7 +101,7 @@ lengthBQD = mkQuantDef baseWthX lengthBEqn
lengthBEqn :: Expr
lengthBEqn = inxi slipDist - inx slipDist (-1)

--DD8
--DD lengthLb: total base lengths of slices

lengthLb :: DataDefinition
lengthLb = dd lengthLbQD [makeCite fredlund1977] Nothing "lengthLb"
Expand All @@ -118,7 +118,7 @@ lengthLbNotes :: Sentence
lengthLbNotes = foldlSent [ch baseWthX, S "is defined in",
makeRef2S lengthB `sAnd` ch baseAngle, S "is defined in", makeRef2S angleA]

--
--DD lengthLs: surface lengths of slices

lengthLs :: DataDefinition
lengthLs = dd lengthLsQD [makeCite fredlund1977] Nothing "lengthLs"
Expand All @@ -136,7 +136,7 @@ lengthLsNotes = foldlSent [ch baseWthX, S "is defined in",
makeRef2S lengthB `sAnd` ch surfAngle, S "is defined in", makeRef2S angleB]


--DD9
--DD slcHeight: y-direction heights of slices

slcHeight :: DataDefinition
slcHeight = dd slcHeightQD [makeCite fredlund1977] Nothing "slcHeight"
Expand All @@ -156,18 +156,29 @@ slcHeightNotes = [S "This" +:+ phrase equation +:+ S "is based on the" +:+
makeRef2S sliceHghtRightDD `sAnd` makeRef2S sliceHghtLeftDD `sC`
S "respectively."]

--DD10
--DD normStress: total normal stress

stressDD :: DataDefinition
stressDD = dd stressQD [makeCite huston2008] Nothing "normStress" []
normStressDD :: DataDefinition
normStressDD = dd normStressQD [makeCite huston2008] Nothing "normStress" []

stressQD :: QDefinition
stressQD = mkQuantDef totStress stressEqn
normStressQD :: QDefinition
normStressQD = mkQuantDef totNormStress normStressEqn

stressEqn :: Expr
stressEqn = sy fn / sy genericA
normStressEqn :: Expr
normStressEqn = sy fn / sy genericA

--DD11
--DD tangStress: tangential stress

tangStressDD :: DataDefinition
tangStressDD = dd tangStressQD [makeCite huston2008] Nothing "tangStress" []

tangStressQD :: QDefinition
tangStressQD = mkQuantDef tangStress tangStressEqn

tangStressEqn :: Expr
tangStressEqn = sy ft / sy genericA

--DD ratioVariation: interslice normal to shear force ratio variation function

ratioVariation :: DataDefinition
ratioVariation = dd ratioVarQD [makeCite fredlund1977] Nothing
Expand All @@ -183,7 +194,7 @@ ratioVarEqn = completeCase [case1, case2]
case2 = (sin (sy QM.pi_ * ((inxi slipDist - idx (sy slipDist) 0) /
(indxn slipDist - idx (sy slipDist) 0))), UnaryOp Not (sy constF))

--DD12
--DD convertFunc1: first function for incorporating interslice forces into shear force

convertFunc1 :: DataDefinition
convertFunc1 = dd convertFunc1QD (map makeCite [chen2005, karchewski2012]) Nothing
Expand All @@ -201,7 +212,7 @@ convertFunc1Eqn = (sy normToShear * inxi scalFunc *
convertFunc1Notes :: Sentence
convertFunc1Notes = foldlSent [ch scalFunc, S "is defined in", makeRef2S ratioVariation `sAnd` ch baseAngle, S "is defined in", makeRef2S angleA]

--DD13
--DD convertFunc2: second function for incorporating interslice forces into shear force

convertFunc2 :: DataDefinition
convertFunc2 = dd convertFunc2QD (map makeCite [chen2005, karchewski2012]) Nothing
Expand Down
6 changes: 3 additions & 3 deletions code/drasil-example/Drasil/SSP/GenDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Drasil.SSP.Assumptions (assumpFOSL, assumpSLH, assumpSP, assumpSLI,
assumpHFSM)
import Drasil.SSP.BasicExprs (eqlExpr, eqlExprN, momExpr)
import Drasil.SSP.DataDefs (intersliceWtrF, angleA, angleB, lengthB, lengthLb,
lengthLs, slcHeight, stressDD, ratioVariation)
lengthLs, slcHeight, normStressDD, ratioVariation)
import Drasil.SSP.Defs (intrslce, slice, slope, slopeSrf, slpSrf, soil,
soilPrpty, waterTable)
import Drasil.SSP.Figures (figForceActing)
Expand Down Expand Up @@ -139,7 +139,7 @@ resShrDesc = foldlSent [ch baseLngth, S "is defined in", makeRef2S lengthLb]

resShrDeriv :: Derivation
resShrDeriv = mkDerivNoHeader [foldlSent [S "Derived by substituting",
makeRef2S stressDD, S "into the Mohr-Coulomb", phrase shrStress `sC`
makeRef2S normStressDD, S "into the Mohr-Coulomb", phrase shrStress `sC`
makeRef2S mcShrStrgth `sC` S "and multiplying both sides of the",
phrase equation, S "by", phrase genericA `ofThe` phrase slice `sIn`
S "the shear-" :+: ch zcoord +:+. S "plane", S "Since the", phrase slope,
Expand Down Expand Up @@ -184,7 +184,7 @@ effNormFDesc = ch baseHydroForce +:+ S "is defined in" +:+. makeRef2S baseWtrFGD

effNormFDeriv :: Derivation
effNormFDeriv = mkDerivNoHeader [foldlSent [
S "Derived by substituting", makeRef2S stressDD, S "into",
S "Derived by substituting", makeRef2S normStressDD, S "into",
makeRef2S effStress `sAnd` S "multiplying both sides of the", phrase equation,
S "by the", phrase genericA `ofThe` phrase slice, S "in the shear-" :+:
ch zcoord +:+. S "plane", S "Since the", phrase slope,
Expand Down
10 changes: 5 additions & 5 deletions code/drasil-example/Drasil/SSP/TMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import Drasil.SSP.Defs (factorOfSafety)
import Drasil.SSP.References (fredlund1977)
import Drasil.SSP.Unitals (effCohesion, effNormStress, effectiveStress,
fricAngle, fs, fx, fy, genericM, mobilizedShear, nrmFSubWat, porePressure,
resistiveShear, shrStress, totStress)
import Drasil.SSP.DataDefs (stressDD)
resistiveShear, shrStress, totNormStress)
import Drasil.SSP.DataDefs (normStressDD)

--------------------------
-- Theoretical Models --
Expand Down Expand Up @@ -96,7 +96,7 @@ mcShrStrgthDesc = foldlSent [S "In this", phrase model, S "the",
------------- New Chunk -----------
effStress :: TheoryModel
effStress = tm (cw effStressRC)
[qw effectiveStress, qw totStress, qw porePressure]
[qw effectiveStress, qw totNormStress, qw porePressure]
([] :: [ConceptChunk])
[] [effStressRel] [] [makeCite fredlund1977] "effStress" [effStressDesc]

Expand All @@ -106,7 +106,7 @@ effStressRC = makeRC "effStressRC"
(nounPhraseSP "effective stress") effStressDesc effStressRel -- l4

effStressRel :: Relation
effStressRel = sy effectiveStress $= sy totStress - sy porePressure
effStressRel = sy effectiveStress $= sy totNormStress - sy porePressure

effStressDesc :: Sentence
effStressDesc = foldlSent [ch totStress, S "is defined in", makeRef2S stressDD]
effStressDesc = foldlSent [ch totNormStress, S "is defined in", makeRef2S normStressDD]
18 changes: 12 additions & 6 deletions code/drasil-example/Drasil/SSP/Unitals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ units = map ucw [accel, genericMass, genericF, genericA, genericM, genericV,
shearRNoIntsl, slcWght, watrForce, intShrForce, baseHydroForce,
surfHydroForce, totNrmForce, nrmFSubWat, surfLoad, baseAngle, surfAngle,
impLoadAngle, baseWthX, baseLngth, surfLngth, midpntHght,
porePressure, sliceHght, sliceHghtW, fx, fy, fn, nrmForceSum, watForceSum,
sliceHghtRight, sliceHghtLeft, intNormForce, shrStress, totStress,
porePressure, sliceHght, sliceHghtW, fx, fy, fn, ft, nrmForceSum, watForceSum,
sliceHghtRight, sliceHghtLeft, intNormForce, shrStress, totNormStress, tangStress,
effectiveStress, effNormStress, dryVol, satVol, rotForce, momntArm, posVec]

accel, genericMass, genericF, genericA, genericM, genericV, genericW,
Expand All @@ -211,10 +211,10 @@ accel, genericMass, genericF, genericA, genericM, genericV, genericW,
mobilizedShear, mobShrI, sliceHght, sliceHghtW, shearFNoIntsl, shearRNoIntsl,
slcWght, watrForce, resistiveShear, shrResI, intShrForce, baseHydroForce,
surfHydroForce, totNrmForce, nrmFSubWat, surfLoad, baseAngle, surfAngle,
impLoadAngle, baseWthX, baseLngth, surfLngth, midpntHght, fx, fy, fn,
impLoadAngle, baseWthX, baseLngth, surfLngth, midpntHght, fx, fy, fn, ft,
nrmForceSum, watForceSum, sliceHghtRight, sliceHghtLeft, porePressure,
intNormForce, shrStress, totStress, effectiveStress, effNormStress, dryVol,
satVol, rotForce, momntArm, posVec :: UnitalChunk
intNormForce, shrStress, totNormStress, tangStress, effectiveStress,
effNormStress, dryVol, satVol, rotForce, momntArm, posVec :: UnitalChunk

{-FIXME: Many of these need to be split into term, defn pairs as
their defns are mixed into the terms.-}
Expand Down Expand Up @@ -383,6 +383,9 @@ fy = makeUCWDS "fy" (nounPhraseSent $ phrase yCoord +:+ S "of the force")
fn = uc' "F_n" (cn "total normal force") "component of a force in the normal direction"
(sub cF (Label "n")) newton

ft = uc' "F_t" (cn "tangential force") "component of a force in the tangential direction"
(sub cF (Label "t")) newton

nrmForceSum = uc' "F_x^G" (cn "sums of the interslice normal forces")
"the sums of the normal forces acting on each pair of adjacent interslice boundaries"
(sup (subX (vec cF)) lNorm) newton
Expand All @@ -399,9 +402,12 @@ sliceHghtLeft = uc' "h^L" (cn "heights of the left side of slices")
"the heights of the left side of each slice, assuming slice surfaces have negative slope"
(sup (vec lH) lLeft) metre

totStress = uc' "sigma" (cn' "total normal stress")
totNormStress = uc' "sigma" (cn' "total normal stress")
"the total force per area acting on the soil mass" lSigma pascal

tangStress = uc' "tau" (cn' "tangential stress")
"the shear force per unit area" lTau pascal

effectiveStress = uc' "sigma'" (cn' "effective stress")
("the stress in a soil mass that is effective in causing volume changes " ++
"and mobilizes the shear strength arising from friction; represents the " ++
Expand Down
Loading

0 comments on commit 704e334

Please sign in to comment.