TQIPS_INIT_BRANCH

Fortran

TQIPS_INIT_BRANCH(TISCOND, TISCNST, PISCOND, PISCNST, IDEPEL, IDISCRT, NSTEP, IPHSTA, T, TMIN, TMAX, P, PMIN, PMAX, RMEMFR, PHAMNT,XMIN, XMAX, IBRANCH, IERR IWSG, IWSE

C-interface

tq_ips_init_branch(TC_BOOL t_is_condition, TC_BOOL t_is_constant, TC_BOOL p_is_condition, TC_BOOL p_is_constant, TC_BOOL* independent_elements,TC_INT dicretization_type, TC_INT nr_of_steps, TC_INT* state_of_phases, TC_FLOAT t, TC_FLOAT tmin, TC_FLOAT tmax,TC_FLOAT p,TC_FLOAT pmin, TC_FLOAT pmax, TC_FLOAT memory_fraction, TC_FLOAT* amount_of_phases, TC_FLOAT* xmin, TC_FLOAT* xmax, TC_INT* branch_nr, TC_INT* err, TC_INT* iwsg, TC_INT* iwse)

Full name:

Initiate a branch of the adaptive interpolation scheme.

Purpose:

Initiates a branch of the interpolation scheme with a set of conditions, phases and values to be interpolated.

Comments:

The size of the arrays IDEPEL, XMIN and XMAX are defined as the number of all components supplied by TQGNC must be provided in the same order as supplied by TQGCOM.Composition conditions are set as the normalized number of moles for each component (N(c) =value).The size of the arrays IPHSTA and PHAMNT are defined as the number of all phases supplied by TQGNP must be provided in the same order as supplied by TQGPN.The allocation of memory to each branch is performed at the first time values are retrieved using TQIPS_GET_VALUE, therefore some considerations must be made when using several branches in order to allocate the same amount of memory to each branch.

Arguments

Name

Type

Value set on call or returned

TISCOND

Logical

Set to TRUE if temperature is a condition in this branch.

TISCNST

Logical

Set to TRUE if temperature is constant in this branch.

PISCOND

Logical

Set to TRUE if pressure is a condition in this branch.

PISCNST

Logical

Set to TRUE if pressure is constant in this branch.

IDEPEL

Logical array

Set to TRUE for each element for which conditions are present.

IDISCRT

Integer

Indicates the type of discretization where: 1=linear2=logarithmic

NSTEP

Integer

Set to the logarithm (10 base) number of steps to be used to interpolate in the temperature / pressure / composition space.

IPHSTA

Integer array

Set to the status for the phases in this branch, where:

1=ENTERED, 2=SUSPENDED, 3=DORMANT, 4=FIXED

T

Double precision

 

Set to temperature if temperature is a condition, otherwise used as starting value.

TMIN

Double precision

Set to lower limit of temperature range.

TMAX

Double precision

Set to upper limit of temperature range.

P

Double precision

Set to pressure if pressure is a condition, otherwise used as starting value.

PMIN

Double precision

Set to lower limit of pressure range.

PMAX

Double Precision

Set to upper limit of pressure range.

RMEMFR

Double precision

Set to the fraction of the amount of free physical memory to be allocated to the interpolation scheme for this branch (value < 1.0). If a value larger than 1.0 if set, it is interpreted as the number of megabytes allocated to the branch.

PHAMNT

Double precision array

Set to the amount of the phase if defined as a fixed phase with IPHSTA.

XMIN

Double precision array

Set to the lower limit of the composition range of each component.

XMAX

Double precision array

Set to the upper limit of the composition range of each component.

IBRANCH

Integer

Set to branch number for which the variable in STRING is to be interpolated.

IERR

Integer

Returns error code.

IWSG

Integer array

Workspace.

IWSE

Integer array

Workspace