Skip to content

polykin.properties.pvt_polymer¤

This module implements methods to evaluate the PVT behavior of pure polymers.

HartmannHaque ¤

Hartmann-Haque equation of state for the specific volume of a polymer.

This EoS implements the following implicit PVT dependence:

\[ \tilde{P}\tilde{V}^5=\tilde{T}^{3/2}-\ln{\tilde{V}} \]

where \(\tilde{V}=V/V^*\), \(\tilde{P}=P/P^*\) and \(\tilde{T}=T/T^*\) are, respectively, the reduced volume, reduced pressure and reduced temperature. \(V^*\), \(P^*\) and \(T^*\) are reference quantities that are polymer dependent.

References

  • Caruthers et al. Handbook of Diffusion and Thermal Properties of Polymers and Polymer Solutions. AIChE, 1998.
PARAMETER DESCRIPTION
V0

Reference volume, \(V^*\).

TYPE: float

T0

Reference temperature, \(T^*\).

TYPE: float

P0

Reference pressure, \(P^*\).

TYPE: float

Tmin

Lower temperature bound. Unit = K.

TYPE: float DEFAULT: 0.0

Tmax

Upper temperature bound. Unit = K.

TYPE: float DEFAULT: inf

Pmin

Lower pressure bound. Unit = Pa.

TYPE: float DEFAULT: 0.0

Pmax

Upper pressure bound. Unit = Pa.

TYPE: float DEFAULT: inf

name

Name.

TYPE: str DEFAULT: ''

Source code in src/polykin/properties/pvt_polymer/eos.py
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
class HartmannHaque(PolymerPVTEoS):
    r"""Hartmann-Haque equation of state for the specific volume of a polymer.

    This EoS implements the following implicit PVT dependence:

    $$ \tilde{P}\tilde{V}^5=\tilde{T}^{3/2}-\ln{\tilde{V}} $$

    where $\tilde{V}=V/V^*$, $\tilde{P}=P/P^*$ and $\tilde{T}=T/T^*$ are,
    respectively, the reduced volume, reduced pressure and reduced temperature.
    $V^*$, $P^*$ and $T^*$ are reference quantities that are polymer dependent.

    **References**

    *   Caruthers et al. Handbook of Diffusion and Thermal Properties of
        Polymers and Polymer Solutions. AIChE, 1998.

    Parameters
    ----------
    V0 : float
        Reference volume, $V^*$.
    T0 : float
        Reference temperature, $T^*$.
    P0 : float
        Reference pressure, $P^*$.
    Tmin : float
        Lower temperature bound.
        Unit = K.
    Tmax : float
        Upper temperature bound.
        Unit = K.
    Pmin : float
        Lower pressure bound.
        Unit = Pa.
    Pmax : float
        Upper pressure bound.
        Unit = Pa.
    name : str
        Name.
    """

    @staticmethod
    def equation(v: float,
                 t: float,
                 p: float
                 ) -> tuple[float, float, float]:
        """Hartmann-Haque equation of state and its volume derivatives.

        Parameters
        ----------
        v : float
            Reduced volume.
        t : float
            Reduced temperature.
        p : float
            Reduced pressure.

        Returns
        -------
        tuple[float, float, float]
            Equation of state, first derivative, second derivative.
        """
        f = p*v**5 - t**(3/2) + log(v)  # =0
        d1f = 5*p*v**4 + 1/v
        d2f = 20*p*v**3 - 1/v**2
        return (f, d1f, d2f)

V ¤

V(
    T: Union[float, FloatArrayLike],
    P: Union[float, FloatArrayLike],
    Tunit: Literal["C", "K"] = "K",
    Punit: Literal["bar", "MPa", "Pa"] = "Pa",
) -> Union[float, FloatArray]

Evaluate the specific volume, \(\hat{V}\), at given temperature and pressure, including unit conversion and range check.

PARAMETER DESCRIPTION
T

Temperature. Unit = Tunit.

TYPE: float | FloatArrayLike

P

Pressure. Unit = Punit.

TYPE: float | FloatArrayLike

Tunit

Temperature unit.

TYPE: Literal['C', 'K'] DEFAULT: 'K'

Punit

Pressure unit.

TYPE: Literal['bar', 'MPa', 'Pa'] DEFAULT: 'Pa'

RETURNS DESCRIPTION
float | FloatArray

Specific volume. Unit = m³/kg.

Source code in src/polykin/properties/pvt_polymer/base.py
 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
