src/EditRecipeTab6.cpp

changeset 158
24bc2de721d9
parent 151
b5b2483f3a3f
child 163
6cccd340ea8c
equal deleted inserted replaced
157:771b0b00092a 158:24bc2de721d9
152 } 152 }
153 153
154 154
155 double EditRecipe::infusionVol(double step_infused, double step_mashkg, double infuse_temp, double step_temp, double last_temp) 155 double EditRecipe::infusionVol(double step_infused, double step_mashkg, double infuse_temp, double step_temp, double last_temp)
156 { 156 {
157 double a = last_temp * (eq_tun_weight * eq_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt); 157 double a = last_temp * (equip_tun_weight * equip_tun_specific_heat + step_infused * SpecificHeatWater + step_mashkg * SpecificHeatMalt);
158 double b = step_temp * (eq_tun_weight * 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);
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 EditRecipe::decoctionVol(double step_volume, double step_temp, double prev_temp) 168 double EditRecipe::decoctionVol(double step_volume, double step_temp, double prev_temp)
169 { 169 {
170 double a = (eq_tun_weight * eq_tun_specific_heat + step_volume * SpecificHeatWater) * (step_temp - prev_temp); 170 double a = (equip_tun_weight * equip_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 = recipe->mashs.at(i).step_temp; 199 tuntemp = recipe->mashs.at(i).step_temp;
200 for (j = 0; j < n; j++) { 200 for (j = 0; j < n; j++) {
201 a = recipe->mashs_kg * graintemp * SpecificHeatMalt + eq_tun_weight * tuntemp * eq_tun_specific_heat; 201 a = recipe->mashs_kg * graintemp * SpecificHeatMalt + equip_tun_weight * tuntemp * equip_tun_specific_heat;
202 b = recipe->mashs[i].step_temp * 202 b = recipe->mashs[i].step_temp *
203 (eq_tun_weight * eq_tun_specific_heat + 203 (equip_tun_weight * equip_tun_specific_heat +
204 recipe->mashs.at(i).step_infuse_amount * SpecificHeatWater + 204 recipe->mashs.at(i).step_infuse_amount * SpecificHeatWater +
205 recipe->mashs_kg * SpecificHeatMalt) - 205 recipe->mashs_kg * SpecificHeatMalt) -
206 SlakingHeat * recipe->mashs_kg; 206 SlakingHeat * recipe->mashs_kg;
207 if (recipe->mashs.at(i).step_infuse_amount > 0) { 207 if (recipe->mashs.at(i).step_infuse_amount > 0) {
208 temp = (b - a) / (recipe->mashs.at(i).step_infuse_amount * SpecificHeatWater); 208 temp = (b - a) / (recipe->mashs.at(i).step_infuse_amount * SpecificHeatWater);

mercurial