Skip to content

Commit

Permalink
Merge commit '0af1e82186a498b4095b6b35f1273a4fdd058c73'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Oct 27, 2023
2 parents a5d88ae + 0af1e82 commit 1284215
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
17 changes: 16 additions & 1 deletion agrolib/criteriaModel/criteria1DCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "criteria1DCase.h"
#include "soilFluxes3D.h"
#include "soil.h"
#include "crop.h"


Crit1DOutput::Crit1DOutput()
Expand Down Expand Up @@ -561,11 +562,25 @@ bool Crit1DCase::computeDailyModel(Crit3DDate &myDate, std::string &error)
{
double rootDensityNorm;
if (rootDensityMax == 0)
{
rootDensityNorm = 0;
}
else
{
rootDensityNorm = crop.roots.rootDensity[l] / rootDensityMax;
}

double rootCohesion;
if (isEqual(crop.roots.rootsAdditionalCohesion, NODATA))
{
rootCohesion = 0;
}
else
{
rootCohesion = crop.roots.rootsAdditionalCohesion * rootDensityNorm;
}

soilLayers[l].factorOfSafety = soilLayers[l].computeSlopeStability(unit.slope, rootDensityNorm);
soilLayers[l].factorOfSafety = soilLayers[l].computeSlopeStability(unit.slope, rootCohesion);
}
}

Expand Down
6 changes: 6 additions & 0 deletions agrolib/crop/cropDbTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ bool loadCropParameters(const QSqlDatabase &dbCrop, QString idCrop, Crit3DCrop &
myCrop.roots.rootDepthMax = query.value("root_depth_max").toDouble();
myCrop.roots.actualRootDepthMax = myCrop.roots.rootDepthMax;

if (! getValue(query.value("roots_additional_cohesion"), &(myCrop.roots.rootsAdditionalCohesion)))
{
// default: no mechanical effect of roots
myCrop.roots.rootsAdditionalCohesion = 0;
}

getValue(query.value("degree_days_root_increase"), &(myCrop.roots.degreeDaysRootGrowth));
if (myCrop.roots.degreeDaysRootGrowth == NODATA)
{
Expand Down
14 changes: 4 additions & 10 deletions agrolib/crop/root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void Crit3DRoot::clear()
rootLength = NODATA;
rootDepth = NODATA;
rootDensity.clear();
rootsAdditionalCohesion = NODATA;
}


Expand Down Expand Up @@ -219,8 +220,6 @@ namespace root
if (currentDD <= 0) return 0.;
if (currentDD > myRoot->degreeDaysRootGrowth) return maxRootLength;

double halfDevelopmentPoint = myRoot->degreeDaysRootGrowth * 0.5 ;

if (myRoot->growth == LINEAR)
{
myRootLength = maxRootLength * (currentDD / myRoot->degreeDaysRootGrowth);
Expand All @@ -230,20 +229,14 @@ namespace root
double logMax, logMin,deformationFactor;
double iniLog = log(9.);
double filLog = log(1 / 0.99 - 1);
double k,b;
k = -(iniLog - filLog) / (emergenceDD - myRoot->degreeDaysRootGrowth);
b = -(filLog + k * myRoot->degreeDaysRootGrowth);
double k = -(iniLog - filLog) / (emergenceDD - myRoot->degreeDaysRootGrowth);
double b = -(filLog + k * myRoot->degreeDaysRootGrowth);

logMax = (myRoot->actualRootDepthMax) / (1 + exp(-b - k * myRoot->degreeDaysRootGrowth));
logMin = myRoot->actualRootDepthMax / (1 + exp(-b));
deformationFactor = (logMax - logMin) / maxRootLength ;
myRootLength = 1.0 / deformationFactor * (myRoot->actualRootDepthMax / (1.0 + exp(-b - k * currentDD)) - logMin);
}
else if (myRoot->growth == EXPONENTIAL)
{
// not used in Criteria Bdp
myRootLength = maxRootLength * (1.- exp(-2.*(currentDD/halfDevelopmentPoint)));
}

return myRootLength;
}
Expand Down Expand Up @@ -571,5 +564,6 @@ namespace root

return true;
}

}

1 change: 1 addition & 0 deletions agrolib/crop/root.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
int firstRootLayer; /*!< [-] */
int lastRootLayer; /*!< [-] */
std::vector<double> rootDensity; /*!< [-] */
double rootsAdditionalCohesion; /*!< [kPa] Cr = roots reinforcement (RR) derived from a model */

/*! state variables */
double rootDepth; /*!< [m] current root depth */
Expand Down
4 changes: 2 additions & 2 deletions agrolib/soil/soil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ namespace soil
* \return factor of safety FoS [-]
* if fos < 1 the slope is unstable
*/
double Crit3DLayer::computeSlopeStability(double slope, double normalizedRootDensity)
double Crit3DLayer::computeSlopeStability(double slope, double rootCohesion)
{
double suctionStress = -waterPotential * getDegreeOfSaturation(); // [kPa]

Expand All @@ -760,7 +760,7 @@ namespace soil
double frictionEffect = tanFrictionAngle / tanAngle;

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

double suctionEffect = (suctionStress * (tanAngle + 1/tanAngle) * tanFrictionAngle) / (unitWeight * depth);

Expand Down

0 comments on commit 1284215

Please sign in to comment.