AGX Dynamics  2.35.0.1
ReliefValve.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
109 
118  void setFullyOpenPressure(agx::Real fullyOpenPressure);
119 
124 
129 
136 
141 
147 
153 
159 
164 
165 
171 
177 
185 
190 
191 
192  // Methods called by the rest of the PowerLine/Hydraulics frame work.
193  public:
195 #ifndef SWIG
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:
248 
249  private:
250  agxHydraulics::PipeRef m_inputChamber;
251  agxHydraulics::PipeRef m_outputChamber;
252  agxHydraulics::PipeRefVector m_drains;
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 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXHYDRAULICS_EXPORT
A FlowConnector is a junction of a set of FlowUnits.
Definition: FlowConnector.h:40
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:67
A pipe carries fluid flow through the hydraulics system.
Definition: Pipe.h:32
The relief valve is a hydraulic component that limits the pressure at some point in the system.
Definition: ReliefValve.h:73
agxHydraulics::FlowConnector * getDrainConnector()
agx::Real getOpeningFraction() const
The opening fraction will always be a multiple of 1/num_drains, and will always be in the range [0....
agx::Real getFullyOpenPressure() const
agxHydraulics::FlowUnit * getInputChamber()
agxHydraulics::FlowUnit * getOutputChamber()
agx::Real getDrainFlowRate() const
void setFullyOpenPressure(agx::Real fullyOpenPressure)
Set the pressure at which the drain should reach fully open.
agx::Constraint * getFlowBlockConstraint(agx::UInt32 index)
The implementation uses constraints to control when drain pipes should open or close.
agx::UInt32 getNumDrains() const
const agxHydraulics::Pipe * getDrain(agx::UInt32 index) const
const agxHydraulics::FlowUnit * getInputChamber() const
const agxHydraulics::FlowUnit * getOutputChamber() const
const agxHydraulics::FlowUnit * getChamber(agxPowerLine::Side side) const
ReliefValve(agx::Real crackingPressure, agx::Real fullyOpenPressure, agx::Real fullyOpenArea, agx::UInt32 numDrains=6)
Create a new relief valve.
agxHydraulics::FlowUnit * getChamber(agxPowerLine::Side side)
agx::Real getPressure() const
void setPressures(agx::Real crackingPressure, agx::Real fullyOpenPressure)
Set the pressure range for the relief valve.
agxHydraulics::Pipe * getDrain(agx::UInt32 index)
agx::Real getCrackingPressure() const
void setCrackingPressure(agx::Real crackingPressure)
Set the pressure at which the drain should start to open.
Pure virtual class.
Definition: Unit.h:73
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:464
The base class for a constraint.
Definition: Constraint.h:89
Templated vector class.
Definition: agx/Vector.h:53
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:28
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
uint32_t UInt32
Definition: Integer.h:40
double Real
Definition: Real.h:42