本文整理汇总了C#中WFloInterface类的典型用法代码示例。如果您正苦于以下问题:C# WFloInterface类的具体用法?C# WFloInterface怎么用?C# WFloInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WFloInterface类属于命名空间,在下文中一共展示了WFloInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
try
{
if (args.Length == 0)
{
Console.WriteLine("Uage : CheckObjectType.exe <full file path > <val1> <val2> ");
return;
}
WFloInterface WfInt = new WFloInterface();
WfInt.OpenFile(args[0]);
var OpPtCalc = WfInt.GetOpPtCalculator();
OpPtCalc.UsePCPPumpPerformanceRange = true;
OpPtCalc.AutoSearchOpPtforPCP = false;
var res = OpPtCalc.CalculateOperatingSpeedforPCP(Convert.ToDouble(args[1]), Convert.ToDouble(args[2]));
Console.WriteLine(" Min Value " + OpPtCalc.MinimumRangeValue);
Console.WriteLine(" Min Value " + OpPtCalc.MaximumRangeValue);
}
catch (Exception ex)
{
Console.WriteLine("Got Exception : "+ex.Message);
}
}
示例2: LayerCollection_A3_Item
public void LayerCollection_A3_Item()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer.wflx");
WFInt.OpenFile(sfile);
double Actual = Math.Round(WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().DietzFactor, 1);
//double Expected = 31.6;
WFInt.EndWellFlo();
//Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected));
AreEqual("DietzFactor", 31.6);
}
}
示例3: LayerCollection_A2_CountAll
public void LayerCollection_A2_CountAll()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layers active.wflx");
WFInt.OpenFile(sfile);
short Actual = WFInt.WellModel.AddRef().Layers.AddRef().CountAll;
//short Expected = 2;
WFInt.EndWellFlo();
//Assert.AreEqual(Expected, Actual);
AreEqual("CountAll", Actual);
}
}
示例4: LayerRate_Set2_A2_GetAt_GasRate
public void LayerRate_Set2_A2_GetAt_GasRate()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx");
WFInt.OpenFile(sfile);
double dRate = 37100;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
int i = 0;
double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().GasRate, 2);
double Expected = 13.91;
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected));
}
}
示例5: Layer_A1_SetViscosityModelingData
public void Layer_A1_SetViscosityModelingData()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\PCP-ViscosityModeling.wflx");
string OutPutfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\Saved layer.wflx");
WFInt.OpenFile(sfile);
Array psaTemperatureOld = Array.CreateInstance(typeof(double), 20);
Array psaViscosityOld = Array.CreateInstance(typeof(double), 20);
short ActualNo = 0;
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetViscosityModelingData(ref ActualNo, ref psaTemperatureOld, ref psaViscosityOld);
psaTemperatureOld.SetValue(90, 2);
psaViscosityOld.SetValue(13, 2);
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().SetViscosityModelingData(3, psaTemperatureOld, psaViscosityOld);
WFInt.SaveFile(OutPutfile);
Array psaTemperatureNew = Array.CreateInstance(typeof(double), 20);
Array psaViscosityNew = Array.CreateInstance(typeof(double), 20);
WFloInterface WFIntSaved = new WFloInterface();
WFIntSaved.AddRef();
WFIntSaved.OpenFile(OutPutfile);
WFIntSaved.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetViscosityModelingData(ref ActualNo, ref psaTemperatureNew, ref psaViscosityNew);
double TempratureAt0 = (double)psaTemperatureNew.GetValue(0);
double TempratureAt1 = (double)psaTemperatureNew.GetValue(1);
double TempratureAt2 = (double)psaTemperatureNew.GetValue(2);
double ViscosityAt0 = (double)psaViscosityNew.GetValue(0);
double ViscosityAt1 = (double)psaViscosityNew.GetValue(1);
double ViscosityAt2 = (double)psaViscosityNew.GetValue(2);
Assert.AreEqual(80, TempratureAt0, DeltaFraction.Default(80));
Assert.AreEqual(85, TempratureAt1, DeltaFraction.Default(85));
Assert.AreEqual(90, TempratureAt2, DeltaFraction.Default(90));
Assert.AreEqual(17, ViscosityAt0, DeltaFraction.Default(17));
Assert.AreEqual(15, ViscosityAt1, DeltaFraction.Default(15));
Assert.AreEqual(13, ViscosityAt2, DeltaFraction.Default(13));
}
}
示例6: LayerCollection_LayerStatus
public void LayerCollection_LayerStatus()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layers active.wflx");
string sfileOutPut = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\Saved layers active.wflx");
WFInt.OpenFile(sfile);
LayerCollection pLayerCollection = new LayerCollection();
pLayerCollection.AddRef();
WFInt.WellModel.AddRef().GetLayerCollectionData(pLayerCollection);
pLayerCollection.SetLayerStatus(2, true);
pLayerCollection.SetLayerStatus(1, true);
WFInt.WellModel.AddRef().SetLayerCollectionData(pLayerCollection);
WFInt.SaveFile(sfileOutPut);
WFloInterface WFInt1 = new WFloInterface();
WFInt1.AddRef();
WFInt1.OpenFile(sfileOutPut);
LayerCollection pLayerCollection1 = new LayerCollection();
pLayerCollection1.AddRef();
WFInt1.WellModel.AddRef().GetLayerCollectionData(pLayerCollection1);
bool ActualStatus1 = pLayerCollection1.GetLayerStatus(1);
string ActualName1 = pLayerCollection1.GetLayerName(1);
bool ActualStatus2 = pLayerCollection1.GetLayerStatus(2);
string ActualName2 = pLayerCollection1.GetLayerName(2);
Assert.AreEqual(true, ActualStatus1);
Assert.AreEqual("Layer 1", ActualName1);
Assert.AreEqual(true, ActualStatus2);
Assert.AreEqual("New Layer *1", ActualName2);
}
}
示例7: Layer_A1_CalculateProductivityIndex
public void Layer_A1_CalculateProductivityIndex()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\PCP-ViscosityModeling.wflx");
WFInt.OpenFile(sfile);
double dIndex = 0;
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().CalculateProductivityIndex(400, 400, ref dIndex);
double ActualIndex = Math.Round(dIndex, 4);
Assert.AreEqual(0.3075, ActualIndex, DeltaFraction.Default(0.3077));
}
}
示例8: MultiStageData_RemoveOneStage
public void MultiStageData_RemoveOneStage()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer/layers active.wflx");
string sSavedfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer/Saved layers active.wflx");
WFInt.OpenFile(sfile);
int initialCount = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().NumberOfFractureStages;
Assert.AreEqual(initialCount, 0);
MultiFractureData firstStage = new MultiFractureData();
firstStage.StageLength = 300;
firstStage.TopMD = 10000;
FractureData firstFracture = new FractureData();
firstFracture.AddRef();
firstFracture.bUseFracFaceSkin = true;
firstFracture.bUseCalcdFracDmgSkin = true;
firstFracture.bUseFracChokedSkin = true;
firstFracture.bUseCalcdFracChokedSkin = true;
firstFracture.bUseCalcdSkin = true;
firstFracture.FracSkin = 0.5;
firstFracture.FracHalfSpacing = 200;
firstFracture.FracWidth = 5;
firstFracture.FracHalfLength = 250;
firstFracture.FracHeight = 2;
firstFracture.FracPermNearWB = 0.2;
firstFracture.FracWidthNearWB = 0.25;
firstFracture.FracPerm = 0.5;
firstFracture.FracDmgPerm = 0.74;
firstFracture.FracDmgThick = 52;
firstFracture.FracDmgSkinCalcd = 0.6;
firstFracture.FracDmgSkinMeas = 75;
firstFracture.FracChokedHalfLength = 300;
firstFracture.FracChokedSkinCalcd = 0.65;
firstFracture.FracChokedSkinMeas = 95;
firstFracture.DarcySkinCalcd = 0.7;
firstFracture.DarcySkinManual = 0.15;
firstStage.AddRef().AddFractureData(firstFracture);
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().AddMultiFractureData(firstStage);
int afterAddingCount = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().NumberOfFractureStages;
// int afterAddingCount = WFIntSaved.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().;
Assert.AreEqual(afterAddingCount, 1);
#region read the number of fractures from the WellTech
MultiFractureData savedMultiFracture = new MultiFractureData();
savedMultiFracture.AddRef();
FractureData savedFirstFracture = new FractureData();
savedFirstFracture.AddRef();
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().GetMultiFractureData(0, savedMultiFracture, 0, savedFirstFracture);
double Stagelength_1 = savedMultiFracture.StageLength;
double TopMD_1 = savedMultiFracture.TopMD;
int CountFractures = savedMultiFracture.NumberOfFractures;
Assert.AreEqual(CountFractures, 1);
Assert.AreEqual(300, savedMultiFracture.StageLength, DeltaFraction.Default(300));
Assert.AreEqual(10000, savedMultiFracture.TopMD, DeltaFraction.Default(10000));
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().RemoveAllOneStageData();
int afterRemoveAll = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().NumberOfFractureStages;
Assert.AreEqual(afterRemoveAll, 0);
#endregion
}
}
示例9: MultiStageData_MultiFractureProductivities
public void MultiStageData_MultiFractureProductivities()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer/Multiple Fractures.wflx");
string sSavedfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer/Saved Multiple Fractures.wflx");
//open wellflo
WFInt.OpenFile(sfile);
int initialCount = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().NumberOfFractureStages;
bool bMatrix = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().UseReservoirMatrixCorrection;
double ReservoirPI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().ReservoirProductivityIndex;
double FracturePI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().FractureProductivityIndex;
double WellborePI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().WellboreProductivityIndex;
double MatrixPI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().MatrixProductivityIndex;
double PI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().ProductivityIndex;
ReservoirPI = Math.Round(ReservoirPI, 4);
FracturePI = Math.Round(FracturePI, 4);
WellborePI = Math.Round(WellborePI, 4);
MatrixPI = Math.Round(MatrixPI, 1);
PI = Math.Round(PI, 4);
Assert.AreEqual(ReservoirPI, 1.0072, DeltaFraction.Default(ReservoirPI));
Assert.AreEqual(FracturePI, 0.4215, DeltaFraction.Default(FracturePI));
Assert.AreEqual(WellborePI, 0.0354, DeltaFraction.Default(WellborePI));
Assert.AreEqual(MatrixPI, 0.0, DeltaFraction.Default(MatrixPI));
Assert.AreEqual(PI, 0.0317, DeltaFraction.Default(PI));
// Get the first stage first fracture pro
MultiFractureData savedMultiFracture = new MultiFractureData();
savedMultiFracture.AddRef();
FractureData savedFirstFracture = new FractureData();
savedFirstFracture.AddRef();
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().GetMultiStageData().AddRef().GetMultiFractureData(0, savedMultiFracture, 0, savedFirstFracture);
double Stagelength_1 = savedMultiFracture.StageLength;
double TopMD_1 = savedMultiFracture.TopMD;
int CountFractures = savedMultiFracture.NumberOfFractures;
Assert.AreEqual(CountFractures, 1);
Assert.AreEqual(313, Stagelength_1, DeltaFraction.Default(313));
Assert.AreEqual(5000, TopMD_1, DeltaFraction.Default(5000));
// Use the Reservoir Matrix Correction
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().UseReservoirMatrixCorrection = true; //true
bool bMatrix_1 = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().UseReservoirMatrixCorrection;
//save wellflo
WFInt.SaveFile(sSavedfile);
WFloInterface WFIntSaved = new WFloInterface();
WFIntSaved.AddRef();
//open the saved wellflo
WFIntSaved.OpenFile(sSavedfile);
bool savedbMatrix = WFIntSaved.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().UseReservoirMatrixCorrection;
Assert.AreEqual(savedbMatrix, true);
double NewReservoirPI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().ReservoirProductivityIndex;
double NewFracturePI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().FractureProductivityIndex;
double NewWellborePI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().WellboreProductivityIndex;
double NewMatrixPI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().MatrixProductivityIndex;
double NewPI = WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().ProductivityIndex;
NewReservoirPI = Math.Round(NewReservoirPI, 4);
NewFracturePI = Math.Round(NewFracturePI, 4);
NewWellborePI = Math.Round(NewWellborePI, 4);
NewMatrixPI = Math.Round(NewMatrixPI, 4);
NewPI = Math.Round(NewPI, 4);
Assert.AreEqual(NewReservoirPI, 1.0072, DeltaFraction.Default(NewReservoirPI));
Assert.AreEqual(NewFracturePI, 0.4215, DeltaFraction.Default(NewFracturePI));
Assert.AreEqual(NewWellborePI, 0.0354, DeltaFraction.Default(NewWellborePI));
Assert.AreEqual(NewMatrixPI, 0.0122, DeltaFraction.Default(NewMatrixPI));
Assert.AreEqual(NewPI, 0.0439, DeltaFraction.Default(NewPI));
}
}
示例10: LayerRate_Set4_A1_GetAt_OilRate
public void LayerRate_Set4_A1_GetAt_OilRate()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx");
WFInt.OpenFile(sfile);
double dRate = 21780.34;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
int i = 0;
double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().OilRate, 2);
double Expected = 16335.25;
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected));
}
}
示例11: LayerRate_Set4_A1_GetAt_Name
public void LayerRate_Set4_A1_GetAt_Name()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx");
WFInt.OpenFile(sfile);
double dRate = 21780.34;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
int i = 0;
string Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().GetAt(i).AddRef().Name;
string Expected = "Layer 1";
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual);
}
}
示例12: LayerRate_Set3_A2_Item_WaterRate
public void LayerRate_Set3_A2_Item_WaterRate()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\one layer active and one is inactive.wflx");
WFInt.OpenFile(sfile);
double dRate = 92987.929;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
string sName = "Layer 2";
double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Item(sName).AddRef().WaterRate, 2);
double Expected = 23246.98;
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected));
}
}
示例13: Layer_Put_LayerParameters_Vogel
public void Layer_Put_LayerParameters_Vogel()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layer rate - set 4.wflx");
string OutPutfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\Saved layer rate - set 4.wflx");
WFInt.OpenFile(sfile);
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().WaterCut = 0.3;
WFInt.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().VogelPCoefficient = 0.25;
WFInt.SaveFile(OutPutfile);
WFloInterface WFInt1 = new WFloInterface();
WFInt1.AddRef();
WFInt1.OpenFile(OutPutfile);
double ActualWaterCut = WFInt1.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().WaterCut;
double ActualVogelPCoefficient = WFInt1.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().VogelPCoefficient;
double ActualProductivityIndex = WFInt1.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().ProductivityIndex;
double ActualAOF = WFInt1.WellModel.AddRef().Layers.AddRef().Item(1).AddRef().AOF;
double ExpectedWaterCut = 0.3;
double ExpectedVogelPCoefficient = 0.25;
double ExpectedProductivityIndex = 7.8599;
double ExpectedAOF = 37637.9218;
Assert.AreEqual(ExpectedWaterCut, ActualWaterCut, DeltaFraction.Default(ExpectedWaterCut));
Assert.AreEqual(ExpectedVogelPCoefficient, ActualVogelPCoefficient, DeltaFraction.Default(ExpectedVogelPCoefficient));
Assert.AreEqual(ExpectedProductivityIndex, ActualProductivityIndex, DeltaFraction.Default(ExpectedProductivityIndex));
Assert.AreEqual(ExpectedAOF, ActualAOF, DeltaFraction.Default(ExpectedAOF));
}
}
示例14: LayerRate_Set2_A5_RemoveAll
public void LayerRate_Set2_A5_RemoveAll()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile1 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx");
string sfile2 = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer_RemoveAll.wflx");
WFInt.OpenFile(sfile1);
WFInt.SaveFile(sfile2);
double dRate = 37100;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().RemoveAll();
WFInt.SaveFile(sfile2);
WFInt.OpenFile(sfile2);
int Actual = WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Count;
int Expected = 0;
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual);
}
}
示例15: LayerRate_Set2_A3_Item_OilRate
public void LayerRate_Set2_A3_Item_OilRate()
{
using (new LifeTimeScope())
{
WFloInterface WFInt = new WFloInterface();
WFInt.AddRef();
string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\get-one layer.wflx");
WFInt.OpenFile(sfile);
double dRate = 37100;
WFInt.GetLayerRateCalculator().AddRef().Calculate(dRate);
string sName = "Layer 1";
double Actual = Math.Round(WFInt.GetLayerRateCalculator().AddRef().LayerRates.AddRef().Item(sName).AddRef().OilRate, 0);
double Expected = 27825.0;
WFInt.EndWellFlo();
Assert.AreEqual(Expected, Actual, DeltaFraction.Default(Expected));
}
}