diff --git a/DATA/SETTINGS/parameters.ini b/DATA/SETTINGS/parameters.ini index 7a3a58ca4..1df065a95 100644 --- a/DATA/SETTINGS/parameters.ini +++ b/DATA/SETTINGS/parameters.ini @@ -78,3 +78,16 @@ snowWaterHoldingCapacity=0.05 snowSkinThickness=0.02 snowVegetationHeight=1 soilAlbedo=0.2 + +[soilFluxes] +isInitialWaterPotential=true +initialWaterPotential=-2 +initialDegreeOfSaturation=0.8 +computeOnlySurface=false +computeAllSoilDepth=true +imposedComputationDepth=1 +conductivityHorizVertRatio=4 +freeCatchmentRunoff=true +freeBottomDrainage=true +freeLateralDrainage=true +modelAccuracy=3 diff --git a/bin/CRITERIA3D/criteria3DProject.cpp b/bin/CRITERIA3D/criteria3DProject.cpp index 754cb594c..d6bc796f8 100644 --- a/bin/CRITERIA3D/criteria3DProject.cpp +++ b/bin/CRITERIA3D/criteria3DProject.cpp @@ -787,7 +787,21 @@ bool Crit3DProject::writeCriteria3DParameters(bool isSnow, bool isWater, bool is if (isWater) { + parametersSettings->setValue("soilFluxes/isInitialWaterPotential", waterFluxesParameters.isInitialWaterPotential); parametersSettings->setValue("soilFluxes/initialWaterPotential", waterFluxesParameters.initialWaterPotential); + parametersSettings->setValue("soilFluxes/initialDegreeOfSaturation", waterFluxesParameters.initialDegreeOfSaturation); + + parametersSettings->setValue("soilFluxes/computeOnlySurface", waterFluxesParameters.computeOnlySurface); + parametersSettings->setValue("soilFluxes/computeAllSoilDepth", waterFluxesParameters.computeAllSoilDepth); + parametersSettings->setValue("soilFluxes/imposedComputationDepth", waterFluxesParameters.imposedComputationDepth); + + parametersSettings->setValue("soilFluxes/conductivityHorizVertRatio", waterFluxesParameters.conductivityHorizVertRatio); + + parametersSettings->setValue("soilFluxes/freeCatchmentRunoff", waterFluxesParameters.freeCatchmentRunoff); + parametersSettings->setValue("soilFluxes/freeBottomDrainage", waterFluxesParameters.freeBottomDrainage); + parametersSettings->setValue("soilFluxes/freeLateralDrainage", waterFluxesParameters.freeLateralDrainage); + + parametersSettings->setValue("soilFluxes/modelAccuracy", waterFluxesParameters.modelAccuracy); } if (isSoilCrack) diff --git a/bin/CRITERIA3D/shared/project3D.cpp b/bin/CRITERIA3D/shared/project3D.cpp index cd22ff41a..d5c33707f 100644 --- a/bin/CRITERIA3D/shared/project3D.cpp +++ b/bin/CRITERIA3D/shared/project3D.cpp @@ -64,6 +64,10 @@ void WaterFluxesParameters::initialize() conductivityHorizVertRatio = 10.0; // [-] default: ten times modelAccuracy = 3; // [-] default: error on the third digit + + minSoilLayerThickness = 0.02; // [m] default: 2 cm + maxSoilLayerThickness = 0.10; // [m] default: 10 cm + maxSoilLayerThicknessDepth = 0.40; // [m] default: 40 cm } @@ -152,11 +156,8 @@ void Project3D::initializeProject3D() soilMapFileName = ""; landUseMapFileName = ""; - computationSoilDepth = 0.0; // [m] - minThickness = 0.02; // [m] default: 2 cm - maxThickness = 0.10; // [m] default: 10 cm - maxThicknessDepth = 0.40; // [m] default: 40 cm - thicknessGrowthFactor = 1.2; // [-] + computationSoilDepth = 0.0; // [m] + soilLayerThicknessGrowthFactor = 1.2; // [-] nrSoils = 0; nrLayers = 0; @@ -1255,9 +1256,9 @@ void Project3D::setSoilLayers() return; // set thicknessGrowthFactor - if (minThickness == maxThickness) + if (waterFluxesParameters.minSoilLayerThickness == waterFluxesParameters.maxSoilLayerThickness) { - thicknessGrowthFactor = 1.0; + soilLayerThicknessGrowthFactor = 1.0; } else { @@ -1267,16 +1268,16 @@ void Project3D::setSoilLayers() while (factor <= 2.0) { double upperDepth = 0; - double currentThickness = minThickness; + double currentThickness = waterFluxesParameters.minSoilLayerThickness; double currentDepth = upperDepth + currentThickness * 0.5; - while (currentThickness < maxThickness) + while (currentThickness < waterFluxesParameters.maxSoilLayerThickness) { upperDepth += currentThickness; - currentThickness = std::min(currentThickness * factor, maxThickness); + currentThickness = std::min(currentThickness * factor, waterFluxesParameters.maxSoilLayerThickness); currentDepth = upperDepth + currentThickness * 0.5; } - double error = fabs(currentDepth - maxThicknessDepth); + double error = fabs(currentDepth - waterFluxesParameters.maxSoilLayerThicknessDepth); if (error < bestError) { bestError = error; @@ -1285,18 +1286,18 @@ void Project3D::setSoilLayers() factor += 0.01; } - thicknessGrowthFactor = bestFactor; + soilLayerThicknessGrowthFactor = bestFactor; } nrLayers++; - double currentThickness = minThickness; - double currentDepth = minThickness; + double currentThickness = waterFluxesParameters.minSoilLayerThickness; + double currentLowerDepth = waterFluxesParameters.minSoilLayerThickness; - while ((computationSoilDepth - currentDepth) > minThickness) + while ((computationSoilDepth - currentLowerDepth) > waterFluxesParameters.minSoilLayerThickness) { nrLayers++; - double nextThickness = std::min(maxThickness, currentThickness * thicknessGrowthFactor); - currentDepth += nextThickness; + double nextThickness = std::min(currentThickness * soilLayerThicknessGrowthFactor, waterFluxesParameters.maxSoilLayerThickness); + currentLowerDepth += nextThickness; currentThickness = nextThickness; } } @@ -1321,9 +1322,9 @@ bool Project3D::setLayersDepth() if (nrLayers == 1) return true; - layerThickness[1] = minThickness; - layerDepth[1] = minThickness * 0.5; - double currentDepth = minThickness; + layerThickness[1] = waterFluxesParameters.minSoilLayerThickness; + layerDepth[1] = waterFluxesParameters.minSoilLayerThickness * 0.5; + double currentDepth = waterFluxesParameters.minSoilLayerThickness; for (unsigned int i = 2; i <= lastLayer; i++) { @@ -1333,7 +1334,7 @@ bool Project3D::setLayersDepth() } else { - layerThickness[i] = std::min(maxThickness, layerThickness[i-1] * thicknessGrowthFactor); + layerThickness[i] = std::min(waterFluxesParameters.maxSoilLayerThickness, layerThickness[i-1] * soilLayerThicknessGrowthFactor); } layerDepth[i] = currentDepth + layerThickness[i] * 0.5; diff --git a/bin/CRITERIA3D/shared/project3D.h b/bin/CRITERIA3D/shared/project3D.h index 0b69ad67f..233fdcb13 100644 --- a/bin/CRITERIA3D/shared/project3D.h +++ b/bin/CRITERIA3D/shared/project3D.h @@ -24,18 +24,22 @@ bool computeAllSoilDepth; bool isInitialWaterPotential; - double initialWaterPotential; // [m] - double initialDegreeOfSaturation; // [-] + double initialWaterPotential; // [m] + double initialDegreeOfSaturation; // [-] - double imposedComputationDepth; // [m] - double conductivityHorizVertRatio; // [-] + double imposedComputationDepth; // [m] + double conductivityHorizVertRatio; // [-] - int modelAccuracy; // [-] + int modelAccuracy; // [-] bool freeCatchmentRunoff; bool freeLateralDrainage; bool freeBottomDrainage; + double minSoilLayerThickness; // [m] minimum thickness of soil layers + double maxSoilLayerThickness; // [m] maximum thickness of soil layers + double maxSoilLayerThicknessDepth; // [m] depth at which the layers must have maximum thickness + WaterFluxesParameters(); void initialize(); @@ -127,13 +131,9 @@ soil::Crit3DFittingOptions fittingOptions; // layers - double minThickness; // [m] minimum thickness of soil layers - double maxThickness; // [m] maximum thickness of soil layers - double maxThicknessDepth; // [m] depth at which the layers must have maximum thickness - double thicknessGrowthFactor; // [-] progressive growth factor of layer thicknesses - std::vector layerDepth; // [m] std::vector layerThickness; // [m] + double soilLayerThicknessGrowthFactor; // [-] progressive growth factor of layer thicknesses double previousTotalWaterContent; // [m3]