def V(self,
      T: Union[float, FloatArrayLike],
      P: Union[float, FloatArrayLike],
      Tunit: Literal['C', 'K'] = 'K',
      Punit: Literal['bar', 'MPa', 'Pa'] = 'Pa'
      ) -> Union[float, FloatArray]:
    r"""Evaluate the specific volume, $\hat{V}$, at given temperature and
    pressure, including unit conversion and range check.

    Parameters
    ----------
    T : float | FloatArrayLike
        Temperature.
        Unit = `Tunit`.
    P : float | FloatArrayLike
        Pressure.
        Unit = `Punit`.
    Tunit : Literal['C', 'K']
        Temperature unit.
    Punit : Literal['bar', 'MPa', 'Pa']
        Pressure unit.

    Returns
    -------
    float | FloatArray
        Specific volume.
        Unit = m³/kg.
    """
    TK = convert_check_temperature(T, Tunit, self.Trange)
    Pa = convert_check_pressure(P, Punit, self.Prange)
    return self.eval(TK, Pa)

alpha ¤

alpha(
    T: Union[float, FloatArray], P: Union[float, FloatArray]
) -> Union[float, FloatArray]

Calculate thermal expansion coefficient, \(\alpha\).

\[\alpha=\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_{P}\]
PARAMETER DESCRIPTION
T

Temperature. Unit = K.

TYPE: float | FloatArray

P

Pressure. Unit = Pa.

TYPE: float | FloatArray

RETURNS DESCRIPTION
float | FloatArray

Thermal expansion coefficient, \(\alpha\). Unit = 1/K.

Source code in src/polykin/properties/pvt_polymer/eos.py
 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
def alpha(self,
          T: Union[float, FloatArray],
          P: Union[float, FloatArray]
          ) -> Union[float, FloatArray]:
    r"""Calculate thermal expansion coefficient, $\alpha$.

    $$\alpha=\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_{P}$$

    Parameters
    ----------
    T : float | FloatArray
        Temperature.
        Unit = K.
    P : float | FloatArray
        Pressure.
        Unit = Pa.

    Returns
    -------
    float | FloatArray
        Thermal expansion coefficient, $\alpha$.
        Unit = 1/K.
    """
    dT = 0.5
    V2 = self.eval(T + dT, P)
    V1 = self.eval(T - dT, P)
    return (V2 - V1)/dT/(V1 + V2)

beta ¤

beta(
    T: Union[float, FloatArray], P: Union[float, FloatArray]
) -> Union[float, FloatArray]

Calculate isothermal compressibility coefficient, \(\beta\).

\[\beta=-\frac{1}{V}\left(\frac{\partial V}{\partial P}\right)_{T}\]
PARAMETER DESCRIPTION
T

Temperature. Unit = K.

TYPE: float | FloatArray

P

Pressure. Unit = Pa.

TYPE: float | FloatArray

RETURNS DESCRIPTION
float | FloatArray

Isothermal compressibility coefficient, \(\beta\). Unit = 1/Pa.

Source code in src/polykin/properties/pvt_polymer/eos.py
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
def beta(self,
         T: Union[float, FloatArray],
         P: Union[float, FloatArray]
         ) -> Union[float, FloatArray]:
    r"""Calculate isothermal compressibility coefficient, $\beta$.

    $$\beta=-\frac{1}{V}\left(\frac{\partial V}{\partial P}\right)_{T}$$

    Parameters
    ----------
    T : float | FloatArray
        Temperature.
        Unit = K.
    P : float | FloatArray
        Pressure.
        Unit = Pa.

    Returns
    -------
    float | FloatArray
        Isothermal compressibility coefficient, $\beta$.
        Unit = 1/Pa.
    """
    dP = 1e5
    P2 = P + dP
    P1 = np.max(P - dP, 0)
    V2 = self.eval(T, P2)
    V1 = self.eval(T, P1)
    return -(V2 - V1)/(P2 - P1)/(V1 + V2)*2

equation staticmethod ¤

equation(
    v: float, t: float, p: float
) -> tuple[float, float, float]

Hartmann-Haque equation of state and its volume derivatives.

PARAMETER DESCRIPTION
v

Reduced volume.

TYPE: float

t

Reduced temperature.

TYPE: float

p

Reduced pressure.

TYPE: float

RETURNS DESCRIPTION
tuple[float, float, float]

Equation of state, first derivative, second derivative.

Source code in src/polykin/properties/pvt_polymer/eos.py
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
@staticmethod
def equation(v: float,
             t: float,
             p: float
             ) -> tuple[float, float, float]:
    """Hartmann-Haque equation of state and its volume derivatives.

    Parameters
    ----------
    v : float
        Reduced volume.
    t : float
        Reduced temperature.
    p : float
        Reduced pressure.

    Returns
    -------
    tuple[float, float, float]
        Equation of state, first derivative, second derivative.
    """
    f = p*v**5 - t**(3/2) + log(v)  # =0
    d1f = 5*p*v**4 + 1/v
    d2f = 20*p*v**3 - 1/v**2
    return (f, d1f, d2f)

