Sei sulla pagina 1di 18

UDQ

x ECLIPSE 100
x ECLIPSE 300
SPECIAL
RUNSPEC
GRID
EDIT
PROPS
REGIONS
SOLUTION
SUMMARY
x SCHEDULE

User defined quantities


The UDQ keyword enables users to define summary quantities in the SCHEDULE section. The
user defined quantities can either be constants, or composed of ECLIPSE summary quantities
in conjunction with a number of mathematical functions. User defined quantities are identified
by a "U" as the second character of the name. Connection, field, group, region, segment, well,
aquifer and block quantities are permitted. With the exception of the field mnemonics these
quantities are vectors with elements for each corresponding entity. The user defined summary
quantities can be output by including them in the SUMMARY section using the conventional
syntax. Since the user defined quantity will not be defined at this point, additional care should
be taken to ensure that the quantity names match their later initializations. User defined
summary quantities that remain uninitialized will return the value specified by item 3 of the
UDQPARAM keyword.
User defined quantities can be used in two modes; either a value can be assigned to elements of
the quantity, or the quantity can be defined in terms of existing ECLIPSE summary quantities.
Elements of the arrays which are not assigned a value are marked as undefined. Internally these
elements remain undefined, however when they are output in the form of a summary vector or
tested in an ACTION(G,R,W,S,X) keyword, undefined elements are set to the value specified by
item 3 of the UDQPARAM keyword.
User defined quantities can be also used for user defined arguments (UDA) in the SCHEDULE
section for well keywords:

WALKALIN, WCONINJE, WECON, WELDRAW, WFOAM, WSALT, WSURFACT, WAPI,


WCONPROD, WELLSTRE, WPOLYMER, WSOLVENT, WTRACER, WTADD, WTMULT,
WINJEDET, WECONCMF

and group keywords:

GCONPRI, GCONPROD, GCONINJE, GECON, GCONSALE, GCONSUMP, GRUPFUEL,


GRUPSALE, GTADD, GTMULT

and connection keyword:

CECON

and keyword:

LINCOM.

The user defined arguments are specified by a corresponding UDQ and keyword UDADIMS.
Note

UDAs require one time step to take effect after the keyword containing the UDA is
read.

A user defined quantity is initialized by either entering an assignment or a definition, with the
order of evaluation following the order of initialization. User defined quantities may refer to
other user defined quantities providing they have already been initialized. Assignment differs
from definition in that assignment is processed immediately, whilst a definition is evaluated
after the following time step. By default a definition will be recalculated at every time step but
this can be over-ridden by the user. Similarly, once a quantity is initialized units can also be
specified.
The number of user defined quantities is specified in RUNSPEC using the UDQDIMS keyword
and additional parameters can be set using the UDQPARAM keyword.

ECLIPSE Reference Manual

Keywords
UDQ

2229

The UDQ keyword is followed by any number of records, each containing the following items
of data and terminated by a slash (/). The set of records must end with a blank record, containing
only a slash (/).
1

Operation to perform
ASSIGN Assign a numeric value to elements of a quantity. The operation will initialize
the quantity and set the update argument to OFF.
DEFINE Define a mathematical expression with which to update the elements of the
quantity. The operation will initialize the quantity and set the update argument to ON.
UNITS Specify the units that will be written along with the summary data. The quantity
must already be initialized in order to perform this operation. This data has no effect on the
calculation of the quantity and is used for reporting only.
UPDATE Specify when next to evaluate the quantity definition. The quantity must already
be initialized in order to perform this operation.

Name of the quantity


The name of the quantity must start CU, FU, GU, RU, SU, WU, AU or BU
depending on whether it is a vector of connection, field, group, region, segment, well,
aquifer and block elements. Quantity names must not exceed 8 characters in length, with
only the first 5 being significant in the case of region quantities. If this is an ASSIGN record
then particular elements can be selected using the syntax outlined below.

Data for operation.


