public void BindAddedWells() { _logstring.Append("IntakeId\tOriginal screen top\tOriginal screen bottom\tNew layer number\t New Screen top\tNew screen bottom\n"); int i = 0; foreach (Layer L in Layers) { for (int j = L.OriginalIntakes.Count; j < L.Intakes.Count; j++) { IIntake I = L.Intakes[j]; _logstring.Append(I.ToString() + "\t" + I.Screens.First().TopAsKote + "\t" + I.Screens.First().BottomAsKote + "\t" + L.LayerNumber); I.Screens.Clear(); Screen sc = new Screen(I); int col; int row; MShe.GridInfo.TryGetIndex(I.well.X, I.well.Y, out col, out row); sc.TopAsKote = MShe.GridInfo.UpperLevelOfComputationalLayers.Data[i][row, col] - 0.01; sc.BottomAsKote = MShe.GridInfo.LowerLevelOfComputationalLayers.Data[i][row, col] - 0.01; _logstring.Append("\t" + I.Screens.First().TopAsKote + "\t" + I.Screens.First().BottomAsKote + "\n"); } i++; } DistributeIntakesOnLayers(); }
/// <summary> /// Writes dfs0 files with head observations for the SelectedIntakes /// Only includes data within the period bounded by Start and End /// </summary> /// <param name="OutputPath"></param> public static void WriteToDfs0(string OutputPath, IIntake Intake, DateTime Start, DateTime End) { //Create the TSObject TSObject _tso = new TSObjectClass(); TSItem _item = new TSItemClass(); _item.DataType = ItemDataType.Type_Float; _item.ValueType = ItemValueType.Instantaneous; _item.EumType = 171; _item.EumUnit = 1; _item.Name = Intake.ToString(); _tso.Add(_item); DateTime _previousTimeStep = DateTime.MinValue; //Select the observations var SelectedObs = Intake.HeadObservations.ItemsInPeriod(Start, End); int i = 0; foreach (var Obs in SelectedObs) { //Only add the first measurement of the day if (Obs.Time != _previousTimeStep) { _tso.Time.AddTimeSteps(1); _tso.Time.SetTimeForTimeStepNr(i + 1, Obs.Time); _item.SetDataForTimeStepNr(i + 1, (float)Obs.Value); } i++; } //Now write the DFS0. if (_tso.Time.NrTimeSteps != 0) { _tso.Connection.FilePath = Path.Combine(OutputPath, Intake.ToString() + ".dfs0"); _tso.Connection.Save(); } }
/// <summary> /// Writes dfs0 files with head observations for the SelectedIntakes /// Only includes data within the period bounded by Start and End /// </summary> /// <param name="OutputPath"></param> public static void WriteToDfs0(string OutputPath, IIntake Intake, DateTime Start, DateTime End) { //Create the TSObject TSObject _tso = new TSObjectClass(); TSItem _item = new TSItemClass(); _item.DataType = ItemDataType.Type_Float; _item.ValueType = ItemValueType.Instantaneous; _item.EumType = 171; _item.EumUnit = 1; _item.Name = Intake.ToString(); _tso.Add(_item); DateTime _previousTimeStep = DateTime.MinValue; //Select the observations var SelectedObs = Intake.HeadObservations.ItemsInPeriod(Start, End); int i = 0; foreach(var Obs in SelectedObs) { //Only add the first measurement of the day if (Obs.Time != _previousTimeStep) { _tso.Time.AddTimeSteps(1); _tso.Time.SetTimeForTimeStepNr(i + 1, Obs.Time); _item.SetDataForTimeStepNr(i + 1, (float)Obs.Value); } i++; } //Now write the DFS0. if (_tso.Time.NrTimeSteps != 0) { _tso.Connection.FilePath = Path.Combine(OutputPath, Intake.ToString() + ".dfs0"); _tso.Connection.Save(); } }
/// <summary> /// Writes dfs0 files with head observations for the SelectedIntakes /// Only includes data within the period bounded by Start and End /// </summary> /// <param name="OutputPath"></param> public static void WriteToDfs0(string OutputPath, IIntake Intake, DateTime Start, DateTime End) { //Create the TSObject TSObject _tso = new TSObjectClass(); TSItem _item = new TSItemClass(); _item.DataType = ItemDataType.Type_Float; _item.ValueType = ItemValueType.Instantaneous; _item.EumType = 171; _item.EumUnit = 1; _item.Name = Intake.ToString(); _tso.Add(_item); DateTime _previousTimeStep = DateTime.MinValue; //Select the observations List<ObservationEntry> SelectedObs = Intake.Observations.Where(TSE => InBetween(TSE, Start, End)).ToList<ObservationEntry>(); SelectedObs.Sort(); for (int i = 0; i < SelectedObs.Count; i++) { //Only add the first measurement of the day if (SelectedObs[i].Time != _previousTimeStep) { _tso.Time.AddTimeSteps(1); _tso.Time.SetTimeForTimeStepNr(i + 1, SelectedObs[i].Time); _item.SetDataForTimeStepNr(i + 1, (float)SelectedObs[i].Value); } } //Now write the DFS0. if (_tso.Time.NrTimeSteps != 0) { _tso.Connection.FilePath = Path.Combine(OutputPath, Intake.ToString() + ".dfs0"); _tso.Connection.Save(); } }
public override string ToString() { return(_intake.ToString() + "_" + Number); }