AGX Dynamics
2.38.0.2
FlowUnit.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
#ifndef AGXHYDRAULICS_FLOW_UNIT_H
18
#define AGXHYDRAULICS_FLOW_UNIT_H
19
20
#include <
agxHydraulics/FlowConnector.h
>
21
#include <
agxHydraulics/FlowDimension.h
>
22
23
#include <
agxPowerLine/Unit.h
>
24
#include <
agxPowerLine/Sides.h
>
25
26
namespace
agx
27
{
28
class
Constraint;
29
}
30
31
namespace
agxSDK
32
{
33
class
Simulation;
34
}
35
36
namespace
agxModel
37
{
38
class
DriveTrain;
39
}
40
41
42
43
44
namespace
agxHydraulics
45
{
46
AGX_DECLARE_POINTER_TYPES
(
FlowUnit
);
47
AGX_DECLARE_VECTOR_TYPES
(
FlowUnit
);
48
49
66
class
AGXHYDRAULICS_EXPORT
FlowUnit
:
public
agxPowerLine::Unit
67
{
68
public
:
75
FlowUnit
(
agx::Real
length,
agx::Real
area,
agx::Real
fluidDensity);
76
77
DOXYGEN_START_INTERNAL_BLOCK
()
78
FlowUnit
(
agx::Real
length,
agx::Real
area,
agx::Real
fluidDensity,
79
agx::RigidBody
* body,
agx::UInt8
elementIndex);
80
81
DOXYGEN_END_INTERNAL_BLOCK
()
82
83
87
explicit
FlowUnit
(
agx::Real
inertia);
88
93
void
setLength(
agx::Real
length);
94
98
agx::Real
getLength()
const
;
99
105
bool
setArea(
agx::Real
area);
106
110
agx::Real
getArea()
const
;
111
116
void
setFluidDensity
(
agx::Real
density);
117
121
agx::Real
getFluidDensity()
const
;
122
130
void
setFluidViscosity
(
agx::Real
viscosity);
131
135
agx::Real
getFluidViscosity()
const
;
136
141
agx::Real
getFlowRate()
const
;
142
153
void
addPressure(
agx::Real
pressure,
agxPowerLine::Side
side);
154
166
agx::Real
getPressure(
agxPowerLine::Side
side)
const
;
167
173
agx::Real
getInputPressure()
const
;
174
179
agx::Real
getInletPressure()
const
;
180
186
agx::Real
getOutputPressure()
const
;
187
192
agx::Real
getOutletPressure()
const
;
193
197
agxHydraulics::FlowDimension
* getFlowDimension();
198
202
const
agxHydraulics::FlowDimension
* getFlowDimension()
const
;
203
204
209
virtual
agxHydraulics::FlowConnector
* getFlowConnector(
agxPowerLine::Side
side);
210
215
virtual
const
agxHydraulics::FlowConnector
* getFlowConnector(
agxPowerLine::Side
side)
const
;
216
221
agxHydraulics::FlowConnector
* getInputFlowConnector();
222
227
const
agxHydraulics::FlowConnector
* getInputFlowConnector()
const
;
228
233
agxHydraulics::FlowConnector
* getOutputFlowConnector();
234
239
const
agxHydraulics::FlowConnector
* getOutputFlowConnector()
const
;
240
245
bool
isConnected(
agxPowerLine::Side
end
)
const
;
246
247
using
Unit::isConnected;
248
253
static
FlowConnector
* findInCommonFlowConnector(
FlowUnit
* a,
FlowUnit
* b);
254
255
256
// Methods called by the rest of the PowerLine/Hydraulics frame work.
257
public
:
258
DOXYGEN_START_INTERNAL_BLOCK
()
264
virtual
agx::Real
computeFrictionLoss(
agx::Real
flowRate);
265
272
virtual
void
addTankPressure();
273
274
#ifndef SWIG
275
278
virtual
bool
preUpdate(
agx::Real
timeStep)
override
;
279
283
virtual
bool
store(
agxStream::StorageStream
& str)
const override
;
284
288
virtual
bool
restore(
agxStream::StorageStream
& str)
override
;
289
290
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxHydraulics::FlowUnit
);
291
#endif
292
293
protected
:
297
FlowUnit
();
298
DOXYGEN_END_INTERNAL_BLOCK
()
299
300
protected
:
301
void
init
();
302
303
void
updateBodyMass();
304
305
agx::Real
computeReynoldsNumber()
const
;
306
static
agx::Real
computeReynoldsNumber(
agx::Real
area,
agx::Real
flowRate,
agx::Real
viscosity);
307
agx::Real
computeFrictionFactor()
const
;
308
agx::Real
computeLaminarFrictionalLoss(
agx::Real
flowRate)
const
;
309
agx::Real
computeQuadraticFrictionalLoss(
agx::Real
flowCoefficient)
const
;
310
agx::Real
updateFrictionLoss();
311
312
protected
:
313
virtual
~FlowUnit
() {}
314
315
protected
:
316
agxHydraulics::FlowDimensionRef
m_flowDimension
;
317
318
private
:
319
agx::Real
m_length;
320
agx::Real
m_area;
321
323
agx::Real
m_fluidDensity;
324
326
agx::Real
m_viscosity;
327
};
328
329
}
330
331
#endif
agx::end
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
Definition:
LinearProbingHashSet.h:593
agx::Real
double Real
Definition:
Real.h:42
agxPowerLine::Side
Side
Definition:
Sides.h:28
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition:
FlowUnit.h:36
Unit.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition:
RigidBody.h:51
FlowConnector.h
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition:
macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition:
macros.h:96
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition:
StorageStream.h:48
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition:
AddedMassInteraction.h:22
FlowDimension.h
AGXHYDRAULICS_EXPORT
#define AGXHYDRAULICS_EXPORT
Definition:
agxHydraulics/export.h:39
agxPowerLine::Unit
Pure virtual class.
Definition:
Unit.h:71
agxHydraulics::FlowUnit::~FlowUnit
virtual ~FlowUnit()
Definition:
FlowUnit.h:313
AGX_DECLARE_VECTOR_TYPES
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition:
Vector.h:34
agxHydraulics::utils::setFluidDensity
AGXHYDRAULICS_EXPORT void setFluidDensity(agxPowerLine::PowerLine *powerLine, agx::Real density)
Set the fluid density of all FlowUnits in a PowerLine.
agx::ref_ptr< FlowDimension >
agx::UInt8
uint8_t UInt8
Definition:
Integer.h:30
agxHydraulics::FlowUnit::m_flowDimension
agxHydraulics::FlowDimensionRef m_flowDimension
Definition:
FlowUnit.h:316
agxHydraulics::FlowConnector
A FlowConnector is a junction of a set of FlowUnits.
Definition:
FlowConnector.h:39
agxHydraulics::utils::setFluidViscosity
AGXHYDRAULICS_EXPORT void setFluidViscosity(agxPowerLine::PowerLine *powerLine, agx::Real viscosity)
Set the fluid viscosity of all FlowUnits in a PowerLine.
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:254
agxHydraulics
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition:
Accumulator.h:27
agxHydraulics::FlowUnit
FlowUnit is the base class for Units that contains a FlowDimension.
Definition:
FlowUnit.h:66
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition:
Constraint.h:30
agx::init
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
Sides.h
agxHydraulics::FlowDimension
A FlowDimension represents the flow of fluid through a FlowUnit.
Definition:
FlowDimension.h:53
include
agxHydraulics
FlowUnit.h
Generated on Sun Sep 1 2024 11:18:38 for AGX Dynamics by
1.8.17