For an ASSIGN record this should be a numerical value.
For a DEFINE record this should be a mathematical expression involving a combination of
the functions and data described below. The expression should evaluate to either a vector
of the same type as being defined, or a scalar. If the expression evaluates to a scalar all
elements of the vector will inherit this value.
For a UNITS operation this should be a character string of not more than 8 characters
For an UPDATE operation this should be one of ON, OFF or NEXT depending on whether
the definition is to be evaluated at all, none, or just the next time step.

Syntax for specifying particular elements


An ASSIGN record can target a subset of the elements in a vector. Similarly, whilst a DEFINE
record applies to a quantity as a whole, a subset of elements can be supplied as an argument to
the functions introduced below. When a unique element of a vector is specified as an argument
in a quantity definition, the argument is treated as a scalar. When a subset of a vector is supplied
as an argument in a quantity definition the remaining elements in the vector remain undefined.
The following syntax should be followed.
Connection quantities:
COFR - COFR for all connections for all wells. Treated as a vector.
COFR P1 - COFR for all connections belonging to well P1. Treated as a vector.
COFR P1 1 2 3 - COFR for the connection in block (1,2,3) belonging to well P1. Specifies
a single element and will be treated as a scalar argument.
COFR P* -1 -1 3 - COFR for all connections belonging to wells with names beginning
with P in layer 3. Treated as a vector regardless of the number of matching connections.

2230

Keywords
UDQ

ECLIPSE Reference Manual

Field quantities:
FOPR - Field quantities are always scalars argument.
Group quantities:
GOPR - GOPR for all groups. Treated as a vector.
GOPR G1 - GOPR for group G1. Specifies a single element and will be treated as a scalar
argument.
Region quantities: Inter-region quantities such as ROFT are not permitted within user defined
quantities.
ROIP - ROIP for all regions and all FIP sets, including the FIPNUM set. Treated as a
vector.
ROIP_NUM - ROIP for all regions in the FIPNUM set. Treated as a vector.
ROIP_ONE - ROIP for all regions in the FIP set ONE. Treated as a vector.
ROIP_ONE 1 - ROIP for region 1 in the FIP set ONE. Specifies a single element and
will be treated as a scalar argument. A FIP set name must be given if a region index is
specified. Use NUM for the FIPNUM set.
Segment quantities:
SOFR - SOFR for all segments belonging to all multi-segment wells. Treated as a vector.
SOFR P* - SOFR for all segments belonging to all multi-segment wells with names
beginning with P. Treated as a vector.
SOFR P* 1 - SOFR for segment 1 belonging to all multi-segment wells with names
beginning with P. Treated as a vector regardless of the number of matching segments.
SOFR P1 1 - SOFR for segment 1 belonging to the multi-segment well P1. Specifies a
single element and will be treated as a scalar argument.
Well quantities:
WOPR - WOPR for all wells. Treated as a vector
WOPR P1 - WOPR for well P1. Specifies a single element and will be treated as a scalar
argument.
WOPR P* - WOPR for all wells with names beginning with P. Treated as a vector
regardless of the number of matching wells.
Aquifer quantities:
AAQR - AAQR for all aquifers. Treated as a vector
AAQR X - AAQR for aquifer number X. Specifies a single element and will be treated as
a scalar argument.
Block quantities:
BOSAT- BOSAT for all active blocks. Treated as a vector
BOSAT X Y Z - BOSAT for block coordinates X Y Z. Specifies a single element and will
be treated as a scalar argument.
Note

ECLIPSE Reference Manual

Well and group names containing template characters should be enclosed in quotes.

Keywords
UDQ

2231

Functions available for quantity definitions