eval ¤

eval(
    T: Union[float, FloatArray], P: Union[float, FloatArray]
) -> Union[float, FloatArray]

Evaluate specific volume, \(\hat{V}\), at given SI conditions without unit conversions or checks.

PARAMETER DESCRIPTION
T

Temperature. Unit = K.

TYPE: float | FloatArray

P

Pressure. Unit = Pa.

TYPE: float | FloatArray

RETURNS DESCRIPTION
float | FloatArray

Specific volume. Unit = m³/kg.

Source code in src/polykin/properties/pvt_polymer/eos.py
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
@vectorize
def eval(self,
         T: Union[float, FloatArray],
         P: Union[float, FloatArray]
         ) -> Union[float, FloatArray]:
    r"""Evaluate specific volume, $\hat{V}$, at given SI conditions without
    unit conversions or checks.

    Parameters
    ----------
    T : float | FloatArray
        Temperature.
        Unit = K.
    P : float | FloatArray
        Pressure.
        Unit = Pa.

    Returns
    -------
    float | FloatArray
        Specific volume.
        Unit = m³/kg.
    """
    t = T/self.T0
    p = P/self.P0
    solution = root_scalar(f=self.equation,
                           args=(t, p),
                           # bracket=[1.1, 1.5],
                           x0=1.05,
                           method='halley',
                           fprime=True,
                           fprime2=True)

    if solution.converged:
        v = solution.root
        V = v*self.V0
    else:
        print(solution.flag)
        V = -1.
    return V

from_database classmethod ¤

from_database(name: str) -> Optional[PolymerPVTEquation]

Construct PolymerPVTEquation with parameters from the database.

PARAMETER DESCRIPTION
name

Polymer code name.

TYPE: str

Source code in src/polykin/properties/pvt_polymer/base.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
@classmethod
def from_database(cls,
                  name: str
                  ) -> Optional[PolymerPVTEquation]:
    r"""Construct `PolymerPVTEquation` with parameters from the database.

    Parameters
    ----------
    name : str
        Polymer code name.
    """
    table = load_PVT_parameters(method=cls.__name__)
    try:
        mask = table.index == name
        parameters = table[mask].iloc[0, :].to_dict()
        return cls(**parameters, name=name)
    except IndexError:
        print(
            f"Error: '{name}' does not exist in polymer database.\n"
            f"Valid names are: {table.index.to_list()}")

get_database classmethod ¤

get_database() -> pd.DataFrame

Get database with parameters for the respective PVT equation.

Method Reference
Flory [2] Table 4.1.7 (p. 72-73)
Hartmann-Haque [2] Table 4.1.11 (p. 85-86)
Sanchez-Lacombe [2] Table 4.1.9 (p. 78-79)
Tait [1] Table 3B-1 (p. 41)

References

  1. Danner, Ronald P., and Martin S. High. Handbook of polymer solution thermodynamics. John Wiley & Sons, 2010.
  2. Caruthers et al. Handbook of Diffusion and Thermal Properties of Polymers and Polymer Solutions. AIChE, 1998.
Source code in src/polykin/properties/pvt_polymer/base.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
@classmethod
def get_database(cls) -> pd.DataFrame:
    r"""Get database with parameters for the respective PVT equation.

    | Method          | Reference                            |
    | :-----------    | ------------------------------------ |
    | Flory           | [2] Table 4.1.7  (p. 72-73)          |
    | Hartmann-Haque  | [2] Table 4.1.11 (p. 85-86)          |
    | Sanchez-Lacombe | [2] Table 4.1.9  (p. 78-79)          |
    | Tait            | [1] Table 3B-1 (p. 41)               |

    **References**

    1.  Danner, Ronald P., and Martin S. High. Handbook of polymer
        solution thermodynamics. John Wiley & Sons, 2010.
    2.  Caruthers et al. Handbook of Diffusion and Thermal Properties of
        Polymers and Polymer Solutions. AIChE, 1998.
    """
    return load_PVT_parameters(method=cls.__name__)

Parameter databank¤

