AGXDynamics  2.35.0.2
VariableDisplacementPumpParameters.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_INTERNAL_UTILS_H
19 #define AGXHYDRAULICS_INTERNAL_UTILS_H
20 
21 #include <agx/Referenced.h>
22 
23 #include <agxHydraulics/FlowUnit.h>
24 
25 namespace agxHydraulics
26 {
27  class Pipe;
28  class Pump;
29  class PumpUnit;
30 
31  namespace detail
32  {
34 
40  {
41  public:
43  agx::Real cutoffPressure, agx::Real deadheadPressure,
44  agx::Real internalLeakage, agx::Real flowRatio,
45  agx::Real compensatorArea)
46  :
47  m_cutoffPressure(cutoffPressure),
48  m_deadheadPressure(deadheadPressure),
49  m_internalLeakage(internalLeakage),
50  m_flowRatio(flowRatio),
51  m_compensatorArea(compensatorArea),
52 
53  m_springConstant(force(deadheadPressure) - force(cutoffPressure)),
54  m_noFlowSpringElongation(elongation(deadheadPressure)),
55  m_fullFlowSpringElongation(elongation(cutoffPressure)),
56  m_noFlowPoppetPosition(poppetPosition(deadheadPressure)),
57  m_fullFlowPoppetPosition(poppetPosition(cutoffPressure))
58  {
59  // this->print(std::cout);
60  agxVerify(agx::equivalent(m_noFlowSpringElongation - m_fullFlowSpringElongation, agx::Real(1)));
61  }
62 
63  agx::Real cutoffPressure() const { return m_cutoffPressure; }
64  agx::Real deadheadPressure() const { return m_deadheadPressure; }
65  agx::Real internalLeakage() const { return m_internalLeakage; }
66  agx::Real flowRatio() const { return m_flowRatio; }
67  agx::Real compensatorArea() const { return m_compensatorArea; }
68  agx::Real springConstant() const { return m_springConstant; }
69  agx::Real noFlowSpringElongation() const { return m_noFlowSpringElongation; }
70  agx::Real fullFlowSpringElongation() const { return m_fullFlowSpringElongation; }
71  agx::Real springRestPosition() const { return m_noFlowSpringElongation; }
72  agx::Real noFlowPoppetPosition() const { return m_noFlowPoppetPosition; }
73  agx::Real fullFlowPoppetPosition() const { return m_fullFlowPoppetPosition; }
74 
76  {
77  return pressure * m_compensatorArea;
78  }
79 
81  {
82  return force(pressure) / m_springConstant;
83  }
84 
86  {
87  return m_noFlowSpringElongation - elongation(pressure);
88  }
89 
90 
91  void print(std::ostream& stream) const;
92 
93 
94 
95  private:
101 
103  {
104  return *this;
105  }
106 
107  private:
108  const agx::Real m_cutoffPressure;
109  const agx::Real m_deadheadPressure;
110  const agx::Real m_internalLeakage;
111  const agx::Real m_flowRatio;
112  const agx::Real m_compensatorArea;
113 
114  const agx::Real m_springConstant;
115  const agx::Real m_noFlowSpringElongation;
116  const agx::Real m_fullFlowSpringElongation;
117  const agx::Real m_noFlowPoppetPosition;
118  const agx::Real m_fullFlowPoppetPosition;
119  };
120 
121 
122  std::ostream& operator<<(std::ostream& stream, const VariableDisplacementPumpParameters& pumpParameters);
123 
124  } // namespace detail
125 
126 } // namespace agxHydraulics
127 
128 
129 
130 #endif
agxHydraulics::detail::VariableDisplacementPumpParameters::compensatorArea
agx::Real compensatorArea() const
Definition: VariableDisplacementPumpParameters.h:67
Referenced.h
agx::Real
double Real
Definition: Real.h:42
agxHydraulics::detail::VariableDisplacementPumpParameters::cutoffPressure
agx::Real cutoffPressure() const
Definition: VariableDisplacementPumpParameters.h:63
agx::equivalent
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)
agxHydraulics::detail::operator<<
std::ostream & operator<<(std::ostream &stream, const VariableDisplacementPumpParameters &pumpParameters)
agxHydraulics::detail::VariableDisplacementPumpParameters::noFlowPoppetPosition
agx::Real noFlowPoppetPosition() const
Definition: VariableDisplacementPumpParameters.h:72
agxVerify
#define agxVerify(expr)
Definition: debug.h:131
agxHydraulics::detail::VariableDisplacementPumpParameters::force
agx::Real force(agx::Real pressure)
Definition: VariableDisplacementPumpParameters.h:75
agxHydraulics::detail::VariableDisplacementPumpParameters::internalLeakage
agx::Real internalLeakage() const
Definition: VariableDisplacementPumpParameters.h:65
AGXHYDRAULICS_EXPORT
#define AGXHYDRAULICS_EXPORT
Definition: agxHydraulics/export.h:39
agxHydraulics::detail::VariableDisplacementPumpParameters::deadheadPressure
agx::Real deadheadPressure() const
Definition: VariableDisplacementPumpParameters.h:64
agxHydraulics::detail::VariableDisplacementPumpParameters::poppetPosition
agx::Real poppetPosition(agx::Real pressure)
Definition: VariableDisplacementPumpParameters.h:85
agxHydraulics::detail::VariableDisplacementPumpParameters::springConstant
agx::Real springConstant() const
Definition: VariableDisplacementPumpParameters.h:68
agxHydraulics::detail::VariableDisplacementPumpParameters::fullFlowSpringElongation
agx::Real fullFlowSpringElongation() const
Definition: VariableDisplacementPumpParameters.h:70
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxHydraulics::detail::VariableDisplacementPumpParameters::flowRatio
agx::Real flowRatio() const
Definition: VariableDisplacementPumpParameters.h:66
agxHydraulics
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:27
agxHydraulics::detail::VariableDisplacementPumpParameters::springRestPosition
agx::Real springRestPosition() const
Definition: VariableDisplacementPumpParameters.h:71
agxHydraulics::detail::VariableDisplacementPumpParameters
Definition: VariableDisplacementPumpParameters.h:39
agxHydraulics::detail::VariableDisplacementPumpParameters::noFlowSpringElongation
agx::Real noFlowSpringElongation() const
Definition: VariableDisplacementPumpParameters.h:69
agxHydraulics::detail::VariableDisplacementPumpParameters::VariableDisplacementPumpParameters
VariableDisplacementPumpParameters(agx::Real cutoffPressure, agx::Real deadheadPressure, agx::Real internalLeakage, agx::Real flowRatio, agx::Real compensatorArea)
Definition: VariableDisplacementPumpParameters.h:42
agxHydraulics::detail::VariableDisplacementPumpParameters::elongation
agx::Real elongation(agx::Real pressure)
Definition: VariableDisplacementPumpParameters.h:80
agxHydraulics::detail::VariableDisplacementPumpParameters::fullFlowPoppetPosition
agx::Real fullFlowPoppetPosition() const
Definition: VariableDisplacementPumpParameters.h:73
FlowUnit.h