AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxHydraulics::NeedleValve Class Reference

A needle valve represents a controllable orifice opening. More...

#include <NeedleValve.h>

+ Inheritance diagram for agxHydraulics::NeedleValve:

Public Member Functions

 NeedleValve (agx::Real maxOpeningArea, agx::Real fluidDensity)
 Create a new needle valve with the given area and fluid density.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxHydraulics::NeedleValve)
 
agx::Real getCutoffArea () const
 
agx::Real getFlowCoefficient () const
 
agx::Real getMaxOpeningArea () const
 
agx::Real getOpeningArea () const
 
agx::Real getOpeningDiameterFraction () const
 
agx::Real getOpeningFraction () const
 
void setCutoffArea (agx::Real cutoff)
 Set smallest area that the needle valve is allowed to have.
 
void setFlowCoefficient (agx::Real coefficient)
 Set the flow coefficient of the valve.
 
void setOpeningArea (agx::Real area)
 Set the area of the valve directly.
 
void setOpeningDiameterFraction (agx::Real fractionOfMax)
 Set the orifice opening diameter using an argument in the range [0..1] that represents diameters between closed and fully open.
 
void setOpeningFraction (agx::Real fractionOfMax)
 Set the orifice opening area using an argument in the range [0..1] that repsents areas between 0 and maxOpeningArea.
 
- Public Member Functions inherited from agxHydraulics::FlowUnit
 FlowUnit (agx::Real inertia)
 Create a FlowUnit with the given inertia.
 
 FlowUnit (agx::Real length, agx::Real area, agx::Real fluidDensity)
 Create a FlowUnit with inertia calculated from the given parameters.
 
void addPressure (agx::Real pressure, agxPowerLine::Side side)
 Add extra pressure to the FlowUnit at the given side.
 
agx::Real getArea () const
 
virtual agxHydraulics::FlowConnector * getFlowConnector (agxPowerLine::Side side)
 
virtual const agxHydraulics::FlowConnector * getFlowConnector (agxPowerLine::Side side) const
 
agxHydraulics::FlowDimension * getFlowDimension ()
 
const agxHydraulics::FlowDimension * getFlowDimension () const
 
agx::Real getFlowRate () const
 
agx::Real getFluidDensity () const
 
agx::Real getFluidViscosity () const
 
agx::Real getInletPressure () const
 
agxHydraulics::FlowConnector * getInputFlowConnector ()
 
const agxHydraulics::FlowConnector * getInputFlowConnector () const
 
agx::Real getInputPressure () const
 Measure the pressure at the inlet of the FlowUnit.
 
agx::Real getLength () const
 
agx::Real getOutletPressure () const
 
agxHydraulics::FlowConnector * getOutputFlowConnector ()
 
const agxHydraulics::FlowConnector * getOutputFlowConnector () const
 
agx::Real getOutputPressure () const
 Measure the pressure at the outlet of the FlowUnit.
 
agx::Real getPressure (agxPowerLine::Side side) const
 Measure the pressure at the given side of the FlowUnit.
 
bool isConnected (agxPowerLine::Side end) const
 
bool setArea (agx::Real area)
 Set the area of the FlowUnit.
 
void setFluidDensity (agx::Real density)
 Set the density of the fluid.
 
void setFluidViscosity (agx::Real viscosity)
 The viscosity specified here is the kinematic viscosity, measured in area per time.
 
void setLength (agx::Real length)
 Set the length of the FlowUnit.
 
- Public Member Functions inherited from agxPowerLine::Unit
 Unit ()
 Constructor.
 
void addNotification (agxPowerLine::PowerLine *powerLine)
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::Unit)
 
void attach (agx::RigidBody *body)
 Define which body in the simulation this Unit is attached to.
 
agx::String buildDimensionsName () const
 
virtual bool connect (agxPowerLine::Connector *connector)
 Connect the unit to a connector.
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side connectorSide, agxPowerLine::Connector *connector)
 Connect the unit to a connector, specifying the side of each.
 
