pmutt.eos.vanDerWaalsEOS

class pmutt.eos.vanDerWaalsEOS(a, b)

Bases: _pmuttBase

van der Waals equation of state

\(\bigg(P+a\big(\frac{n}{V}\big)^2 \bigg)\bigg(\frac{V}{n}-b \bigg)=RT\)

a

Measure of average attraction between particles in Pa m6/mol

Type:

float

b

Volume excluded by a mole of particles in m3/mol

Type:

float

__init__(a, b)

Methods

__init__(a, b)

from_critical(Tc, Pc)

Creates the van der Waals object from critical temperature and pressure

from_dict(json_obj)

Recreate an object from the JSON representation.

get_P([T, V, n])

Calculates the pressure of a van der Waals gas

get_Pc()

Calculates the critical pressure

get_T([V, P, n])

Calculates the temperature of a van der Waals gas

get_Tc()

Calculates the critical temperature

get_V([T, P, n, gas_phase])

Calculates the volume of a van der Waals gas

get_Vc([n])

Calculates the critical volume

get_Vm([T, P, gas_phase])

Calculates the molar volume of a van der Waals gas

get_n([V, P, T, gas_phase])

Calculates the moles of a van der Waals gas

to_dict()

Represents object as dictionary with JSON-accepted datatypes

classmethod from_critical(Tc, Pc)

Creates the van der Waals object from critical temperature and pressure

Parameters:
  • Tc (float) – Critical temperature in K

  • Pc (float) – Critical pressure in bar

Returns:

vanDerWaalsEOS

Return type:

vanDerWaalsEOS object

classmethod from_dict(json_obj)

Recreate an object from the JSON representation.

Parameters:

json_obj (dict) – JSON representation

Returns:

Obj

Return type:

Appropriate object

get_P(T=298.15, V=0.0247895618937, n=1.0)

Calculates the pressure of a van der Waals gas

Parameters:
  • T (float, optional) – Temperature in K. Default is standard temperature

  • V (float, optional) – Volume in m3. Default is standard volume

  • n (float, optional) – Number of moles (in mol). Default is 1 mol

Returns:

P – Pressure in bar

Return type:

float

get_Pc()

Calculates the critical pressure

Returns:

Pc – Critical pressure in bar

Return type:

float

get_T(V=0.0247895618937, P=1.0, n=1.0)

Calculates the temperature of a van der Waals gas

Parameters:
  • V (float, optional) – Volume in m3. Default is standard volume

  • P (float, optional) – Pressure in bar. Default is standard pressure

  • n (float, optional) – Number of moles (in mol). Default is 1 mol

Returns:

T – Temperature in K

Return type:

float

get_Tc()

Calculates the critical temperature

Returns:

Tc – Critcial temperature in K

Return type:

float

get_V(T=298.15, P=1.0, n=1.0, gas_phase=True)

Calculates the volume of a van der Waals gas

Parameters:
  • T (float, optional) – Temperature in K. Default is standard temperature

  • P (float, optional) – Pressure in bar. Default is standard pressure

  • n (float, optional) – Number of moles (in mol). Default is 1 mol

  • gas_phase (bool, optional) – Relevant if system is in vapor-liquid equilibrium. If True, return the larger volume (gas phase). If False, returns the smaller volume (liquid phase).

Returns:

V – Volume in m3

Return type:

float

get_Vc(n=1.0)

Calculates the critical volume

Parameters:

n (float, optional) – Number of moles in mol. Default is 1 mol

Returns:

Vc – Critical volume in m3

Return type:

float

get_Vm(T=298.15, P=1.0, gas_phase=True)

Calculates the molar volume of a van der Waals gas

Parameters:
  • T (float, optional) – Temperature in K. Default is standard temperature

  • P (float, optional) – Pressure in bar. Default is standard pressure

  • gas_phase (bool, optional) – Relevant if system is in vapor-liquid equilibrium. If True, return the larger volume (gas phase). If False, returns the smaller volume (liquid phase).

Returns:

Vm – Volume in m3

Return type:

float

get_n(V=0.0247895618937, P=1.0, T=298.15, gas_phase=True)

Calculates the moles of a van der Waals gas

Parameters:
  • V (float, optional) – Volume in m3. Default is standard volume

  • P (float, optional) – Pressure in bar. Default is standard pressure

  • T (float, optional) – Temperature in K. Default is standard temperature

  • gas_phase (bool, optional) – Relevant if system is in vapor-liquid equilibrium. If True, return the smaller moles (gas phase). If False, returns the larger moles (liquid phase).

Returns:

n – Number of moles in mol

Return type:

float

to_dict()

Represents object as dictionary with JSON-accepted datatypes

Returns:

obj_dict

Return type:

dict