Tutorial Functionmod
Tutorial Functionmod
FunctionMod
Last updated: release 9.5
Trademarks
3D Grid/CPG Builder , 3DiQ , EarthModel , EarthModel® FT™, EPlus™, FunctionMod™, InverMod®,
™ ™ ®
ii FunctionMod
FunctionMod
Contents
Chapter 1. Introduction...................................................................................... 1
1.1. Objective ...................................................................................... 1
1.2. Duration and prerequisites ............................................................ 1
Contents iii
Introduction 1
Chapter 1. INTRODUCTION
1.1. Objective
The examples in this tutorial show you how to perform various types of calculation.
The tutorial focuses on how to achieve the results, rather than on the results
themselves.
FunctionMod
2 Basic Expressions
FunctionMod
Basic Expressions 3
If you are not sure about the syntax of an expression, or if the expression you want to
use is a complicated one, the easiest way to input the functions and operators is
through the Edit Expression dialog box.
1. Click Edit to the right of the Expression field.
2. Look at the available subcategories of functions, variables or operators under
Function category and choose to use the Math and Trigonometry.
3. Note that when you click on any of the items in the Predefined Functions panel,
a description of the function is shown.
4. Select the function that calculates the average (in FunctionMod this is called
mean) and click Add (or double-click on the function name) to add the function to
the Expression field.
5. Click OK to return to the Horizon Calculations tab.
The Expression field now contains the expression mean(v). In the Variables and
parameters table, a row has been added for every variable in the expression. The first
row always defines the output and is given the name Result by default. In this
example there is only one input variable, named v.
FunctionMod
4 Basic Expressions
FunctionMod
Basic Expressions 5
In FunctionMod you can save your session with all the related data and settings (such
as expressions) in a transform, for use in future sessions. For this exercise this is not
necessary but if you wish to save your work, select File > Save Transform.
FunctionMod
6 Basic Expressions
In the calculations tab, the Expression field now displays the complete expression;
and the Variables and Parameters table contains rows for the Result and for each
variable in your expression. Proceed to assign all the variables to parameters (see
Assigning variables and parameters on page 3), then generate the output (see
Performing the calculation and QC’ing the results on page 5).
FunctionMod
Using Conditional Expressions (if-then-else) 7
The example above is used for this exercise. Start by creating a facies mapping of the
facies types: sand, shale and shaley-sand. You can then use this mapping to perform
an if-then-else calculation.
1. To create the mapping of the facies, proceed as follows.
• In the Workbench, select Project > Jason Project Settings.
• Go to the Types and Units tab, where you can add new data types:
FunctionMod
8 Using Conditional Expressions (if-then-else)
Since this categorical data type does not have a unit associated with it,
leave the entry none in the Unit field.
Click OK to close the Edit Data Type dialog box. You have now created a
facies type curve called sand-shale with facies types sand, shale and
shaley-sand.
• When you are done, click OK to close the Project Settings.
2. Now you can compute the facies type curve using an if-then-else expression:
• Return to FunctionMod. If the main window is no longer open, select Analysis
> FunctionMod from the Jason Workbench.
• In the Well Calculations tab:
Select well WELLS_DB/AllCurvesGroup/db@OCS-G_05825_5.wll.
As the Expression enter GR < 80 ? 0 : GR > 90 ? 1 : 2 and either click
Set, or press Enter on the keyboard. Two rows are added to the Variables
and Parameters table.
Most curves are mapped to codes that can be used in an expression. For example, if
you use GR in the expression, FunctionMod will automatically assign the gamma ray
curve to the GR variable. You could also use a different name, but then you have to
FunctionMod
Using Conditional Expressions (if-then-else) 9
To see which codes are assigned to which curves, in FunctionMod select Edit > Edit
log code mapping.
3. Assign the parameters and variables for the calculation:
• For Result, click <Not assigned> in the Assignments column.
Select sand-shale in the Select Variable Type dialog box.
• Define the sampling and the vertical gate for the computation:
Underneath the table, set the sampling to Measured Depth on a vertical
gate defined by Well Log Extent using the Gamma ray curve. Your Well
Calculations tab should now look like this:
Make sure that the JGW types are set correctly: your entries should read
sand-shale for your result and Gamma ray for your GR parameter.
You can easily apply the same calculation to multiple wells by selecting these under
Perform the same calculations on additional wells.
• Save your session with all the related data and settings using File > Save
Transform As, so that you can use the transform in future sessions.
• Click Generate to generate the results. The curve is added to the well.
4. Open Well Log View to check the results:
FunctionMod
10 Using Conditional Expressions (if-then-else)
You can use more than one variable in FunctionMod functions. For example, you
just computed a facies curve based on only a gamma ray curve that does not
distinguish between fluids. To distinguish between pay sands and wet sands, you
need to include resistivity, as follows:
5. In the Jason Project Settings, create a new user-defined categorical data type
called MyLitho with the following facies types and mapping values: sand = 0,
shale = 1, shaley_sand = 2, and oil_sand = 3.
FunctionMod
Using Conditional Expressions (if-then-else) 11
else
if gamma ray > 80, then
set to 2 (= mapped to shaley-sand);
else
if resistivity > 2
set to 3 (= mapped to oil_sand);
else
set to 0 (= mapped to sand)
FunctionMod
12 Using Conditional Expressions (if-then-else)
Figure 7: Well Log View of the computed sand-shale-oil curve with adjusted color scaling.
Gamma ray [50-200 gAPI] curve is displayed in black. Resistivity log [0-20 ohm*m] is shown
in light blue in the right panel
FunctionMod
Using Tables, Polygons or Pre-defined Functions in your expressions 13
FunctionMod
14 Using Tables, Polygons or Pre-defined Functions in your expressions
If you expect to use the table in other expressions as well, you can add it as an
external function. The advantage is that you do not have to define the row for a
anymore, as FunctionMod already knows what table to use. See Managing External
Functions (page 16) for more information.
7. Set the following parameters:
• Vertical domain to Time.
• Trace gate to Demo_Area.
8. Compute the porosity volume by clicking Generate.
• The file new_porosity.mod will be added to your project.
9. Examine the result in Section View or 3D View.
FunctionMod
Using Tables, Polygons or Pre-defined Functions in your expressions 15
FunctionMod
16 Managing External Functions
External functions in FunctionMod are functions (.fun files), tables or polygons that
were not predefined but made by you or by another user. These items can be used in
FunctionMod expressions. You can also add a function, table or polygon to the
overview in the Edit Expression dialog box, with the advantage that you do not have
to remember any syntax.
Below are some general instructions on how to manage external functions.
1. To add an item to the overview in the Edit Expression dialog box, do the
following:
• Depending on the item you want to add, go to the appropriate calculations tab
in FunctionMod.
• Next to Expression, click Edit to open the Edit Expression dialog box.
• Under Function category choose External Functions. An additional button
Manage is shown to the right of the window.
• Click Manage to open the Manage External Functions dialog box.
• Click Function, Table or Polygon to add an item to the Loaded functions
list. The standard file selection dialog box opens.
• Select the function, table or polygon and click OK.
• Click OK again to close the Manage External Functions dialog box. The
external function is now listed in the Edit Expression dialog box.
• To use the external function, select it and click Add.
• Click OK to close the Edit Expression dialog box, and to return to the
calculations tab.
2. Assign the variables and parameters as before, and generate the results.
FunctionMod
Performing Different Calculations on Multiple Layers 17
FunctionMod lets you perform different seismic or property calculations in each layer
of a solid model in one run.
As an example you will build a trend model where different calculations are
performed for three layers of the solid model. For these layers you want the following
calculations to be performed:
• Orange: mean of predefined traces.
• Red: the trend function which calculates a linear trend between the two
means.
• Deep: mean of predefined traces.
1. To perform the calculations for the Red layer, you will need the external function
Trend.fun that is available in the FunctionMod_tutorial directory.
• Copy the function to the main project directory. If the function is not in the
JASON_DATA folder (the Jason Workbench project directory), you will not be
able to select it in the Advanced Calculations tab.
2. In FunctionMod, go to the Advanced Calculations tab.
3. Define the parameters:
• Select Vertical gate of Input = Solid model. This means that the layers in the
solid model are used as input. At a later stage, when you define the output, you
can assign specific functions to the different layers.
• Click Edit to the right of Vertical gate of Input and select SM as the solid
model to use, then click OK.
• In the next dialog box that opens, you will see the solid model layers in
alphabetical order. In addition to the three layers from the solid model, you
should also see the layers ABOVE, GAPS and BELOW that are created by
FunctionMod. They define the area above the top layer, the gaps in your
model (for example because of reverse faults), and below the bottom layer,
respectively.
Select all the listed layers.
• Change the Vertical gate of Output to Solid model. This solid model defines
the layers for the calculation. Click Edit to the right of Vertical gate of
Output, and select the same solid model as you did for the Vertical gate of
Input.
Note: Make sure both solid models are the same. If the input and output solid models are
different, your calculations will come out wrong.
FunctionMod
18 Performing Different Calculations on Multiple Layers
• In the Transform dialog box, click Add to add the output file settings to the
listing.
7. The next step is to define how the output file is to be created:
• Click on the filename you just added.
• Click Assign. The Assign Function and Parameters dialog box appears.
All the layers from the output solid model are listed, as well as ABOVE, GAPS
and BELOW that were created by FunctionMod. You can use all layers to perform
calculations on, but note the following:
FunctionMod
Performing Different Calculations on Multiple Layers 19
Figure 10: Assign Functions and Parameters dialog box to assign a function or value to layers
9. You are now ready to start assigning different functions to the layers. The purpose
of this transform is to execute the following functions for the following layers:
• Orange: mean of predefined traces.
• Red: the trend function which calculates a linear trend between the means of
the layer above and below.
• Deep: mean of predefined traces.
You can add each function as follows:
• Click on layer Orange in the Function assignments column. The button
Assign becomes available.
• Click Assign to open the Select Function dialog box. As the output file already
has been assigned to an output type, only functions that produce that type of
file are available in the list.
• Select the mean_predefined_trace function from the list.
• Click OK.
Once you have selected the appropriate function for this layer, the parameters of
the function are shown in the third column. The name of this column changes to
reflect the selected function.
On your screen, the right-most column should now be called Parameters for
mean_predefined_trace and the parameters that need to be defined are listed. In
this case there is only one parameter to define: v (trace).
FunctionMod
20 Performing Different Calculations on Multiple Layers
FunctionMod
Performing Different Calculations on Multiple Layers 21
To check that the right function and variables are being used, simply click on the
layer. The parameters are then shown in the right-most column.
12. After adding the functions and parameters, the dialog box should look as follows:
13. Note that only the layers and functions from the Function assignments column
will be used to compute the output later. For example, suppose your Assign
Functions and Parameters dialog box looks like this:
Figure 12: Example of an advanced calculation on only three layers from the solid model
Only two layers are selected and visible in the Function assignments column.
The output will only be calculated for these two layers, even though functions
may exist for the other layers.
• Make sure that all the layers on which you want calculations done, are present
in the Function assignments column.
• Click OK to close the dialog box.
14. Click OK to close all open dialog boxes except the main FunctionMod window.
15. If you expect to use this setup of functions per layer for this solid model in the
future, you should save the transform using File > Save Transform (As).
16. Generate the output file by clicking Generate.
17. Check the results in Section View:
FunctionMod
22 Performing Different Calculations on Multiple Layers
Figure 13: Section View of the trend model, the solid model and the horizons
This example shows how a trend model can be built for separate layers in a solid
model. The trend you built here is a little simpler than you would normally use, but
you now have a basic understanding to build the models you need.
FunctionMod
Creating Your Own Functions (or Not) 23
FunctionMod
24 Appendix: Restoring the dataset
For this tutorial you need the GeoSoftware sample project called Amberjack 9v6 that
was installed along with the installation of the software.
If that project is not available, you need to restore the Amberjack_Tutorial_9v6
GeoSoftware project:
1. Go to Start > All Programs > CGG GeoSoftware > Tools > Project
Management 9.6.
2. Go to the Backup & Restore tab.
3. Click Restore. This opens the Restore GeoSoftware Project dialog box.
4. For Project File select GeoSoftware 9.6
\samples\Amberjack_Tutorial_9v6.gswzip.
5. Change the Target Location to the directory where you want to install your
GeoSoftware project.
FunctionMod
Appendix: Restoring the dataset 25
The Session tab in the information pane shows which project, database and well
project have been selected.
16. Select Applications > Jason Workbench.
FunctionMod