| Example Functions | |
Refer to the examples below. Note the WellSpring equations can be pasted directly into either the function editor, or the text box to the left of the green "fn".
Tip: You can copy the below WellSpring function examples (shown in red ) and paste directly into the formula text box in WellSpring
Note: Calculations are done in metric default units, while monetary units are in dollars. See Units in Calculations for more information on units, and the unit conversion factors.
Example 1 - A drilling learning curve function that reduces the drilling time from a start of 60 days by increments of 10% (6 days) for every doubling of the number of wells drilled.
The equation is:

It is modeled in WellSpring as:
= 60.0 - (6 * @LOG(@DrillOrderSchedule() , 2) )
Note: the syntax for Log base 2 (Log2) s @LOG(value,base)
Example 2 - An exponential decline in costs, 5% reduction for every doubling of the wells in the project (beginning from $1,000).
The equation is:

It is modeled in WellSpring as:
= 1000 * (@POWER(0.95, @LOG(@WellCount() , 2)))
*Note: Money calculations are done in dollars, and are returned to WellSpring in dollars. See Units in Calclulations for more information on units.
Example 3 - An Exponential Decline in Opcosts of 1% per annum (beginning from $10,000/month)
The equation is:

It is modelled in WellSpring as:
= 10*@Power(10,(-0.01*@Step()/12))
Note: The first index of @Step is equal to 0.
Note: 10 represents 10,000 as base opcost units within WellSpring which are m$/month
Entered into the opex facility costs:


Function Editor:

Reported results from WellSpring reports:

