-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoil_Functions.py
1600 lines (1385 loc) · 67.2 KB
/
Soil_Functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import numpy
import math
from SoilFunctionsDef import SoilParametersTotal,ConductivitySuction,SoilThermalProperties,SoilParameters,SoilMoistureConductivityUpdate,Infiltration2Def,LeakageBottomDef,SoilWaterMultiLayerDef,VolumeCorrectionDef
import copy
'''
Soil Functions:
Developed by Mohsen Moradi
Atmospheric Innovations Research (AIR) Laboratory, University of Guelph, Guelph, Canada
Last update: June 2021
'''
class Soil_Calculations(object):
def Conductivity_Suction(self,SPAR,Ks,Osat,Ohy,L,Pe,O33,alpVG,nVG,O):
"""
------
INPUT:
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
Ks: Hydraulic conductivity at saturation for each soil layer [mm s^-1]
Osat: Water content at saturation, saturation moisture 0 kPa [-]
Ohy: Hygroscopic Moisture Evaporation cessation 10000 kPa - 10 MPa - 1000 m [-]
L: Slope of logarithmic tension-moisture curve [-]
Pe: Tension at air entry (bubbling pressure) [kPa]
O33: 33 kPa Moisture [-]
alpVG: Alpha parameter Van-Genuchten soil water retention curve [mm^-1]
nVG: n parameter Van-Genuchten soil water retention curve [mm^-1]
O: Soil moisture/water content in the different soil layers [-]
-------
OUTPUT:
Ko: Hydraulic conductivity at O [mm s^-1]
Po: Tension at O [mm]
"""
if SPAR == 1:
# [-]
Se = (O - Ohy)/ (Osat - Ohy)
# [mm]
mVG = 1 - 1 / nVG
# Tension at O [mm]
Po = -(1 / alpVG) * ((Se) ** (-1. / mVG) - 1) ** (1. / nVG)
# Hydraulic conductivity at O [mm s^-1]
Ko = Ks * ((Se) ** (0.5)) * (1 - (1 - (Se) ** (1. / mVG)) ** mVG) ** 2
else:
# Specific weight water[N m^-3]
gw = 9810
B = 1 / L
# Coefficient of moisture tension
if O33 == 0:
A = 0
else:
A = numpy.exp(math.log(33) + B * math.log(O33))
# Equation 17 in Saxton and Rawls, 2006. [mm s^-1]
Ko = Ks * (O / Osat) ** (3 + (2 / L))
IFCond = numpy.all(O<O33)
if IFCond:
# [kPa]
Psi = A * (O**(-B))
else:
# [kPa]
Psi = 33 - ((O - O33) * (33 - Pe) / (Osat - O33))
# Tension at O [mm]
Po = 1000 * 1000 * Psi / (gw)
self.CondSuc = ConductivitySuction()
self.CondSuc.Ko = Ko # [mm s^-1]
self.CondSuc.Po = Po # [mm]
return Ko,Po
def Infiltration_2(self,Osat,Ohy,L,alpVG,nVG,Pe,Ks_Zs,O33,SPAR,O,Dz,WIS,cosalp,Pond,dts):
"""
------
INPUT:
Osat: Water content at saturation, saturation moisture 0 kPa [-]
Ohy: Hygroscopic Moisture Evaporation cessation 10000 kPa - 10 MPa - 1000 m [-]
L: Slope of logarithmic tension-moisture curve [-]
alpVG: Alpha parameter Van-Genuchten soil water retention curve [mm^-1]
nVG: n parameter Van-Genuchten soil water retention curve [mm^-1]
Pe: Tension at air entry (bubbling pressure) [kPa]
Ks_Zs: Hydraulic conductivity at saturation for each soil layer [mm s^-1]
O33: 33 kPa Moisture [-]
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
O: Soil moisture/water content in the different soil layers [-]
Dz: Distance from surface to half-layer [mm]
WIS: Water Incoming to Soil Layer [mm s^-1]
cosalp: model constant
Pond: Interception/ponding from the previous time step as an indicator if there is ponding infiltration [mm s^-1]
dts: Time step [s]
-------
OUTPUT:
f: Infiltration rate [mm s^-1]
fpot: Potential Infiltration rate [mm s^-1]
"""
if SPAR ==1:
PAE = 0
else:
gw = 9810
# Suction at air entry (bubbling pressure) [mm]
PAE = -1000*1000*Pe/(gw)
# [mm]
P0 = max(Pond*dts,0.0)
self.Conductivity_Suction(SPAR,Ks_Zs,Osat,Ohy,L,Pe,O33,alpVG,nVG,O)
Ko = self.CondSuc.Ko # [mm s^-1]
Po = self.CondSuc.Po # [mm]
# Water Potential [mm]
P = -Po
Khalf = 0.5 * (Ko + Ks_Zs)
# Potential Infiltration rate [mm s^-1]
fpot = Khalf*(1*cosalp-(-PAE+(P-P0))/Dz)
# Infiltration rate [mm s^-1]
f = max(0, min(fpot, WIS))
self.Infiltration2 = Infiltration2Def()
self.Infiltration2.f = f
self.Infiltration2.fpot = fpot
return f,fpot
def Leakage_Bottom(self,O,Ks_Zs,Osat,Ohy,L,nVG,Kbot,ms,SPAR):
"""
------
INPUT:
O: Soil moisture in the different soil layers [-]
Ks_Zs: Hydraulic conductivity at saturation for each soil layer [mm s^-1]
Osat: Water content at saturation, saturation moisture 0 kPa [-]
Ohy: Hygroscopic Moisture Evaporation cessation 10000 kPa - 10 MPa - 1000 m [-]
L: Slope of logarithmic tension-moisture curve
nVG: n parameter Van-Genuchten soil water retention curve [mm^-1]
Kbot: Conductivity at the bedrock layer [mm s^-1]
ms: Number of soil layers [-]
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
-------
OUTPUT:
Lk: Leakage [mm s^-1]
"""
if numpy.isnan(Kbot):
if SPAR == 1:
Se = (O[ms-1] - Ohy[ms-1]) / (Osat[ms-1] - Ohy[ms-1])
mVG = 1 - 1 / nVG[ms]
# Estimation Conductivity last layer [mm s^-1]
Ko = Ks_Zs[ms-1] * ((Se)**(0.5)) * (1 - (1 - (Se)**(1 / mVG))**mVG)**2
else:
# Estimation Conductivity last layer [mm s^-1]
Ko = Ks_Zs[ms-1] * (O[ms-1]/ Osat[ms-1])**(3 + (2 / L[ms-1]))
Lk = Ko
else:
if O[ms-1] > Osat[ms-1]-1e-5:
Lk = Kbot
else:
Lk = 0
self.LeakageBottom = LeakageBottomDef()
self.LeakageBottom.Lk = Lk
return Lk
def Root_Fraction_General(self,Zs,CASE_ROOT,ZR95_H,ZR50_H,ZR95_L,ZR50_L,ZRmax_H,ZRmax_L):
# RfH_Zs : Root Fraction for High Vegetation [1...m] [%]
# RfL_Zs : Root Fraction for Low Vegetation [1...m] [%]
n = len(Zs) - 1
RfH_Zs = numpy.zeros(n)
RfL_Zs = numpy.zeros(n)
if numpy.isnan(ZRmax_H):
if ZR95_H > Zs[n] or ZR95_L > Zs[n] or ZRmax_L > Zs[n]:
print('ERROR: LAST LAYER TOO SHALLOW FOR ACCOMODATING ROOTS')
elif numpy.isnan(ZRmax_L):
if ZR95_H > Zs[n] or ZR95_L > Zs[n] or ZRmax_H > Zs[n]:
print('ERROR: LAST LAYER TOO SHALLOW FOR ACCOMODATING ROOTS')
elif numpy.isnan(ZRmax_H) and numpy.isnan(ZRmax_L):
if ZR95_H > Zs[n] or ZR95_L > Zs[n]:
print('ERROR: LAST LAYER TOO SHALLOW FOR ACCOMODATING ROOTS')
else:
if ZR95_H > Zs[n] or ZR95_L > Zs[n] or ZRmax_H > Zs[n] or ZRmax_L > Zs[n]:
print('ERROR: LAST LAYER TOO SHALLOW FOR ACCOMODATING ROOTS')
if CASE_ROOT ==1: # Exponential Profile
# Shape of Root Distribution [mm^-1]
eta_H = 3. / ZR95_H if ZR95_H != 0 else numpy.inf
eta_L = 3. / ZR95_L if ZR95_L != 0 else numpy.inf
i = 0
if ZR95_H != 0:
while i <= n-1: ### n-1 is right???
if ZR95_H > Zs[i+1]:
RfH_Zs[i] = numpy.exp(-eta_H * Zs[i]) - numpy.exp(-eta_H * Zs[i + 1])
else:
RfH_Zs[i] = numpy.exp(-eta_H * Zs[i]) - numpy.exp(-eta_H * ZR95_H)
i = n-1
i = i+1
i = 0
if ZR95_L != 0:
while i <= n-1:
if ZR95_L > Zs[i+1]:
RfL_Zs[i] = numpy.exp(-eta_L * Zs[i]) - numpy.exp(-eta_L * Zs[i+1])
else:
RfL_Zs[i] = numpy.exp(-eta_L * Zs[i]) - numpy.exp(-eta_L * ZR95_L)
i = n-1
i = i+1
# Water Content for the Root
Rto1 = 0.9502
# Root Proportion in the Layer
RfH_Zs[:] = RfH_Zs[:] / Rto1
RfL_Zs[:] = RfL_Zs[:] / Rto1
# Linear Dose Response
# Schenk and Jackson 2002, Collins and Bras 2007
if CASE_ROOT ==2:
c_H = 2.94 / math.log(ZR50_H / ZR95_H)
c_L = 2.94 / math.log(ZR50_L / ZR95_L)
i = 0
if ZR95_H != 0:
while i <= n-1:
if ZR95_H > Zs[i+1]:
RfH_Zs[i] = 1 / (1 + (Zs[i+1] / ZR50_H)**c_H) - 1 / (1+(Zs[i]/ZR50_H)**c_H)
else:
RfH_Zs[i] = 1 / (1 + (ZR95_H / ZR50_H)**c_H) - 1 / (1+(Zs[i]/ZR50_H)**c_H)
i = n-1
i = i+1
i = 0
if ZR95_L != 0:
while i <= n-1:
if ZR95_L > Zs[i+1]:
RfL_Zs[i] = 1 / (1 + (Zs[i+1] / ZR50_L)**c_L) - 1 / (1+(Zs[i]/ZR50_L)**c_L)
else:
RfL_Zs[i] = 1 / (1 + (ZR95_L / ZR50_L)**c_L) - 1 / (1+(Zs[i]/ZR50_L)**c_L)
i = n-1
i = i+1
Rto1 = 0.9498
# Root Proportion in the Layer
RfH_Zs[:] = RfH_Zs[:] / Rto1
RfL_Zs[:] = RfL_Zs[:] / Rto1
# Constant Profile
if CASE_ROOT == 3:
i = 0
if ZR95_H != 0:
while i <= n-1:
if ZR95_H > Zs[i+1]:
RfH_Zs[i] = (Zs[i+1]-Zs[i])/ZR95_H
else:
RfH_Zs[i] = (ZR95_H - Zs[i]) / ZR95_H
i = n-1
i = i+1
i = 1
if ZR95_L != 0:
while i <= n-1:
if ZR95_L > Zs[i+1]:
RfL_Zs[i] = (Zs[i+1]-Zs[i])/ZR95_L
else:
RfL_Zs[i] = (ZR95_L - Zs[i]) / ZR95_L
i = n-1
i = i+1
# Deep (Tap) Root Profile
if CASE_ROOT == 4:
c_H = 2.94 / math.log(ZR50_H / ZR95_H)
c_L = 2.94 / math.log(ZR50_L / ZR95_L)
i = 0
if ZR95_H != 0:
while i <= n-1:
if ZR95_H > Zs[i + 1]:
RfH_Zs[i] = 1 / (1 + (Zs[i+1] / ZR50_H)**c_H) - 1/(1+(Zs[i]/ZR50_H)**c_H)
elif ZR95_H <= Zs[i+1] and ZR95_H > Zs[i]:
RfH_Zs[i] = 1 / (1 + (ZR95_H / ZR50_H)**c_H) - 1/(1+(Zs[i]/ZR50_H)**c_H)
if ZRmax_H[j] <= Zs[i+1]:
RfH_Zs[i] = RfH_Zs[i] + 0.0502*(ZRmax_H- ZR95_H) / (ZRmax_H - ZR95_H)
i = n-1
else:
RfH_Zs[i] = RfH_Zs[i] + 0.0502*(Zs[i+1] - ZR95_H) / (ZRmax_H - ZR95_H)
elif ZRmax_H > Zs[i+1]:
RfH_Zs[i] = 0.0502 * (Zs[i + 1] - Zs[i]) / (ZRmax_H - ZR95_H)
else:
RfH_Zs[i] = 0.0502 * (ZRmax_H - Zs[i]) / (ZRmax_H - ZR95_H)
i = n-1
i = i+1
i = 1
if ZR95_L != 0:
while i <= n-1:
if ZR95_L > Zs[i+1]:
RfL_Zs[i] = 1/(1 + (Zs[i+1]/ZR50_L)**c_L) - 1/(1 + (Zs[i]/ZR50_L)**c_L)
elif ZR95_L <= Zs[i+1] and ZR95_L > Zs[i]:
RfL_Zs[i] = 1/(1 + (ZR95_L / ZR50_L)**c_L) - 1/(1 + (Zs[i]/ZR50_L)**c_L)
if ZRmax_L <= Zs[i+1]:
RfL_Zs[i] = RfL_Zs[i] + 0.0502*(ZRmax_L - ZR95_L) / (ZRmax_L - ZR95_L)
i = n-1
else:
RfL_Zs[i] = RfL_Zs[i] + 0.0502*(Zs[i + 1] - ZR95_L) / (ZRmax_L - ZR95_L)
elif ZRmax_L > Zs[i+1]:
RfL_Zs[i] = 0.0502 * (Zs[i + 1] - Zs[i]) / (ZRmax_L - ZR95_L)
else:
RfL_Zs[i] = 0.0502 * (ZRmax_L - Zs[i]) / (ZRmax_L - ZR95_L)
i = n-1
i = i+1
return RfH_Zs,RfL_Zs
def Root_Soil_Conductance(self,Ks,Rl,rcyl,rroot,Zr):
# Re-define input parameters which are overwritten in this function
Zr_local = copy.copy(Zr)
Ks_local = copy.copy(Ks)
# Rooting depth [m]
Zr_local = Zr_local / 1000
# water density [kg m^-3]
row = 1000
# gravity acceleration [m s^-2]
g = 9.81
# water density [mmolH20 kg^-1]
rho = 55555
# [m MPa^-1]
CF = 10**6 / (row * g)
# [m s^-1]
Ks_local = Ks_local / 1000
OPT = 3
if OPT == 1:
# [s^-1]
gsr = Ks_local * numpy.sqrt(Rl / (2 * Zr_local))
# [m s^-1 MPa^-1]
gsr = gsr * CF
# [mmol H20 m^-2 ground s MPa]
Ksr = gsr * row * rho
if OPT == 2:
# Radial conductivity or root [s^-1]
Kr = 5 * 1e-08 / CF
# Radial thickness of the rhizosphere [m]
Lrs = rcyl
# [s^-1]
gsr = numpy.sqrt(Ks_local * Kr / Lrs)
# [mmol H20 m^-2 ground s MPa]
Ksr = gsr * CF * row * rho
if OPT == 3:
# [s^-1]
gsr = Ks_local * Rl * (2 * numpy.pi) / (math.log(rcyl / rroot))
Ksr = gsr * CF * row * rho # [mmol H20 m^-2 ground s MPa]
return Ksr
def Soil_Parameters(self,Psan,Pcla,Porg):
# Note that Pcla+Psan+Porg must be less than 1
Psil = 1 - Psan - Pcla - Porg
if Psil < 0:
print('SOIL PERCENTAGE INPUTS INCONSISTENT')
# Weight fraction of gravel [g Gravel g^-1 bulk soil]
Rw = 0
# Density factor
DF = 1
# Fraction of organic material in the soil in percent ### ???
Porg_perc = Porg * 100
O1500t = -0.024 * Psan + 0.487 * Pcla + 0.006 * Porg_perc + 0.005 * (Psan * Porg_perc) - 0.013 * (
Pcla * Porg_perc) + 0.068 * (Psan * Pcla) + 0.031
O1500 = O1500t + 0.14 * O1500t - 0.02 # 1500 kPa Moisture
O33t = -0.251 * Psan + 0.195 * Pcla + 0.011 * Porg_perc + 0.006 * (Psan * Porg_perc) - 0.027 * (
Pcla * Porg_perc) + 0.452 * (Psan * Pcla) + 0.299
O33 = O33t + (1.283 * O33t ** 2 - 0.374 * O33t - 0.015) # 33 kPa Moisture
Os_33t = 0.278 * Psan + 0.034 * Pcla + 0.022 * Porg_perc - 0.018 * (Psan * Porg_perc) - 0.027 * (
Pcla * Porg_perc) - 0.584 * (Psan * Pcla) + 0.078
Os_33 = Os_33t + (0.636 * Os_33t - 0.107) # SAT - 33 kPa Moisture
# Coefficient of moisture tension
B = (math.log(1500) - math.log(33)) / (math.log(O33) - math.log(O1500))
# Coefficient of moisture tension
A = numpy.exp(math.log(33) + B * math.log(O33))
# Slope of logarithmic tension-moisture curve [-]
L = 1 / B
# Saturation moisture 0 kPa []
Osat = O33 + Os_33 - 0.097 * Psan + 0.043
# Normal density dry soil [kg m^-3] (Equation 6 in Saxton and Rawls, 2006)
rsd = (1 - Osat) * 2650
# Adjust density density dry soil [kg m^-3]
rsd_df = rsd * DF
# Saturation moisture 0 kPa [%]
Osat_df = 1 - (rsd_df / 2650)
# 33 kPa Moisture [%]
O33_df = O33 - 0.2 * (Osat - Osat_df)
# SAT-33 kPa Moisture [%]
Os_33_df = Osat_df - O33_df
Osat = Osat_df
O33 = O33_df
Os_33 = Os_33_df
rsd = rsd_df
# Saturation conductivity [mm s^-1]
Ks = (1930 * (Osat - O33) ** (3 - L))/3600
# Tension at air entry, first solution, [kPa]
Pet = -21.67 * Psan - 27.93 * Pcla - 81.97 * Os_33 + 71.12 * (Psan * Os_33) + 8.29 * (Pcla * Os_33) + 14.05 * (
Psan * Pcla) + 27.16
# Tension at air entry (bubbling pressure) [kPa]
Pe = Pet + (0.02 * Pet ** 2 - 0.113 * Pet - 0.70)
if Pe < 0.5:
Pe = 0.5
# Gravel effects
# matric soil density / gravel density []
alpha = rsd / 2650
# Volume fraction of gravel [g cm^-3]
Rv = (alpha * Rw) / (1 - Rw * (1 - alpha))
# Bulk soil density (matric plus gravel), [g cm^-3]
rhoB = (rsd / 1000) * (1 - Rv) + (Rv * 2.65)
Osatb = Osat * (1 - Rv)
O33b = O33 * (1 - Rv)
# Saturated conductivity bulk soil [mm s^-1]
Kb = Ks * (1 - Rw) / (1 - Rw * (1 - 3 * alpha / 2))
rsd = rhoB * 1000 # [kg m^-3]
Osat = Osatb # [-]
O33 = O33b # [-]
Ks = Kb # [mm s^-1]
# -------------------------------
# Thermal characteristics of soil
# -------------------------------
# Normal density dry soil for thermal properties computing [kg m^-3]
rsd_s = 2700 * (1 - Osat)
# Thermal conductivity dry soil [W m^-1 K^-1]
lan_dry = (0.135 * rsd_s + 64.7) / (2700 - 0.947 * rsd_s)
# Thermal conductivity soil solid [W m^-1 K^-1]
lan_s = (8.8 * Psan + 2.92 * Pcla) / (Psan + Pcla)
# Volumetric heat capacity soil solid [J m^-3 K^-1]
cv_s = 1e+6 * (2.128 * Psan + 2.385 * Pcla) / (Psan + Pcla)
# -----------------
# K USLE Parameter
# -----------------
# Organic carbon
Porg_c = Porg / 1.72
fsand = (0.2 + 0.3 * numpy.exp(-25.6 * Psan * (1 - Psil)))
fcli = (Psil / (Pcla + Psil)) ** 0.3
forg = (1 - (0.25 * Porg_c) / (Porg_c + numpy.exp(3.72 - 2.95 * Porg_c)))
fhisand = (1 - (0.7 * (1 - Psan)) / ((1 - Psan) + numpy.exp(-5.51 - 22.9 * (1 - Psan))))
# K_Usle [ton h MJ^-1 mm^-1]
K_usle = fsand * fcli * forg * fhisand
# Erosivity factor [kg h J^-1 mm^-1]
K_usle = K_usle / 1000
self.SoilParam = SoilParameters()
self.SoilParam.Osat = Osat
self.SoilParam.L = L
self.SoilParam.Pe = Pe
self.SoilParam.Ks = Ks
self.SoilParam.O33 = O33
self.SoilParam.rsd = rsd
self.SoilParam.lan_dry = lan_dry
self.SoilParam.lan_s = lan_s
self.SoilParam.cv_s = cv_s
self.SoilParam.K_usle = K_usle
return Osat,L,Pe,Ks,O33,rsd,lan_dry,lan_s,cv_s,K_usle
def Soil_ParametersII(self,ms,Osat,L,Pe,Ks,O33,nVG,alpVG,Kfc,Pss,Pwp,Phy,Ohy,SPAR):
# nVG : n parameter Van-Genuchten soil water retention curve [mm^-1]
# L : Slope of logaritimc tension-moisture curve
# Kfc : Conductivity at field capacity [mm h^-1]
# Ks : saturation conductivity [mm s^-1]
# Ofc : Field Capacity Moisture [] Kns < 0.2 mm/h
# Oss : Stomatal closure begin moisture 30 kPa - 0.03 MPa - 3 m []
# Owp : Stomatal closure end moisture -Wilting point 3000 kPa - 3 MPa -300 m []
# Ohy : Hygroscopic Moisture Evaporation cessation 10000 kPa - 10 MPa - 1000 m []
# Re-define input parameters which are overwritten in this function
Pss_local = copy.copy(Pss)
Pwp_local = copy.copy(Pwp)
Ohy_local = copy.copy(Ohy)
if SPAR == 1:
mVG = 1 - 1 / nVG # [mm]
Pss_local = -101.9368 * Pss_local # [mm]
Se = 1 / ((1 + abs(alpVG * Pss_local)**nVG)**mVG)
Se[Se > 1] = 1
O = Ohy_local + (Osat - Ohy_local) * Se
Oss = O
Pwp_local = -101.9368 * Pwp_local # [mm]
Se = 1 / ((1 + abs(alpVG * Pwp_local)**nVG)**mVG)
Se[Se > 1] = 1
O = Ohy_local + (Osat - Ohy_local) * Se
Owp = O
Ofc = numpy.zeros(ms)
Ohy_local = numpy.zeros(ms)
else:
Ofc = numpy.zeros(ms)
Oss = numpy.zeros(ms)
Owp = numpy.zeros(ms)
Ohy_local = numpy.zeros(ms)
for i in range(0,ms):
B = 1/L[i]
# Coefficient of moisture tension
A = numpy.exp(math.log(33) + B * math.log(O33[i]))
if Pss_local < 33:
Oss[i] = O33[i] + (33 - Pss_local) * (Osat[i] - O33[i]) / (33 - Pe[i])
else:
Oss[i] = (Pss_local/A)**(-1/B)
if Pwp_local < 33:
Owp[i] = O33[i] + (33 - Pwp_local) * (Osat[i] - O33[i]) / (33 - Pe[i])
else:
Owp[i] = (Pwp_local / A)**(-1 / B)
if Phy < 33:
Ohy_local[i] = O33[i] + (33 - Phy) * (Osat[i] - O33[i]) / (33 - Pe[i])
else:
Ohy_local[i] = (Phy / A)**(-1 / B)
Ofc[i] = Osat[i] * ((Kfc/3600) / Ks[i])**(1 / (3 + (2 / L[i])))
return Ofc,Oss,Owp,Ohy_local
def Soil_Thermal_Properties(self,Tdp,rsd,lan_dry,lan_s,cv_s,Osat,Ohy,O):
"""
------
INPUT:
Tdp: Dampening temperature [C]
rsd: Dry soil density [kg m^-3]
lan_dry: Dry soil thermal conductivity [W m^-1 K^-1]
lan_s: Solid soil thermal conductivity [W m^-1 K^-1]
cv_s: Solid soil volumertic heat capacity [J m^-3 K^-1]
Osat: Water content at saturation [-]
Ohy: Residual / Hygroscopic / Wilting Point water content [-]
O: Soil moisture, soil water content at previous time step [-]
-------
OUTPUT:
CTt: Soil total thermal capacity [K m^2 J^-1]
lanS: Soil thermal conductivity [W m^-1 K^-1]
cv_Soil: Soil volumetric heat capacity [J m^-3 K^-1]
"""
# Re-define input parameters which are overwritten in this function
O_local = copy.copy(O)
# Water properties
# Density of water [kg m^-3]
row = 1000
# Thermal conductivity of water [W m^-1 K^-1]
lan_wat = 0.58
# Thermal conductivity of ice [W m^-1 K^-1]
lan_ice = 2.29
# Volumetric heat capacity of water [J m^-3 K^-1]
cv_w = 4186000
n = numpy.size(O_local)
# This if condition is used, because size of O will change
if n == 1:
# Thermal conductivity Soil [W m^-1 K^-1]
lanS = 0
# Volumetric heat capacity Soil [J m^-3 K^-1]
cv_Soil = 0
# Soil density [kg m^-3]
rsoil = 0
# Specific Heat of Soil [J kg^-1 K^-1]
cs_Soil = 0
if O_local < Ohy[0]:
O_local = Ohy[0]
if O_local > Osat[0]:
O_local = Osat[0]
# Frozen layer
Oice = [Osat[i] if Tdp < 0 else 0 for i in range(len(Osat))]
# Each soil layer
if Tdp > 0:
lan_sat = (lan_wat ** Osat[0]) * (lan_s[0] ** (1 - Osat[0]))
Ke = math.log((O_local + Oice[0]) / Osat[0]) + 1
Ke = Ke*int(Ke >= 0)
else:
# Liquid water content at saturation
Oliq = Osat[0] - Oice[0]
# Saturated Conductivity [W m^-1 K^-1]
lan_sat = (lan_wat ** Osat[0]) * (lan_s[0] ** (1 - Osat[0])) * (lan_ice ** (Osat[0] - Oliq))
Ke = (O_local + Oice[0]) / Osat[0]
if O_local/Osat[0] > 10**(-7):
# Thermal conductivity Soil [W m^-1 K^-1]
lanS = Ke * lan_sat + (1 - Ke) * lan_dry[0]
else:
# Thermal conductivity Soil [W m^-1 K^-1]
lanS = lan_dry[0]
# Volumetric heat capacity Soil [J m^-3 K^-1]
cv_Soil = cv_s[0] * (1 - Osat[0]) + O_local * cv_w
# Soil Density [kg m^-3]
rsoil = rsd[0] + (O_local - Ohy[0]) * row
# Specific Heat Soil [J kg^-1 K^-1]
cs_Soil = cv_Soil / rsoil
# time constant [s]
tau = 86400
# Total Thermal Capacity Soil [K m^2 J^-1]
CTt = 2 * (numpy.sqrt(numpy.pi / (lanS * cs_Soil * rsoil * tau)))
else:
# Thermal conductivity Soil [W m^-1 K^-1]
lanS = numpy.zeros(n)
# Volumetric heat capacity Soil [J m^-3 K^-1]
cv_Soil = numpy.zeros(n)
# Soil density [kg m^-3]
rsoil = numpy.zeros(n)
# Specific Heat of Soil [J kg^-1 K^-1]
cs_Soil = numpy.zeros(n)
for i in range(0,n):
if O_local[i] < Ohy[i]:
O_local[i] = Ohy[i]
for i in range(0,n):
if O_local[i] > Osat[i]:
O_local[i] = Osat[i]
# Frozen layer
Oice = Osat*int(Tdp < 0)
# Each soil layer
for i in range(n):
if Tdp > 0:
# Saturated Conductivity [W m^-1 K^-1]
lan_sat = (lan_wat ** Osat[i]) * (lan_s[i] ** (1 - Osat[i]))
# Kersten number
Ke = math.log((O_local[i] + Oice[i]) / Osat[i]) + 1
Ke = Ke * int(Ke >= 0)
else:
# Liquid water content at saturation
Oliq = Osat[i] - Oice[i]
# Saturated Conductivity [W m^-1 K^-1]
lan_sat = (lan_wat ** Osat[i]) * (lan_s[i] ** (1 - Osat[i])) * (lan_ice ** (Osat[i] - Oliq))
Ke = (O_local[i] + Oice[i]) / Osat[i]
if O_local[i]/Osat[i] > 10**(-7):
# Thermal conductivity Soil [W m^-1 K^-1]
lanS[i] = Ke * lan_sat + (1 - Ke) * lan_dry[i]
else:
# Thermal conductivity Soil [W m^-1 K^-1]
lanS[i] = lan_dry[i]
# Volumetric heat capacity Soil [J m^-3 K^-1]
cv_Soil[i] = cv_s[i] * (1 - Osat[i]) + O_local[i] * cv_w
# Soil Density [kg m^-3]
rsoil[i] = rsd[i] + (O_local[i] - Ohy[i]) * row
# Specific Heat Soil [J kg^-1 K^-1]
cs_Soil[i] = cv_Soil[i] / rsoil[i]
# time constant [s]
tau = 86400
# Total Thermal Capacity Soil [K m^2 J^-1]
CTt = 2 * (numpy.sqrt(numpy.pi / (lanS[0] * cs_Soil[0] * rsoil[0] * tau)))
self.SoilThProp = SoilThermalProperties()
self.SoilThProp.lanS = lanS
self.SoilThProp.cv_Soil = cv_Soil
self.SoilThProp.CTt = CTt
return lanS,cv_Soil,CTt
def Soil_Water_MultiLayer(self,V,Zs,dz,n,Osat,Ohy,nVG,alpVG,Ks_Zs,L,Pe,O33,SPAR,EvL_Zs,Inf_Zs,RfH_Zs,RfL_Zs,Rrootl_H,
Rrootl_L,PsiL50_H,PsiL50_L,PsiX50_H,PsiX50_L):
"""
------
INPUT:
V: Water content in each soil layer [mm]
Zs: Soil layer discretization [mm]
dz: Thickness of soil layers [mm]
n: Number of soil layers [-]
Osat: Water content at saturation, saturation moisture 0 kPa [-]
Ohy: MoistHygroscopicure Evaporation cessation 10000 kPa - 10 MPa - 1000 m [-]
nVG: n parameter Van-Genuchten soil water retention curve [mm^-1]
alpVG: Alpha parameter Van-Genuchten soil water retention curve [mm^-1]
Ks_Zs: Hydraulic conductivity at saturation for each soil layer [mm s^-1]
L: Slope of logarithmic tension-moisture curve
Pe: Tension at air entry (bubbling pressure) [kPa]
O33: 33 kPa Moisture [-]
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
EvL_Zs: Fraction of evaporation depth in a specific soil layer [-]
Inf_Zs: Fraction of infiltration depth in a specific soil layer [-]
RfH_Zs: Root Fraction for High Vegetation [1...m] [%]
RfL_Zs: Root Fraction for Low Vegetation [1...m] [%]
Rrootl_H: Root length index of high vegetation [m root m^-2 PFT]
Rrootl_L: Root length index of low vegetation [m root m^-2 PFT]
PsiL50_H: Water Potential at 50% loss conductivity of high vegetation [MPa]
PsiL50_L: Water Potential at 50% loss conductivity of low vegetation [MPa]
PsiX50_H: Water potential at 50 of xylem hydraulic conductivity and limit for water extraction from soil of high vegetation [MPa]
PsiX50_L: Water potential at 50 of xylem hydraulic conductivity and limit for water extraction from soil of low vegetation [MPa]
------
OUTPUT:
O: Water Content [1...m] Layer [-]
ZWT: [mm]
OF: Water Content for infiltration [-]
OS: Water Content for evaporation [-]
Psi_s_H: Soil water potential for first layer of vegetation [MPa]
Psi_s_L: Soil Water Potential for Second Layer of Vegetation [MPa]
gsr_H: Root soil conductance [mmol H20 m^-2 ground s^-1 MPa^-1]
gsr_L: Root soil conductance [mmol H20 m^-2 ground s^-1 MPa^-1]
Exwat_H: Maximum extractable water [mm m^2 m^-2 ground s^-1]
Exwat_L: Maximum extractable water [mm m^2 m^-2 ground s^-1]
Rd: Water table rise that reaches the surface level (Dunne Runoff) [mm]
WTR: Water table rise [mm]
POT: Soil water potential [mm]
OH: Water content for first layer of vegetation [-]
OL: Water content for second layer of vegetation [-]
"""
# Re-define input parameter which is overwritten in this function
n_local = copy.copy(n)
# Water Content [-] (n Layer)
O = numpy.ones(n_local)
# Water Table Rise [mm]
WTR = numpy.zeros(n_local)
for i in range(n_local-1,-1,-1):
if i == n_local-1:
O[i] = (V[i] / dz[i]) + Ohy[i]
WTR[i] = (O[i] - Osat[i]) * dz[i] * int(O[i] > Osat[i])
else:
O[i] = (V[i] + WTR[i + 1]) / dz[i] + Ohy[i]
WTR[i] = (O[i] - Osat[i]) * dz[i] * int(O[i] > Osat[i])
if O[i] < Ohy[i]:
O[i] = Ohy[i]
if O[i] > Osat[i]:
O[i] = Osat[i]
i = n_local-1
while O[i] > Osat[i]-1e-5 and i > -1:
i = i-1
ZWT = Zs[i + 1]
PHead = [(Zs[j] + dz[j]/2)-ZWT for j in range(0,len(dz))]
for i in range(0,len(PHead)):
if PHead[i] < 0:
PHead[i] = 0
# Compute First Potential
if SPAR == 1:
# Hydraulic Head
Se = [(O[j] - Ohy[j]) / (Osat[j] - Ohy[j]) for j in range(0,len(O))] # [-]
mVG = [1 - 1 / nVG[j] for j in range(0,len(nVG))] # [mm]
POT = [PHead[j] + (1 / alpVG[j]) * ((Se[j])**(-1 / mVG[j]) - 1)**(1 / nVG[j]) for j in range(0,len(nVG))]
else:
# Hydraulic Head
Ptem = numpy.zeros(n_local)
for jk in range(0,n_local):
CondSuc = self.Conductivity_Suction(2,Ks_Zs[jk],Osat[jk],Ohy[jk],L[jk],Pe[jk],O33[jk],alpVG[jk],nVG[jk],O[jk])
Ptem[jk] = CondSuc[1] # [mm]
POT = [PHead[j]-Ptem[j] for j in range(0,len(nVG))] # [mm]
if i == n_local-1:
ZWT = Zs[i + 1]
else:
if i == 0:
ZWT = 0
else:
# Find Water Table Depth
CZ = [Zs[j]+dz[j]/2 for j in range(0,len(dz))] # [mm]
ZWT = CZ[i + 1] + (CZ[i] - CZ[i + 1]) * (-POT[i + 1]) / (POT[i] - POT[i + 1]) # [mm]
# Recompute Potential
PHead = [Zs[j]+dz[j]/2-ZWT for j in range(0,len(dz))]
for i in range(0, len(PHead)):
if PHead[i] < 0:
PHead[i] = 0
# Recompute Potential
if SPAR == 1:
# Hydraulic Head
Se = [(O[j]-Ohy[j])/(Osat[j]-Ohy[j]) for j in range(0,len(O))] # [-]
mVG = [1-1/nVG[j] for j in range(0,len(nVG))] # [mm]
POT = [PHead[j] + (1/alpVG[j])*((Se[j])**(-1/mVG[j])-1)**(1/nVG[j]) for j in range(0,len(nVG))] # [mm]
else:
# Hydraulic Head
Ptem = numpy.zeros(n_local)
for jk in range(0,n_local):
CondSuc = self.Conductivity_Suction(2,Ks_Zs[jk],Osat[jk],Ohy[jk],L[jk],Pe[jk],O33[jk],alpVG[jk],nVG[jk],O[jk])
Ptem[jk] = CondSuc[1]
POT = [PHead[j] - Ptem[j] for j in range(0, len(nVG))] # [mm]
# Dunne Runoff [mm]
Rd = WTR[0]
# Evaporation Layer Water Content
# Evaporation Bare Soil WC [-]
OS = sum([EvL_Zs[j]*O[j] for j in range(0, len(O))])
# First layer
# Infiltration Water Content [-]
OF = sum([Inf_Zs[j]*O[j] for j in range(0, len(O))])
# VEGETATION
cc = 1
n_local = len(RfH_Zs)
for i in range(0,cc):
OH = sum([RfH_Zs[j]*O[j] for j in range(0,len(O))])
OL = sum([RfL_Zs[j]*O[j] for j in range(0,len(O))])
CondSuc = self.Conductivity_Suction(SPAR,sum([RfH_Zs[j]*Ks_Zs[j] for j in range(0,len(Ks_Zs))]),
sum([RfH_Zs[j]*Osat[j] for j in range(0,len(Osat))]),
sum([RfH_Zs[j]*Ohy[j] for j in range(0,len(Ohy))]),
sum([RfH_Zs[j]*L[j] for j in range(0,len(L))]),
sum([RfH_Zs[j]*Pe[j] for j in range(0,len(Pe))]),
sum([RfH_Zs[j]*O33[j] for j in range(0,len(O33))]),
sum([RfH_Zs[j]*alpVG[j] for j in range(0,len(alpVG))]),
sum([RfH_Zs[j]*nVG[j] for j in range(0,len(nVG))]),
OH)
Psi_s_H = CondSuc[1] # [mm]
CondSuc = self.Conductivity_Suction(SPAR, sum([RfL_Zs[j] * Ks_Zs[j] for j in range(0, len(Ks_Zs))]),
sum([RfL_Zs[j] * Osat[j] for j in range(0, len(Osat))]),
sum([RfL_Zs[j] * Ohy[j] for j in range(0, len(Ohy))]),
sum([RfL_Zs[j] * L[j] for j in range(0, len(L))]),
sum([RfL_Zs[j] * Pe[j] for j in range(0, len(Pe))]),
sum([RfL_Zs[j] * O33[j] for j in range(0, len(O33))]),
sum([RfL_Zs[j] * alpVG[j] for j in range(0, len(alpVG))]),
sum([RfL_Zs[j] * nVG[j] for j in range(0, len(nVG))]),
OL)
Psi_s_L = CondSuc[1] # [mm]
Psi_s_H = -(Psi_s_H/1000)*1000*9.81/1e+6 # [MPa]
Psi_s_L = -(Psi_s_L/1000)*1000*9.81/1e+6 # [MPa]
# Water density [mmol H20 m^-3]
rho2 = 55555555
# Radius cylinder of soil to which root has access to [m]
rcyl= 2.0*1e-3
# Root radius [m]
rroot = 0.5 * 1e-3
Psi_s = numpy.zeros(n_local)
gsr_L = numpy.zeros(n_local)
gsr_H = numpy.zeros(n_local)
for jk in range(0,n_local):
CondSuc = self.Conductivity_Suction(SPAR,Ks_Zs[jk],Osat[jk],Ohy[jk],L[jk],Pe[jk],O33[jk],alpVG[jk],nVG[jk],O[jk])
Ko = CondSuc[0] # [mm s^-1]
Psi_s[jk] = CondSuc[1] # [mm]
gsr_L[jk] = self.Root_Soil_Conductance(Ko,RfL_Zs[jk]*Rrootl_L,rcyl,rroot,dz[jk]) # [mmol H20 m^-2 ground s^-1 MPa^-1]
gsr_H[jk] = self.Root_Soil_Conductance(Ko,RfH_Zs[jk]*Rrootl_H,rcyl,rroot,dz[jk]) # [mmol H20 m^-2 ground s^-1 MPa^-1]
Psi_s = [-(Psi_s[j] / 1000) * 1000 * 9.81 / 1e+6 for j in range(0,len(Psi_s))] # [MPa]
Psi_minH = min(PsiX50_H, PsiL50_H)
Psi_minL = min(PsiX50_L, PsiL50_L)
# Max extractable water [mm m^2 m^-2 ground s^-1]
Exwat_L = gsr_L / rho2 * 1000 * (-numpy.tile(Psi_minL,(n_local)) + numpy.tile(Psi_s,(cc)))
Exwat_H = gsr_H / rho2 * 1000 * (-numpy.tile(Psi_minH,(n_local)) + numpy.tile(Psi_s,(cc)))
Exwat_L[Exwat_L < 0] = 0
Exwat_H[Exwat_H < 0] = 0
gsr_L = numpy.sum(gsr_L,axis=0) # [mmol H20 m^-2 ground s^-1 MPa^-1]
gsr_H = numpy.sum(gsr_H,axis=0) # [mmol H20 m^-2 ground s^-1 MPa^-1]
self.SoilWaterMultLay = SoilWaterMultiLayerDef()
self.SoilWaterMultLay.O = O # []
self.SoilWaterMultLay.ZWT = ZWT # [mm]
self.SoilWaterMultLay.OF = OF # []
self.SoilWaterMultLay.OS = OS # []
self.SoilWaterMultLay.Psi_s_H = Psi_s_H # [MPa]
self.SoilWaterMultLay.Psi_s_L = Psi_s_L # [MPa]
self.SoilWaterMultLay.gsr_H = gsr_H # [mmol H20 m^-2 ground s^-1 MPa^-1]
self.SoilWaterMultLay.gsr_L = gsr_L # [mmol H20 m^-2 ground s^-1 MPa^-1]
self.SoilWaterMultLay.Exwat_H = Exwat_H # [mm m^2 m^-2 ground s^-1]
self.SoilWaterMultLay.Exwat_L = Exwat_L # [mm m^2 m^-2 ground s^-1]
self.SoilWaterMultLay.Rd = Rd # [mm]
self.SoilWaterMultLay.WTR = WTR # [mm]
self.SoilWaterMultLay.POT = POT # [mm]
self.SoilWaterMultLay.OH = OH # []
self.SoilWaterMultLay.OL = OL # []
return O,ZWT,OF,OS,Psi_s_H,Psi_s_L,gsr_H,gsr_L,Exwat_H,Exwat_L,Rd,WTR,POT,OH,OL
def Soil_Parameters_Total(self,Pcla,Psan,Porg,Kfc,Phy,SPAR,Kbot,CASE_ROOT_H,CASE_ROOT_L,ZR95_H,ZR95_L,ZR50_H,ZR50_L,ZRmax_H,ZRmax_L,Zs):
"""
------
INPUT:
Pcla: Fraction of clay in the soil [-]
Psan: Fraction of sand in the soil [-]
Porg: Fraction of organic material in the soil [-]
Kfc: Conductivity at field capacity [mm h^-1]
Phy: Suction at the residual/hygroscopic water content [kPa]
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
Kbot: Conductivity at the bedrock layer [mm h^-1]
CASE_ROOT_H: Type of Root Profile of high vegetation
CASE_ROOT_L: Type of Root Profile of low vegetation
ZR95_H: Root depth 95 percentile of high vegetation [mm]
ZR95_L: Root depth 95 percentile of low vegetation [mm]
ZR50_H: Root depth 50 percentile of high vegetation [mm]
ZR50_L: Root depth 50 percentile of low vegetation [mm]
ZRmax_H: Maximum Root depth of high vegetation [mm]
ZRmax_L: Maximum Root depth of low vegetation [mm]
Zs: Soil layer discretization [mm]
-------
OUTPUT:
Zs: Soil layer discretization [mm]
dz: Thickness of soil layers [mm]
ms: Number of soil layers [-]
Osat: Water content at saturation, saturation moisture 0 kPa [-]
Ohy: MoistHygroscopicure Evaporation cessation 10000 kPa - 10 MPa - 1000 m [-]
nVG: n parameter Van-Genuchten soil water retention curve [mm^-1]
alpVG: Alpha parameter Van-Genuchten soil water retention curve [mm^-1]
Ks_Zs: Hydraulic conductivity at saturation for each soil layer [mm s^-1]
L: Slope of logarithmic tension-moisture curve
Pe: Tension at air entry (bubbling pressure) [kPa]
O33: 33 kPa Moisture [-]
SPAR: Soil parameter type (1:VanGenuchten, 2:Saxton-Rawls)
EvL_Zs: Fraction of evaporation depth in a specific soil layer [-]
Inf_Zs: Fraction of infiltration depth in a specific soil layer [-]
RfH_Zs: Root Fraction for High Vegetation [1...m] [%]
RfL_Zs: Root Fraction for Low Vegetation [1...m] [%]
Zinf: Depth of infiltration layer (=first layer) [mm]
Kbot: Conductivity at the bedrock layer [mm s^-1]
Slo_pot: [fraction dy/dx]
Dz: Delta Depth Between First Middle Layer and soil surface [mm]
aR: Anisotropy ratio
aTop: Ratio between Area and Contour-Lenght [mm]
rsd: Normal density dry soil [kg m^-3]
lan_dry: Thermal conductivity dry soil [W m^-1 K^-1]
lan_s: Thermal conductivity solid soil [W m^-1 K^-1]
cv_s: Volumetric heat capacity solid soil [J m^-3 K^-1]
"""
ms = len(Zs) - 1
# Thickness of the Layers [mm]
dz = numpy.diff(Zs)
Dz = numpy.zeros(ms)
for i in range(0,ms):
if i > 0:
# Delta Depth Between Middle Layer [mm]
Dz[i] = (dz[i]+dz[i-1])/2
else:
# Delta Depth Between First Middle Layer and soil surface [mm]
Dz[i] = dz[0]/2
# Depth of desorption, Depth of evaporation layer (=first layer) [mm]
Zdes = Zs[1] - Zs[0]
# Depth of infiltration layer (=first layer) [mm]
Zinf = Zs[1] - Zs[0]
# Fraction of evaporation depth in a specific soil layer [-]
EvL_Zs = self.Evaporation_Layers(Zs,Zdes)
# Fraction of infiltration depth in a specific soil layer [-]
Inf_Zs = self.Evaporation_Layers(Zs,Zinf)
# [fraction dy/dx]
Slo_pot = numpy.zeros(ms)
# Anisotropy ratio
aR = 1
cellsize = 1
# Ratio between Area and Contour-Lenght [mm]
aTop = 1000*cellsize**2/cellsize
#---------------------------------------------------------------------------------------
# Calculation of total thermal capacity out of soil composition for force restore method
#---------------------------------------------------------------------------------------
# Soil Parameters: characterization of soil parameters out of soil composition
SoilParam = self.Soil_Parameters(Psan,Pcla,Porg)
Osat = SoilParam[0] # Saturation moisture 0 kPa []
L = SoilParam[1] # Slope of logaritimc tension-moisture curve
Pe = SoilParam[2] # Tension at air entry (bubbling pressure) [kPa]
Ks = SoilParam[3] # saturation conductivity [mm s^-1]
O33 = SoilParam[4] # 33 kPa Moisture []
rsd = SoilParam[5] # density density dry soil [kg m^-3]
lan_dry = SoilParam[6]# Thermal conductivity dry soil [W m^-1 K^-1]
lan_s = SoilParam[7] # Thermal conductivity soil solid [W m^-1 K^-1]
cv_s = SoilParam[8] # Volumetric heat capacity soil solid [J m^-3 K^-1]
# Normal density dry soil [kg m^-3]
rsd = rsd*numpy.ones(ms)
# Thermal conductivity dry soil [W m^-1 K^-1]
lan_dry = lan_dry*numpy.ones(ms)
# Thermal conductivity solid soil [W m^-1 K^-1]
lan_s = lan_s*numpy.ones(ms)
# Volumetric heat capacity solid soil [J m^-3 K^-1]
cv_s = cv_s*numpy.ones(ms)