The following functions are available for use in quantity definitions. Without brackets, the
functions are evaluated in order of decreasing precedence, with binary functions of equal
precedence evaluated left to right and unary functions of equal precedence evaluated right to
left. Brackets can be used to re-order the evaluation as required.
Binary functions take two arguments, one from the left and one from the right. Note, the
majority of binary functions operate on the intersection of the two vectors, i.e. the output is only
defined if both corresponding input elements are defined. A smaller number of the binary
functions operate on the union of the two vectors, i.e the output is defined if either of the
corresponding input elements are defined. The binary functions are elemental, operating on
each element in turn. As a consequence both the left and right functions need either to be of the
same type, for example, a well vector, or one of the arguments needs to be a scalar. If one
argument is a vector and the other a scalar, the scalar value is applied to all elements in the
vector.
Unary functions take a single argument usually supplied in a following bracket. The Unary
functions are either elemental, or return a scalar value. The majority of the unary functions only
operate on defined elements although a few also operate on undefined elements.
User defined quantity definitions are evaluated as real numbers constrained to lie in the range
specified by item 2 of the UDQPARAM keyword. Values exceeding this range will be limited and
ECLIPSE will issue a message notifying the user. Similarly, should an argument fall outside the
domain of a function then the element will be returned undefined and the user notified.
Table 3.37

Functions of UDQ

Function

Precedence & Type

Opening bracket.

Closing bracket.

Start of table argument list.

End of table argument list.


Separator for table arguments.

2232

Keywords
UDQ

Description

unary elemental

Sign change of defined element.

ABS()

unary elemental

Absolute value of defined elements.

AVEA()

unary scalar

Arithmetic average of defined elements.

AVEG()

unary scalar

Geometric average of defined elements. The result will be


undefined if the input vector contains zero or negative
elements.

AVEH()

unary scalar

Harmonic average of defined elements. The result will be


undefined if the input vector contains zero elements.

DEF()

unary elemental

1 if the element is defined, otherwise the result is


undefined.

EXP()

unary elemental

Exponential of defined elements.

IDV()

unary elemental (all


elements)

1 if the element is defined, zero if the element is


undefined.

LN()

unary elemental

Natural logarithm of defined elements.

LOG()

unary elemental

Base 10 logarithm of defined elements.

MAX()

unary scalar

Maximum of defined elements.

ECLIPSE Reference Manual

Table 3.37

Functions of UDQ

Function

Precedence & Type

Description

MIN()

unary scalar

Minimum of defined elements.

NORM1()

unary scalar

1 norm of defined elements.

NORM2()

unary scalar

2 norm of defined elements.

NORMI()

unary scalar

Infinity norm of defined elements.

NINT()

unary elemental

Nearest integer to defined elements.

PROD()

unary scalar

Product of defined elements.

RANDN()

unary elemental

Normally distributed random number with zero mean and


unit variance. The seed for the random number generator
can be set using item 1 of the UDQPARAM keyword. The
input argument is used purely to determine the size of the
vector and the defined/undefined elements.

RANDU()

unary elemental

Uniformly distributed random number between -1 and 1.


The seed for the random number generator can be set
using item 1 of the UDQPARAM keyword. The input
argument is used purely to determine the size of the vector
and the defined/undefined elements.

RRNDN()

unary elemental

Really random normally distributed random number


with zero mean and unit variance. This is the same as the
RANDN function, but the seed for the random number
generator is computed (using a unique number generated
from the HH:MM:SS of the 24-hour clock) for each
simulation.
A base simulation case seed value will be used in restart
simulations unless UDQDIMS item 11 is set to Y.

RRNDU()

unary elemental

Really random uniformly distributed random number


between -1 and 1. This is the same as the RANDU function,
but the seed for the random number generator is computed
(using a unique number generated from the HH:MM:SS of
the 24-hour clock) for each simulation.
A base simulation case seed value will be used in restart
simulations unless UDQDIMS item 11 is set to Y.

SORTA()

unary elemental

Position of the element in an ascending sort of defined


elements.

SORTD()

unary elemental

Position of the element in a descending sort of defined


elements.

SUM()

unary scalar

Sum of defined elements.

UNDEF()

unary elemental

1 if the element is undefined, otherwise the result is


undefined.

ECLIPSE Reference Manual

Keywords
UDQ

2233

Table 3.37

Functions of UDQ

Function

Precedence & Type

Description

TU*[]

The value from the specified user defined table associated


with the values of the elements in each of the arguments.
The table must be defined in a UDT keyword, and the
interpolation method used for each argument is specified
in the table.

unary elemental

There must be one argument for each dimension in the


