AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
ConstantFlowValve.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17
18#ifndef AGXHYDRAULICS_CONSTANT_FLOW_VALVE_H
19#define AGXHYDRAULICS_CONSTANT_FLOW_VALVE_H
20
23
24namespace agxHydraulics
25{
27
40 {
41 public:
52 agx::Real length, agx::Real area, agx::Real fluidDensity,
53 agx::Real targetFlowRate, bool allowPumping = false);
54
59
64 void setTargetFlowRate(agx::Real targetFlowRate);
65
69 bool getAllowPumping() const;
70
75 void setAllowPumping(bool allowPumping);
76
77
83 void setEnable(bool enable);
84
88 bool getEnable() const;
89
90
96
97
98
99 // Methods called by the rest of the PowerLine/Hydraulics frame work.
100 public:
102
103
106 virtual bool preUpdate(agx::Real timeStep) override;
107
112 virtual bool addNotification(agxSDK::Simulation* simulation) override;
113
114#ifndef SWIG
119 virtual bool removeNotification(agxUtil::ConstraintHolder* constraintHolder, agxSDK::Simulation* simulation) override;
120
121
125 virtual bool store(agxStream::StorageStream& str) const override;
126
130 virtual bool postStore(agxStream::StorageStream& str) const override;
131
135 virtual bool restore(agxStream::StorageStream& str) override;
136
140 virtual bool postRestore(agxStream::StorageStream& str) override;
141
143#endif
144
146
147 protected:
150
151 void createFlowRateConstraint();
152 void destroyFlowRateConstraint();
153
154 private:
155 agxHydraulics::detail::FlowRateConstraintData m_constraintData;
156 agxHydraulics::detail::FlowRateConstraintRef m_flowRateConstraint;
157 };
158}
159
160
161#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXHYDRAULICS_EXPORT
A constant flow valve is a valve that acts to limit the flow rate through a pipe to some maximum valu...
ConstantFlowValve(agx::Real length, agx::Real area, agx::Real fluidDensity, agx::Real targetFlowRate, bool allowPumping=false)
Create a new constant flow valve with the given geometry and target flow rate.
void setTargetFlowRate(agx::Real targetFlowRate)
Set the target flow rate of the constant flow valve.
void setEnable(bool enable)
Enable or disable the constant flow valve.
agx::Real getTargetFlowRate() const
void setAllowPumping(bool allowPumping)
Set to true to allow the constant flow valve to accelerate the fluid.
const agx::Constraint * getConstraint() const
agx::Constraint * getConstraint()
Provides access to the constraint that regulates the flow rate.
FlowUnit is the base class for Units that contains a FlowDimension.
Definition FlowUnit.h:67
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition Simulation.h:126
Abstract base class for storing/restoring a line/drums with version control.
Utility class to hold custom implementations of constraints.
Definition agxUtil.h:464
The base class for a constraint.
Definition Constraint.h:89
#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
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.
double Real
Definition Real.h:42