61 { |
61 { |
62 double C1 = 0; |
62 double C1 = 0; |
63 |
63 |
64 if ((F.f_di_ph != 5.7) && ((F.f_acid_to_ph_57 < - 0.1) || (F.f_acid_to_ph_57 > 0.1))) { |
64 if ((F.f_di_ph != 5.7) && ((F.f_acid_to_ph_57 < - 0.1) || (F.f_acid_to_ph_57 > 0.1))) { |
65 C1 = F.f_acid_to_ph_57 / (F.f_di_ph - 5.7); |
65 C1 = F.f_acid_to_ph_57 / (F.f_di_ph - 5.7); |
66 } else { |
66 } else { |
67 /* |
67 /* |
68 * If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid. |
68 * If the acid_to_ph_5.7 is unknown from the maltster, guess the required acid. |
69 */ |
69 */ |
70 switch (F.f_graintype) { |
70 switch (F.f_graintype) { |
71 case 0: // Base, Special, Kilned |
71 case FERMENTABLE_GRAINTYPE_BASE: |
72 case 3: |
72 case FERMENTABLE_GRAINTYPE_KILNED: |
73 case 5: C1 = 0.014 * F.f_color - 34.192; |
73 case FERMENTABLE_GRAINTYPE_SPECIAL: C1 = 0.014 * F.f_color - 34.192; |
74 break; |
74 break; |
75 case 2: C1 = -0.0597 * F.f_color - 32.457; // Crystal |
75 case FERMENTABLE_GRAINTYPE_CRYSTAL: C1 = -0.0597 * F.f_color - 32.457; |
76 break; |
76 break; |
77 case 1: C1 = 0.0107 * F.f_color - 54.768; // Roast |
77 case FERMENTABLE_GRAINTYPE_ROAST: C1 = 0.0107 * F.f_color - 54.768; |
78 break; |
78 break; |
79 case 4: C1 = -149; // Sour malt |
79 case FERMENTABLE_GRAINTYPE_SOUR_MALT: C1 = -149; |
80 break; |
80 break; |
81 } |
81 } |
82 } |
82 } |
83 return C1; |
83 return C1; |
84 } |
84 } |
85 |
85 |
103 * proton deficit for the grist |
103 * proton deficit for the grist |
104 */ |
104 */ |
105 if (product->fermentables.size()) { |
105 if (product->fermentables.size()) { |
106 for (i = 0; i < product->fermentables.size(); i++) { |
106 for (i = 0; i < product->fermentables.size(); i++) { |
107 F = product->fermentables.at(i); |
107 F = product->fermentables.at(i); |
108 if (F.f_added == 0 && F.f_graintype != 6) { // Added == Mash && graintype != No Malt |
108 if (F.f_added == FERMENTABLE_ADDED_MASH && F.f_graintype != FERMENTABLE_GRAINTYPE_NO_MALT) { |
109 x = AcidRequired(pHZ, F) * F.f_amount; |
109 x = AcidRequired(pHZ, F) * F.f_amount; |
110 Result += x; |
110 Result += x; |
111 } |
111 } |
112 } |
112 } |
113 } else { |
113 } else { |