Line 0
Link Here
|
|
|
1 |
--- src/calculator/gasCalculator.cpp.orig 2018-10-24 05:36:48 UTC |
2 |
+++ src/calculator/gasCalculator.cpp |
3 |
@@ -139,7 +139,7 @@ void gasCalculator::calculatePressure() |
4 |
double temp = m_temp.convertTo( KUnitConversion::Kelvin ).number(); |
5 |
double b = m_Vand_b.convertTo( KUnitConversion::Liter ).number(); |
6 |
|
7 |
- double pressure = m_moles * R * temp / (volume - m_moles * b) - m_moles * m_moles * m_Vand_a / volume / volume; |
8 |
+ double pressure = m_moles * Rgas * temp / (volume - m_moles * b) - m_moles * m_moles * m_Vand_a / volume / volume; |
9 |
|
10 |
m_pressure = Value(pressure, KUnitConversion::Atmosphere ); |
11 |
m_pressure = m_pressure.convertTo(getCurrentUnitId(ui.pressure_unit)); |
12 |
@@ -154,7 +154,7 @@ void gasCalculator::calculateMolarMass() |
13 |
double temp = m_temp.convertTo(KUnitConversion::Kelvin).number(); |
14 |
double b = m_Vand_b.convertTo(KUnitConversion::Liter).number(); |
15 |
|
16 |
- m_molarMass = mass * R * temp / (pressure + m_moles * m_moles * m_Vand_a / volume / volume)\ |
17 |
+ m_molarMass = mass * Rgas * temp / (pressure + m_moles * m_moles * m_Vand_a / volume / volume)\ |
18 |
/ (volume - m_moles * b); |
19 |
ui.molarMass->setValue(m_molarMass); |
20 |
} |
21 |
@@ -165,7 +165,7 @@ void gasCalculator::calculateVol() |
22 |
double temp = m_temp.convertTo(KUnitConversion::Kelvin).number(); |
23 |
double b = m_Vand_b.convertTo(KUnitConversion::Liter).number(); |
24 |
|
25 |
- double volume = m_moles * R * temp / pressure + (m_moles * b); |
26 |
+ double volume = m_moles * Rgas * temp / pressure + (m_moles * b); |
27 |
m_vol = Value(volume, KUnitConversion::Liter); |
28 |
m_vol = m_vol.convertTo( getCurrentUnitId(ui.volume_unit) ); |
29 |
ui.volume->setValue(m_vol.number()); |
30 |
@@ -178,7 +178,7 @@ void gasCalculator::calculateTemp() |
31 |
double b = m_Vand_b.convertTo(KUnitConversion::Liter).number(); |
32 |
|
33 |
double temp = (pressure + (m_moles * m_moles * m_Vand_a / volume / volume))\ |
34 |
- * (volume - m_moles * b) / m_moles / R; |
35 |
+ * (volume - m_moles * b) / m_moles / Rgas; |
36 |
m_temp = Value(temp, KUnitConversion::Kelvin); |
37 |
m_temp = m_temp.convertTo( getCurrentUnitId( ui.temp_unit ) ); |
38 |
ui.temp->setValue(m_temp.number()); |
39 |
@@ -192,7 +192,7 @@ void gasCalculator::calculateMoles() |
40 |
double b = m_Vand_b.convertTo(KUnitConversion::Liter).number(); |
41 |
|
42 |
m_moles = (pressure + m_moles * m_moles * m_Vand_a / volume / volume)\ |
43 |
- * (volume - m_moles * b) / R / temp; |
44 |
+ * (volume - m_moles * b) / Rgas / temp; |
45 |
ui.moles->setValue(m_moles); |
46 |
} |
47 |
|
48 |
@@ -204,7 +204,7 @@ void gasCalculator::calculateMass() |
49 |
double b = m_Vand_b.convertTo(KUnitConversion::Liter).number(); |
50 |
|
51 |
double mass = (pressure + m_moles * m_moles * m_Vand_a / volume / volume)\ |
52 |
- * (volume - m_moles * b) * m_molarMass / R / temp; |
53 |
+ * (volume - m_moles * b) * m_molarMass / Rgas / temp; |
54 |
m_mass = Value(mass, KUnitConversion::Gram); |
55 |
m_mass = m_mass.convertTo( getCurrentUnitId( ui.mass_unit ) ); |
56 |
ui.mass->setValue(m_mass.number()); |