Ejemplo n.º 1
0
            private double FunctionValueHalfTime(INonlinearModel model, int rowVid,
                                                 ValuesByIndex values, bool newValues)
            {
                foreach (Variable c in data.Variables)
                {
                    if (c.ConstName == "T1/2")
                    {
                        c.ConstValue = values[model.GetIndexFromKey(c.ConstName)];
                        break;
                    }
                }

                double R    = data.Variables[0].ConstValue;
                double w    = data.Variables[1].ConstValue;
                double Kon  = data.Variables[2].ConstValue;
                double Koff = data.Variables[3].ConstValue;
                double Df   = data.Variables[4].ConstValue;
                double Ceq  = data.Variables[5].ConstValue;
                double Feq  = 1 - Ceq;
                double Tht  = data.Variables[6].ConstValue;

                data.FitYVals = new double[data.XVals.Length];

                Laplace lap = new Laplace();

                lap.InitStehfest(14);

                return(Math.Abs((R)*lap.InverseTransform(R, w, Feq, Ceq, Kon, Koff, Df, Tht) - 0.5 * R));
            }
Ejemplo n.º 2
0
        /// <summary>
        ///     The calculation Of the dimensionless wellbore pressure drop  with skin for homogeneous reservoir.
        /// </summary>
        /// <param name="td">dimensionless time</param>
        /// <param name="cd">dimensionless wellbore storage</param>
        /// <param name="skinFactor">skin factor</param>
        /// <returns></returns>
        public static double PwdR(double td, double cd, double skinFactor)
        {
            Condition.Requires(td, nameof(td)).IsGreaterOrEqual(0.0);
            Condition.Requires(cd, nameof(cd)).IsGreaterOrEqual(0.0);

            return(Laplace.InverseTransform((x) => PwdRinLaplaceSpace(x, cd, skinFactor), td));
        }
Ejemplo n.º 3
0
            private static void SolveEq(DataSet data)
            {
                if (data.XVals.Length == 0 || data.Variables.Count == 0)
                {
                    return;
                }

                double R    = data.Variables[0].ConstValue;
                double w    = data.Variables[1].ConstValue;
                double Kon  = data.Variables[2].ConstValue;
                double Koff = data.Variables[3].ConstValue;
                double Df   = data.Variables[4].ConstValue;
                double Ceq  = data.Variables[5].ConstValue;
                double Feq  = 1 - Ceq;

                data.FitYVals = new double[data.XVals.Length];

                Laplace lap = new Laplace();

                lap.InitStehfest(14);

                for (int t = 1; t < data.XVals.Length; t++)
                {
                    //data.FitYVals[0][t] = MathNet.Numerics.SpecialFunctions.BesselK1(data.XVals[t]);
                    //data.YVals[0][t] = MathNet.Numerics.SpecialFunctions.BesselI1(data.XVals[t]);
                    //data.FitYVals[0][t] = Accord.Math.Bessel.I(data.XVals[t]);

                    //data.FitYVals[0][t] = Accord.Math.Bessel.Y(data.XVals[t]); - it is not modified!!!
                    data.FitYVals[t] = (R)*lap.InverseTransform(R, w, Feq, Ceq, Kon, Koff, Df, data.XVals[t]);
                }
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Dimensionless wellbore pressure
 /// </summary>
 /// <param name="td">dimensionless time</param>
 /// <returns></returns>
 private double Pwd(double td)
 {
     return(Laplace.InverseTransform(PwdRinLaplaceSpace, td));
 }