FePEST Tutorial
For this exercise, a new FEFLOW file fepest1.fem is created based on the original demonstration-exercise file exercise_fri_13.fem. At this stage, all boundary conditions, material properties and problem settings have already been assigned. The file is located in the folder femdata in the tutorial section.
While a steady-state flow problem is considered here, the same workflow can be followed for other FEFLOW problem classes (including transient simulations) as well. The tutorial covers the four main steps that apply to any FePEST problem:
-
Definition of observation points (in FEFLOW and/or FePEST)
-
Definition of parameter zones (in FEFLOW)
-
Definition of a PEST problem (in FePEST)
-
Post-processing of PEST results (in FePEST and FEFLOW).
Conceptual Model
The material property Conductivity K_xx is calibrated in this FePEST demo exercise. Conductivity measurements were taken in different locations at the surface level (Layer 1 in FEFLOW). Initially, the spatial distribution of conductivity in FEFLOW for this slice was computed by means of a linear Akima regionalization method. Using existing information of conductivity measurements, structure parameters of the semi-variogram (or variogram) were identified. Methods for variogram fitting are outside of the scope of this chapter.
Two sets of field measurements (Hydraulic head) are used for the parameter estimation problem.
Pilot points together with a regularization approach are applied to estimate the final conductivity distribution for Layer 1. Simple Prior knowledge is used to incorporate existing information of conductivity in the regularization techniques.
Field Measurements and Reference Data
Seven Observations Points are already defined in fepest1.fem. Together with four additional observation points to be included later in FePEST, they will be used for the calibration of K_xx. Further details of observation-point manipulation wild be discussed in this chapter.
Figure below shows a distribution of measured conductivity values. Here, a first overview gives an idea of the wide range of conductivity values in the model domain. A classical approach in this situation is to apply a log transformation to the distribution of K_xx. From the measurement distribution, a variogram structure can be estimated using geostatistical methods. In our case, the distribution of log(K_xx) is well represented by a spherical variogram with nugget = 0, sill = 0.58, and range = 4200. This information will be implemented in the FePEST problem.
Field measurements of conductivity in the Friedrichshagen FEFLOW model domain.
FEFLOW Model Preparation
If the parameter estimation considers only a specific zone of the FEFLOW model domain (e.g., a layer, slice, or arbitrary subdomain), some preliminary steps are needed in FEFLOW before initiating FePEST.
In this FePEST demo exercise, the conductivity is calibrated on layer 1 only; therefore, an element selection of this area is created first after opening fepest1.fem in FEFLOW:
-
In the active view, go to Layer 1.
-
In the Selection toolbar, indicate Elements as selection target.
-
Click on Select All.
-
In the Entities panel, store the element selection and rename it as Zone1.
This element selection Zone1 will be available in FePEST as a Zone for the parameter estimation.
The Observation Points already included in the FEFLOW problem can be verified by opening the Observation Point Properties dialog.
Observation Point Properties dialog.
The same dialog is also used to assign measurement time series to observation points.
Click on OK to leave the dialog without any changes. In the Slice view, navigate through the different slices. Notice that Observation Points are situated on slices 1 and 4 of the FEFLOW model while the actual parameter estimation in this example will be limited to the first slice. Observation points to be included for the calibration problem can be still defined later in FePEST.
Save the FEFLOW file as fepest2.fem and then close FEFLOW.
FePEST Initial Configuration
FePEST is the graphical user interface for PEST. Although FePEST provides full communication between FEFLOW and PEST (main program and PEST utilities), the user has the option to manually update the PEST program files and thus to control which PEST version is used in FePEST. During the installation of FEFLOW , the PEST program files are automatically installed as well. Their location is controlled via the menu Tools > Options in FePEST.
Location of main PEST files and PEST utilities.
Definition of a New FePEST Problem
Open FePEST and create a new problem from the menu File > New. A dialog prompts for the location of the FEFLOW fem file that will be used for the FePEST optimization. Select the previously saved file
\tutorial\femdata\fepest2.fem.
Click on OK to create a new FePEST problem. FePEST now automatically retrieves all important information from the FEFLOW model such as problem class (flow, mass, heat and/or age), material properties, observation points with their corresponding time series (if applicable), stored element selections, etc.
Definition of new FePEST problem.
Optimization Settings
Next, the FePEST Problem Settings dialog will prompt for the information needed to define the PEST problem and to create the main PEST files:
-
Optimization Control
-
Parameters
-
Observations
-
Prior Knowledge
-
Subspace Regularization
-
Predictive Analysis
-
Parallelization
Experienced PEST users will recognize the traditional code names of the PEST parameters shown in bold letters.
While for most groundwater models, the default values suggested by the PEST manual and indicated in the Problem Settings dialog should be appropriate, some modifications may be needed for highly-parameterized FEFLOW models.
In the Optimization Control section, the PEST operation mode is indicated. For the case of this exercise, PEST runs in Estimation operation mode. This is the default mode in FePEST.
In Optimization Control > Termination Criteria, the different criteria to terminate the PEST execution are listed. A maximum number of PEST iterations (NOPTMAX) of 30 is recommended. It is worthy to notice that a single PEST iteration includes several FEFLOW model runs. The total number of FEFLOW runs depends on the number of parameter to be calibrated and the selected kind of PEST statistics. The most-demanding PEST operation is the computation of the Jacobian Matrix.
Other termination criteria are the relative reduction of the objective function (PHIREDSTP), the maximum number of consecutive iterations which failed to lower the objective function (NPHINORED), the maximum relative parameter change (RELPARSTP), and the maximum number of consecutive iterations with minimal parameter change (NRELPAR).
The value of NOPTMAX in FePEST also defines the type of action to undertake in the current PEST run. In a classical PEST configuration (no FePEST interface), a value of NOPTMAX equal to 0 means that PEST runs only once to compute the measurement objective function. A value of -1 computes the Jacobian Matrix and statistics, and a value of -2 the Jacobian Matrix only. In FePEST these options are controlled via the combo box below NOPTMAX in the Termination Criteria section.
The type of optimization statistics (covariance matrix, correlation matrix and eigenvalues) for the final PEST run needs to be indicated in the Optimization Control > Optimization Statistics section.
Problem Settings dialog: Termination Criteria.
Parameter Definition
Parameters in a FePEST optimization problem can be defined either as homogeneous zones, or as spatially variable using pilot points. In both cases, material properties (so-called Parameter definitions) are specified for Zones (or for the entire model domain). Typically, zones reflect different geological units with respective FEFLOW material properties.
Zones correspond to stored element sections in a FEFLOW fem file. After opening the file with FePEST, all existing element selections will be listed in the Zones section of the Parameter definition dialog.
In the Parameters section of the Problem Settings dialog, click on New to create a new parameter definition. The Parameter definition dialog shows that the FEFLOW file contains an element selection named Slice_1.
In the Parameter definition dialog, select Slice_1 as Zone, choose K_xx as Parameter type and Pilot points in 2D, all layers adjustable as the assignment method.
Parameter definition dialog.
The assignment method via #IFM implemented# is for advanced users with experience in FEFLOW interface programming. A FEFLOW plug-in (previously attached and registered in FEFLOW ) can be made responsible for transferring parameter values to FePEST. This is a powerful option to calibrate FEFLOW parameters not available via the FePEST graphical interface, e.g., boundary conditions.
After defining Pilot points in 2D, all layers adjustable as the assignment method, the Parameter definition dialog slightly changes.
Now the locations of pilot points need to be specified using a specific geographical position (X, Y, Z), slice or layer number as reference.
FePEST provides a very convenient automatic generator of pilot points. Click on Generate to open the Pilot point generation dialog which will prompt for the number of points desired. For this exercise, enter a value of 60. Pilot points can be distributed in one of four automatic patterns: uniform, stagger rows, stagger columns and random.
Choose the option uniform and close the dialog by clicking OK.
Parameter definition dialog in pilot point mode.
Notice that the actual number of pilot points will depend on the geometry of the FEFLOW model domain and pattern specified. Indeed, the final number of pilot points in our case is 61. If the automatic generation was not satisfactory, pilot points can be edited and/or deleted in the Parameter definition dialog.
PEST will calibrate parameter values at each individual pilot point. Subsequently, PEST will interpolate (and/or extrapolates) parameter values over the entire Zone specified as pilot-point domain. Kriging or Radial basis functions are available as interpolation methods.
Pilot point generation dialog.
For this exercise, the Kriging interpolation method is used.
Click on Interpolation method properties to assign properties of the experimental variogram. In the Kriging configuration dialog, four well-known variogram types are available (Spherical, Exponential, Gaussian and Power). In Geostatistics, these are called theoretical variograms (or semi-variograms) and they represent the spatial structure of a measured property, in particular, how field measurements are correlated depending on sampling distance. Notice that all the variogram properties (range, sill, nugget, etc.) have to be set up in FePEST and the uncertainty of these parameters will also be reflected in the parameter estimation.
Kriging configuration dialog.
After activating Show variogram and a click on Refresh, FePEST computes the experimental variogram (dots) and theoretical variogram (continuous line) in the chart. FePEST can also compute variograms for different lag tolerances. This feature gives a faster overview about the goodness-of-fit between experimental and theoretical variograms. Chart information can be exported by choosing the Properties option from the context menu.
For this exercise, use the values presented in the figure. Click on OK to confirm the changes in the Kriging configuration dialog.
Next, click on the Defaults tab in the Parameter definition dialog. Depending on the material property, a parameter log-transformation may improve the PEST optimization result. Parameters such as conductivity and transmissivity are typically log-transformed because they can change several orders of magnitude within a given model domain.
FePEST offers four possibilities to define a PEST parameter (none, log, fixed and tied):
-
None: Parameter calibration is carried out without any transformation of the parameter.
-
Log: A log-transformation is applied to the parameter before PEST is executed. PEST statistics are presented based on transformed parameters.
-
Fixed: The parameter is listed within the PEST control file, but is not modified during PEST optimization. Fixed parameters do not influence the objective function.
-
Tied: The parameter is tied to a so-called “parent” parameter and its value will depend on the current value of the parent. Tied parameters will be updated during the PEST run with the same ratio as given by the initial parameter values.
In this exercise, Initial value is set as current, i.e., FePEST will automatically retrieve all parameter K_xx values from the FEFLOW fem file.
In a first PEST run, it is always recommended to provide wide bounds for the parameter to be estimated so that the PEST optimization will not be influenced. Here, modify Upper Bound to a value of 500 m/d. In further PEST runs, parameter bounds can be adjusted based on parameter tendencies observed from previous runs.
Click on OK to close the dialog.
Since our FEFLOW model contains information in three dimensions, conductivity values for K_yy and K_zz are also available in the fem file. However, these two material properties in FEFLOW are related to values of K_xx, i.e. K_yy = K_xx and K_zz = Kxx / 10. Therefore, PEST and FePEST should also update the spatial distributions of K_yy and K_zz according to the modifications of K_xx. This is accomplished by defining K_yy and K_zz as tied parameters, with the parent parameter K_xx.
Click on New to create a new parameter definition. Indicate conductivity K_yy as parameter type. In the Assignment method, choose Tied to other parameter definition. Indicate xco (Conductivity K_xx) in the field Tied to. In the Defaults tab, modify Upper Bound to a value of 500 m/d. Click on OK to confirm the changes. FePEST automatically creates 61 pilot points to compute the distribution of K_yy based on the distribution of the parent parameter pilot points.
Repeat the steps for K_zz.
Click on Apply to assign all changes made in the Parameter section.
PEST parameters for parameter definition (tied parameters).
Observations Definition
In the Observations section of the Problem Settings dialog, all field measurements (Hydraulic head, Mass concentration, Temperature, Groundwater age, etc.) to be used in the PEST optimization problem are specified.
Create a new observation definition by clicking on the New button. In the Observation definition dialog, indicate Hydraulic head as Observation type. As Source method, select Reference values in the FEM. This option will automatically retrieve the information for all Observation Points from the FEFLOW file.
In the Defaults tab in the Observation definition dialog, indicate a Weight of 2.621 for this observation group. The weight value will reflect to which degree an observation group affects the measurement objective function. Different Weights can be used between observation groups to include different uncertainties of the measurements. As a rule of thumb, observation weights can be calculated as the inverse of the measurement standard deviation.
Click on OK to add this observation group to the FePEST problem.
Since also the Observation Points located on Slice 4 were imported into FePEST, they need to be deactivated so that they do not influence the objective function. Double-click on the observation line corresponding to GWM2 and change Weight to 0. Click on OK to confirm the modifications. Repeat these steps for GWM5, GWM8, GMW10, GMW11 and GMW12.
The second set of observation points is added directly using an external file. This group has a higher uncertainty (standard deviation of 0.35 m).
-
Click on New to create a second observation definition. Define Hydraulic head as Observation type.
-
Select External file as Source for importing observation points.
-
In the file dialog, select the ASCII Table (*.dat) named new_observations.dat.
-
In the Defaults tab, insert a Weight of 0.545.
-
Click on OK to complete definition of this second observation group.
Observation definition dialog.
A FEFLOW triplet file can be easily prepared in a spreadsheet or text editor. This file type has a very simple structure and can accommodate geographical coordinates and observation values. Further details can be found in the FEFLOW Help System.
Structure of a FEFLOW triplet file used to import observations.
Information for all the observations considered in the FePEST optimization problem is given in the lower part of the Observation section in the Problem Settings dialog, including observation type, name, coordinates, value, weights, etc. Any time series associated with FEFLOW Observation Points would also be listed here.
Observation items can be edited directly within FePEST. Additionally, FePEST provides the possibility to edit all or some of the observations in an external spreadsheet. Clicking Copy will generate a copy of the entire observation list (this also applies for the parameter list).
Final list of observations used for PEST optimization.
Parallelization Mode
FePEST allows a PEST run in parallel mode. FePEST uses BeoPEST (third-part software) as tool for the communication between slaves and master.
In the Parallelization section of the Problem Settings dialog, click on New to create a Slave definition. In the Slave definition dialog, the server to be used is specified under Host name. In this exercise, localhost is used for sake of simplicity. This means that multiple FEFLOW executions will simultaneously run on different cores of the same computer. As No. of slaves, insert a value of 3. Make sure Active is selected.
Definition of slaves for a PEST run in parallel mode.
Click OK to close the Slave definition dialog. Click Apply to confirm the changes in the Parallelization section.
Similarly, slave definitions can be created if multiple slave servers are available. The status (Active or Inactive) of a slave definition can be modified any time before the PEST problem is initiated.
For reference, all the FePEST runs in this exercise were computed using an Intel(R) Core™ i7 – 3840 QM CPU with 2.80 GHz and 16.0 GB RAM. Depending on the available hardware, FePEST run times may vary.
Estimation Method and Regularization Setup
FePEST graphical interface provides all the combination of regularization supported by PEST such as:
Regularization methods
-
Tikhonov Regularization
-
Singular Value Decomposition (SVD)
-
SVD-Assist
-
Least Squares Regularization (LSQR)
By default, FePEST uses Singular Value Decomposition. This is a very powerful option for FEFLOW models, as discussed in the theoretical part of this chapter. For this exercise, scenarios are implemented with and without Tikhonov regularization in order to explore the importance of the prior knowledge in the calibration process. SVD-Assist is used in this tutorial to cut off the number of dimensions of the problem, i.e. a rapid calibration.
Regularization Setup
In the Problem Settings dialog, go to the section Regularization and activate Tikhonov. In the same page include SVD-Assist.
Regularization settings in FePEST.
In the section of Tikhonov, activate the three different options of prior information as shown in figure below.
Tikhonov regularization settings: Prior information.
In the Objective function settings of Tikhonov, specify values of 0.25, 0.5 and 0.1 for the PEST parameters PHIMLIM, PHIMACCEPT, and FRACPHIM, respectively.
Click on Apply to confirm the modifications.
Settings of SVD-Assist
In the Problem Settings dialog, go to the section Regularization > SVD-Assist, the option Automatically set using SUPCALC is selected by default as the option to determine the number of super parameters. Click on Apply and OK to confirm the changes.
Save the changes to fepest.fps.
Running PEST
In the active view FePEST shows pilot points, observation points and parameter zones, as indicated in the Problem Settings dialog.
Navigation through different slices and layers of the FEFLOW domain is possible via the Map Contents panel (if not visible, this is found in menu View > Map Contents).
FEFLOW model with assigned pilot and observation points for FePEST project.
Before initiating a PEST run, all configuration files need to be created. Click on Checks to generate the three main PEST files (Control file, Template file and Instruction file) and batch files for FEFLOW and PEST. At the same time, the PEST check tools PESTCHEK, TEMPCHEK, and INSCHEK are executed. A dialog in FePEST will show any errors and/or warnings found.
If errors are found, modifications can be made via the Problem Settings dialog. As a general recommendation, the Checks tools should always be run after any modification to the FePEST project.
PEST is initiated with a click on Run. FePEST still provides the possibility to re-create PEST files if modifications have been made in the Problem Settings dialog. If a FePEST project involves the use of pilot points, this option should be marked as the pilot-point files PLPROC are not automatically created by the Checks tool.
In the Run dialog, activate Create the files required by PEST and click OK to initiate the PEST optimization.
The Output panel appears after the PEST initialization. In the case of running PEST in parallel mode, additional Output panels will appear on the master display for each slave. The information presented in the Output panels is identical to that appearing on the console in a classic command-line PEST execution.
In a similar manner the rest of FePEST projects can be executed.
Postprocessing PEST Results
Optimization Results in FePEST
Immediately after the first FEFLOW model execution, FePEST provides graphical feedback of the optimization problem and the status of the objective function. In the Simulated vs. Observed panel, the current misfit between FEFLOW results and observations is shown.
Status panel in FePEST with current PEST iteration information.
After the PEST optimization process has finished, results are available automatically or they can be retrieved via the Estimation > Show results menu.
Estimation results and different export options.
In the Estimation results dialog, the final estimated value of K_xx for each pilot point is shown. From here, several options are available:
-
Click Save to save the results in a FEFLOW fem file with final parameter estimates (automatic assignment of material properties in FEFLOW).
-
Click Save and select Use the new FEM to connect a new FEFLOW fem file (with new material properties) to the current FePEST project.
-
Click Apply to create a new FePEST project based on the final parameter estimates.
Use the first option to review PEST results directly in FEFLOW. Save the new file as fepest3.fem. We will leave the post-processing in FEFLOW for the next steps.
In FePEST you can visualize the Simulated vs. Observed panel to verify the graphically the mismatch between model and historical data. Exact numbers can be visualized faster using the Tooltip option (activated via right-click into the chart), and placing the mouse cursor over a data point in the chart.
Simulated versus observed values in FePEST.
The final misfit can be reviewed in the Residuals panel, which also contains information on the weighted residuals.
Residuals panels shows the final misfit between FEFLOW simulated values and measured values.
Results Postprocessing in FEFLOW
Open the file fepest3.fem in FEFLOW. Make sure that Layer 1 is selected in the Spatial Units panel. Double-click on K_xx under Material Properties > Fluid flow > Conductivity in the Data panel to plot this parameter in the Slice view.
In the Maps panel, right-click on ASCII Table Files and choose Add Map (s) to folder ASCII Table Files. Select new_observation_wells.dat to include a file with new observation points (second group in FePEST).
Right-click on this new entry and choose the option Convert to > Observation Points. Click OK to accept the defaults settings.
Double-click on Observation Points in the Spatial Units panel to plot them in the active view.
The distribution of K_xx estimated by PEST is shown in figure. Observation points NEW1-NEW4 strongly influence the conductivity values.
The distribution of conductivity K_xx using Tikhonov, Singular Value Decomposition and SVD-Assist is shown in figure below. Note that the estimated distribution is significantly smoother due to the regularization techniques. In this exercise, the observation points NEW1-NEW4 contain a significant measurement noise. From a first inspection to the conductivity field, it seems to be that these do no influence significantly the regularized calibration. The reason of this behaviour falls into the distribution of the observation weights in the FePEST problem. The observation weights have been assigned in such a manner that all the observation groups contribute equally to the measurement objective function, i.e. observations NEW1-NEW4 must have a lower weight than others. Moreover, the objective function limits for the Tikhonov regularization has been significantly increased compared to the default values in PEST / FePEST. This information instructs PEST to avoid the over-fitting.
Areas of high conductivity (shown in red in Figure below) are even far from reaching the bounds of the parameter definition in FePEST.
Distribution of conductivity K_xx estimated including regularization methods in FePEST.
The initial distribution of conductivity K_xx has been previously stored as a User Data > initial_conductivity in the Data panel. Double-click on initial_conductivity to plot its distribution in the Slice view. By default, User Data are plotted using a linear colour mapping. Double-click on initial_conductivity in the View Components panel to open the Properties panel. Here, change to the Logarithmic option and click Apply to confirm. The distribution of the original (initial) conductivity K_xx is shown below.
Distribution of initial conductivity K_xx interpolated by an Akima regionalization technique.
The initial distribution of conductivity K_xx looks somewhat “bumpy” due to the Akima regionalization applied.
To compute the relative parameter deviation, the initial distribution initial_conductivity is used as reference. In the Data panel, right-click on User Data to open the context menu and select Add Elemental Expression. Rename this elemental expression to Parameter-Deviation. Right-click on Parameter-Deviation to open its context menu and select Edit Parameter Expression. In the Expression Editor, write the same expression as shown below.
Use of the Expression Editor in FEFLOW to compute the parameter deviation in respect to the initials.
Click OK to confirm the changes, leave the dialog and plot the element expression in the active view by double-clicking on Parameter-Deviation. We can identify the areas, where the maximum changes occurred during the calibration by plotting the distribution with the option Fringes in the View Components panel. Open the Properties panel of Fringes and select Arbitrary option. Click Edit to provide the list. Finally Click Apply.
Fringes of parameter deviation.
The distribution of the parameter deviation shows that the regularized calibration has indeed modified the conductivity distribution in the model. The areas near the new four observation wells have suffered the maximum changes.
Distribution of the parameter deviation between calibrated set and initial set.
Save the changes in FEFLOW to fepest4.fem and close FEFLOW.
Sensitivity Estimation
In the previous steps we have learnt that some observation points influenced the regularized calibration more than others. Now in FePEST we will intend to calculate the sensitivity distribution
Go back to FePEST and go to the menu Estimation - Utilities - Sensitivity. The sensitivity distribution will be computed using the JROW2VEC PEST utility. FePEST extracts information from the Jacobian Matrix to compute the sensitivity distribution. In the Sensitivities dialog and check Select / deselect all to consider all the observations. Click Recalculate to initiate the calculation. Check and open the FEM in order to save the distributions in FEFLOW. You can save this file as fepest5.fem. Click Close to leave the Sensitivities dialog.
Open FEFLOW and load fepest5.fem to visualize the sensitivities in the model domain.
Alternatively, the sensitivities table can be copy to any text editor or spreadsheet editor for further post-processing. If that is the case, file can be anyway imported as usual in FEFLOW with the following steps:
-
Click Add Nodal Distribution under User Data in the Data panel and rename the new entry to Sensitivity.
-
In the Maps panel, right-click on ASCII Table Files and select Add Map(s) to Folder ASCII Table Files. Choose the file pilot_point_sensitivities.dat. Right-click on this new file and select Link to Parameter (s). In the Parameter Association dialog, create a link between HEA-9 and User Data > Sensitivity. Keep the default settings (Regionalization method Inverse distance, Neighbors 4 and Exponent 2). Click on OK to confirm the changes.
-
Activate the link with a double-click on HEA-9 -> sensitivity in the Data panel. Select Slice 1 in the Spatial Units panel and select all nodes with a click on Select All. Reduce the Snap distance to 0 m in the Snap-Distance toolbar and click on Assign.
The sensitivity distribution for observation HEA-9, corresponding to observation point named GWM9, is plotted in image below. The distribution of sensitivity from the Jacobian Matrix reveals that K_xx values from pilot points placed on the southern border (around observation points GWM13, GWM6 and GWM4) highly influence the values for the observation point HEA-9.
The negative sensitivity values reflect the tendency of a decreasing Hydraulic head in HEA-9 with increasing K_xx at these pilot points.
Save the changes to the FEFLOW file fepest5.fem.
Distribution of sensitivity for observation point GWM9.
Additional Exercises
Run the same FePEST problem under these two cases. Use as a starting point the file fepest.fps.
-
Case 1: Decrease significantly the value of the objective function limits for the Tikhonov regularization.
-
Case 2: Deactivate the Tikhonov option in the regularization.
In the first case, you will notice the problem of over-fitting. There will be a perfect match between the observations and the FEFLOW results, but the conductivity calibrated is far from being realistic (i.e. according to the imposed prior knowledge).
In the second case, there is no prior information supported in the calibration. PEST will find a solution, which perfectly fits the observations, however this is again not realistic. Here you end up with the problem of non-uniqueness in the system, i.e. several solutions provide the same answer.