table, separated by commas. All arguments must either be
the same type of vector quantity or scalar. The function
returns a scalar if all arguments are scalar, or the same
type of vector as its vector arguments.
It is not possible to have further computations inside the
square brackets - each table argument must be a simple
one word mnemonic. However, table arguments can
themselves be UDQs if a more complicated expression is
required.

2234

Keywords
UDQ

<=

binary intersection

1 if the left argument is less than or equal to the right


argument, else 0. The tolerance to check for equality is
specified by item 4 of the UDQPARAM keyword.

>=

binary intersection

1 if the left argument is greater than or equal to the right


argument, else 0. The tolerance to check for equality is
specified by item 4 of the UDQPARAM keyword.

<

binary intersection

1 if the left argument is less than the right argument, else


0.

>

binary intersection

1 if the left argument is greater than the right argument,


else 0.

==

binary intersection

1 if the left argument is equal to the right argument, else 0.


The tolerance to check for equality is specified by item 4
of the UDQPARAM keyword.

!=

binary intersection

1 if the left argument is not equal to the right argument,


else 0. The tolerance to check for equality is specified by
item 4 of the UDQPARAM keyword.

binary intersection

Exponentiation.

binary intersection

Multiplication.

binary intersection

Division.

binary intersection

Addition.

binary intersection

Subtraction.

UADD

binary union

Union of the two vectors with intersecting elements added


together.

UMAX

binary union

Union of the two vectors with the maximum of


intersecting elements taken.

UMIN

binary union

Union of the two vectors with the minimum of intersecting


elements taken.

UMUL

binary union

Union of the two vectors with intersecting elements


multiplied together.

ECLIPSE Reference Manual

Data available for quantity definitions


Any of the quantities available to the ACTIONX keyword can be included in a quantity
definition. The above syntax should be used. In addition the following simulator performance
keywords are available and return scalar values.
ELAPSED Returns the elapsed time in seconds.
MSUMLINS Returns the total number of linear iterations since the start of the run.
MSUMNEWT Returns the total number of Newton iterations since the start of the run.
NEWTON Returns the number of Newton iterations used for each time step.
TCPU Returns the current CPU usage in seconds.
TIME Returns the current simulation time.
TIMESTEP Returns the time step length.

Initialization of quantities
A quantity is initialized via the first ASSIGN or DEFINE record referencing the quantity in the
UDQ data. Upon initialization the elements of the quantity are undefined. When they are output
or used with in an ACTION(G,R,W,S,X) keyword, undefined elements are replaced by the value
specified in item 3 of UDQPARAM keyword.

Processing of quantity assignments


A quantity assignment is processed upon reading a UDQ ASSIGN record. If a subset of a vector
is specified then the assignment applies only to these elements, leaving the remaining elements
unaltered. Consider a simulation with four wells named P11, P12, P32 and P33. The following
UDQ assignments:
ASSIGN WUMW1 P*1* 1.0 /
ASSIGN WUMW1 P12 2.0 /

would result in the user defined well vector:

WUMW1

Note

P11

P12

P32

P33

1.0

2.0

UNDEFINED

UNDEFINED

A quantity assignment sets the UPDATE status of the vector to OFF.

Evaluation of quantity definitions


A quantity definition is an expression that is used to update every element in the vector after
every time step. Additional consideration maybe required if a definition includes operations on
subsets of vectors. Again, consider a simulation with four wells named P11, P12, P32 and P33,
and the following UDQ definition:

ECLIPSE Reference Manual

Keywords
UDQ

2235

DEFINE WUMW1 WOPR P*1* + WOPR P*2* /

Internally, the following vectors will be generated. Recall a well vector has an element for every
well in the simulation and if only a subset of the wells are selected the remaining elements are
left undefined:

WOPR P*1*

P11

P12

P32

P33

WOPR P11

WOPR P12

UNDEFINED

UNDEFINED

UNDEFINED

WOPR P12

WOPR P32

UNDEFINED

UNDEFINED

2 x WOPR P12

UNDEFINED

UNDEFINDED

+
WOPR P*2*
=
WUMW1

