Coverage for wsimod/core/constants.py: 90%

61 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-01-11 16:39 +0000

1# -*- coding: utf-8 -*- 

2"""Created on Fri Dec 6 15:17:07 2019. 

3 

4@author: bdobson 

5""" 

6from wsimod.core import constants 

7 

8M3_S_TO_ML_D = 86.4 

9MM_KM2_TO_ML = 1e-3 * 1e6 * 1e3 * 1e-6 # mm->m, km2->m2, m3->l, l->Ml 

10MM_M2_TO_ML = 1e-3 * 1e3 * 1e-6 # mm->m, m3->l, l->Ml 

11MM_M2_TO_SIM_VOLUME = MM_M2_TO_ML # SIM volume is by default ML, but can be changed by 

12# changing MM_TO_SIM_VOLUME 

13MM_M2_TO_M3 = 1e-3 # mm->m 

14ML_TO_M3 = 1000 

15PCT_TO_PROP = 1 / 100 

16L_TO_ML = 1e-6 

17FLOAT_ACCURACY = 1e-11 

18UNBOUNDED_CAPACITY = 1e15 

19MAX_INFLOW = 1e10 

20DT_DAYS = 1 

21POLLUTANTS = [ 

22 "do", 

23 "org-phosphorus", 

24 "phosphate", 

25 "ammonia", 

26 "solids", 

27 "bod", 

28 "cod", 

29 "ph", 

30 "temperature", 

31 "nitrate", 

32 "nitrite", 

33 "org-nitrogen", 

34] 

35NON_ADDITIVE_POLLUTANTS = [ 

36 "do", 

37 "temperature", 

38 "ph", 

39] # e.g. pollutants whose concentration should not increase if volume is distilled out 

40ADDITIVE_POLLUTANTS = [ 

41 "org-phosphorus", 

42 "phosphate", 

43 "ammonia", 

44 "solids", 

45 "bod", 

46 "cod", 

47 "nitrate", 

48 "nitrite", 

49 "org-nitrogen", 

50] 

51NUTRIENTS = ["N", "P"] 

52PCT_GARDENS = 0.1 # Percentage of area that is people's gardens 

53PI = 3.141592653589793 

54PER_DAY_TO_PER_SECOND = 1 / (60 * 60 * 24) 

55PER_DAY_TO_PER_HOUR = 1 / 24 

56M3_S_TO_ML_H = M3_S_TO_ML_D * PER_DAY_TO_PER_HOUR 

57MAXITER = 5 # Max iterations in a while loop 

58M3_S_TO_M3_DT = 86400 

59M_S_TO_M_DT = 86400 

60UG_L_TO_KG_M3 = 1e-6 

61MG_L_TO_KG_M3 = 1e-3 

62KG_M3_TO_MG_L = 1e3 

63MM_TO_M = 1e-3 

64G_TO_KG = 1e-3 

65KG_TO_MG = 1e6 

66DECAY_REFERENCE_TEMPERATURE = 20 # C 

67PER_30MONTH_TO_PER_DAY = 1 / 30 

68DAYS_IN_YEAR = 365 

69L_S_TO_M3_D = 1e-3 / PER_DAY_TO_PER_SECOND 

70 

71M_TO_MM = 1e3 

72MM_TO_M = 1e-3 

73KM_TO_M = 1e3 

74M_TO_KM = 1e-3 

75MJ_M2_TO_CAL_CM2 = 23.889 

76KPA_TO_MBAR = 10 

77HPA_TO_KPA = 0.1 

78KM2_TO_HA = 100 

79KM2_TO_M2 = 1e6 

80HA_TO_M2 = 1e4 

81M2_TO_KM2 = 1e-6 

82 

83G_M2_TO_KG_KM2 = 1e3 

84G_M2_TO_KG_M2 = 1e-3 

85MGMM_L_TO_KG_KM2 = 1e-6 * 1e3 * 1e-3 * 1e6 

86KG_M2_TO_KG_KM2 = 1e6 

87 

88KG_M3_TO_KG_KM3 = 1e9 

89 

90D_TO_S = 3600 * 24 

91 

92 

93def set_simple_pollutants(): 

94 """""" 

95 constants.POLLUTANTS = ["phosphate", "temperature"] 

96 constants.ADDITIVE_POLLUTANTS = ["phosphate"] 

97 constants.NON_ADDITIVE_POLLUTANTS = ["temperature"] 

98 

99 

100def set_default_pollutants(): 

101 """""" 

102 constants.POLLUTANTS = [ 

103 "do", 

104 "org-phosphorus", 

105 "phosphate", 

106 "ammonia", 

107 "solids", 

108 "bod", 

109 "cod", 

110 "ph", 

111 "temperature", 

112 "nitrate", 

113 "nitrite", 

114 "org-nitrogen", 

115 ] 

116 constants.NON_ADDITIVE_POLLUTANTS = [ 

117 "do", 

118 "temperature", 

119 "ph", 

120 ] # e.g. pollutants whose concentration should not increase if volume is distilled 

121 # out 

122 constants.ADDITIVE_POLLUTANTS = [ 

123 "org-phosphorus", 

124 "phosphate", 

125 "ammonia", 

126 "solids", 

127 "bod", 

128 "cod", 

129 "nitrate", 

130 "nitrite", 

131 "org-nitrogen", 

132 ]