GaPFlow.models.viscosity#

Viscosity models.

This module implements the non-Newtonian viscosity models for piezoviscosity and shear thinning.

Functions

barus_piezo(p, mu0[, aB, name])

Computes viscosity under pressure using the Barus equation.

carreau_shear(shear_rate, mu0[, mu_inf, ...])

Computes shear-thinning viscosity using the Carreau model.

dukler_mixture(rho, eta_l[, eta_v, rho_l, ...])

Computes mixture viscosity using the linear Dukler model.

eyring_shear(shear_rate, mu0[, tauE, name])

Computes shear-thinning viscosity using the Eyring model.

mc_adams_mixture(rho, eta_l[, eta_v, rho_l, ...])

Computes mixture viscosity using the McAdams model.

piezoviscosity(p, mu0, piezo_dict)

Wrapper around implemented piezoviscosity models.

roelands_piezo(p, mu0[, mu_inf, p_ref, z, name])

Computes the pressure-dependent viscosity using Roeland's empirical piezoviscosity equation.

shear_rate_avg(dp_dx, dp_dy, h, u1, u2, mu)

Average shear rate.

shear_thinning_factor(shear_rate, mu0, ...)

Wrapper around implemented piezoviscosity models.

srate_wall_newton(dp_dx[, h, u1, u2, mu])

Shear rate of a Newtonian fluid at bottom and top walls.

GaPFlow.models.viscosity.barus_piezo(p, mu0, aB=2e-08, name='Barus')#

Computes viscosity under pressure using the Barus equation.

\[\mu(p) = \mu_0 e^{a_B p}\]
Parameters:
  • p (float or Array) – Pressure.

  • mu0 (float) – Reference viscosity.

  • aB (float) – Barus pressure-viscosity coefficient.

Returns:

Pressure-dependent viscosity.

Return type:

float or Array

GaPFlow.models.viscosity.carreau_shear(shear_rate, mu0, mu_inf=0.001, lam=0.02, a=2, N=0.8, name='Carreau')#

Computes shear-thinning viscosity using the Carreau model.

\[\mu(\dot{\gamma}) = \mu_\infty + (\mu_0 - \mu_\infty) \left[1 + (\lambda \dot{\gamma})^a \right]^{(N - 1)/a}\]
Parameters:
  • shear_rate (float or Array) – Shear rate.

  • mu0 (float) – Zero-shear viscosity.

  • mu_inf (float) – Infinite-shear viscosity.

  • lam (float) – Time constant (relaxation time).

  • a (float) – Power-law exponent factor.

  • N (float) – Flow behavior index.

Returns:

Shear-rate-dependent viscosity.

Return type:

float or Array

GaPFlow.models.viscosity.dukler_mixture(rho, eta_l, eta_v=3.9e-05, rho_l=850.0, rho_v=0.019, name='Dukler')#

Computes mixture viscosity using the linear Dukler model.

\[\eta = \alpha \eta_v + (1 - \alpha) \eta_l\]

where \(\alpha = \frac{\rho - \rho_l}{\rho_v - \rho_l}\) is the vapor mass fraction.

Parameters:
  • rho (float or np.ndarray) – Mixture density.

  • rho_l (float) – Liquid density.

  • rho_v (float) – Vapor density.

  • eta_l (float) – Viscosity of the liquid phase.

  • eta_v (float) – Viscosity of the vapor phase.

Returns:

Mixture viscosity.

Return type:

float or np.ndarray

GaPFlow.models.viscosity.eyring_shear(shear_rate, mu0, tauE=500000.0, name='Eyring')#

Computes shear-thinning viscosity using the Eyring model.

\[\mu(\dot{\gamma}) = \frac{\tau_0}{\dot{\gamma}} \sinh^{-1}\left(\frac{\mu_0 \dot{\gamma}}{\tau_0}\right)\]
Parameters:
  • shear_rate (float or Array) – Shear rate.

  • mu0 (float) – Zero-shear viscosity.

  • tauE (float) – Eyring stress.

Returns:

Shear-rate-dependent viscosity.

Return type:

float or Array

GaPFlow.models.viscosity.mc_adams_mixture(rho, eta_l, eta_v=3.9e-05, rho_l=850.0, rho_v=0.019, name='McAdams')#

Computes mixture viscosity using the McAdams model.

\[M = \alpha \frac{\rho_v}{\rho}, \quad \eta = \frac{\eta_v \eta_l}{\eta_l M + \eta_v (1 - M)}\]
Parameters:
  • rho (float or np.ndarray) – Mixture density.

  • eta_l (float) – Viscosity of the liquid phase.

  • eta_v (float) – Viscosity of the vapor phase.

  • rho_l (float) – Liquid density.

  • rho_v (float) – Vapor density.

Returns:

Mixture viscosity.

Return type:

float or np.ndarray

GaPFlow.models.viscosity.piezoviscosity(p: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], mu0: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], piezo_dict: dict) float | ndarray[tuple[Any, ...], dtype[_ScalarT]]#

Wrapper around implemented piezoviscosity models.

Parameters:
  • p (float or Array) – Pressure (field) (or density for Bayada-Chupin EoS)

  • mu0 (float) – Newtonian viscosity

  • piezo_dict (dict) – Parameters

Returns:

Pressure-dependent viscosity

Return type:

float or Array

GaPFlow.models.viscosity.roelands_piezo(p, mu0, mu_inf=0.001, p_ref=196000000.0, z=0.68, name='Roelands')#

Computes the pressure-dependent viscosity using Roeland’s empirical piezoviscosity equation.

Roeland’s equation models the increase of viscosity with pressure, commonly used in elastohydrodynamic lubrication and high-pressure fluid applications.

\[\mu(p) = \mu_0 * \exp( \ln(\mu_0/\mu_{\infty})(-1 + (1 + p/p_{ref})^z))\]
Parameters:
  • p (float or Array) – Pressure at which the viscosity is evaluated.

  • mu0 (float) – Viscosity at ambient pressure.

  • mu_inf (float) – Viscosity at very high pressure.

  • pR (float) – Reference pressure, characteristic of the fluid.

  • zR (float) – Pressure exponent, controlling the curvature of the viscosity increase.

Returns:

Pressure-dependent viscosity, same shape as p.

Return type:

float or Array

GaPFlow.models.viscosity.shear_rate_avg(dp_dx, dp_dy, h, u1, u2, mu)#

Average shear rate.

This assumes a Newtonian flow profile, i.e. a linear shear rate across the gap.

Parameters:
  • dp_dx (float or Array) – Pressure gradient x

  • dp_dy (float or Array) – Pressure gradient y

  • h (float or Array) – Gap height

  • u1 (float) – Velocity lower wall

  • u2 (float) – Velocity upper wall

  • mu (float or Array) – Viscosity

Returns:

Average shear rate

Return type:

float or Array

GaPFlow.models.viscosity.shear_thinning_factor(shear_rate: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], mu0: float | ndarray[tuple[Any, ...], dtype[_ScalarT]], thinning_dict: dict) float | ndarray[tuple[Any, ...], dtype[_ScalarT]]#

Wrapper around implemented piezoviscosity models.

Parameters:
  • shear_rate (float or Array) – Shear rate (field)

  • mu0 (float) – Newtonian viscosity

  • thinning_dict (dict) – Parameters

Returns:

Shear rate-dependent viscosity

Return type:

float or Array

GaPFlow.models.viscosity.srate_wall_newton(dp_dx, h=1.0, u1=1.0, u2=0.0, mu=1.0)#

Shear rate of a Newtonian fluid at bottom and top walls.