CRSManager¶
This submodule facilitate the creation, execution, and output processes for mutiple crsJob
and is intended to be used in conjunction with the pyCRS.database module.
-
class
pyCRS.CRSManager.
CRSSystem
¶ This class is designed to manage multiple instances of the
CRSMixture
class, facilitating the creation, execution, and output processes.A
CRSSsytem
instance can create mutipleCRSMixute
instance associated with itsmixture
attribute byadd_compound
method. The resulting mutipleCRSResults
will be stored in itsoutputs
attribute. This functionality requires the concurrent use of the pyCRS.database module.-
num_mix
¶ The numbers of mixture
- Type
int
-
mixture
¶ A list of
CRSMixture
class- Type
list of |CRSMixture|
-
outputs
¶ A list of CRSResults class corresponding to the each
CRSMixture
in themixture
- Type
list of |CRSResults|
-
add_Mixture
(mixture: dict, temperature=298.15, problem_type='activitycoef', database='my_coskf_db.db', method='COSMORS', pressure=1.01325, jobname=None, conformer=False, massfraction=False, density_corr=False, vp_corr=False, solute='solid', iso='isotherm', additional_sett=None, multi_species=None)¶ Add a new
CRSMixture
to the mixture attribute inCRSSystem
class- Parameters
mixture (
dictionary
) – A dictionary representing the composition of the mixture, where keys are Identifiers and values are mole fractions or mass fractions.- Keyword Arguments
temperature (
float
) – The temperature in Kelvin. Default is 298.15K.problem_type (
str
) – The type of problem for the calculation. Default is ‘activitycoef’.database (
str
) – The fullpath of a COSKFDatabase. Default is ‘my_coskf_db.db’.method (
str
) – A str indicating the version of COSMORS or COSMOSAC to be used. Default is ‘COSMORS’.pressure (
float
) – The pressure in bar. Default is 1.01325barjobname (
str
) – The name of the job and the directory within plam_workdir. Defaults to “crsJob_0”, “crsJob_1”, etc.conformer (
bool
) – A boolean indicating if multiple conformers are used in COSMO-RS. Default is False.massfraction (
bool
) – A boolean indicating if the input fraction is a mass fraction. Default is False.density_corr (
bool
) – A boolean indicating whether to correct the volume of the compound using the density of the pure compound. Default is False, indicating the COSMO volume will be used instead.vp_corr (
bool
) – A boolean indicating whether to correct the gas phase chemical potentail using the vapor pressure. Default is False.solute (
str
) – A str indicating the solute state to be ‘solid’, ‘gas’ or ‘liquid’, applicable to problem type SOLUBILITY and PURESOLUBILITY. Default is ‘solid’.iso (
str
) – A str indicating the calculation condition to be ‘isotherm’, ‘isobar’ or ‘flashpoint’, applicable to problem types BINMIXCOEF, TERNARYMIX and COMPOSITIONLINE. Default is ‘isotherm’additional_sett (
|Settings|
) – A Settings object that allows for additional customized settings.multi_species (
dictionary
) – A dictionary representing multi-species settings, where keys are Identifiers and values are Settings objects
Note
The identifiers for a compound can be the name, the CAS number, or the chemical identifier stored in the pyCRS.database. When searching in the database, the input string will be converted to lowercase, except when it starts with ‘InChI’.
The available problem types is listed below.
problem_type
valueProblem type
ACTIVITYCOEF
Activity Coefficient
BINMIXCOEF
Binary mixture LLE/VLE
TERNARYMIX
Ternary mixture LLE/VLE
COMPOSITIONLINE
Solvent composition line interpolation
SOLUBILITY
Solubility calculation in a mixed solvent
PURESOLUBILITY
Solubility calculation in a pure solvent
LOGP
Partition coefficient calculation
VAPORPRESSURE
Vapor pressure calculation for a mixed solvent
PUREVAPORPRESSURE
Vapor pressure calculation for a pure solvent
BOILINGPOINT
Boiling point calculation for a mixture
PUREBOILINGPOINT
Boiling point calculation for a pure solvent(s)
FLASHPOINT
Flashpoint calculation for a mixture
SIGMAPROFILE
Sigma profile calculation for a mixture
PURESIGMAPROFILE
Sigma profile calculation for a pure component(s)
SIGMAPOTENTIAL
Sigma potential calculation for a mixture
PURESIGMAPOTENTIAL
Sigma potential calculation for a pure component(s)
-
get_activity_coefficients
(idx=None)¶ Return the activity coefficient of all
CRSMixture
or the ithCRSMixture
.- Keyword Arguments
idx (
interger
) – Index of the specificCRSMixture
to be returned
-
runCRSJob
()¶ Run all
CRSJob``_ in each ``CRSMixture
-
-
class
pyCRS.CRSManager.
CRSMixture
(**kwargs)¶ This class is used to generate the CRSJob class
-
CRSJob
¶ The CRSJob class.
- Type
|CRSJob|
-
mixture
¶ A dictionary representing the composition of the mixture, where keys are Identifiers and values are mole fractions or mass fractions.
- Type
dictionary
-
temperature
¶ The temperature in Kelvin. Default is 298.15K.
- Type
float
-
problem_type
¶ The type of problem for the calculation. Default is ‘activitycoef’.
- Type
str
-
database
¶ The fullpath of a COSKFDatabase. Default is ‘my_coskf_db.db’.
- Type
str
-
method
¶ A str indicating the version of COSMORS or COSMOSAC to be used. Default is ‘COSMORS’.
- Type
str
-
pressure
¶ The pressure in bar. Default is 1.01325bar
- Type
float
-
jobname
¶ The name of the job and the directory within plam_workdir. Defaults to “crsJob_0”, “crsJob_1”, etc.
- Type
str
-
conformer
¶ A boolean indicating if multiple conformers are used in COSMO-RS. Default is False.
- Type
bool
-
massfraction
¶ A boolean indicating if the input fraction is a mass fraction. Default is False.
- Type
bool
-
density_corr
¶ A boolean indicating whether to correct the volume of the compound using the density of the pure compound. Default is False, indicating the COSMO volume will be used instead.
- Type
bool
-
vp_corr
¶ A boolean indicating whether to correct the gas phase chemical potentail using the vapor pressure. Default is False.
- Type
bool
-
solute
¶ A str indicating the solute state to be ‘solid’, ‘gas’ or ‘liquid’, applicable to problem type SOLUBILITY and PURESOLUBILITY. Default is ‘solid’.
- Type
str
-
iso
¶ A str indicating the calculation condition to be ‘isotherm’, ‘isobar’ or ‘flashpoint’, applicable to problem types BINMIXCOEF, TERNARYMIX and COMPOSITIONLINE. Default is ‘isotherm’
- Type
str
-
additional_sett
¶ A Settings object that allows for additional customized settings.
- Type
|Settings|
-
multi_species
¶ A dictionary representing multi-species settings, where keys are Identifiers and values are Settings objects
- Type
dictionary
-
Reference