Skip to content

Commit

Permalink
Merge pull request #57 from c-ortbauer/patch-1
Browse files Browse the repository at this point in the history
Fix error HumidAir.mixing humidity
  • Loading branch information
portyanikhin authored Dec 18, 2024
2 parents b09589e + 268fea1 commit cc91abd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pyfluids/humid_air/humid_air.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,13 @@ def mixing(
),
InputHumidAir.humidity(
(
first_specific_mass_flow * first.humidity
+ second_specific_mass_flow * second.humidity
first_specific_mass_flow * first.humidity * (1 + second.humidity)
+ second_specific_mass_flow * second.humidity * (1 + first.humidity)
)
/ (
first_specific_mass_flow * (1 + second.humidity)
+ second_specific_mass_flow * (1 + first.humidity)
)
/ (first_specific_mass_flow + second_specific_mass_flow)
),
)

Expand Down
8 changes: 7 additions & 1 deletion tests/humid_air/test_humid_air_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,11 @@ def test_mixing(self):
assert self.humid_air.mixing(1, first, 2, second) == self.humid_air.with_state(
InputHumidAir.pressure(self.humid_air.pressure),
InputHumidAir.enthalpy((1 * first.enthalpy + 2 * second.enthalpy) / 3),
InputHumidAir.humidity((1 * first.humidity + 2 * second.humidity) / 3),
InputHumidAir.humidity(
(
1 * first.humidity * (1 + second.humidity)
+ 2 * second.humidity * (1 + first.humidity)
)
/ (1 * (1 + second.humidity) + 2 * (1 + first.humidity))
),
)

0 comments on commit cc91abd

Please sign in to comment.