functions

stin.functions.BC_v_G(α_L, v_L, α_G)

The only purpose of this function is to make sure that two-phase flow boundary condition for v_G is consistent with the mathematical model. I.e., by the moment an influx occurs I know liquid phase velocity as a result of the single-phase model solution. Hence, at the boundary of two-phase flow I specify v_L and calculate v_G. Hence, I need a function to find v_G.

Parameters
  • α_L (float) – from 0 to 1.

  • v_L (float) – variable, not a function.

  • α_G (float) – from 0 to 1.

Returns

the return value (boundary condition for gaseous phase velocity).

Can assume any positive value.

Return type

float

stin.functions.cond(v_G)

Verifies that liquid velocity is positive (based on the condition obtained from the sixth equation of the system).

Parameters

v_G (float) –

Returns

the return value. Can assume any positive value.

Return type

float

stin.functions.derivative_p(α_L, α_G, ρ_G, v_L, v_G)

Calculates pressure spatial derivative to be pluged into the expression for pressure at the next spatial step (see first equation of the model). It returns the value of pressure spatial derivative at the current time step and, hence, takes as arguments volume fractions, velocities, and gas density at the current spatial step.

Parameters
  • α_L (float) – from 0 to 1.

  • α_G (float) – from 0 to 1.

  • ρ_G (float) –

  • v_L (float) – negative values.

  • v_G (float) –

Returns

the return value (pressure derivative at the current spatial

step). Can assume any value from negative infinity to 0.

Return type

float

stin.functions.derivative_v_G(v_G, α_G, ρ_G, derivative_p)

Calculates gaseous phase spatial velocity derivative at the current spatial step, therefore all the arguments assume their values at the current spatial step. Is used in the third equation of the system.

Parameters
  • v_G (float) –

  • α_G (float) – from 0 to 1.

  • ρ_G (float) –

  • derivative_p (float) – from negative infinity to 0. It is a variable, not a function.

Returns

the return value (gaseous phase velocity). Can assume any

positive value.

Return type

float

stin.functions.derivative_v_L(v_L, α_L, derivative_α_G)

Calculates spatial derivative of liquid phase velocity at the current spatial step. Hence, all the arguments it takes assume their values at the current spatial step. It is used in the second version of the sixth equation of the system.

Parameters
  • v_L (float) – negative values.

  • α_L (float) – from 0 to 1.

  • derivative_α_G (float) – any value. It is a variable, not a function.

Returns

the return value (spatial liquid velocity derivative). Can assume

any value.

Return type

float

stin.functions.derivative_α_G(α_G, ρ_G, derivative_p, v_G, derivative_v_G)

Calculates spatial derivative of gaseous volume fraction at the current spatial step. Hence, all the arguments it takes assume their values at the current spatial step. It is used in the fourth equation of the system.

Parameters
  • α_G (float) – from 0 to 1.

  • ρ_G (float) –

  • derivative_p (float) – from negative infinity to 0. It is a variable, not a function.

  • v_G (float) –

  • derivative_v_G (float) – any value. It is a variable, not a function.

Returns

the return value (gaseous phase velocity). Can assume any value.

Return type

float

stin.functions.single_p(v_L, L, p_0)

Calculates pressure at the given point in a single-phase flow. See the second equation of the system.

Parameters
  • v_L (float) – variable, not a function.

  • L (integer) – any positive value.

  • p_0 (float) – value.

Returns

the return value (pressure at the specified point). Can assume

any positive value.

Return type

float

stin.functions.single_v_L(v_L0, L)

Calculates velocity of a single-phase flow at the given position L along the wellbore. See the first equation of the system.

Parameters

v_L0 (float) – value.

Returns

the return value (flow velocity). Can assume any positive value;

normaly should be equal to the function’s argument.

Return type

float

stin.functions.α_L(α_G)

Calculates liquid phase volume fraction at the next spatial step. Hence, the argument it takes assumes its value at the next spatial step also.

Parameters

α_G (float) – from 0 to 1.

Returns

the return value (liquid phase volume fraction). Can assume

any value in the range 0 to 1.

Return type

float

Example

α_L(0.3) = 0.7 - both entities are dimensionless

stin.functions.ρ_G(p)

Calculates gas phase density at the next spatial step based on the pressure value at the next spatial step (see second equation of the model).

Parameters

p (float) –

Returns

the return value (gaseous phase density). Can assume any

positive value.

Return type

float

Example

ρ_G(50000000Pa) = 260kg/m^3