Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs =================================================================== diff -u -r909 -r912 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 909) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkKernelWrapper.cs (.../DamPipingSellmeijerVnkKernelWrapper.cs) (revision 912) @@ -40,64 +40,16 @@ private const double defaultMaxReturnValue = 90.0; private const double defaultFluidisationGradient = 0.3; - - public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) - { - DamPipingSellmeijerVnkInput damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; - if (damPipingInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_Execute_NoInputObjectDefinedForSellmeijerVNK); - } - DamPipingSellmeijerVnkOutput damPipingOutput = (DamPipingSellmeijerVnkOutput)kernelDataOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); - } - damPipingOutput.FoSp = defaultMaxReturnValue; - messages = new List(); - if (damPipingOutput.UpliftSituation.IsUplift) - { - var calculator = CreatePipingCalculatorSellmeijerVnk(kernelDataInput); - calculator.Calculate(); - damPipingOutput.FoSp = calculator.FoSp; - damPipingOutput.Hc = calculator.Hc; - damPipingOutput.CalculationResult = CalculationResult.Succeeded; - } - } - - public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) - { - DamPipingSellmeijerVnkOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijerVnkOutput; - if (damPipingOutput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); - } - if (damKernelInput == null) - { - throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); - } - - designResults = new List(); - var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, - damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, - DamProjectCalculationSpecification.SelectedAnalysisType) - { - CalculationResult = damPipingOutput.CalculationResult - }; - - var pipingDesignResults = new PipingDesignResults(PipingModelType.SellmeijerVnk); - designResult.PipingDesignResults = pipingDesignResults; - pipingDesignResults.ResultMessage = resultMessage; - // TODO: for now this only works for NoAdaption of geometry; if adaption is enabled, the real redesigned surfaceline has to be assigned - pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; - pipingDesignResults.SellmeijerVnkFactor = damPipingOutput.FoSp; - pipingDesignResults.SellmeijerVnkHcritical = damPipingOutput.Hc; - pipingDesignResults.LocalExitPointX = damPipingOutput.ExitPointX; - pipingDesignResults.UpliftFactor = damPipingOutput.UpliftFactor; - pipingDesignResults.UpliftSituation = damPipingOutput.UpliftSituation; - designResults.Add(designResult); - } - + /// + /// Prepares the failure mechanism input based on general dam kernel input. + /// + /// The dam kernel input. + /// The number of the current iteration + /// The kernel data input. + /// The kernel data output. + /// + /// Result of the prepare + /// public PrepareResult Prepare(DamKernelInput damKernelInput, int iterationIndex, out IKernelDataInput kernelDataInput, out IKernelDataOutput kernelDataOutput) { var damOutput = new DamPipingSellmeijerVnkOutput() @@ -192,6 +144,15 @@ return PrepareResult.NotRelevant; } + /// + /// Validates the kernel data input. + /// + /// The kernel data input. + /// The kernel data output. + /// The messages. + /// + /// Number of errors that prevent a calculation + /// public int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { DamPipingSellmeijerVnkOutput damPipingOutput = (DamPipingSellmeijerVnkOutput)kernelDataOutput; @@ -210,7 +171,80 @@ return messages.Count; } + /// + /// Performs a failure mechanism calculation based on the input. + /// + /// The kernel data input. + /// The kernel data output. + /// The messages. + /// + /// + public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) + { + DamPipingSellmeijerVnkInput damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; + if (damPipingInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_Execute_NoInputObjectDefinedForSellmeijerVNK); + } + DamPipingSellmeijerVnkOutput damPipingOutput = (DamPipingSellmeijerVnkOutput)kernelDataOutput; + if (damPipingOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); + } + damPipingOutput.FoSp = defaultMaxReturnValue; + messages = new List(); + if (damPipingOutput.UpliftSituation.IsUplift) + { + var calculator = CreatePipingCalculatorSellmeijerVnk(kernelDataInput); + calculator.Calculate(); + damPipingOutput.FoSp = calculator.FoSp; + damPipingOutput.Hc = calculator.Hc; + damPipingOutput.CalculationResult = CalculationResult.Succeeded; + } + } + /// + /// Fills the dam result based on the kernel output. + /// + /// The dam kernel input. + /// The kernel data output. + /// The result message. + /// The design results + /// + /// + public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) + { + DamPipingSellmeijerVnkOutput damPipingOutput = kernelDataOutput as DamPipingSellmeijerVnkOutput; + if (damPipingOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoOutputObjectDefinedForSellmeijerVNK); + } + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingSellmeijerVnkKernelWrapper_NoInputObjectDefinedForSellmeijerVNK); + } + + designResults = new List(); + var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, + damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, null, + DamProjectCalculationSpecification.SelectedAnalysisType) + { + CalculationResult = damPipingOutput.CalculationResult + }; + + var pipingDesignResults = new PipingDesignResults(PipingModelType.SellmeijerVnk); + designResult.PipingDesignResults = pipingDesignResults; + pipingDesignResults.ResultMessage = resultMessage; + // TODO: for now this only works for NoAdaption of geometry; if adaption is enabled, the real redesigned surfaceline has to be assigned + pipingDesignResults.RedesignedSurfaceLine = damKernelInput.Location.SurfaceLine; + pipingDesignResults.SellmeijerVnkFactor = damPipingOutput.FoSp; + pipingDesignResults.SellmeijerVnkHcritical = damPipingOutput.Hc; + pipingDesignResults.LocalExitPointX = damPipingOutput.ExitPointX; + pipingDesignResults.UpliftFactor = damPipingOutput.UpliftFactor; + pipingDesignResults.UpliftSituation = damPipingOutput.UpliftSituation; + designResults.Add(designResult); + } + private static PipingCalculatorSellmeijerVNK CreatePipingCalculatorSellmeijerVnk(IKernelDataInput kernelDataInput) { DamPipingSellmeijerVnkInput damPipingInput = kernelDataInput as DamPipingSellmeijerVnkInput; Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkOutput.cs =================================================================== diff -u -r877 -r912 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkOutput.cs (.../DamPipingSellmeijerVnkOutput.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkOutput.cs (.../DamPipingSellmeijerVnkOutput.cs) (revision 912) @@ -32,11 +32,47 @@ { class DamPipingSellmeijerVnkOutput : IKernelDataOutput { + /// + /// Gets or sets the Factor of safety for piping. + /// + /// + /// The fo sp. + /// public double FoSp { get; set; } + /// + /// Gets or sets the Critical Head. + /// + /// + /// The hc. + /// public double Hc { get; set; } + /// + /// Gets or sets the calculation result. + /// + /// + /// The calculation result. + /// public CalculationResult CalculationResult { get; set; } + /// + /// Gets or sets the uplift factor. + /// + /// + /// The uplift factor. + /// public double? UpliftFactor { get; set; } + /// + /// Gets or sets the exit point x. + /// + /// + /// The exit point x. + /// public double ExitPointX { get; set; } + /// + /// Gets or sets the uplift situation. + /// + /// + /// The uplift situation. + /// public UpliftSituation UpliftSituation { get; set; } } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkInput.cs =================================================================== diff -u -r877 -r912 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkInput.cs (.../DamPipingSellmeijerVnkInput.cs) (revision 877) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingSellmeijerVnk/DamPipingSellmeijerVnkInput.cs (.../DamPipingSellmeijerVnkInput.cs) (revision 912) @@ -19,11 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamPipingSellmeijerVnk @@ -73,8 +68,8 @@ /// Gets or sets the seepagelength. /// /// - /// The length of the seepage. - // + /// The length of the seepage channel. + /// public double SeepageLength { get; set; } /// @@ -86,10 +81,10 @@ public double D70 { get; set; } /// - /// Gets or sets the whites constant. + /// Gets or sets the Whites constant. /// /// - /// The whites constant. + /// The Whites constant. /// public double WhitesConstant { get; set; } @@ -123,22 +118,22 @@ public double SurfaceLevel { get; internal set; } /// - /// Gets or sets the @@@ + /// Gets or sets the height of the in between aquifer layer /// public double DInBetweenAquiferlayer { get; internal set; } /// - /// + /// Gets or sets the height of the bottom aquifer layer /// public double DBottomAquiferlayer { get; internal set; } /// - /// + /// Gets or sets the permeability of the in between aquifer layer /// public double PermeabilityInBetweenAquiferlayer { get; internal set; } /// - /// + /// Gets or sets the permeability of the bottom aquifer layer /// public double PermeabilityBottomAquiferlayer { get; internal set; } }