Navigation:  Numerical Modeling Workflow - Finite Difference Grids >

Expression Builder

The field calculator is available in the Edit property dialog to facilitate creating/editing variable or distributed values of properties within each zone. Mathematical expressions including variable names can be typed directly into the Calculation entry form (show in red below) or with the assistance of the Expression Builder ().

 

Building Expressions

The Expression Builder can be used to construct mathematical expressions to specify variable property (e.g. Kx, initial heads, Kd) and boundary condition (river conductance) values.  The Expression Builder is shown below for editing conductivity values.

 

the expression field is shown on the left and consists of a basic text editor,

the buttons in the middle include basic operators for addition, subtraction, multiplication, parentheses and exponents, and

the list box on the right contains a list of available variables.

 

 

Operators

The following operators are always available in the Expression Builder:

Operator

Button

Example

Result

Add

1+2

3

Subtract

4-3

1

Divide

2/4

0.5

Multiply

2*5

10

Open bracket

5+(10*2)

25

Close bracket

Power

5^3

125

 

NOTE: The expression builder does not support spaces between operators

 

Variables - Properties

The following variables are available in the Expression Builder during Property editing sessions:

Variable

Description

$OLD{fieldname}

initial value of the specified field {fieldname} at the start of the edit session

 

Variables - Boundary Conditions

The following variables are available in the Expression Builder during Boundary Condition editing sessions:

Variable

Description

$OLD{fieldname}

initial value of the specified field {fieldname} at the start of the edit session

$BOT

cell bottom elevation

$DX

cell width in the x-direction

$DY

cell length in the y-direction

$DZ

cell thickness

$KX

horizontal conductivity along X-axis

$KY

horizontal conductivity along Y-axis

$KZ

vertical conductivity

$MBOT

model bottom elevation

 

Functions and Expressions

The following functions/ expressions are always available in the Expression Builder:

 

Function/Expression

Keyword

Example

Result

Average

average

average({1 2 3})

2

Conditional If

cif

cif(true 23 24)

cif(false 23 24)

cif(1 23 24)

cif(0 23 24)

cif(1-1 23 24)

23

24

23

24

24

Cosine

cos

cos(0)

1

Exponential

exp

exp(1)

2.71828

False (constant)

false

false

0

Maximum Value

max

max({10 2.2 34})

34

Minimum Value

min

min({10 2.2 34})

2.2

Modulo

mod

(10)mod(3)

1

Multiplication

mult

mult({2.0 3.0 4.0})

24

Negation

not

not(true)

not(false)

not(1)

not(0)

not(2)

not(1-1)

0

1

0

1

0

1

Pi (π) (constant)

pi

pi

cos(pi)

3.14159

-1

Sine

sin

sin(pi/2)

1

Square Root

sqrt

sqrt(4)

2

Sum

sum

sum({1 2 3})

6

Tangent

tan

tan(pi/4)

1

True (constant)

true

true

1

Vector

vector

vector({3 2})

[2.0, 2.0, 2.0]

 

 

 


Page url:http://www.waterloohydrogeologic.com/help/vmod-flex/index.html?vm_field-calculator.htm