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
| Private Sub CmdValMois_Click()
'Range("B:Z").Delete
Nb_Mois = Me.TxtNbmois.Value
For i = 0 To Nb_Mois - 1
H2HC = 75
K = Me.TxtK.Value
Range("B5").Offset(0, i).Value = K
Range("B2").Offset(0, i).Formula = i + 1
Range("B12").Offset(0, i).Formula = H2HC
Range("B6").Offset(0, i).Formula = 9
Next i
Unload Me
UsfParametres.Show
'Nb jour
Range("B3").Formula = Nb_jour
Range("B4").Formula = Nb_jour / 30.5
'Valeur de S0
Range("B7").Formula = S0
'Valeur de SDBTO
Range("B8").Formula = SDBTO
Range("B9").Formula = S0 * SDBTO / 100
'Valeur de Nt
Range("B10").Formula = Nt
'Valeur de Temperature
Range("B11").Formula = Temp
'Valeur de Pression H2
Range("B13").Formula = ppH2
'Calcul de LHSV
exp0 = 11.0007
exp1 = 6910.93
cSDBTO = 0.0146611
cNt = 0.731505
c2_VVH = 0.415662
c3_H2HC = 0.220087
c1_ppH2 = 0.258668
H2HCnew = 70
Range("B18").Formula = 65
Do
Range("B14").Formula = ((K * Exp(exp0 - (exp1 + cNt * Nt + cSDBTO * (SDBTO * S0 / 100)) / (Temp + 273.15)) * (H2HC ^ c3_H2HC * ppH2 ^ c1_ppH2)) / Log(SDBTO * S0 / 100 / 9)) ^ (1 / c2_VVH)
'Calcul du débit moyen
Range("B15").Formula = Range("B14").Value * 180.5 * 0.83
'Calcul du débit max
If Range("B15").Value > 300 Then
Range("B16").Formula = 300
Else
Range("B16").Formula = Range("B15").Value
End If
'Calcul H2/HC calculé
If Range("B16").Value < 300 Then
Range("B18").Formula = 4070000 * Range("B16").Value ^ (-1.912)
Else
Range("B18").Formula = 74.7
End If
'H2HCnew = CellB18
H2HCnew = H2HCnew + 1
Range("B12").Formula = H2HCnew
'Calcul charge cumulée
Range("B17").Formula = Range("B16").Value * Nb_jour * 24 / 1000
Loop Until (Range("B18").Value - H2HCnew >= -1) And (Range("B18").Value - H2HCnew <= 1)
Unload Me
For i = 0 To Nb_Mois - 2
UsfParametres.Show
'Nb jour
Range("C3").Offset(0, i).Formula = Nb_jour
Range("C4").Offset(0, i).Formula = Nb_jour / 30.5
'Valeur de S0
Range("C7").Offset(0, i).Formula = S0
'Valeur de SDBTO
Range("C8").Offset(0, i).Formula = SDBTO
Range("C9").Offset(0, i).Formula = S0 * SDBTO / 100
'Valeur de Nt
Range("C10").Offset(0, i).Formula = Nt
'Valeur de Temperature
Range("C11").Offset(0, i).Formula = Temp
'Valeur de Pression H2
Range("C13").Offset(0, i).Formula = ppH2
'Calcul de LHSV
'MsgBox exp0
'MsgBox exp1
'MsgBox cSDBTO
'MsgBox cNt
'MsgBox c2_VVH
'MsgBox c3_H2HC
'MsgBox c1_ppH2
'calcul de K
If Range("B17").Offset(0, i).Value < 700 Then
Range("C5").Offset(0, i).Formula = -0.116 * Math.Log(Range("B17").Offset(0, i).Value * 1000) + 2.1676
Else
Range("C5").Offset(0, i).Formula = 0.7 - 1.5 * Range("B17").Offset(0, i).Value * 10 ^ -4
End If
H2HCnew = 70
Range("C18").Offset(0, i).Formula = 65
Do
'Calcul de VVH
Range("C14").Offset(0, i).Formula = (((Range("C5").Offset(0, i).Value * Math.Exp(exp0 - (exp1 + cNt * Nt + cSDBTO * SDBTO * S0 / 100) / (Temp + 273.15))) * H2HCnew ^ c3_H2HC * ppH2 ^ c1_ppH2) / Math.Log(SDBTO * S0 / 100 / 9)) ^ (1 / c2_VVH)
'Calcul du débit moyen
Range("C15").Offset(0, i).Formula = Range("C14").Offset(0, i).Value * 180.5 * 0.83
'Calcul du débit max
If Range("C15").Offset(0, i).Value > 300 Then
Range("C16").Offset(0, i).Formula = 300
Else
Range("C16").Offset(0, i).Formula = Range("C15").Offset(0, i).Value
End If
'Calcul H2/HC calculé
If Range("C16").Offset(0, i).Value < 300 Then
Range("C18").Offset(0, i).Formula = 4070000 * Range("C16").Offset(0, i).Value ^ (-1.912)
Else
Range("C18").Formula = 74.7
End If
'Calcul charge cumulée
Range("C17").Offset(0, i).Formula = Range("C16").Offset(0, i).Value * Nb_jour * 24 / 1000 + Range("B17").Offset(0, i).Value
H2HCnew = H2HCnew + 1
Range("C12").Offset(0, i).Formula = H2HCnew
Loop Until (Range("C18").Offset(0, i).Value - H2HCnew >= -1) And (Range("C18").Offset(0, i).Value - H2HCnew <= 1)
Next i
Unload Me
End Sub |
Partager