Polymer P0 V0 T0 Tmin Tmax Pmin Pmax
HDPE 2.804e+09 0.001038 1211 415 473 0 2e+08
HDPE 1.968e+09 0.001116 1582 413 476 0 1.96e+08
HMLPE 3.212e+09 0.001026 1135 410 473 0 2e+08
BPE 2.51e+09 0.001068 1313 398 471 0 2e+08
LDPE 2.816e+09 0.001042 1212 394 448 0 1.96e+08
LDPE-A 4.299e+08 0.0009236 603 385 498 0 1.96e+08
LDPE-B 4.214e+08 0.0009193 610 385 498 0 1.96e+08
LDPE-C 4.318e+08 0.0009229 606 385 498 0 1.96e+08
PIB 2.976e+09 0.0009935 1422 326 383 0 1e+08
i-PP 1.852e+09 0.001107 1475 443 570 0 1.96e+08
a-PP 2.383e+09 0.001029 1197 353 393 0 1e+08
i-PB 2.06e+09 0.001082 1452 406 519 0 1.96e+08
PMP 1.671e+09 0.001123 1449 514 592 0 1.96e+08
i-PMMA 4.18e+09 0.0007419 1403 328 463 0 2e+08
PMMA 3.819e+09 0.0007582 1467 387 432 0 2e+08
PCHMA 3.038e+09 0.0008249 1517 321 471 0 2e+08
PNBMA 3.268e+09 0.0008552 1309 307 473 0 2e+08
PS 2.956e+09 0.0008754 1603 388 469 0 2e+08
POMS 3.096e+09 0.0008891 1608 412 471 0 1.8e+08
PVAC 3.817e+09 0.0007368 1151 337 393 0 1e+08
PDMS 1.837e+09 0.0008795 1006 298 343 0 1e+08
PDMS3 1.789e+09 0.0009053 868 298 343 0 9e+08
PDMS10 1.861e+09 0.0009004 920 298 343 0 9e+08
PDMS20 1.908e+09 0.0008839 941 298 343 0 9e+08
PDMS100 1.98e+09 0.0008709 953 298 343 0 9e+08
PDMS350 1.928e+09 0.0008715 975 298 343 0 9e+08
PDMS1000 1.925e+09 0.0008716 977 298 343 0 9e+08
PTFE 3.251e+09 0.0003683 900 603 645 0 3.9e+08
PSF 3.972e+09 0.0007246 1623 475 644 0 1.96e+08
PBD 3.333e+09 0.0009855 1199 277 328 0 2.83e+08
PEO 3.504e+09 0.0008005 1254 361 497 0 6.8e+07
PTHF 2.894e+09 0.0009165 1276 335 439 0 7.8e+07
PET 4.071e+09 0.0006802 1484 547 615 0 1.96e+08
PBT 4.174e+09 0.0007096 1357 508 576 0 2e+08
POM 4.056e+09 0.0006994 1370 462 492 0 1.96e+08
PPO 3.079e+09 0.0007906 1339 476 593 0 1.76e+08
PC 3.644e+09 0.0007474 1502 424 613 0 1.76e+08
PAR 3.709e+09 0.0007408 1614 450 583 0 1.76e+08
PH 4.357e+09 0.0007784 1481 341 573 0 1.76e+08
PEEK 3.668e+09 0.0007044 1568 619 671 0 2e+08
PVC 3.595e+09 0.0006559 1532 373 423 0 2e+08
PA6 2.264e+09 0.0007654 2255 509 569 0 1.96e+08
PA66 2.453e+09 0.0007559 1643 519 571 0 1.96e+08
PA66 4.678e+09 0.0008144 1423 533 573 0 1e+08
PVME 3.245e+09 0.0008836 1342 303 471 0 2e+08
PMA 3.68e+09 0.0007712 1334 310 493 0 1.96e+08
PEA 3.076e+09 0.0008038 1284 310 490 0 1.96e+08
PEMA 3.654e+09 0.0007976 1298 386 434 0 1.96e+08
TMPC 2.907e+09 0.000801 1430 491 563 0 1.6e+08
HFPC 2.92e+09 0.0005758 1306 432 553 0 2e+08
BCPC 3.641e+09 0.0005356 1520 428 557 0 2e+08
PECH 3.775e+09 0.0006734 1456 333 413 0 2e+08
PCL 3.013e+09 0.0008418 1411 373 421 0 2e+08

Examples¤

Estimate the PVT properties of PMMA.

from polykin.properties.pvt_polymer import HartmannHaque

# Parameters from Handbook of Diffusion and Thermal Properties of Polymers
# and Polymer Solutions, p.85. 
m = HartmannHaque(
    V0=0.7582e-3,
    T0=1467.,
    P0=3819e6,
    Tmin=387.15,
    Tmax=432.15,
    Pmin=0.1e6,
    Pmax=200e6,
    name="PMMA"
    )

print(m.V(127., 1500, Tunit='C', Punit='bar'))
print(m.alpha(400., 1.5e8))
print(m.beta(400., 1.5e8))
0.0008238022439002397
0.0004115669587657248
3.055460905284873e-10
from polykin.properties.pvt_polymer import HartmannHaque

# Parameters retrieved from internal databank 
m = HartmannHaque.from_database("PMMA")

print(m.V(127., 1500, Tunit='C', Punit='bar'))
print(m.alpha(400., 1.5e8))
print(m.beta(400., 1.5e8))
0.0008238022439002397
0.0004115669587657248
3.055460905284873e-10