darsia.SimpleFlash#

class SimpleFlash(min_value_aq=0.0, max_value_aq=0.75, min_value_g=0.75, max_value_g=1.0, restoration=None)[source]#

Bases: object

Flash splitting a signal into aqueous and gas fractions by fixed bounds.

Constructor.

The default bounds split the signal range [0, 1] into an aqueous part [0, 0.75] and a gaseous part [0.75, 1].

Parameters:
min_value_aqfloat

Signal value below which there is no dissolved CO2.

max_value_aqfloat

Signal value from which the aqueous phase is saturated.

min_value_gfloat

Signal value below which there is no gas.

max_value_gfloat

Signal value from which the gas saturation is one.

restorationoptional

Restoration applied to the resulting concentration and saturation.

Methods

from_dict(data)

Create a SimpleFlash from a dictionary.

load(path)

Load the SimpleFlash parameters from a file.

ramp_bounds()

Bounds of the two linear ramps, if the flash consists of them only.

save(path)

Save the SimpleFlash parameters to a file.

to_dict()

Convert the SimpleFlash parameters to a dictionary.

update([min_value_aq, max_value_aq, ...])

Update of internal parameters.

Attributes

min_value_aq

Minimum value.

max_value_aq

Maximum value.

min_value_g

Minimum value.

max_value_g

Maximum value.

restoration

Restoration object.

classmethod from_dict(data)[source]#

Create a SimpleFlash from a dictionary.

Parameters:
datadict

Dictionary representation of the SimpleFlash parameters.

classmethod load(path)[source]#

Load the SimpleFlash parameters from a file.

Parameters:
pathPath

The path to the file from which the parameters will be loaded.

Returns:
SimpleFlash

The loaded SimpleFlash instance.

ramp_bounds()[source]#

Bounds of the two linear ramps, if the flash consists of them only.

Compiled single-pass evaluations (multiphase/mass_kernels.py) rely on this and replace __call__. NOTE: Any new option which changes the result of __call__ must return None here, and a change of the ramps must be mirrored in the kernel.

Returns:
tuple or None

Minimal and maximal signal of the aqueous ramp, minimal and maximal signal of the gas ramp; None with a restoration or for a subclass.

save(path)[source]#

Save the SimpleFlash parameters to a file.

Parameters:
pathPath

The path to the file where the parameters will be saved.

to_dict()[source]#

Convert the SimpleFlash parameters to a dictionary.

Returns:
dict

Dictionary representation of the SimpleFlash parameters.

update(min_value_aq=None, max_value_aq=None, min_value_g=None, max_value_g=None)[source]#

Update of internal parameters.

Parameters:
min_value_aqfloat | None

Minimum value for aqueous phase.

max_value_aqfloat | None

Maximum value for aqueous phase.

min_value_gfloat | None

Minimum value for gas phase.

max_value_gfloat | None

Maximum value for gas phase.

max_value_aq#

Maximum value.

max_value_g#

Maximum value.

min_value_aq#

Minimum value.

min_value_g#

Minimum value.

restoration#

Restoration object.