-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from EcoExtreML/SSM_v.0.3.2
Update the code to count for groundwater (SSM v.0.3.2)
- Loading branch information
Showing
36 changed files
with
984 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
function [AirVariabes, RHS, SAVE, P_gg] = solveDryAirEquations(SoilVariables, GasDispersivity, TransportCoefficient, InitialValues, VaporVariables, ... | ||
BoundaryCondition, ForcingData, P_gg, P_g, Xah, XaT, Xaa, RHODA, KT, Delt_t) | ||
BoundaryCondition, ForcingData, P_gg, P_g, Xah, XaT, Xaa, RHODA, KT, Delt_t, GroundwaterSettings) | ||
%{ | ||
Solve the dry air equation with the Thomas algorithm to update the soil | ||
air pressure 'P_gg', the finite difference time-stepping scheme is | ||
exampled as for the soil moisture equation, which derived in 'STEMMUS | ||
Technical Notes' section 4, Equation 4.32. | ||
%} | ||
AirVariabes = dryair.calculateDryAirParameters(SoilVariables, GasDispersivity, TransportCoefficient, InitialValues, VaporVariables, ... | ||
P_gg, Xah, XaT, Xaa, RHODA); | ||
P_gg, Xah, XaT, Xaa, RHODA, GroundwaterSettings); | ||
|
||
AirMatrices = dryair.calculateMatricCoefficients(AirVariabes, InitialValues); | ||
AirMatrices = dryair.calculateMatricCoefficients(AirVariabes, InitialValues, GroundwaterSettings); | ||
|
||
[RHS, AirMatrices, SAVE] = dryair.assembleCoefficientMatrices(AirMatrices, SoilVariables, Delt_t, P_g); | ||
[RHS, AirMatrices, SAVE] = dryair.assembleCoefficientMatrices(AirMatrices, SoilVariables, Delt_t, P_g, GroundwaterSettings); | ||
|
||
[RHS, AirMatrices] = dryair.calculateBoundaryConditions(BoundaryCondition, AirMatrices, ForcingData, RHS, KT); | ||
[RHS, AirMatrices] = dryair.calculateBoundaryConditions(BoundaryCondition, AirMatrices, ForcingData, RHS, KT, P_gg, GroundwaterSettings); | ||
|
||
[AirMatrices, P_gg, RHS] = dryair.solveTridiagonalMatrixEquations(RHS, AirMatrices); | ||
[AirMatrices, P_gg, RHS] = dryair.solveTridiagonalMatrixEquations(RHS, AirMatrices, GroundwaterSettings); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
function [AirMatrices, P_gg, RHS] = solveTridiagonalMatrixEquations(RHS, AirMatrices) | ||
function [AirMatrices, P_gg, RHS] = solveTridiagonalMatrixEquations(RHS, AirMatrices, GroundwaterSettings) | ||
%{ | ||
Use Thomas algorithm to solve the tridiagonal matrix equations, which is | ||
in the form of Equation 4.25 STEMMUS Technical Notes, page 41. | ||
%} | ||
|
||
ModelSettings = io.getModelSettings(); | ||
RHS(1) = RHS(1) / AirMatrices.C6(1, 1); | ||
|
||
for i = 2:ModelSettings.NN | ||
if ~GroundwaterSettings.GroundwaterCoupling % no Groundwater coupling, added by Mostafa | ||
indxBotm = 1; % index of bottom layer is 1, STEMMUS calculates from bottom to top | ||
else % Groundwater Coupling is activated | ||
% index of bottom layer after neglecting saturated layers (from bottom to top) | ||
indxBotm = GroundwaterSettings.indxBotmLayer; | ||
end | ||
|
||
RHS(indxBotm) = RHS(indxBotm) / AirMatrices.C6(indxBotm, 1); | ||
|
||
for i = indxBotm + 1:ModelSettings.NN | ||
AirMatrices.C6(i, 1) = AirMatrices.C6(i, 1) - AirMatrices.C6_a(i - 1) * AirMatrices.C6(i - 1, 2) / AirMatrices.C6(i - 1, 1); | ||
RHS(i) = (RHS(i) - AirMatrices.C6_a(i - 1) * RHS(i - 1)) / AirMatrices.C6(i, 1); | ||
end | ||
|
||
for i = ModelSettings.NL:-1:1 | ||
for i = ModelSettings.NL:-1:indxBotm | ||
RHS(i) = RHS(i) - AirMatrices.C6(i, 2) * RHS(i + 1) / AirMatrices.C6(i, 1); | ||
end | ||
|
||
for i = 1:ModelSettings.NN | ||
for i = indxBotm:ModelSettings.NN | ||
P_gg(i) = RHS(i); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.