src/Utils.cpp

changeset 336
e97f9e87d94b
parent 300
2a97905cb637
child 337
8133cdb19aa1
equal deleted inserted replaced
335:c4b4a2879bb8 336:e97f9e87d94b
358 358
359 double factor = og * 3157 * pow(10, -5) + 9.716 * pow(10, -2); 359 double factor = og * 3157 * pow(10, -5) + 9.716 * pow(10, -2);
360 return round((og * 1000 - fg * 1000) * factor * 100) / 100; 360 return round((og * 1000 - fg * 1000) * factor * 100) / 100;
361 } 361 }
362 362
363 /*
364 double Utils::boilIBU(int Form, double SG, double Volume, double Amount, double Time, double Alpha, int Method)
365 {
366 if (Method == 0) { // Tinseth
367 */ /* http://realbeer.com/hops/research.html */
368 /* AddedAlphaAcids = (alpha * mass * 1000) / liters;
369 Bigness_factor = 1.65 * pow(0.000125, gravity - 1);
370 BoilTime_factor = ((1 - exp(-0.04 * time)) / 4.15);
371 utiisation = Bigness_factor * BoilTime_factor;
372 ibu = round((utiisation * AddedAlphaAcids * fmoment * pfactor + whirlibus) * 100) / 100;
373 }
374 if (Method == 2) { // Daniels
375 if (Form == 2) // Leaf
376 boilfactor = -(0.0041 * time * time) + (0.6162 * time) + 1.5779;
377 else
378 boilfactor = -(0.0051 * time * time) + (0.7835 * time) + 1.9348;
379 if (gravity < 1050)
380 sgfactor = 0;
381 else
382 sgfactor = (gravity - 1050) / 200;
383 ibu = round((fmoment * ((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor))) + whirlibus) * 100) / 100;
384 }
385 if (Method == 1) { // Rager
386 boilfactor = fmoment * 18.11 + 13.86 * tanh((time * 31.32) / 18.27);
387 if (gravity < 1050)
388 sgfactor = 0;
389 else
390 sgfactor = (gravity - 1050) / 200;
391 ibu = round(((mass * (alpha * 100) * boilfactor * 0.1) / (liters * (1 + sgfactor)) + whirlibus) * 100) / 100;
392 }
393 }
394 */
363 395
364 double Utils::toIBU(int Use, int Form, double SG, double Volume, double Amount, double Boiltime, double Alpha, 396 double Utils::toIBU(int Use, int Form, double SG, double Volume, double Amount, double Boiltime, double Alpha,
365 int Method, double Whirlpool9, double Whirlpool7, double Whirlpool6, double Fulltime) 397 int Method, double Whirlpool9, double Whirlpool7, double Whirlpool6, double Fulltime)
366 { 398 {
367 double fmoment = 1.0, pfactor = 1.0, ibu = 0, boilfactor; 399 double fmoment = 1.0, pfactor = 1.0, ibu = 0, boilfactor;

mercurial