Since the addition function acts on the intersection of the defined elements P12 is the only well
for which WUMW1 is defined. All other wells would return the specified value for an undefined
element. A similar result is obtained in the following example in which we accumulate on a user
defined quantity:
ASSIGN WUMW1 P1 1 /
DEFINE WUMW1 WUMW1 * WOPR /

for which the calculation would be:

WUMW1

P11

P12

P32

P33

UNDEFINED

UNDEFINED

UNDEFINED

WOPR P11

WOPR P12

WOPR P32

WOPR P33

WOPR P11

UNDEFINED

UNDEFINED

UNDEFINED

*
WOPR
=
WUMW1

The key point to note is that binary functions act sequentially on corresponding elements. If we
wish to add together elements from different positions in a vector this must be done on an
individual basis as scalars. For example:
DEFINE FUMW1 WOPR P11 + WWPR P12 /

Alternatively, if the intention is to combine vectors then functions that act on the union of the
defined elements should be considered. For example in a simulation with the FIPNUM set and
two additional FIP sets named ONE and TWO, each with the three regions, we could
consider the definition:
DEFINE RUMW1 ROIP_NUM UMAX RGIP_ONE UMIN RWIP_TWO /

which would generate the vectors:


NUM set
ROIP_NUM

ONE set

TWO set

UMAX
RGIP_ONE
UMIN
RWIP_TWO
=
RUMW1

2236

Keywords
UDQ

ROIP_NUM

RGIP_ONE

RWIP_TWO

ECLIPSE Reference Manual

where X represents a value and U an undefined element. Note, in this case the choice of union
functions is not significant since the defined portions of the vectors do not overlap.
Note

A quantity definition applies to every element in the vector. A quantity definition


cannot be applied to selected elements only.

Note

A quantity definition sets the UPDATE status of the vector to ON.

Examples
SUMMARY section
Request of user defined quantities in the SUMMARY section
CUMW1
P1 /
/
CUMW2
P1 /
/
FUMW1
FUMW2
GUMW1
/
GUMW2
/
RUMW1
/
RUMW1ONE
/
RUMW1TWO
/
WUMW1
/
WUMW2
/
AUMW1
/
AUMW2
1/
BUMW2
1 2 3/
/

ECLIPSE Reference Manual

Keywords
UDQ

2237

SCHEDULE section
Definition of the user defined quantities in the SCHEDULE section
UDQ
-- A COUPLE OF CONNECTION QUANTITES
ASSIGN CUMW1 2.0 /
ASSIGN CUMW1 P12 3.0 /
ASSIGN CUMW1 P12 10 12 1 4.0 /
UNITS CUMW1 CONS /
DEFINE CUMW2 COFR/MAX(CGFR) /
UNITS CUMW2 CONS /
-- A COUPLE OF FIELD QUANTITIES
DEFINE FUMW1 LOG(1+SUM(WOPR)) /
UNITS FUMW1 FLDS /
ASSIGN FUMW2 0 /
DEFINE FUMW2 WOPR P1 / -- RECORD WOPR OF P1 (SCALAR) IN A FIELD UDQ
UNITS FUMW2 FLDS /
-- A COUPLE OF GROUP QUANTITES
DEFINE GUMW1 SORTA(GOPR) /
UNITS GUMW1 GRPS /
ASSIGN GUMW2 G2 99.99 /
UNITS GUMW2 GRPS /
-- A COUPLE OF REGION QUANTITES
DEFINE RUMW1 ROIP /
UNITS RUMW1 REGS /
ASSIGN RUMW2 2.0E-2 /
ASSIGN RUMW2ONE 3 3.0 /
ASSIGN RUMW2TWO 4 4.0 /
UNITS RUMW2 REGS /
-- A COUPLE OF WELL QUANTITIES
DEFINE WUMW1 WBHP 'P*1*' UMAX WBHP 'P*4*' /
UNITS WUMW1 WELLS /
UPDATE WUMW1 NEXT /
DEFINE WUMW2 RANDN(WBHP 'P1*') /
UNITS WUMW2 WELLS /
-- A COUPLE OF AQUIFER QUANTITIES
DEFINE AUMW1 SORTA(AAQR) /
UNITS AUMW1 AQUIFER /
UPDATE AUMW1 NEXT /
DEFINE AUMW2 RANDN(AAQR) /
UNITS AUMW2 AQUIFER/

