Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ARPA-SIMC/CRITERIA3D
Browse files Browse the repository at this point in the history
  • Loading branch information
giadasan committed Jul 30, 2024
2 parents 3ac18a9 + 5892f9a commit d1c6b5a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion agrolib/soilFluxes3D/header/soilFluxes3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
__EXTERN int DLL_EXPORT __STDCALL setNodeSurface(long nodeIndex, int surfaceIndex);

// WATER
__EXTERN int DLL_EXPORT __STDCALL setHydraulicProperties(int waterRetentionCurve, int conductivityMeanType, float horizVertRatioConductivity);
__EXTERN int DLL_EXPORT __STDCALL setHydraulicProperties(int waterRetentionCurve, int conductivityMeanType, float conductivityHorizVertRatio);
__EXTERN int DLL_EXPORT __STDCALL setWaterContent(long index, double myWaterContent);
__EXTERN int DLL_EXPORT __STDCALL setDegreeOfSaturation(long nodeIndex, double degreeOfSaturation);
__EXTERN int DLL_EXPORT __STDCALL setMatricPotential(long index, double psi);
Expand Down
2 changes: 1 addition & 1 deletion agrolib/soilFluxes3D/header/solver.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SOLVER_H
#define SOLVER_H

inline double square(double x) {return ((x)*(x));}
inline double square(double x) { return ((x)*(x)); }

double distance(unsigned long index1, unsigned long index2);

Expand Down
8 changes: 4 additions & 4 deletions agrolib/soilFluxes3D/soilFluxes3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,18 @@ int DLL_EXPORT __STDCALL setNumericalParameters(float minDeltaT, float maxDeltaT
* k_lateral_vertical_ratio = 10
* \param waterRetentionCurve
* \param conductivityMeanType
* \param horizVertRatioConductivity
* \param conductivityHorizVertRatio
* \return OK or PARAMETER_ERROR
*/
int DLL_EXPORT __STDCALL setHydraulicProperties(int waterRetentionCurve,
int conductivityMeanType, float horizVertRatioConductivity)
int conductivityMeanType, float conductivityHorizVertRatio)
{
myParameters.waterRetentionCurve = waterRetentionCurve;
myParameters.meanType = conductivityMeanType;

if ((horizVertRatioConductivity >= 0.1) && (horizVertRatioConductivity <= 100))
if ((conductivityHorizVertRatio >= 0.1) && (conductivityHorizVertRatio <= 100))
{
myParameters.k_lateral_vertical_ratio = horizVertRatioConductivity;
myParameters.k_lateral_vertical_ratio = conductivityHorizVertRatio;
return CRIT3D_OK;
}
else
Expand Down
7 changes: 7 additions & 0 deletions bin/CRITERIA3D/dialogWaterFluxesSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
QLineEdit *initialWaterPotentialEdit;
QLineEdit *initialDegreeOfSaturationEdit;
QLineEdit *imposedComputationDepthEdit;
QLineEdit *conductivityHVRatioEdit;

bool _isUpdateAccuracy;

Expand All @@ -34,6 +35,12 @@

DialogWaterFluxesSettings();

double getConductivityHVRatio() const
{ return conductivityHVRatioEdit->text().toDouble(); }

void setConductivityHVRatio(double value)
{ conductivityHVRatioEdit->setText(QString::number(value)); }

double getInitialWaterPotential() const
{ return initialWaterPotentialEdit->text().toDouble(); }

Expand Down
4 changes: 2 additions & 2 deletions bin/CRITERIA3D/shared/project3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void WaterFluxesParameters::initialize()
initialDegreeOfSaturation = 0.8; // [-]

imposedComputationDepth = 1.0; // [m]
horizVertRatioConductivity = 10.0; // [-] default: ten times
conductivityHorizVertRatio = 10.0; // [-] default: ten times

modelAccuracy = 3; // [-] default: error on the third digit
}
Expand Down Expand Up @@ -407,7 +407,7 @@ bool Project3D::initialize3DModel()
}
logInfo("Node properties initialized");

soilFluxes3D::setHydraulicProperties(MODIFIEDVANGENUCHTEN, MEAN_LOGARITHMIC, waterFluxesParameters.horizVertRatioConductivity);
soilFluxes3D::setHydraulicProperties(MODIFIEDVANGENUCHTEN, MEAN_LOGARITHMIC, waterFluxesParameters.conductivityHorizVertRatio);

double vmax = 10.0; // [m s-1]
if (waterFluxesParameters.modelAccuracy < 3)
Expand Down
10 changes: 6 additions & 4 deletions bin/CRITERIA3D/shared/project3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
class WaterFluxesParameters
{
public:
bool computeOnlySurface;
bool computeAllSoilDepth;

bool isInitialWaterPotential;
double initialWaterPotential; // [m]
double initialDegreeOfSaturation; // [-]
bool isInitialWaterPotential;

double imposedComputationDepth; // [m]
double horizVertRatioConductivity; // [-]
double conductivityHorizVertRatio; // [-]

int modelAccuracy; // [-]

bool freeCatchmentRunoff;
bool freeLateralDrainage;
bool freeBottomDrainage;
bool computeOnlySurface;
bool computeAllSoilDepth;

WaterFluxesParameters();

void initialize();
};

Expand Down

0 comments on commit d1c6b5a

Please sign in to comment.