Valve Class

Calculation of the flow through a valve

Definition

Namespace: DHI.Mike1D.StructureModule
Assembly: DHI.Mike1D.StructureModule (in DHI.Mike1D.StructureModule.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class Valve : ValvedStructure, IValve, 
	IValvedStructure, IStructure, IDoubleProxy, IQuantityProxy, ILinearZeroVariation, 
	ITimeStructure, IModelStateReadWrite
Inheritance
Object    Structure    ValvedStructure    Valve
Implements
IDoubleProxy, IQuantityProxy, IModelStateReadWrite, ILinearZeroVariation, IStructure, ITimeStructure, IValve, IValvedStructure

Constructors

Valve Constructor method for the valve

Properties

CurrentValveOpening For structure with control, the valve opening may change. Use this property to get/set the current valve opening. Unit: fraction [0;1]
dDischargedDownStreamWaterLevel Calculated Discharge derivative with DownStreamWaterLevel. Downstream is relative to the direction of chainage. The value is calculated by SetWaterLevels. Unit: [m^2/s]
(Inherited from Structure)
dDischargedUpStreamWaterLevel Calculated Discharge derivative with UpStreamWaterLevel. Upstream is relative to the direction of chainage. The value is calculated by SetWaterLevels. Unit: [m^2/s]
(Inherited from Structure)
Delhs Linear flow variation. For water level differences less than delhs use a linear Q variation between h1-h2=delhs and h1-h2=0. This is to avoid stability problems for small water level differences where dQdh goes to infinity. Unit: [m] Default: 0.01
Diameter The diameter of the valve Type: River Structure Geometry Unit: [m] Default: 0
Discharge Calculated Discharge. The value is calculated by SetWaterLevels. Unit: [m^3/s]
(Inherited from Structure)
DownstreamWaterLevel Downstream water level.Downstream refers to the direction of chainage. The water level is set by use of SetWaterLevels Unit: [m]
(Inherited from Structure)
EnableCheckFlowDirectionOscillations Flag indicating whether to use special check and damping for structure discharge oscillating around zero.
(Inherited from Structure)
ExtensionData Property used by (de)serializer, when it can not find proper target for a data field. Support of forward compatible data contracts.
(Inherited from Structure)
FlowArea The flow area of the valve if the gate is fully open Type: River Structure Geometry Unit: [m2] Default: 0
FlowFactor The discharge (and discharge derivatives) are scaled by the flow factor.
(Inherited from Structure)
FlowFactorTable Table holding flow factor as a function of opening (as fraction [0;1]).
ID Structure ID
(Inherited from Structure)
IDInUserUnit Used to get a consistent description of the structure. The ID comes in user units. Used e.g. when reporting errors, warnings and hints.
(Inherited from Structure)
Implicit Flag to control if the structure is implicit or explicit. If the structure is explicit (Implicit == false) then the derivatives of the dicharge are always zero. Default value: true
(Inherited from Structure)
InvertLevel The invert level of the valve Type: River Structure Geometry Unit: [m] Default: 0
InvertLevelDownstream Invert level down stream
(Overrides StructureInvertLevelDownstream)
InvertLevelUpstream Invert level up stream
(Overrides StructureInvertLevelUpstream)
Length Length of the structure. Unit: [m] Default value: 0m
(Inherited from Structure)
Location Location property.
(Inherited from Structure)
MaxValveOpening Maximum valve opening, when valve is controlled Unit: fraction [0;1]
MaxValveSpeed Maximum valve speed, i.e. speed with which it can open and close Unit: [/s] - fraction per second
MinValveOpening Minimum valve opening, when valve is controlled Unit: fraction [0;1]
RunTimeDiagnostics The getter is used to get a list of errors.
(Inherited from Structure)
SideStructureBank Bank side that side-structure is located on

If side structure contains reservoir, and has the Coordinate set, this is not used (and should be set to Undefined).


(Inherited from Structure)
SideStructureReservoir Reservoir at end of side structure. Null if not side structure, or no reservoir is defined
(Inherited from Structure)
SmoothingFactor Exponential smoothing factor for structure discharge. The smoothing factor is the weight of the previous discharge on the new discharge: q = (1 - SmoothingFactor) * qStructure + SmoothingFactor * qPrevious
(Inherited from Structure)
StructureType Type of structure
(Inherited from Structure)
TopoID String used to identified cross sections
(Inherited from Structure)
Type Structure type, unique for each structure.
(Overrides StructureType)
UpstreamWaterLevel Upstream water level. Upstream refers to the direction of chainage. The water level is set by use of SetWaterLevels Unit: [m]
(Inherited from Structure)
Valve Type of the valve Default: None
(Inherited from ValvedStructure)
ValveOpening The opening of the valve as a fraction. This is the initial value only, the actual value may be changed if RTC is applied. Type: River Structure Geometry Unit: fraction [0;1] Default: 0
WaterLevelDifferenceMinimal Water level difference below which it is assumed that structure has no flow.
(Inherited from Structure)

Methods

Accepts List of data types that is accepted, i.e., that you can get a ValueSetter for.
(Inherited from Structure)
AddToOffers Add additional offers to structure
(Inherited from Structure)
ApplyFlowFactor Applies flow factor to discharge and it's derivatives
(Inherited from Structure)
ControlClose Close valve, set the opening to zero
ControlOpen Open valve, set the discharge to max
ControlSetFlowFactor Set flow factor to specified value
(Inherited from Structure)
ControlSetValveOpening Set new valve opening
Description Return a string that describes this structure. Includes structure type and ID
(Inherited from Structure)
Dispose Frees the licenses held.
(Inherited from Structure)
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExplicitStructureSupport DEBUG: This method is called from Prepare() if _implitcit == false to check if the structure supports being Explicit. Once all structures support explicit operation this method can be deleted.
(Overrides StructureExplicitStructureSupport)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetActionInfos List of control action infos
(Overrides StructureGetActionInfos)
GetControlAction If an entity implements the IControllable interface it can be controlled by the ControlModule.
(Overrides StructureGetControlAction(String))
GetCurrentValue If an entity implements the IControllable interface it can be controlled by the ControlModule.
(Overrides StructureGetCurrentValue(String))
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Initialize(IDiagnostics) Set up structure and set runtime diagnostics object
(Inherited from Structure)
Initialize(ICrossSection, ICrossSection, Boolean, IDiagnostics) Set up structure and set runtime diagnostics object
(Overrides StructureInitialize(ICrossSection, ICrossSection, Boolean, IDiagnostics))
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Offers List of data types that is offered and can be used in GetValue
(Overrides StructureOffers)
Prepare(HDParameterData, IDiagnostics) Set up structure and set runtime diagnostics object
(Inherited from Structure)
Prepare(DateTime, HDParameterData, IDiagnostics) Set up structure and set runtime diagnostics object
(Inherited from Structure)
PrepareTimeStep Prepare structure for time step
ReadState Read state and apply to module. Returns true if state was successfully read.
ResetControlledState If an entity implements the IControllable interface it can be controlled by the ControlModule.
(Overrides StructureResetControlledState)
SetControlStrategyId Set control strategy ID manually.

Base implementation for IControllable


(Inherited from Structure)
SetInputWaterLevels Set the _upstreamWaterLevel, _downstreamWaterLevel and _flowDir
(Inherited from Structure)
SetWaterLevels Sets up- and down- stream water level and forces the calculation of the discharge and its derivatives.
(Overrides StructureSetWaterLevels(Double, Double))
SetZeroFlow Sets the conditions for zero flow
(Inherited from Structure)
ToStringReturns a string that represents the current object.
(Inherited from Object)
UpdatedWaterLevels After a time step (or iteration) has finished, update the discharge to the actual value, based on the final water levels and the discharge derivatives.
(Inherited from Structure)
Validate Validation of data for a valve structure.
(Overrides StructureValidate)
ValueGetter Get value setter for the specified data quantity
(Overrides StructureValueGetter(Int32))
ValueSetter Get value setter for the specified data type
(Inherited from Structure)
ValveDecidesFlow Decides whether the valve will decide the flow and sets the flow to zero in case the valve forbids flow.
(Inherited from ValvedStructure)
WriteState Write current state of module
ZeroFlowDueToValve Decides whether the valve will prevent flow given the flow direction.
(Inherited from ValvedStructure)

Fields

_accepts List of quantities that are accepted
(Inherited from Structure)
_controlStategyId If the structure is being controlled, then _controlStategyId contains the ID of the active control strategy
(Inherited from Structure)
_downstreamWaterLevel Downstream water level, as set by SetWaterLevels(Double, Double) Unit: [m]
(Inherited from Structure)
_dqdhDownstream The derivative of flow through the structure with downstream water level. The flow is calculated in the derived classes when the SetWaterLevels method is called. Unit: [m2/sec]
(Inherited from Structure)
_dqdhUpstream The derivative of flow through the structure with upstream water level. The flow is calculated in the derived classes when the SetWaterLevels method is called. Unit: [m2/sec]
(Inherited from Structure)
_flowArea Flow area through structure. Used by most (but not all) structures.
(Inherited from Structure)
_flowDir FlowDir is used to determine which parameters to use for the flow calculations. Derived by the SetWaterLevels(Double, Double).
(Inherited from Structure)
_id Identification name of the structure
(Inherited from Structure)
_implicit If _implicit == false, then the derivatives are always zero. Default value: true.
(Inherited from Structure)
_location Location in the network
(Inherited from Structure)
_offers List of quantities that are offered
(Inherited from Structure)
_q Flow through the structure. The flow is calculated in the derived classes when the SetWaterLevels method is called. Unit: [m3/sec]
(Inherited from Structure)
_runTimeDiagnostics Diagnostics are written into this Diagnostics during calculations. Set during Initialize(IDiagnostics)
(Inherited from Structure)
_topoID Identification used to find referenced cross sections
(Inherited from Structure)
_upstreamWaterLevel Upstream water level, as set by SetWaterLevels(Double, Double) Unit: [m]
(Inherited from Structure)
_valveType Type of the valve Default: None
(Inherited from ValvedStructure)

Extension Methods

Getter

From the proxy, return an FuncTResult for the specified quantity.

It returns the first quantity of that type that is offered, and null if the quantity is not offered.


(Defined by ProxyExtensions)
Getters Returns a set of FuncTResult for the quantity. We can return several quantities with the same id (usually they will differ in their description). If the quantity is not offerent, an empty list is returned.
(Defined by ProxyExtensions)
GettersFraction Returns a set of FuncT, TResult for the quantity. We can return several quantities with the same id (usually they will differ in their description). If the quantity is not offerent, an empty list is returned.
(Defined by ProxyExtensions)
GetterUnboxed

From the proxy, return an FuncTResult for the specified quantity.

It returns the first quantity of that type that is offered, and null if the quantity is not offered.


(Defined by ProxyExtensions)
Initialize Helper function for some unit tests. Do not use.
(Defined by StructureExtensions)
Initialize Helper function for some unit tests. Do not use.
(Defined by StructureExtensions)
IsSideStructure Returns true if the structure is a side structure
(Defined by StructureExtensions)
Setter

From the proxy, return an IDoubleGetSet for the specified quantity.

It returns the first quantity of that type that is accepted, and null if the quantity is not accepted.


(Defined by ProxyExtensions)

See Also