Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Feb 27, 2025
1 parent 7317ad2 commit 2185be7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
14 changes: 14 additions & 0 deletions DATA/PROJECT/Ravone/SETTINGS/parameters.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,17 @@ real_sky_algorithm=Linke turbidity factor
shadowing=true
tilt=0
tilt_mode=dem

[soilWaterFluxes]
isInitialWaterPotential=true
initialWaterPotential=-2
initialDegreeOfSaturation=0.8
computeOnlySurface=true
computeAllSoilDepth=false
imposedComputationDepth=1
conductivityHorizVertRatio=10
freeCatchmentRunoff=true
freeBottomDrainage=true
freeLateralDrainage=true
modelAccuracy=3
numberOfThreads=4
21 changes: 11 additions & 10 deletions agrolib/soilFluxes3D/water.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,20 @@


/*!
* \brief [m3] water flow between node i and Link
* \param i
* \brief getWaterExchange
* \param link TlinkedNode pointer
* \param deltaT
* \return result
* \param deltaT [s]
* \return water exchange [m3] between node i and Link
*/
double getWaterExchange(long i, TlinkedNode *link, double deltaT)
{
if (link != nullptr)
{
{
double matrixValue = getMatrixValue(i, link);
double flow = matrixValue * (nodeList[i].H - nodeList[link->index].H) * deltaT;
return (flow);
}
return matrixValue * (nodeList[i].H - nodeList[link->index].H) * deltaT;
}
else
return(double(INDEX_ERROR));
return double(INDEX_ERROR);
}


Expand Down Expand Up @@ -205,7 +203,8 @@ double redistribution(long i, TlinkedNode *link, int linkType)

bool computeFlux(long i, int matrixIndex, TlinkedNode *link, double deltaT, unsigned approximationNr, int linkType)
{
if ((*link).index == NOLINK) return false;
if ((*link).index == NOLINK)
return false;

double val;
long j = (*link).index;
Expand Down Expand Up @@ -370,7 +369,9 @@ bool waterFlowComputation(double deltaT)
unsigned long end = (n+1) * step - 1;

if (n == lastThread)
{
end = myStructure.nrNodes-1;
}

threadVector.push_back(std::thread(computeMatrixElements_thread, start, end, approximationNr, deltaT));
}
Expand Down

0 comments on commit 2185be7

Please sign in to comment.