flory.shortcut
Shortcuts for simple tasks of finding coexisting phases.
Functions
Find coexisting phases of Flory-Huggins mixtures in canonical ensemble. |
- find_coexisting_phases(num_comp, chis, phi_means, sizes=None, **kwargs)[source]
Find coexisting phases of Flory-Huggins mixtures in canonical ensemble.
This function is a convenience wrapper for the class
CoexistingPhasesFinder. This function will create the classCoexistingPhasesFinderinternally, conduct the random initialization, and then use self consistent iterations to find coexisting phases. See classCoexistingPhasesFinderfor more details on the supported arguments.- Parameters:
num_comp¶ (
int) – Number of components \(N_\mathrm{C}\) in the system.chis¶ (
ndarray) – The interaction matrix. Symmetric 2D array with size of \(N_\mathrm{C} \times N_\mathrm{C}\). This matrix should be the full \(\chi_{ij}\) matrix of the system, including the solvent component.phi_means¶ (
ndarray) – The average volume fractions \(\bar{\phi}_i\) of all the components of the system. 1D array of length \(N_\mathrm{C}\). Note that the volume fraction of the solvent is included as well, so the sum of this array must be one.sizes¶ (
ndarray|None, default:None) – The relative molecule volumes \(l_i = \nu_i/\nu\) with respect to the volume of a reference molecule \(\nu\). It is treated as all-one vector by default.**kwargs¶ – All additional arguments are used directly to initialize
CoexistingPhasesFinder.
- Returns:
Composition and relative size of the phases. The member
volumes(accessible by.volumes) contains the fraction of volume of each phase. The memberfractions(accessible by.fractions) contains volume fractions of all components.- Return type: