Here is listed the completed API available to implement the Solver Configuration Hooks.
Hydrodynamic Model
Secondary Variables
Constants
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)
AddPhase
UpdatePhase
AddLayer
UpdateLayer
name – Name of the new field.
Note
This type is supposed to be used in the alfasim_configure_fields() hook.
alfasim_configure_fields()
Allows the plugin to add new phases to Hydrodynamic model.
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.
This type is supposed to be used in the alfasim_configure_phases() hook.
alfasim_configure_phases()
Allows the plugin update existing phases of the Hydrodynamic model.
GAS_PHASE
OIL_PHASE
WATER_PHASE (If a three phase hydrodynamic model is used)
WATER_PHASE
additional_fields – List of additional fields names to be appended in the fields list of the phase.
Allows the plugin to add new layers to Hydrodynamic model.
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).
This type is supposed to be used in the alfasim_configure_layers() hook.
alfasim_configure_layers()
Allows the plugin to update existing layer of the Hydrodynamic model.
GAS_LAYER
OIL_LAYER
WATER_LAYER (If a three phase hydrodynamic model is used)
WATER_LAYER
name – Name of the updated layer.
additional_fields – List of additional fields names to be appended in the fields list of the layer.
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.
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.
Type
unit – A string with the unit of the variable.
visibility – a Visibility value.
Visibility
location – a Location value.
Location
multifield_scope – a Scope.
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.
Output
The unit param accepts all units available on Barril Unit Manager, for more information read its documentation.
unit
This type is supposed to be used in the alfasim_get_additional_variables() hook.
alfasim_get_additional_variables()
Double: Double precision floating point data type.
Double
Int: Integral data type.
Int
Internal: The variable should only be used by the plugin, but not available to the end-user.
Internal
Output: The variable should be available to the end user, as a Property on Plot Window
Center: Center of the control volumes.
Center
Face: Faces of control volumes.
Face
Energy: One value for each energy equation (One for GLOBAL model and number of layers for LAYER model).
Energy
Global: One global value (or related to the mixture).
Global
Field: One value for each field of the hydrodynamic model.
Field
Layer: One value for each layer of the hydrodynamic model.
Layer
Phase: One value for each phase of the hydrodynamic model.
Phase
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’.