www/js/prod_edit.js

changeset 609
e9b108569818
parent 607
0efba09a694c
child 610
38b22ccb2bf8
equal deleted inserted replaced
608:0a8495edf53c 609:e9b108569818
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2018-2019 2 * Copyright (C) 2018-2020
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of BMS 6 * This file is part of BMS
7 * 7 *
3335 return Round(sugar, 3); 3335 return Round(sugar, 3);
3336 } 3336 }
3337 3337
3338 function GetPressure(CO2, T1, T2) { 3338 function GetPressure(CO2, T1, T2) {
3339 var P, V = CO2 - ResCO2(CO2, T1); 3339 var P, V = CO2 - ResCO2(CO2, T1);
3340 V = CO2; // TODO: temp only total pressure, testing
3340 if (V < 0) 3341 if (V < 0)
3341 return 0; 3342 return 0;
3342 P = -1.09145427669121 + 0.00800006989646477 * T2 + 0.000260276315484684 * T2 * T2 + 0.0215142075945119 * T2 * V + 3343 P = -1.09145427669121 + 0.00800006989646477 * T2 + 0.000260276315484684 * T2 * T2 + 0.0215142075945119 * T2 * V +
3343 0.674996600795854 * V + -0.00471757220150754 * V * V; 3344 0.674996600795854 * V + -0.00471757220150754 * V * V;
3344 //console.log("CO2: "+CO2+" "+V+" Temp: "+T1+" "+T2+" Pressure: "+P);
3345 if (P < 0) 3345 if (P < 0)
3346 P = 0; 3346 P = 0;
3347 P = P * 1.01325; // atm to bar 3347 P = Round(P * 1.01325, 2); // atm to bar
3348 return Round(P, 1); 3348 console.log("GetPressure(" + CO2 + ", " + T1 + ", " + T2 + ") V:" + V + " Bar: " + P);
3349 return P;
3349 } 3350 }
3350 3351
3351 function CarbCO2ToPressure(CO2, T) { 3352 function CarbCO2ToPressure(CO2, T) {
3352 return (CO2 - (-0.000005594056 * Math.pow(T, 4) + 0.000144357886 * Math.pow(T, 3) + 3353 return (CO2 - (-0.000005594056 * Math.pow(T, 4) + 0.000144357886 * Math.pow(T, 3) +
3353 0.000362999168 * T * T - 0.064872987645 * T + 1.641145175049)) / 3354 0.000362999168 * T * T - 0.064872987645 * T + 1.641145175049)) /

mercurial