Skip to content

Commit

Permalink
factor of safety
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Mar 8, 2024
1 parent 6bad327 commit a8c22df
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion agrolib/soil/soil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ namespace soil

double frictionEffect = tanFrictionAngle / tanAngle;

double unitWeight = horizonPtr->bulkDensity * GRAVITY; // [kN m-3]
double unitWeight = horizonPtr->bulkDensity * GRAVITY; // [kN m-3]
double cohesionEffect = 2 * (horizonPtr->effectiveCohesion + rootCohesion) / (unitWeight * depth * sin(2*slopeAngle));

double suctionEffect = (suctionStress * (tanAngle + 1/tanAngle) * tanFrictionAngle) / (unitWeight * depth);
Expand Down
47 changes: 42 additions & 5 deletions bin/CRITERIA3D/shared/project3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ bool Project3D::setCriteria3DMap(criteria3DVariable var, int layerIndex)
double value;
if (var == factorOfSafety)
{
value = computeFactorOfSafety(nodeIndex);
value = computeFactorOfSafety(row, col, layerIndex, nodeIndex);
}
else
{
Expand Down Expand Up @@ -1553,11 +1553,48 @@ double Project3D::assignTranspiration(int row, int col, double currentLai, doubl
}


float Project3D::computeFactorOfSafety(int nodeIndex)
float Project3D::computeFactorOfSafety(int row, int col, int layerIndex, int nodeIndex)
{
//TODO

return NODATA;
// suction stress [kPa]
double saturationDegree = soilFluxes3D::getDegreeOfSaturation(nodeIndex) / 100; // [-]

// sign is just in matric potential
double waterPotential = soilFluxes3D::getMatricPotential(nodeIndex) * GRAVITY; // [kPa]
waterPotential = std::min(0.0, waterPotential);
double suctionStress = waterPotential * saturationDegree;

// slope angle [rad]
float slopeDegree = radiationMaps->slopeMap->getValueFromRowCol(row, col);
float slopeAngle = slopeDegree * DEG_TO_RAD;

// friction angle [rad]
int soilIndex = getSoilIndex(row, col);
int horizonIndex = soil::getHorizonIndex(soilList[unsigned(soilIndex)], layerDepth[layerIndex]);
double frictionAngle = soilList[unsigned(soilIndex)].horizon[horizonIndex].frictionAngle * DEG_TO_RAD;

// effective cohesion [kPa]
double effectiveCohesion = soilList[unsigned(soilIndex)].horizon[horizonIndex].effectiveCohesion;

// friction effect [-]
double tanAngle = tan(slopeAngle);
double tanFrictionAngle = tan(frictionAngle);
double frictionEffect = tanFrictionAngle / tanAngle;

// unit weight [kN m-3]
double bulkDensity = soilList[unsigned(soilIndex)].horizon[horizonIndex].bulkDensity; // [g cm-3] --> [Mg m-3]
double unitWeight = bulkDensity * GRAVITY;

// cohesion effect [-]
double depth = layerDepth[layerIndex]; // [m]
// TODO root cohesion [kPa] leggere da db e assegnare in base alla ratio di root density
double rootCohesion = 0.;
double cohesionEffect = 2 * (effectiveCohesion + rootCohesion) / (unitWeight * depth * sin(2*slopeAngle));

// suction effect [-]
double suctionEffect = (suctionStress * (tanAngle + 1/tanAngle) * tanFrictionAngle) / (unitWeight * depth);

// factor of safety [-]
return frictionEffect + cohesionEffect - suctionEffect;
}


Expand Down
2 changes: 1 addition & 1 deletion bin/CRITERIA3D/shared/project3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@

bool setCriteria3DMap(criteria3DVariable var, int layerIndex);

float computeFactorOfSafety(int nodeIndex);
float computeFactorOfSafety(int row, int col, int layerIndex, int nodeIndex);
};

bool isCrit3dError(int result, QString &error);
Expand Down

0 comments on commit a8c22df

Please sign in to comment.