using System; // ======================================================================================================================= // Class name: THorizontalBalancePlane // // Description: // // Copyright (c) 2007-2010 Deltares // // Date ID Modification // 2010-06-17 Created // ======================================================================================================================= namespace Deltares.Stability.Calculation.Inner { public class THorizontalBalancePlane : TSlipPlane { private double FForcePassiveWedge = 0; private double FGamWater = 0; private double FHor1 = 0; private double FHor2 = 0; private double FHorizontalForceEarthQuacke = 0; private bool FIsReverse = false; private double FResisting = 0; private double FZFreaLeft = 0; private double FZFreaRight = 0; private double FZTangent = 0; public THorizontalBalancePlane() : base() { // TODO: Add any constructor code here } public double ZTangent { get { return FZTangent; } set { FZTangent = value; } } public double SafetyFactor { get { return DetermineSafetyfactor(); } } public double ZFreaLeft { get { return FZFreaLeft; } set { FZFreaLeft = value; } } public double ZFreaRight { get { return FZFreaRight; } set { FZFreaRight = value; } } public double GamWater { get { return FGamWater; } set { FGamWater = value; } } public double Hor1 { get { return FHor1; } set { FHor1 = value; } } public double Hor2 { get { return FHor2; } set { FHor2 = value; } } public double Resisting { get { return FResisting; } set { FResisting = value; } } public override void CreateSlices() { int i; base.CreateSlices(); // divide plane in slices FSliceDivision.ZTangent = FZTangent; FSliceDivision.DivideFailureSurfaceInSlices(); FNSlices = FSliceDivision.NSlices; FSlices = new Tslice[FNSlices]; for (i = 0; i < FNSlices; i++) { FSlices[i] = new Tslice(FSliceDivision.Slices[i]); } } // private declarations // ======================================================================================================================= // Date ID Modification // 2007-04-26 Best Created // 2008-05-14 Best Horizontal forces were wrongly calculated // ======================================================================================================================= private void DetermineHorizontalForces() { double FHorLeft; double FHorRight; if ((FZTangent > FZFreaLeft)) { FHorLeft = 0; } else { FHorLeft = 0.5*(FZFreaLeft - FZTangent)*(FZFreaLeft - FZTangent)*FGamWater; } if ((FZTangent > FZFreaRight)) { FHorRight = 0; } else { FHorRight = 0.5*(FZFreaRight - FZTangent)*(FZFreaRight - FZTangent)*FGamWater; } FIsReverse = (FSlices[0].ZTopLeft < FSlices[FNSlices - 1].ZTopRight); if (FIsReverse) { FHor1 = FHorRight; FHor2 = FHorLeft; } else { FHor1 = FHorRight; FHor2 = FHorLeft; } } // ======================================================================================================================= // Date ID Modification // 2007-04-26 Best Created // ======================================================================================================================= private double GetHorResistingForce() { double result; const double Pir = Math.PI/180.0; int i; double LSom; double LCoh; double LCohTerm; double LSigTerm; double LSinPhi; double LCosPhi; double LCosDilet; double LSinDilet; double LTau; LSom = 0.0; for (i = 0; i < FNSlices; i++) { Tslice _wvar1 = FSlices[i]; LCoh = _wvar1.CohBottom; // cohesie LSinPhi = Math.Sin(GetSlice(i).PhiBottom*Pir); LCosPhi = Math.Cos(_wvar1.PhiBottom*Pir); LCosDilet = Math.Cos(_wvar1.Dilatancy*Pir); LSinDilet = Math.Sin(_wvar1.Dilatancy*Pir); LSigTerm = LCosDilet*LSinPhi/(1 - LSinDilet*LSinPhi); LCohTerm = LCosDilet*LCosPhi/(1 - LSinDilet*LSinPhi); LTau = LCoh*LCohTerm + _wvar1.EffectiveStress*LSigTerm; LSom = LSom + _wvar1.ArcLength*LTau; // Nieuwe Tau - alfa _wvar1.NormalStress = _wvar1.EffectiveStress; FSlices[i].ShearStress = LTau; } result = LSom; return result; } // ======================================================================================================================= // Date ID Modification // 2010-06-17 Created // ======================================================================================================================= private bool IsSlipPlaneValid() { bool result; result = true; return result; } // ======================================================================================================================= // Date ID Modification // 2010-06-17 Created // ======================================================================================================================= // ======================================================================================================================= // Date ID Modification // 2007-04-26 Best Created // ======================================================================================================================= private double DetermineSafetyfactor() { double result; result = Constants.CFMinStart; if ((IsSlipPlaneValid())) { CreateSlices(); // Fill soil,stress data of slices FillSlices(); DetermineHorizontalForces(); DetermineEarthQuackeHorizontalForce(); DeterminePassiveWedge(); FResisting = GetHorResistingForce(); if ((Math.Abs(FHor1 - FHor2) > Constants.CEpsMin)) { //result = FResisting / Math.Abs(FHor1 - FHor2); result = (FResisting + FForcePassiveWedge)/ (Math.Abs(FHor1 - FHor2) + Math.Abs(FHorizontalForceEarthQuacke)); } } return result; } //======================================================================================================================= //Date ID Modification //2013-10-29 Created //=======================================================================================================================} private void DetermineEarthQuackeHorizontalForce() { double LSom = 0.0; for (int i = 0; i < FNSlices; i++) { LSom += FSlices[i].HorizontalQuakeforce; } FHorizontalForceEarthQuacke = LSom; } //======================================================================================================================= //Date ID Modification //2013-10-29 Created //=======================================================================================================================} private void DeterminePassiveWedge() { double LXCoor = FZFreaLeft > FZFreaRight ? FXRightSurface : FxLeftSurface; int sliceIndex = FZFreaLeft > FZFreaRight ? FNSlices - 1 : 0; FForcePassiveWedge = FSlices[sliceIndex].Vertical.DetermineEffectivePassiveForce(FZTangent, 1); } } }