Skip to content

Commit

Permalink
correct wrong index
Browse files Browse the repository at this point in the history
  • Loading branch information
MostafaGomaa93 authored Jul 30, 2024
1 parent 8cce9c6 commit 06d2953
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/+energy/assembleCoefficientMatrices.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
SV = SoilVariables;

if ModelSettings.Soilairefc && ModelSettings.Thmrlefc
RHS(indxBotm) = -C7(indxBotm) + (C2(indxBotm, 1) * SV.T(indxBotm) + C2(indxBotm, 2) * SV.T(2)) / Delt_t ...
RHS(indxBotm) = -C7(indxBotm) + (C2(indxBotm, 1) * SV.T(indxBotm) + C2(indxBotm, 2) * SV.T(indxBotm + 1)) / Delt_t ...
- (C1(indxBotm, 1) / Delt_t + C4(indxBotm, 1)) * SV.hh(indxBotm) - (C1(indxBotm, 2) / Delt_t + C4(indxBotm, 2)) * SV.hh(indxBotm + 1) ...
- (C3(indxBotm, 1) / Delt_t + C6(indxBotm, 1)) * P_gg(indxBotm) - (C3(indxBotm, 2) / Delt_t + C6(indxBotm, 2)) * P_gg(indxBotm + 1) ...
+ (C3(indxBotm, 1) / Delt_t) * P_g(indxBotm) + (C3(indxBotm, 2) / Delt_t) * P_g(indxBotm + 1) ...
Expand Down Expand Up @@ -79,7 +79,7 @@
+ (C1(n - 1, 2) / Delt_t) * SV.h(n - 1) + (C1(n, 1) / Delt_t) * SV.h(n);

else
RHS(indxBotm) = -C7(indxBotm) + (C2(indxBotm, 1) * SV.T(indxBotm) + C2(1, 2) * SV.T(indxBotm + 1)) / Delt_t;
RHS(indxBotm) = -C7(indxBotm) + (C2(indxBotm, 1) * SV.T(indxBotm) + C2(indxBotm, 2) * SV.T(indxBotm + 1)) / Delt_t;
for i = indxBotm + 1:ModelSettings.NL
RHS(i) = -C7(i) + (C2(i - 1, 2) * SV.T(i - 1) + C2(i, 1) * SV.T(i) + C2(i, 2) * SV.T(i + 1)) / Delt_t;
end
Expand Down

0 comments on commit 06d2953

Please sign in to comment.