virtual bool connect (agxPowerLine::Side mySide, agxPowerLine::Side otherSide, agxPowerLine::Unit *other)
 
virtual bool connect (agxPowerLine::Unit *otherUnit)
 Connect the unit to another unit.
 
virtual bool disconnect (agxPowerLine::Unit *unit)
 
void disconnectAll ()
 
agxPowerLine::PhysicalDimension * getActiveDimension (size_t index)
 
const agxPowerLine::PhysicalDimension * getActiveDimension (size_t index) const
 
virtual agxPowerLine::DimensionAndSide getConnectableDimension (agxPowerLine::PhysicalDimension::Type type, agxPowerLine::Side side)
 
virtual void getConnectableDimensionTypes (agxPowerLine::PhysicalDimension::TypeVector &types, agxPowerLine::Side side) const
 
agxPowerLine::PhysicalDimension * getConnectableInputDimension (agxPowerLine::PhysicalDimension::Type type)
 
agxPowerLine::PhysicalDimension * getConnectableOutputDimension (agxPowerLine::PhysicalDimension::Type type)
 
void getConnectedUnits (UnitPtrSetVector &result, agxPowerLine::Side side)
 
size_t getConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 Append all connectors connecting this Unit to the given Unit to the 'result' Vector.
 
agxPowerLine::PhysicalDimension * getDimension (agxPowerLine::PhysicalDimension::Type type)
 
const agxPowerLine::PhysicalDimension * getDimension (agxPowerLine::PhysicalDimension::Type type) const
 
agxPowerLine::PhysicalDimensionRefVector & getDimensions ()
 
const agxPowerLine::PhysicalDimensionRefVector & getDimensions () const
 
Connector * getFirstInputConnector (const agxPowerLine::Unit *unit) const
 
Connector * getFirstOutputConnector (const agxPowerLine::Unit *unit) const
 
bool getIgnoreForStoreRestoreStream () const
 
size_t getInputConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getInputConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 
size_t getNumActiveDimensions () const
 The number of non-null PhysicalDimension in this Unit, not including internal Units.
 
virtual size_t getNumConnectableDimensions (Side side) const
 
size_t getNumConnections () const
 
size_t getOutputConnectors (agxPowerLine::ConnectorPtrVector &result) const
 
size_t getOutputConnectors (const agxPowerLine::Unit *unit, agxPowerLine::ConnectorPtrVector &result)
 
void getOwnConnectedUnits (UnitPtrSetVector &unitSet, agxPowerLine::Side side, bool startFromCleanUnitSet=true) const
 
void getOwnConnectedUnits (UnitPtrSetVector &unitSet, bool startFromCleanUnitSet=true) const
 Constructs the set of Units connected to this Unit's own dimensions.
 
agxPowerLine::PowerLine * getPowerLine () const
 
agxPowerLine::Unit * getRoot () const
 
agxPowerLine::Side getSide (const Connector *connector) const
 
bool hasConnector (const Connector *connector) const
 
virtual bool isConnected (agxPowerLine::Unit *otherUnit) const
 
virtual bool isValid () const
 
virtual bool postRestore (agxStream::StorageStream &str)
 
virtual bool postStore (agxStream::StorageStream &str) const
 
void removeNotification (agxPowerLine::PowerLine *powerLine)
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str) override
 Restores internal data from stream.
 
void setRoot (agxPowerLine::Unit *root)
 
void spreadRootToGraph ()
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const override
 Stores internal data into stream.
 
virtual bool vetoConnect (agxPowerLine::Connector *connector) const
 
- Public Member Functions inherited from agxPowerLine::SubGraph
 SubGraph ()
 
virtual bool addNotification (agxSDK::Simulation *simulation)=0
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::SubGraph)
 
virtual void getConnectorsRecursive (ConnectorPtrVector &connectors)
 Fill the given vector with the Connectors that are held by this SubGraph.
 