2238

Keywords
UDQ

ECLIPSE Reference Manual

-- A COUPLE OF BLOCK QUANTITIES


DEFINE BUMW1 MAX(BOSAT) /
UNITS BUMW1 BLOCK /
UPDATE BUMW1 NEXT /
DEFINE BUMW2 RANDN(BOSAT) /
UNITS BUMW2 BLOCK/
-- A WELL QUANTITY CALCULATED FROM A 3-DIMENSIONAL UDT
DEFINE WUPRICE TUPRICE[FGPR,FOPR,FWPR]-TUPRICE[WGPR,WOPR,WWPR] /
/
/

How to Define a Cumulative Quantity


UDQ
ASSIGN FU_CAPXQ 0.0 /
-- Set drilling cost for every well
ASSIGN WU_DRCST 1.0e6 /
-- Set the CAPEX as the drilling cost multiplied by the number of times
it happens in a time step
DEFINE WU_CAPEX WU_DRCST * WPWE0 /
-- Field CAPEX is the sum of well CAPEX
DEFINE FU_CAPEX SUM(WU_CAPEX) /
-- Cumulative CAPEX
ASSIGN FU_CAPXT 0.0 /
DEFINE FU_CAPXT FU_CAPXT + FU_CAPEX /
DEFINE FU_CAPXQ FU_CAPXQ + FU_CAPEX /
-/

Note

Both FU_CAPXT and FU_CAPXQ are defined in (almost) exactly the same way but
only FU_CAPXT will give the desired behavior.

The only difference is that FU_CAPXQ is initialized at the beginning of the UDQ definitions,
whereas FU_CAPXT is initialized just before its definition. As stated above the UDQs are
evaluated in the order in which they are first initialized. This means that at each time step,
FU_CAPXQ is evaluated before FU_CAPEX, whereas FU_CAPXT is evaluated after it. Thus,
when FU_CAPXQ is evaluated, the FU_CAPEX term being added is still undefined (that is 0) so
nothing is added and the cumulative does not grow. By contrast, FU_CAPXT is evaluated after
FU_CAPEX (because it is first initialized after it) and so behaves as expected.

ECLIPSE Reference Manual

Keywords
UDQ

2239

How to use conditional UDQs


A UDQ can take a certain value depending on a pre-defined condition. In the example below
UDQ
DEFINE FUBOOL WBHP I > 3573 /
DEFINE WUMULT ((1-FUBOOL)*2.5) +(FUBOOL*1.5)/
/

The value of WUMULT, 2.5 or 1.5 in this example, depends on the value of BHP in well I. The
same syntax can be used for a multiple condition.
UDQ
DEFINE FUBL1 WBHP I > 3573 /
DEFINE FUBL2 WWIR I < 6200 /
DEFINE WUMULT (FUBL1*1)+((1-FUBL1)*((FUBL2*2)+((1-FUBL2)*3)))/
/

How to use UDQs for time-derivative calculation


As the UDQs are evaluated in the same order they have been defined or assigned, UDQs can be
used to calculate a function time derivative. In the example, WUBHP2 is a time step ahead of
WUBHP1 when updating WUBHPDT, hence this later is the derivative of the BHP of the well P
with regard to time.
UDQ
ASSIGN
DEFINE
DEFINE
DEFINE
UNITS
UNITS

WUBHP1 0.0 /
WUBHP2 WBHP P /
WUBHPDT ((WUBHP2- WUBHP1) / TIMESTEP) /
WUBHP1 WUBHP2 /
WUBHP1 PSIA /
WUBHP2 PSIA /

2240

Keywords
UDQ

ECLIPSE Reference Manual

UDQDIMS
x ECLIPSE 100
x ECLIPSE 300
SPECIAL
x RUNSPEC
GRID
EDIT
PROPS
REGIONS
SOLUTION
SUMMARY
SCHEDULE

Dimensions for the user defined quantity


facility
The data consists of up to 10 items, specifying dimensions associated with the UDQ keyword.
The data must be terminated by a slash (/).
1

