opendrift.models.openoil.adios.computation.physical_properties

utilities for doing computation on the physical properties of an oil record

Module Contents

Classes

Density

class to hold and do calculations on density

KinematicViscosity

class to hold and do calculations on kinematic viscosity

Functions

get_density_data(oil[, units, temp_units])

Return a table of density data:

get_kinematic_viscosity_data(oil[, units, temp_units])

Return a table of kinematic viscosity data:

get_dynamic_viscosity_data(oil[, units, temp_units])

Return a table of kinematic viscosity data:

convert_dvisc_to_kvisc(dvisc, density)

convert dynamic viscosity to kinematic viscosity

get_pour_point(oil)

Return oil's pour point or None

get_distillation_cuts(oil[, units, temp_units])

Return a table of distillation data:

max_water_fraction_emulsion(oil)

emul_water(oil)

This function computes two terms used in emulsification.

bullwinkle_fraction(oil)

_adios2_new_bull_calc(bullwinkle_fraction, oil_api)

From the Adios2 c++ file OilInitialize.cpp, there is functionality

class opendrift.models.openoil.adios.computation.physical_properties.Density(oil)[source]

class to hold and do calculations on density

data is stored internally in standard units: temperature in Kelvin density in kg/m^3

Initialize a density calculator

Parameters:

oil – an Oil object – the density data will be extracted

or

Parameters:

oil – Sequence of density/temperature pairs: [(980.0, 288.15), (990.0, 273.15)])

If data pairs, units must be kg/m^3 and K

initialize()[source]

Initialize the expansion coefficient

For outside the measured range

at_temp(temp, unit='K')[source]

density(s) at the provided temperature(s)

Parameters:
  • temp – scalar or sequence of temp in K

  • unit='K' – unit of temperature

densities will be returned as kg/m^3

class opendrift.models.openoil.adios.computation.physical_properties.KinematicViscosity(oil)[source]

class to hold and do calculations on kinematic viscosity

data is stored internally in standard units: temperature in Kelvin viscosity in m^2/s

initialize from an oil object

at_temp(temp, kvis_units='m^2/s', temp_units='K')[source]

Compute the kinematic viscosity of the oil as a function of temperature

Parameters:

temp_k – temperatures to compute at: can be scalar or array of values. Should be in Kelvin

viscosity as a function of temp is given by: v = A exp(k_v2 / T)

with constants determined from measured data

initialize()[source]

viscosity as a function of temp is given by:

v = A exp(k_v2 / T)

The constants, A and k_v2 are determined from the viscosity data:

If only one data point, a default value for k_vs is used:

2100 K, based on analysis of data in the ADIOS database as of 2018

If two data points, the two constants are directly computed

If three or more, the constants are computed by a least squares fit.

opendrift.models.openoil.adios.computation.physical_properties.get_density_data(oil, units='kg/m^3', temp_units='K')[source]

Return a table of density data:

list of (density, temp) pairs

Parameters:
  • oil – the oil object to get data from

  • units="kg/m^3" – units you want the density in

  • temp_units="K" – units you want the density in

opendrift.models.openoil.adios.computation.physical_properties.get_kinematic_viscosity_data(oil, units='m^2/s', temp_units='K')[source]

Return a table of kinematic viscosity data:

list of (viscosity, temp) pairs

Parameters:
  • oil – the oil object to get data from

  • units="cSt" – units you want the viscosity in

  • temp_units="K" – units you want the viscosity in

opendrift.models.openoil.adios.computation.physical_properties.get_dynamic_viscosity_data(oil, units='Pas', temp_units='K')[source]

Return a table of kinematic viscosity data:

list of (viscosity, temp) pairs

Parameters:
  • oil – the oil object to get data from

  • units="cSt" – units you want the viscosity in

  • temp_units="K" – units you want the viscosity in

opendrift.models.openoil.adios.computation.physical_properties.convert_dvisc_to_kvisc(dvisc, density)[source]

convert dynamic viscosity to kinematic viscosity

Parameters:

density – an initialized Density object

dvisc and densities are tables as returned from:

  • get_dynamic_viscosity_data

  • get_density_data

units: viscosity: Pas or kg/(m s)

density: kg/m^3

opendrift.models.openoil.adios.computation.physical_properties.get_pour_point(oil)[source]

Return oil’s pour point or None

opendrift.models.openoil.adios.computation.physical_properties.get_distillation_cuts(oil, units='fraction', temp_units='K')[source]

Return a table of distillation data:

list of (cut fraction, temp) pairs

Parameters:
  • oil – the oil object to get data from

  • units="fraction" – units you want the fraction in

  • temp_units="K" – units you want the temperature in

opendrift.models.openoil.adios.computation.physical_properties.max_water_fraction_emulsion(oil)[source]
opendrift.models.openoil.adios.computation.physical_properties.emul_water(oil)[source]

This function computes two terms used in emulsification. Ymax is the maximum water fraction of a stable emulsion. Smax is the maximum surface area of the water droplets inside the emulsion. (from ADIOS2)

opendrift.models.openoil.adios.computation.physical_properties.bullwinkle_fraction(oil)[source]
opendrift.models.openoil.adios.computation.physical_properties._adios2_new_bull_calc(bullwinkle_fraction, oil_api)[source]

From the Adios2 c++ file OilInitialize.cpp, there is functionality inside the function CAdiosData::Bullwinkle() which is annotated in the code as ‘new bull calc’.

It uses the following definitions: - TG, Documented as the value ‘dT/df - evaporation’.

I can only assume this is the initial fractional rate of evaporation.

  • TBP, Documented as the ‘ADIOS 1 liquid boiling point

    (bubble pt)’.

  • BullAdios1, which appears to be used to scale-average the

    initially computed bullwinkle fraction.

    get_density_data

Regardless, in order to approximate what Adios2 is doing, we need this modification of our bullwinkle fraction.