Connector * getEnclosingConnector ()
 
const Connector * getEnclosingConnector () const
 
SubGraph * getEnclosingGraph ()
 
const SubGraph * getEnclosingGraph () const
 
Unit * getEnclosingUnit ()
 
const Unit * getEnclosingUnit () const
 
const agxPowerLine::ConnectorRefVector & getInternalConnectors () const
 
const agxPowerLine::UnitRefVector & getInternalUnits () const
 
const agx::Name & getName () const
 
SubGraph * getRootEnclosingGraph ()
 
const SubGraph * getRootEnclosingGraph () const
 
virtual void getUnitsRecursive (UnitPtrVector &units)
 Fill the given vector with the Units that are held by this SubGraph.
 
bool isEnclosedWithin (const SubGraph *component) const
 
virtual bool postUpdate (agx::Real timeStep)
 
virtual void prepareForRestore ()
 
virtual void prepareForStore ()
 
virtual bool preUpdate (agx::Real timeStep)
 
virtual bool removeNotification (agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation)=0
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &str)
 Restores internal data from stream.
 
void setName (const agx::Name &name)
 Set the name of this power line component.
 
void spreadPowerLineToGraph ()
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &str) const
 Stores internal data into stream.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agxHydraulics::FlowUnit
static FlowConnector * findInCommonFlowConnector (FlowUnit *a, FlowUnit *b)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 NeedleValve ()
 
virtual ~NeedleValve ()
 
NeedleValve & operator= (const NeedleValve &)
 
- Protected Member Functions inherited from agxHydraulics::FlowUnit
virtual ~FlowUnit ()
 
agx::Real computeFrictionFactor () const
 
agx::Real computeLaminarFrictionalLoss (agx::Real flowRate) const
 
agx::Real computeQuadraticFrictionalLoss (agx::Real flowCoefficient) const
 
agx::Real computeReynoldsNumber () const
 
void init ()
 
void updateBodyMass ()
 
agx::Real updateFrictionLoss ()
 
- Protected Member Functions inherited from agxPowerLine::Unit
virtual ~Unit ()
 
bool activateDimension (PhysicalDimension *dimension)
 
virtual bool hasValidInputConnection () const
 returns if it is possible to connect to this unit
 
void restorePre46 (agxStream::InputArchive &in)
 
void setPowerLine (PowerLine *powerLine)
 Point to the power line the unit is a part of.
 
- Protected Member Functions inherited from agxPowerLine::SubGraph
virtual ~SubGraph ()
 
void addInternalConnector (agxPowerLine::Connector *connector)
 
void addInternalUnit (agxPowerLine::Unit *unit)
 
void removeInternalConnector (agxPowerLine::Connector *connector)
 
void removeInternalUnit (agxPowerLine::Unit *unit)
 
agx::Bool replaceInternalUnit (agxPowerLine::Unit *oldUnit, agxPowerLine::Unit *newUnit)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from agxHydraulics::FlowUnit
static agx::Real computeReynoldsNumber (agx::Real area, agx::Real flowRate, agx::Real viscosity)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agxHydraulics::FlowUnit
agxHydraulics::FlowDimensionRef m_flowDimension
 
- Protected Attributes inherited from agxPowerLine::Unit
agx::observer_ptr< agx::RigidBody > m_attachBody
 
PhysicalDimensionRefVector m_dimensions
 
bool m_ignoreMeForStoreRestoreStream
 
agxPowerLine::Unit * m_rootUnit
 
- Protected Attributes inherited from agxPowerLine::SubGraph
SubGraphObserver m_enclosingGraph
 
ConnectorRefVector m_internalConnectors
 
UnitRefVector m_internalUnits
 
agx::Name m_name
 
PowerLine * m_powerLine
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

A needle valve represents a controllable orifice opening.

