Skip to content

Commit c490ab3

Browse files
Improve variable name in solubility adapter
co2-rich matches both acidwatch and solubility model itself
1 parent 54420fa commit c490ab3

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

backend/src/acidwatch_api/models/solubilityccs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,25 @@ async def run(self) -> RunResult:
7373
return phases, TextResult(data=table, label="Solubility Output")
7474

7575
def _extract_phases(self, fluid: Fluid) -> list[Phase]:
76-
gas_phase = fluid.phases[0]
77-
gas_fraction = fluid.betta
76+
co2_rich_phase = fluid.phases[0]
77+
co2_rich_fraction = fluid.betta
7878

7979
co2_rich_concs: dict[str, float | int] = {}
80-
for component, fraction in zip(gas_phase.components, gas_phase.fractions):
80+
for component, fraction in zip(
81+
co2_rich_phase.components, co2_rich_phase.fractions
82+
):
8183
if component != "CO2":
8284
co2_rich_concs[component] = fraction * 1e6
8385

8486
phases = [
8587
Phase(
8688
kind="co2-rich",
87-
fraction=gas_fraction,
89+
fraction=co2_rich_fraction,
8890
concentrations=co2_rich_concs,
8991
)
9092
]
9193

92-
if gas_fraction < 1.0 and len(fluid.phases) > 1:
94+
if co2_rich_fraction < 1.0 and len(fluid.phases) > 1:
9395
liquid_phase = fluid.phases[1]
9496
aqueous_concs: dict[str, float | int] = {}
9597
for component, fraction in zip(
@@ -101,7 +103,7 @@ def _extract_phases(self, fluid: Fluid) -> list[Phase]:
101103
phases.append(
102104
Phase(
103105
kind="aqueous",
104-
fraction=1.0 - gas_fraction,
106+
fraction=1.0 - co2_rich_fraction,
105107
concentrations=aqueous_concs,
106108
)
107109
)

0 commit comments

Comments
 (0)