AGX Dynamics  2.37.2.0
ReliefValve.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 
18 #ifndef AGXHYDRAULICS_RELIEF_VALVE_H
19 #define AGXHYDRAULICS_RELIEF_VALVE_H
20 
21 
22 #include <agxHydraulics/FlowUnit.h>
24 #include <agxHydraulics/Pipe.h>
25 
27 
29 
30 
31 namespace agx
32 {
33  class Constraint;
34 }
35 
36 namespace agxSDK
37 {
38  class Simulation;
39 }
40 
41 
42 
43 namespace agxHydraulics
44 {
46 
73  {
74  public:
82  ReliefValve(agx::Real crackingPressure, agx::Real fullyOpenPressure, agx::Real fullyOpenArea, agx::UInt32 numDrains=6);
83 
93  void setPressures(agx::Real crackingPressure, agx::Real fullyOpenPressure);
94 
103  void setCrackingPressure(agx::Real crackingPressure);
104 
108  agx::Real getCrackingPressure() const;
109 
118  void setFullyOpenPressure(agx::Real fullyOpenPressure);
119 
123  agx::Real getFullyOpenPressure() const;
124 
128  agx::Real getPressure() const;
129 
135  agx::Real getOpeningFraction() const;
136 
140  agx::Real getDrainFlowRate() const;
141 
145  agxHydraulics::FlowUnit* getInputChamber();
146  const agxHydraulics::FlowUnit* getInputChamber() const;
147 
151  agxHydraulics::FlowUnit* getOutputChamber();
152  const agxHydraulics::FlowUnit* getOutputChamber() const;
153 
158  const agxHydraulics::FlowUnit* getChamber(agxPowerLine::Side side) const;
159 
163  agx::UInt32 getNumDrains() const;
164 
165 
170  agxHydraulics::Pipe* getDrain(agx::UInt32 index);
171 
176  const agxHydraulics::Pipe* getDrain(agx::UInt32 index) const;
177 
184  agx::Constraint* getFlowBlockConstraint(agx::UInt32 index);
185 
189  agxHydraulics::FlowConnector* getDrainConnector();
190 
191 
192  // Methods called by the rest of the PowerLine/Hydraulics frame work.
193  public:
195 #ifndef SWIG
196 
199  virtual void getConnectableDimensionTypes(
201 
207  virtual agxPowerLine::DimensionAndSide getConnectableDimension(
209 
214  virtual bool addNotification(agxSDK::Simulation *simulation) override;
215 
220  virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation *simulation) override;
221 
228  virtual bool store(agxStream::StorageStream& str) const override;
229 
230  virtual bool postStore(agxStream::StorageStream& str) const override;
231 
238  virtual bool restore(agxStream::StorageStream& str) override;
239 
240  virtual bool postRestore(agxStream::StorageStream& str) override;
241 
243 #endif
245 
246  protected:
247  ReliefValve();
248 
249  private:
250  agxHydraulics::PipeRef m_inputChamber;
251  agxHydraulics::PipeRef m_outputChamber;
253  agxHydraulics::detail::LimitedFlowBlockConstraintRefVector m_flowBlockConstraints;
254 
255  agx::Real m_crackingPressure;
256  agx::Real m_fullyOpenPressure;
257  agx::Real m_fullyOpenArea;
258 
259  // Owned by the base class SubGraph.
260  FlowConnectorObserver m_drainConnector;
261  };
262 }
263 
264 #endif
265 
266 
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:39
The relief valve is a hydraulic component that limits the pressure at some point in the system...
Definition: ReliefValve.h:72
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
Pure virtual class.
Definition: Unit.h:72
The base class for a constraint.
Definition: Constraint.h:88
A pipe carries fluid flow through the hydraulics system.
Definition: Pipe.h:31
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Templated vector class.
Definition: Vector.h:52
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXHYDRAULICS_EXPORT
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:27
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
double Real
Definition: Real.h:42
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:66