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:
objectFlash 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_aq
float Signal value below which there is no dissolved CO2.
- max_value_aq
float Signal value from which the aqueous phase is saturated.
- min_value_g
float Signal value below which there is no gas.
- max_value_g
float Signal value from which the gas saturation is one.
- restoration
optional Restoration applied to the resulting concentration and saturation.
- min_value_aq
Methods
from_dict(data)Create a SimpleFlash from a dictionary.
load(path)Load the SimpleFlash parameters from a file.
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
Minimum value.
Maximum value.
Minimum value.
Maximum value.
Restoration object.
- classmethod from_dict(data)[source]#
Create a SimpleFlash from a dictionary.
- Parameters:
- data
dict Dictionary representation of the SimpleFlash parameters.
- data
- classmethod load(path)[source]#
Load the SimpleFlash parameters from a file.
- Parameters:
- path
Path The path to the file from which the parameters will be loaded.
- path
- Returns:
SimpleFlashThe 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.
- save(path)[source]#
Save the SimpleFlash parameters to a file.
- Parameters:
- path
Path The path to the file where the parameters will be saved.
- path
- to_dict()[source]#
Convert the SimpleFlash parameters to a dictionary.
- Returns:
dictDictionary 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.
- max_value_aq#
Maximum value.
- max_value_g#
Maximum value.
- min_value_aq#
Minimum value.
- min_value_g#
Minimum value.
- restoration#
Restoration object.