// Copyright (C) Stichting Deltares 2017. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System;
using Core.Common.Base.Data;
using Ringtoets.ClosingStructures.Data.Properties;
using Ringtoets.Common.Data.Probabilistics;
namespace Ringtoets.ClosingStructures.Data
{
///
/// The general input parameters that apply to each closing structures calculation.
///
public class GeneralClosingStructuresInput
{
private static readonly Range validityRangeN2A = new Range(0, 40);
private int n2A;
///
/// Initializes a new instance of the class.
///
public GeneralClosingStructuresInput()
{
C = new RoundedDouble(2, 0.5);
N2A = 1;
GravitationalAcceleration = new RoundedDouble(2, 9.81);
ModelFactorOvertoppingFlow = new LogNormalDistribution(3)
{
Mean = (RoundedDouble) 0.09,
StandardDeviation = (RoundedDouble) 0.06
};
ModelFactorStorageVolume = new LogNormalDistribution(2)
{
Mean = (RoundedDouble) 1,
StandardDeviation = (RoundedDouble) 0.2
};
ModelFactorSubCriticalFlow = new VariationCoefficientNormalDistribution(2)
{
Mean = (RoundedDouble) 1,
CoefficientOfVariation = (RoundedDouble) 0.1
};
ModelFactorInflowVolume = new RoundedDouble(2, 1);
}
#region Constants
///
/// Gets the gravitational acceleration.
/// [m/s^2]
///
public RoundedDouble GravitationalAcceleration { get; }
#endregion
#region Length effect parameters
///
/// Gets or sets the 'C' parameter used to factor in the 'length effect'.
///
public RoundedDouble C { get; }
///
/// Gets or sets the 'N2A' parameter used to factor in the 'length effect'.
/// Thrown when the 'N2A' value is set outside the range [0, 40].
///
public int N2A
{
get
{
return n2A;
}
set
{
if (!validityRangeN2A.InRange(value))
{
string message = string.Format(Resources.N2A_Value_should_be_in_Range_0_,
validityRangeN2A);
throw new ArgumentOutOfRangeException(nameof(value), message);
}
n2A = value;
}
}
///
/// Gets the 'N' parameter used to factor in the 'length effect'.
///
public double N
{
get
{
return Math.Max(1, C * N2A);
}
}
#endregion
#region Model factors
///
/// Gets the model factor overtopping flow.
///
public LogNormalDistribution ModelFactorOvertoppingFlow { get; }
///
/// Gets the model factor for storage volume.
///
public LogNormalDistribution ModelFactorStorageVolume { get; }
///
/// Gets the model factor for sub critical flow.
///
public VariationCoefficientNormalDistribution ModelFactorSubCriticalFlow { get; }
///
/// Gets the model factor for incoming flow volume.
///
public RoundedDouble ModelFactorInflowVolume { get; }
#endregion
}
}