Reducing the orifice area increases the resistance to change in flow rate (inertia) through the valve, but also increases a viscous velocity damping parameter, i.e., increases the frictional loss in the valve. This makes it possible to control the flow rate through the valve for a given pressure difference over the valve.

Very narrow needle valve openings produces hard to solve numerical systems and may lead to instabilities in the simulation. There is a cutoff area where the valve is considered to be shut. If making the orifice very small brings instabilities to the simulation, then increase the cutoff area. If very narrow orifices are required, then this cutoff can be lowered.

Definition at line 42 of file NeedleValve.h.

Constructor & Destructor Documentation

◆ NeedleValve() [1/2]

agxHydraulics::NeedleValve::NeedleValve ( agx::Real  maxOpeningArea,
agx::Real  fluidDensity 
)

Create a new needle valve with the given area and fluid density.

The valve is initially fully open.

◆ NeedleValve() [2/2]

agxHydraulics::NeedleValve::NeedleValve ( )
protected

◆ ~NeedleValve()

virtual agxHydraulics::NeedleValve::~NeedleValve ( )
inlineprotectedvirtual

Definition at line 132 of file NeedleValve.h.

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxHydraulics::NeedleValve::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxHydraulics::NeedleValve  )

◆ create()

static agxStream::Serializable * agxHydraulics::NeedleValve::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 125 of file NeedleValve.h.

◆ getCutoffArea()

agx::Real agxHydraulics::NeedleValve::getCutoffArea ( ) const
Returns
The smallest possible non-zero area of the needle valve.

◆ getFlowCoefficient()

agx::Real agxHydraulics::NeedleValve::getFlowCoefficient ( ) const
Returns
The flow coefficient of the valve.

◆ getMaxOpeningArea()

agx::Real agxHydraulics::NeedleValve::getMaxOpeningArea ( ) const
Returns
The maximum that area that the value can be opened to.

◆ getOpeningArea()

agx::Real agxHydraulics::NeedleValve::getOpeningArea ( ) const
Returns
The current opening area, a number in the range [0..maxOpeningArea].

◆ getOpeningDiameterFraction()

agx::Real agxHydraulics::NeedleValve::getOpeningDiameterFraction ( ) const
Returns
The current diameter opening fraction, a number in the range [0..1].

◆ getOpeningFraction()

agx::Real agxHydraulics::NeedleValve::getOpeningFraction ( ) const
Returns
The current area opening fraction, a number in the range [0..1].

◆ operator=()

NeedleValve & agxHydraulics::NeedleValve::operator= ( const NeedleValve &  )
protected

◆ setCutoffArea()

void agxHydraulics::NeedleValve::setCutoffArea ( agx::Real  cutoff)

Set smallest area that the needle valve is allowed to have.

Any request to set the area smaller than this will shut the valve.

◆ setFlowCoefficient()

void agxHydraulics::NeedleValve::setFlowCoefficient ( agx::Real  coefficient)

Set the flow coefficient of the valve.

A larger value lets the fluid pass through the valve more easily, and a smaller values causes a larger pressure drop over the valve.

◆ setOpeningArea()

void agxHydraulics::NeedleValve::setOpeningArea ( agx::Real  area)

Set the area of the valve directly.

The argument will be clamped to the range [0..maxOpeningArea] and values less than the cutoff area will be flushed to zero.

◆ setOpeningDiameterFraction()

void agxHydraulics::NeedleValve::setOpeningDiameterFraction ( agx::Real  fractionOfMax)

Set the orifice opening diameter using an argument in the range [0..1] that represents diameters between closed and fully open.

The value will be clamped to this range and a resulting area leass than the cutoff area will be flushed to zero.

◆ setOpeningFraction()

void agxHydraulics::NeedleValve::setOpeningFraction ( agx::Real  fractionOfMax)

Set the orifice opening area using an argument in the range [0..1] that repsents areas between 0 and maxOpeningArea.

The value will be clamped to this range and a resulting area less than the cutoff area will be flushed to zero.


The documentation for this class was generated from the following file: