152 } |
152 } |
153 |
153 |
154 |
154 |
155 double EditProduct::infusionVol(double step_infused, double step_mashkg, double infuse_temp, double step_temp, double last_temp) |
155 double EditProduct::infusionVol(double step_infused, double step_mashkg, double infuse_temp, double step_temp, double last_temp) |
156 { |
156 { |
157 double a = last_temp * (equip_tun_weight * equip_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
157 double a = last_temp * (product->eq_tun_weight * product->eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
158 double b = step_temp * (equip_tun_weight * equip_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
158 double b = step_temp * (product->eq_tun_weight * product->eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); |
159 double vol = round(((b - a) / ((infuse_temp - step_temp) * SpecificHeatWater)) * 100.0) / 100.0; |
159 double vol = round(((b - a) / ((infuse_temp - step_temp) * SpecificHeatWater)) * 100.0) / 100.0; |
160 |
160 |
161 if (vol < 0) |
161 if (vol < 0) |
162 vol = 0; |
162 vol = 0; |
163 qDebug() << " infusionVol(" << step_infused << "," << step_mashkg << "," << infuse_temp <<"," << step_temp << "," << last_temp << "):" << vol; |
163 qDebug() << " infusionVol(" << step_infused << "," << step_mashkg << "," << infuse_temp <<"," << step_temp << "," << last_temp << "):" << vol; |
165 } |
165 } |
166 |
166 |
167 |
167 |
168 double EditProduct::decoctionVol(double step_volume, double step_temp, double prev_temp) |
168 double EditProduct::decoctionVol(double step_volume, double step_temp, double prev_temp) |
169 { |
169 { |
170 double a = (equip_tun_weight * equip_tun_specific_heat + step_volume * SpecificHeatWater) * (step_temp - prev_temp); |
170 double a = (product->eq_tun_weight * product->eq_tun_specific_heat + step_volume * SpecificHeatWater) * (step_temp - prev_temp); |
171 double b = SpecificHeatWater * (99 - step_temp); |
171 double b = SpecificHeatWater * (99 - step_temp); |
172 double vol = 0; |
172 double vol = 0; |
173 |
173 |
174 if (b > 0) |
174 if (b > 0) |
175 vol = round((a / b) * 1000000.0) / 1000000.0; |
175 vol = round((a / b) * 1000000.0) / 1000000.0; |
196 if (i == 0) { |
196 if (i == 0) { |
197 // First mash step, temperature from the mashtun and malt. |
197 // First mash step, temperature from the mashtun and malt. |
198 n = 20; // tun is preheated. |
198 n = 20; // tun is preheated. |
199 tuntemp = product->mashs.at(i).step_temp; |
199 tuntemp = product->mashs.at(i).step_temp; |
200 for (j = 0; j < n; j++) { |
200 for (j = 0; j < n; j++) { |
201 a = product->mashs_kg * graintemp * SpecificHeatMalt + equip_tun_weight * tuntemp * equip_tun_specific_heat; |
201 a = product->mashs_kg * graintemp * SpecificHeatMalt + product->eq_tun_weight * tuntemp * product->eq_tun_specific_heat; |
202 b = product->mashs[i].step_temp * |
202 b = product->mashs[i].step_temp * |
203 (equip_tun_weight * equip_tun_specific_heat + |
203 (product->eq_tun_weight * product->eq_tun_specific_heat + |
204 product->mashs.at(i).step_infuse_amount * SpecificHeatWater + |
204 product->mashs.at(i).step_infuse_amount * SpecificHeatWater + |
205 product->mashs_kg * SpecificHeatMalt) - |
205 product->mashs_kg * SpecificHeatMalt) - |
206 SlakingHeat * product->mashs_kg; |
206 SlakingHeat * product->mashs_kg; |
207 if (product->mashs.at(i).step_infuse_amount > 0) { |
207 if (product->mashs.at(i).step_infuse_amount > 0) { |
208 temp = (b - a) / (product->mashs.at(i).step_infuse_amount * SpecificHeatWater); |
208 temp = (b - a) / (product->mashs.at(i).step_infuse_amount * SpecificHeatWater); |