Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Stress to NormStress + Implement TangStress + Update Dependencies #2160

Merged
merged 3 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 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,17 +17,17 @@ 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
Expand Down Expand Up @@ -158,17 +158,28 @@ slcHeightNotes = [S "This" +:+ phrase equation +:+ S "is based on the" +:+

--DD10

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

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

tangStressQD :: QDefinition
tangStressQD = mkQuantDef tangStress tangStressEqn

tangStressEqn :: Expr
tangStressEqn = sy ft / sy genericA

--DD12

ratioVariation :: DataDefinition
ratioVariation = dd ratioVarQD [makeCite fredlund1977] Nothing
"ratioVariation" []
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
--DD13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there is much value to comments with hard-coded numbers. I can see you are making an effort to keep them in sync, but it is a challenge for maintenance. The numbers are something that are automatically generated in the tex file. We should either delete these comments, or change them to something meaningful, like the name of the DD that is being defined.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then. I've updated the comments by removing the numbers and adding in the DD name and label like so.

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

ratioVariation :: DataDefinition
ratioVariation = dd ratioVarQD [makeCite fredlund1977] Nothing 
  "ratioVariation" []

ratioVarQD :: QDefinition
ratioVarQD = mkQuantDef scalFunc ratioVarEqn

ratioVarEqn :: Expr
ratioVarEqn = completeCase [case1, case2]
  where case1 = (1, sy constF)

        case2 = (sin (sy QM.pi_ * ((inxi slipDist - idx (sy slipDist) 0) /
                (indxn slipDist - idx (sy slipDist) 0))), UnaryOp Not (sy constF))

Does that work @smiths?


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
--DD14

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 total force per area acting on the soil mass" 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