Example 4 - Evaluating the time until start of production
If you want to calculate the number of months from the start of the project to the start of production, you need to use one function as the argument for another.
= @ConvertDateToIndex( ) function returns an index from a serial date.
= @FirstProductionDate( ) returns a serial date for the start of production.
combing these gives the required function:
= @ConvertDateToIndex(@FirstProductionDate( ))
If production started two years after the project start, then this would return a value of 24.
Example 5 - Creating a zero multiplier to use prior to production start
If you wanted to zero out any operating costs prior to the start of production, you could simply multiply say your fixed opex (eg 5 m$/month) by the "HasProduced" flag in the function builder. The "HasProduced()" function returns zero prior to production start, and 1 after.
It is modeled in WellSpring as:
= 5*@HasProduced( )
In this example the operating costs would be zero until the start of production. Note that this function will be redundant for operating cost controlled by the Scheduler (where an asset’s operating costs starting after its capital spend is complete is an intrinsic feature) unless there is a delay between completion of a facility’s construction and the start of its operation.
Example 6 – Boolean function Values that change at a fixed date
This function allows for a cost that changes at a specific date. This may be the case when you are waiting on electricity to be run to a well or field, and the wells will have reduced costs when the generator is replaced with line power. (Operating Costs input directly in the Network or Data tabs use relative dates and always shift with asset start date. )
Psuedo Code:
IF Current time step > fixed date THEN
Value = 1.25
Else
Value = 4.25
End If
It is modelled in WellSpring as:
= @If(@DateFromIndex(@STEP())> @DATE( 2014,9 ,1 ) ,1.25 ,4.250 )
In this example the operating costs would be 1.25 after Sept 1, 2014, and 4.25 in prior periods.
Example 7 – Operating costs as a function of fuel gas price
This function models a situation where a project is required to purchase gas for fuel (SAGD or CSS heavy oil project)
This operating cost can be modeled in WellSpring as:
=@Price (Gas_Price_File, Gas) * @Tseries(FuelGas) * @BTU()
FuelGas is a user defined custom array - see Using Custom Variables - Time Series in Functions for information on how to use custom data in WellSpring.
Price - is the specified price file in WellSpring ($/mmBtu) (*Note, the price file name is not in quotations, so cannot have any spaces in the name).
BTU - is a user defined scalar variable representing the Btu content of the purchased gas.
Example 8 – Steam utilization calculation
This function models a situation where you want to find out the amount (fraction) of steam used at a steam generation facility in a SAGD project
It is modeled in WellSpring as:
=@Steam() / @ConstraintVol(InjectedWater)
This variable would be reported at your steam generator.
To construct a function that will report anywhere in the project, the facility can be specified:
= @Steam() / @ConstraintVol( ‘Steam Generator’ , InjectedWater)
The function assumes that the facility is named "Steam Generator".
Note: InjectedWater is the WellSpring variable used for Steam.
Note: @Steam() could also be written as @Steam('Steam Generator').
Example 9 – Water as a function of Gas production (Used in the Decline tab)
This function models a situation where you have an initial water rate (6 months) as a function of gas production which changes to a lower rate as the well cleans up. In our example the water is 5bbl/mmscf/day, which reduces to 3bbl/mmscf/day
It is modeled in WellSpring as:
=@IF(Step()<(@IndexOfFirst(Gas ,Production)+6),@Base(Imperial, FluidVolume,@DataRate(Gas ,Production ))*5/@Base(Imperial,GasVolume,1),@Base(Imperial, FluidVolume,@dataRate(gas,production))*3/@Base(Imperial,GasVolume,1))/1000
The formula also converts the value from Imperial units to base units to do the calculation, thus the @Base(Imperial, FluidVolume...) and @Base(Imperial,GasVolume,1) is required to perform these conversions.
@IndexOfFirst(Gas,Production) + 6 returns the index 6 months after the start of production.
Example 10 - Waterflood example, calculation of make up water See Waterflood Example for more detail.
This example calculates the amount of make up water required to supplement produced water for a waterflood.
The required equation is qwi = VRR*(qw + Bo*qo) where qw, qwi are water production and injection rates and qo is oil production rate.
Therefore qwi – qw = (VRR-1)*qw + VRR*Bo*qo is the required makeup water (if it falls below zero, then it is assumed to be zero). The formula for the constraint is modeled as:
=((@VRR()-1)*@Data('Pattern1',Water, OutflowPotential, @step())+ @VRR()*@Bo()*@Data('Pattern1', Oil, OutflowPotential, @Step()))/ @DaysInMonth()
*If the expression evaluates to <0, then WellSpring will set the constraint to 0.
@VRR() and @Bo() are user parameters that were set to 1 and 0.8 for this example.
(Refer to User Defined Functions for more on how to use functions in WellSpring)
Example 11 - Calculating NRI
The following formula using the expression (Total WI Revenue - Total WI Royalties)/Total WI Revenue to calculate the NRI within the function.
(@EconFirstWI(TotalRevenue)-@EconFirstWI(TotalRoyalties))/@EconFirstWI(TotalRevenue))
Example 12 - First year net capital divided by two-year net BOE (Reporting Formula)
The EconCumDiscount function allowed the capture of first or second year data, Pete’s NRI inference using EconFirstWI for revenue and royalties was used, and BOE had to be manually determined from the volumes.
Here’s the formula for Net Capital 12 months divided by Net BOE 24 months.
@EconCumDiscountWI(TotalCapital,0,11)/((@DataCumWI(Oil,Production,23)+@DataCumWI(Ethane,Production,23)+@DataCumWI(Propane,Production,23)+@DataCumWI(Butane,Production,23)+@DataCumWI(Pentane,Production,23)+@DataCumWI(Gas,Production,23)*@ConvertToBase(Imperial,FluidVolume,1)/@ConvertToBase(Imperial,GasVolume,6)) *(@EconFirstWI(TotalRevenue)-@EconFirstWI(TotalRoyalties))/@EconFirstWI(TotalRevenue))
Notes:
@EconCumDiscountWI(TotalCapital,0,11) returns the working interest capital for the first year. It references discounting, but the "0" is the discount rate, so it is undiscounted. The "11" represents the first year (Index 0 to Index 11 is the first 12 months)
The second part of the expression sums the BOE components. Note that gas is coverted to BOE.
The third part of the expression (@EconFirstWI(TotalRevenue)-@EconFirstWI(TotalRoyalties))/@EconFirstWI(TotalRevenue)) calculates NRI as a ratio.
Example 13 - Selecting wells by name in a report filter
@namecontains(‘searchname’)
e.g. for assets called "Rover-xxxx", the formula would be @namecontains(‘Rover) which would return a list of all the Rover wells.
See also