The maximum number of functions, including brackets, permitted in a quantity definition.


See the UDQ keyword for the list of available functions.

The maximum number of arguments permitted in a quantity definition.

DEFAULT: 0

The maximum number of user defined well quantities.

DEFAULT: 0

The maximum number of user defined segment quantities.

DEFAULT: 0

The maximum number of user defined region quantities.

DEFAULT: 0

The maximum number of user defined group quantities.

DEFAULT: 0

The maximum number of user defined field quantities.

DEFAULT: 16

The maximum number of user defined connection quantities.

DEFAULT: 16

DEFAULT: 0

The maximum number of user defined aquifer quantities.

DEFAULT: 0

10 The maximum number of user defined block quantities.

DEFAULT: 0

11 Specifies whether a new random number generator seed is computed for restart runs. This
affects the UDQ functions RRNDN and RRNDU. If this item is set to Y, then a new seed
will be computed for restart simulations, hence the restart simulation random value
sequence will differ from that of the base simulation. If this item is defaulted or set to N,
then restart simulations will use the same seed as the base simulation, hence the restart
simulation random value sequence will be the same as that of the base simulation.

DEFAULT: N

Example
UDQDIMS
8 8 2

ECLIPSE Reference Manual

Keywords
UDQDIMS

2241

UDQPARAM
x ECLIPSE 100
x ECLIPSE 300
SPECIAL
x RUNSPEC
GRID
EDIT
PROPS
REGIONS
SOLUTION
SUMMARY
SCHEDULE

Parameters for the user defined quantity


facility
The data consists of up to 4 items, specifying control parameters associated with the UDQ
keyword. The data must be terminated by a slash (/).
1

Integer seed value for the RANDN and RANDU random number functions. This item should
be a integer greater than 0.

The permitted range (+/-) of the user defined quantities. This item should be in the range
1.0 to 1.0E+20.

DEFAULT: 1.0E+20

Value given to undefined elements when outputting data or using in an


ACTION(G,R,W,S) keyword. This item should be in the range specified by item 2.

DEFAULT: 1

DEFAULT: 0.0

The fractional equality tolerance used in the ==,!=,<= and >= functions.

DEFAULT: 1.0E-4

Example
UDQPARAM
100 1* -1.0 /

2242

Keywords
UDQPARAM

ECLIPSE Reference Manual

UDT
x ECLIPSE 100
x ECLIPSE 300
SPECIAL
RUNSPEC
GRID
EDIT
PROPS
REGIONS
SOLUTION
SUMMARY
x SCHEDULE

User defined tables


The UDT keyword enables users to define lookup tables in the SCHEDULE section. These can
then be used to assign values to user defined quantities in a UDQ keyword.
Tables can have any number of dimensions between 1 and 4, any number of interpolation points
per dimension, and any number of values in the table itself. The maximum number of tables,
interpolation points, values and dimensions permitted in any one dataset is set using the
UDTDIMS keyword.
The UDT keyword is followed by a varying number of records depending on the required
dimension of the table, each terminated by a slash (/). The set of records must end with a blank
record, containing only a slash (/), to indicate the end of the UDT keyword.

Record 1:Basic data for table


1

Table name
A name, which must be unique, which will be used to identify the table in UDQ definitions.
The name must begin with TU and cannot exceed 8 characters in length.

Number of dimensions in this table (NUMDIM)


An integer value between 1 and MUDTDS, the maximum number of UDT table dimensions,
which is the 4th argument of UDTDIMS. Note that it is not possible to set this value to be
greater than 4.

Records 2 to NUMDIM+1
1

The type of interpolation to be used for this dimension.


This is one of NV, LC, LL or ID

NV dimensions will use the nearest value.

LC dimensions will be linearly interpolated within the table but clamped to the first
or last value as appropriate when outside it.

LL dimensions will be linearly interpolated within the table and linearly extrapolated
outside it.

ID dimensions will use the name or identifier associated with the element rather than
the value. If there is no match found, the table lookup will return the undefined value
specified by item 3 of the UDQPARAM keyword. The first match found will always be
used.

The interpolation points for this dimension.

For ID dimensions, these will be character strings, which can optionally use wildcard
characters. This dimension type is only available for group or well mnemonics as
arguments.

For all other dimensions, these will be numerical values, which must be entered in
ascending order.

ECLIPSE Reference Manual

Keywords
UDT

2243

Records NUMDIM+2 onwards


Each record contains one value for each interpolation point in the first dimension, terminated
with a slash.
The first record corresponds to the first interpolation point in each dimension other than the first.
The second record corresponds to the second interpolation point in the second dimension, and
the first point for subsequent dimensions, and so on.
At the end of the records for the points for the second dimension, there is a record containing
only a slash, to indicate the end of this dimension.
The next record will correspond to the first interpolation point in the second dimension, the
second point in the third dimension, and the first point in the fourth dimension.
This pattern repeats, with a record containing only a slash every time we complete a dimension.
So after the record which corresponds to the last point in the second dimension and the last point
in the third dimension, there will be two records containing only slashes.

Examples
This is a simple sample table with 3 dimensions. The first dimension will be evaluated using
linear interpolation and extrapolation, the second using the nearest value, and the third using the
ID of the elements. The first dimension has three interpolation points, the other two dimensions
have two each.
UDT
'TUTEST' 3 /
'LL' 1 2 3 /
'NV' 2 4 /
'ID' 'W2' '*' /
1 2 3 /
2 4 6 /
/
10 11 12 /
20 22 24 /
/
/
/
So, if in a UDQ keyword we had a table reference like
TUTEST[WOPR,WGPR,WWPR]

with wells W1 and W2, then the result of the table reference would be a well vector with two
elements. Wed start off with the first element of the well vector, which is well W1.
WOPR would be evaluated for W1, and then linear interpolation/extrapolation used.
WGPR would be evaluated for W1, and then the nearest value method of interpolation used.
WWPR isnt evaluated at all, because the third dimension of the table uses the ID method.
Instead we use the well name for its first element, which is W1, and compare it with the names
associated with the interpolation points. The name does not match the first point W2, but it
does match the second point which is the wildcard character *.

2244

Keywords
UDT

ECLIPSE Reference Manual

So, for the third dimension, we will be using the second set of values: the two rows starting with
10 and ending with 24.
For the second dimension, we will look to see whether the value of WGPR for W1 is closer to 2
or to 4. If it is closer to 2, we will use row 10 11 12. If it is closer to 4, we will use row 20 22 24.
And finally we will do linear interpolation or extrapolation based on where the value of WOPR
lies with relation to the interpolation points for the first dimension, which are 1 2 3.
So, if WGPR for W1 is 2, and WOPR for W1 is 1.5, the result would be 10.5 - wed take row 10
11 12, and then interpolate half way between the first two values.
This process is then repeated for well W2. This time we will be using the first block of values:
the two rows starting with 1 and ending with 6, since this block has the name W2. Assuming
for simplicity that W2 and W1 have the same values for WGPR and WOPR, then this time the
result will be 1.5.
We now have a well vector as our result, with values 10.5 and 1.5.

ECLIPSE Reference Manual

Keywords
UDT

2245

UDTDIMS
x ECLIPSE 100
x ECLIPSE 300
SPECIAL
x RUNSPEC
GRID
EDIT
PROPS
REGIONS
SOLUTION
SUMMARY
SCHEDULE

Dimensions for the user defined tables


facility
The data consists of 4 items, specifying dimensions associated with the UDT keyword. The data
must be terminated by a slash (/).
1

The maximum number of user defined tables permitted.

The maximum number of rows permitted in any one UDT keyword.

DEFAULT: 0

The maximum number of interpolation points permitted in any one dimension.

DEFAULT: 0

DEFAULT: 0

The maximum number of dimensions permitted in any one table.

DEFAULT: 0

To be able to define user defined tables in a UDT keyword, all items must be set to greater than 0.

Example
UDTDIMS
2 20 3

2246

Keywords
UDTDIMS

ECLIPSE Reference Manual

Potrebbero piacerti anche