Configuration API#

Here is listed the completed API available to implement the Solver Configuration Hooks.

Hydrodynamic Model#

class AddField#

Allows the plugin to add new fields to Hydrodynamic model.

An added field must be associated to a phase (Using AddPhase or UpdatePhase) and added to a layer (Using AddLayer or UpdateLayer)

Variables:

name – Name of the new field.

Note

This type is supposed to be used in the alfasim_configure_fields() hook.

class AddPhase#

Allows the plugin to add new phases to Hydrodynamic model.

Variables:
  • name – Name of the new phase.

  • fields – List of fields names associated to the added phase. It is important to know how to calculate the state variables of fields.

  • primary_field – Reference field when a phase property calculation is performed through the fields of the phase.

  • is_solid – A boolean variable to identify if the added phase is solid.

Note

This type is supposed to be used in the alfasim_configure_phases() hook.

class UpdatePhase#

Allows the plugin update existing phases of the Hydrodynamic model.

List of possible phase names (see Constants for details):
  • GAS_PHASE

  • OIL_PHASE

  • WATER_PHASE (If a three phase hydrodynamic model is used)

Variables:
  • name – Name of the new phase.

  • additional_fields – List of additional fields names to be appended in the fields list of the phase.

Note

This type is supposed to be used in the alfasim_configure_phases() hook.

class AddLayer#

Allows the plugin to add new layers to Hydrodynamic model.

Variables:
  • name – Name of the new layer.

  • fields – List of fields names contained in the added layer.

  • continuous_field – Name of the continuous field of the added layer (must be in the fields list).

Note

This type is supposed to be used in the alfasim_configure_layers() hook.

class UpdateLayer#

Allows the plugin to update existing layer of the Hydrodynamic model.

List of possible layers names (see Constants for details):
  • GAS_LAYER

  • OIL_LAYER

  • WATER_LAYER (If a three phase hydrodynamic model is used)

Variables:
  • name – Name of the updated layer.

  • additional_fields – List of additional fields names to be appended in the fields list of the layer.

Note

This type is supposed to be used in the alfasim_configure_layers() hook.

Secondary Variables#

class SecondaryVariable#

Secondary variables are those variables that are not unknowns from the nonlinear system. That is, they are not directly solved in the nonlinear system, but they are calculated based on the nonlinear system results.

Variables:
  • name – Plugin secondary variable name. This name will be used to access it in the Solver Hooks.

  • caption – Caption to be shown in the GUI (For output purpose).

  • type – a Type value.

  • unit – A string with the unit of the variable.

  • visibility – a Visibility value.

  • location – a Location value.

  • multifield_scope – a Scope.

  • default_value – Default value to be set.

  • checked_on_gui_default – If the added variable has Visibility equal to Output, it indicates that this variable will be exported as output by default.

The unit param accepts all units available on Barril Unit Manager, for more information read its documentation.

Note

This type is supposed to be used in the alfasim_get_additional_variables() hook.

class Type#
Indicates the type of the variable.
  • Double: Double precision floating point data type.

  • Int: Integral data type.

class Visibility#
Controls the visibility of the variable.
  • Internal: The variable should only be used by the plugin, but not available to the end-user.

  • Output: The variable should be available to the end user, as a Property on Plot Window

class Location#
Controls the Location of the variable in the pipe discretization.
  • Center: Center of the control volumes.

  • Face: Faces of control volumes.

class Scope#
Controls the Scope of the variable.
  • Energy: One value for each energy equation (One for GLOBAL model and number of layers for LAYER model).

  • Global: One global value (or related to the mixture).

  • Field: One value for each field of the hydrodynamic model.

  • Layer: One value for each layer of the hydrodynamic model.

  • Phase: One value for each phase of the hydrodynamic model.

Constants#

GAS_PHASE = 'gas'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

OIL_PHASE = 'oil'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

WATER_PHASE = 'water'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

GAS_LAYER = 'gas'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

OIL_LAYER = 'oil'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

WATER_LAYER = 'water'#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.