Eos
jax_lab.core.eos.EOS
Base class for equations of state.
Parameters
temperature_field_type (str, optional): "isothermal" for a fixed temperature or "thermal" for a temperature
field. Defaults to "isothermal".
a, b (float or list of float): Equation-specific parameters for each component.
R (float or list of float): Gas constant for each component.
T (float, optional): Fixed temperature required for isothermal calculations.
Source code in jax_lab/core/eos.py
9 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 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 | |
EOS
Evaluate the isothermal equation of state.
Parameters
rho_tree (pytree of jax.Array): Component density fields.
Returns
pytree of jax.Array Component pressure fields.
Source code in jax_lab/core/eos.py
EOS_thermal
Evaluate the equation of state with a temperature field.
Parameters
rho_tree (pytree of jax.Array): Component density fields.
T (jax.Array): Temperature field.
Returns
pytree of jax.Array Component pressure fields.
Source code in jax_lab/core/eos.py
dp_eos_dT
Evaluate the pressure derivative with respect to temperature.
Parameters
rho_tree (pytree of jax.Array): Component density fields.
T (jax.Array): Temperature field.
Returns
pytree of jax.Array Component pressure derivatives.
Source code in jax_lab/core/eos.py
jax_lab.core.eos.VanderWaals
Bases: EOS
Define a multiphase model using the VanderWaals EOS.
Parameters
a (list of float): Attraction parameter for each component.
b (list of float): Excluded-volume parameter for each component.
R (list of float): Gas constant for each component.
T (float or jax.Array): Temperature used by the isothermal equation of state.
References
- Reprint of: The Equation of State for Gases and Liquids. The Journal of Supercritical Fluids, 100th year Anniversary of van der Waals’ Nobel Lecture, 55, no. 2 (2010): 403-14. https://doi.org/10.1016/j.supflu.2010.11.001.
Notes
EOS is given by: p = (rhoRT)/(1 - brho) - arho^2
Source code in jax_lab/core/eos.py
pressure_component
Evaluate one component’s isothermal pressure.
Source code in jax_lab/core/eos.py
jax_lab.core.eos.RedlichKwong
Bases: EOS
Define multiphase model using the Redlich-Kwong EOS.
Parameters
a, b, R (list of float): Equation parameters for each component.
T (float or jax.Array): Temperature used by the isothermal equation of state.
References
- Redlich O., Kwong JN., “On the thermodynamics of solutions; an equation of state; fugacities of gaseous solutions.” Chem Rev. 1949 Feb;44(1):233-44. https://doi.org/10.1021/cr60137a013.
Notes
EOS is given by: p = (rhoRT)/(1 - brho) - (arho^2)/(sqrt(T) * (1 + b*rho))
Source code in jax_lab/core/eos.py
pressure_component
Evaluate one component’s isothermal pressure.
Source code in jax_lab/core/eos.py
jax_lab.core.eos.RedlichKwongSoave
Bases: EOS
Define multiphase model using the Redlich-Kwong-Soave EOS.
Parameters
a, b, R (list of float): Equation parameters for each component.
T (float or jax.Array): Temperature used by the isothermal equation of state.
RKS_omega (list of float): Acentric factor for each component.
References
- Giorgio Soave, “Equilibrium constants from a modified Redlich-Kwong equation of state”, Chemical Engineering Science 27, no. 6(1972), 1197-1203, https://doi.org/10.1016/0009-2509(72)80096-4.
Notes
EOS is given by: p = (rhoRT)/(1 - brho) - (aalpharho^2)/(1 + brho)
Source code in jax_lab/core/eos.py
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 | |
pressure_component
Evaluate one component’s isothermal pressure.
Source code in jax_lab/core/eos.py
jax_lab.core.eos.PengRobinson
Bases: EOS
Define multiphase model using the Peng-Robinson EOS.
Parameters
a, b, R (list of float): Equation parameters for each component.
T (float or jax.Array): Temperature used by the isothermal equation of state.
pr_omega (float or list of float): Acentric factor for each component.
References
- Peng, Ding-Yu, and Donald B. Robinson. “A new two-constant equation of state.” Industrial & Engineering Chemistry Fundamentals 15, no. 1 (1976): 59-64. https://doi.org/10.1021/i160057a011
Notes
EOS is given by: p = (rhoRT)/(1 - brho) - (aalpharho^2)/(1 + 2brho - (brho)**2)
Source code in jax_lab/core/eos.py
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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
pressure_component
Evaluate one component’s isothermal pressure.
Source code in jax_lab/core/eos.py
jax_lab.core.eos.CarnahanStarling
Bases: EOS
Define multiphase model using the Carnahan-Starling EOS.
Parameters
a, b, R (list of float): Equation parameters for each component.
T (float or jax.Array): Temperature used by the isothermal equation of state.
References
- Carnahan, Norman F., and Kenneth E. Starling. “Equation of state for nonattracting rigid spheres.” The Journal of chemical physics 51, no. 2 (1969): 635-636. https://doi.org/10.1063/1.1672048
Notes
EOS is given by: p = (rhoRT)(1 + (0.25brho) + (0.25brho)^2 - (0.25brho)^3)/(1 - brho)^3 - (a*rho^2)
Source code in jax_lab/core/eos.py
pressure_component
Evaluate one component’s isothermal pressure.