Diffusion (polykin.properties.diffusion)¤
This module implements methods to calculate mutual and self-diffusion coefficients in binary liquid and gas mixtures.
DL_Hayduk_Minhas ¤
DL_Hayduk_Minhas(
T: float,
method: Literal["paraffin", "aqueous"],
MA: float,
rhoA: float,
viscB: float,
) -> float
Estimate the infinite-dilution coefficient of a solute A in a liquid solvent B, \(D^0_{AB}\), using the Hayduk-Minhas method.
References
- RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids 4th edition, 1986, p. 602.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
method
|
Method selection. Chose
TYPE:
|
MA
|
Molar mass of solute A. Unit = kg/mol.
TYPE:
|
rhoA
|
Density of solute A at the normal boiling point. Unit = kg/m³.
TYPE:
|
viscB
|
Viscostity of solvent B. Unit = Pa.s.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Diffusion coefficient of A in B at infinite dilution. Unit = m²/s. |
See also
DL_Wilke_Chang
: alternative method.
Examples:
Estimate the diffusion coefficient of vinyl chloride through liquid water.
>>> from polykin.properties.diffusion import DL_Hayduk_Minhas
>>> D = DL_Hayduk_Minhas(
... T=298., # temperature
... method='aqueous', # equation for aqueous solutions
... MA=62.5e-3, # molar mass of vinyl chloride
... rhoA=910., # density of vinyl chloride at the boiling point
... viscB=0.89e-3 # viscosity of water at solution temperature
... )
>>> print(f"{D:.2e} m²/s")
1.26e-09 m²/s
Source code in src/polykin/properties/diffusion/liquid.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
DL_Wilke_Chang ¤
DL_Wilke_Chang(
T: float,
MA: float,
MB: float,
rhoA: float,
viscB: float,
phi: float = 1.0,
) -> float
Estimate the infinite-dilution coefficient of a solute A in a liquid solvent B, \(D^0_{AB}\), using the Wilke-Chang method.
where the meaning of all symbols is as described below in the parameters section. The numerical factor has been adjusted to convert the equation to SI units.
References
- RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids 4th edition, 1986, p. 598.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
MA
|
Molar mass of solute A. Unit = kg/mol.
TYPE:
|
MB
|
Molar mass of solvent B. Unit = kg/mol.
TYPE:
|
rhoA
|
Density of solute A at the normal boiling point, \(\rho_A\). Unit = kg/m³.
TYPE:
|
viscB
|
Viscostity of solvent B, \(\eta_B\). Unit = Pa.s.
TYPE:
|
phi
|
Association factor of solvent B, \(\phi\). The following values are recomended: {water: 2.6, methanol: 1.9, ethanol: 1.5, unassociated: 1.0}.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Diffusion coefficient of A in B at infinite dilution. Unit = m²/s. |
See also
DL_Hayduk_Minhas
: alternative method.
Examples:
Estimate the diffusion coefficient of vinyl chloride through liquid water.
>>> from polykin.properties.diffusion import DL_Wilke_Chang
>>> D = DL_Wilke_Chang(
... T=298., # temperature
... MA=62.5e-3, # molar mass of vinyl chloride
... MB=18.0e-3, # molar mass of water
... rhoA=910., # density of vinyl chloride at the boiling point
... viscB=0.89e-3, # viscosity of water at solution temperature
... phi=2.6 # association factor for water (see docstring)
... )
>>> print(f"{D:.2e} m²/s")
1.34e-09 m²/s
Source code in src/polykin/properties/diffusion/liquid.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
DV_Wilke_Lee ¤
DV_Wilke_Lee(
T: float,
P: float,
MA: float,
MB: float,
rhoA: float,
rhoB: float | None,
TA: float,
TB: float | None,
) -> float
Estimate the mutual diffusion coefficient of a binary gas mixture, \(D_{AB}\), using the Wilke-Lee method.
Note
If air is one of the components of the mixture, arguments TB
and
rhoB
should both be set to None
.
References
- RC Reid, JM Prausniz, and BE Poling. The properties of gases & liquids 4th edition, 1986, p. 587.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
P
|
Pressure. Unit = Pa.
TYPE:
|
MA
|
Molar mass of component A. Unit = kg/mol.
TYPE:
|
MA
|
Molar mass of component B. Unit = kg/mol.
TYPE:
|
rhoA
|
Density of component A at the normal boiling point. Unit = kg/m³.
TYPE:
|
rhoB
|
Density of component B at the normal boiling point. If
TYPE:
|
TA
|
Normal boiling temperature of component A. Unit = K.
TYPE:
|
TB
|
Normal boiling temperature of component B. If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Binary diffusion coefficient. Unit = m²/s. |
Examples:
Estimate the diffusion coefficient of vinyl chloride through water vapor.
>>> from polykin.properties.diffusion import DV_Wilke_Lee
>>> D = DV_Wilke_Lee(
... T=298., # temperature
... P=1e5, # pressure
... MA=62.5e-3, # molar mass of vinyl chloride
... MB=18.0e-3, # molar mass of water
... rhoA=910., # density of vinyl chloride at the normal boiling point
... rhoB=959., # density of water at the normal boiling point
... TA=260., # normal boiling point of vinyl chloride
... TB=373., # normal boiling point of water
... )
>>> print(f"{D:.2e} m²/s")
1.10e-05 m²/s
Estimate the diffusion coefficient of vinyl chloride through air.
>>> from polykin.properties.diffusion import DV_Wilke_Lee
>>> D = DV_Wilke_Lee(
... T=298., # temperature
... P=1e5, # pressure
... MA=62.5e-3, # molar mass of vinyl chloride
... MB=18.0e-3, # molar mass of water
... rhoA=910., # density of vinyl chloride at the normal boiling point
... rhoB=None, # air
... TA=260., # normal boiling point of vinyl chloride
... TB=None, # air
... )
>>> print(f"{D:.2e} m²/s")
1.37e-05 m²/s
Source code in src/polykin/properties/diffusion/vapor.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
VrentasDudaBinary ¤
Vrentas-Duda free volume model for the diffusivity of binary polymer solutions.
The solvent self-diffusion coefficient is given by:
and the mutual diffusion coefficient is given by:
where \(D_0\) is the pre-exponential factor, \(E\) is the activation energy required to overcome the atractive forces between neighboring molecules, \(K_{ij}\) are free-volume parameters, \(T\) is the temperature, \(T_{gi}\) is the glass-transition temperature of component \(i\), \(\hat{V}_i^*\) is the specific volume of component \(i\) at 0 kelvin, \(w_i\) is the mass fraction of compoenent \(i\), \(\gamma\) is the overlap factor, \(\xi\) is the ratio between the critical volume of the polymer and the solvent jumping units, and \(\chi\) is the Flory-Huggins' interaction parameter.
References
- Vrentas, J.S. and Duda, J.L. (1977), J. Polym. Sci. Polym. Phys. Ed., 15: 403-416.
PARAMETER | DESCRIPTION |
---|---|
D0
|
Pre-exponential factor. Unit = L²/T.
TYPE:
|
E
|
Activation energy required to overcome the atractive forces between neighboring molecules. Units = J/mol/K.
TYPE:
|
v1star
|
Specific volume of solvent at 0 K. Unit = L³/M.
TYPE:
|
v2star
|
Specific volume of polymer at 0 K. Unit = L³/M.
TYPE:
|
z
|
Ratio between the critical volume of the polymer and the solvent jumping units, \(\xi\).
TYPE:
|
K11
|
Free-volume parameter of solvent. Unit = L³/M/K.
TYPE:
|
K12
|
Free-volume parameter of polymer. Unit = L³/M/K.
TYPE:
|
K21
|
Free-volume parameter of solvent. Unit = K.
TYPE:
|
K22
|
Free-volume parameter of polymer. Unit = K.
TYPE:
|
Tg1
|
Glas-transition temperature of solvent. Unit = K.
TYPE:
|
Tg2
|
Glas-transition temperature of polymer. Unit = K.
TYPE:
|
y
|
Overlap factor, \(\gamma\).
TYPE:
|
X
|
Flory-Huggings interaction parameter, \(\chi\).
TYPE:
|
unit
|
Unit of diffusivity, by definition equal to L²/T.
TYPE:
|
name
|
Name.
TYPE:
|
Examples:
Estimate the mutual and self-diffusion coefficient of toluene in polyvinylacetate at 20 wt% toluene and 25°C.
>>> from polykin.properties.diffusion import VrentasDudaBinary
>>> d = VrentasDudaBinary(
... D0=4.82e-4, E=0., v1star=0.917, v2star=0.728, z=0.82,
... K11=1.45e-3, K12=4.33e-4, K21=-86.32, K22=-258.2, X=0.5,
... unit='cm²/s',
... name='Tol(1)/PVAc(2)')
>>> D = d(0.2, 25., Tunit='C')
>>> print(f"D = {D:.2e} {d.unit}")
D = 3.79e-08 cm²/s
>>> D1 = d(0.2, 25., Tunit='C', selfd=True)
>>> print(f"D1 = {D1:.2e} {d.unit}")
D1 = 7.40e-08 cm²/s
Source code in src/polykin/properties/diffusion/vrentasduda.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
|
__call__ ¤
__call__(
w1: Union[float, FloatArrayLike],
T: Union[float, FloatArrayLike],
Tunit: Literal["C", "K"] = "K",
selfd: bool = False,
) -> Union[float, FloatArray]
Evaluate solvent self-diffusion, \(D_1\), or mutual diffusion coefficient, \(D\), at given solvent content and temperature, including unit conversion and range check.
PARAMETER | DESCRIPTION |
---|---|
w1
|
Mass fraction of solvent. Unit = kg/kg.
TYPE:
|
T
|
Temperature.
Unit =
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
selfd
|
Switch result between mutual diffusion coefficient (if
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Solvent self-diffusion or mutual diffusion coefficient. |
Source code in src/polykin/properties/diffusion/vrentasduda.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
|
mutual ¤
mutual(
w1: Union[float, FloatArray],
T: Union[float, FloatArray],
) -> Union[float, FloatArray]
Evaluate mutual diffusion coefficient, \(D\), at given SI conditions, without unit conversions or checks.
PARAMETER | DESCRIPTION |
---|---|
w1
|
Mass fraction of solvent. Unit = kg/kg.
TYPE:
|
T
|
Temperature. Unit = K.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Mutual diffusion coefficient, \(D\). |
Source code in src/polykin/properties/diffusion/vrentasduda.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
plot ¤
plot(
T: Union[float, FloatArrayLike],
w1range: tuple[float, float] = (0.0, 0.5),
Tunit: Literal["C", "K"] = "K",
selfd: bool = False,
title: Optional[str] = None,
ylim: Optional[tuple[float, float]] = None,
axes: Optional[Axes] = None,
return_objects: bool = False,
) -> Optional[tuple[Optional[Figure], Axes]]
Plot the mutual or self-diffusion coefficient as a function of solvent content and temperature.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature.
Unit =
TYPE:
|
w1range
|
Range of solvent mass fraction to be ploted. Unit = kg/kg.
TYPE:
|
Tunit
|
Temperature unit.
TYPE:
|
selfd
|
Switch result between mutual diffusion coefficient (if
TYPE:
|
title
|
Title of plot. If
TYPE:
|
ylim
|
User-defined limit of y-axis. If
TYPE:
|
axes
|
Matplotlib Axes object.
TYPE:
|
return_objects
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Figure | None, Axes] | None
|
Figure and Axes objects if return_objects is |
Source code in src/polykin/properties/diffusion/vrentasduda.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
|
selfd ¤
selfd(
w1: Union[float, FloatArray],
T: Union[float, FloatArray],
) -> Union[float, FloatArray]
Evaluate solvent self-diffusion coefficient, \(D_1\), at given SI conditions, without unit conversions or checks.
PARAMETER | DESCRIPTION |
---|---|
w1
|
Mass fraction of solvent. Unit = kg/kg.
TYPE:
|
T
|
Temperature. Unit = K.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Solvent self-diffusion coefficient, \(D_1\). |
Source code in src/polykin/properties/diffusion/vrentasduda.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|