qiangyicheng / flory

Python package for finding coexisting phases in multicomponent mixtures.
https://flory.readthedocs.io/en/latest/
MIT License
4 stars 1 forks source link

Support polydispersed systems #8

Closed qiangyicheng closed 2 months ago

qiangyicheng commented 2 months ago

In polydispersed systems, several components may share same interaction property but only different molecule sizes. In these systems, we only need $N\mathrm{S}$ variables to describe the systems, instead of $N\mathrm{C}$ variables, allowing many components to mimic a continuous size distribution.

This feature can be implemented by providing specialization for interaction and entropy. To reuse the code, core parts of FloryHugginsInteraction and IdealGasEntropy are separated out.

Tests are required. Potentially a consistent check against the standard method may be sufficient.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 89.26174% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
flory/interaction/flory_huggins_block.py 72.97% 10 Missing :warning:
flory/entropy/ideal_gas_polydispersed.py 93.54% 4 Missing :warning:
flory/common/utilities.py 92.85% 1 Missing :warning:
flory/interaction/flory_huggins.py 93.33% 1 Missing :warning:
Flag Coverage Δ
Tests 86.50% <89.26%> (+0.08%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
flory/__init__.py 100.00% <100.00%> (ø)
flory/common/__init__.py 100.00% <100.00%> (ø)
flory/entropy/__init__.py 100.00% <100.00%> (ø)
flory/entropy/ideal_gas.py 98.43% <100.00%> (+0.10%) :arrow_up:
flory/interaction/__init__.py 100.00% <100.00%> (ø)
flory/common/utilities.py 94.73% <92.85%> (-5.27%) :arrow_down:
flory/interaction/flory_huggins.py 75.55% <93.33%> (+0.55%) :arrow_up:
flory/entropy/ideal_gas_polydispersed.py 93.54% <93.54%> (ø)
flory/interaction/flory_huggins_block.py 72.97% <72.97%> (ø)