Aerodynamic Objects Core 2.0.0
Loading...
Searching...
No Matches
AerodynamicObjects.AeroObject Class Reference

Used to calculate the aerodynamic forces and moments acting on an object based on geometry and flow velocity. More...

Inheritance diagram for AerodynamicObjects.AeroObject:
AerodynamicObjects.FlowSensor AerodynamicObjects.FlowAffected

Public Types

enum  ReferenceAreaShape
 Used to descripe what shape the reference area of an aerodynamic object is. More...
 

Public Member Functions

override void Awake ()
 
void OnValidate ()
 
void Initialise ()
 Adds the specified models to the object and performs any dimension-related calculations. More...
 
void UpdateDimensions ()
 Update the dimensions for the aero object using its transform scale and the relative dimensions. More...
 
void SetVelocity (Vector3 velocity)
 Set the velocity and local velocity of the object. More...
 
void SetPositionAndRotation (Vector3 position, Quaternion rotation)
 Set the position and rotation of the object's transform. More...
 
Vector3 GlobalNetForce ()
 The net aerodynamic force acting on this object in the global frame of reference. More...
 
Vector3 LocalNetForce ()
 The net aerodynamic force acting on this object in the local frame of reference. More...
 
Vector3 GlobalNetTorque ()
 The net aerodynamic torque acting on this object in the global frame of reference. More...
 
Vector3 LocalNetTorque ()
 The net aerodynamic torque acting on this object in the local frame of reference. More...
 
Vector3 Vector3 drag GetLocalLiftAndDrag ()
 
Vector3 Vector3 drag GetGlobalLiftAndDrag ()
 
float GetDragCoefficient ()
 If the Aero Object has a drag model, calculates and returns the pressure drag coefficient. More...
 
float GetDragCoefficient (float referenceArea)
 Uses the resolved net force of the object in the wind direction and the provided reference area to determine a drag coefficient. More...
 
float GetLiftCoefficient ()
 If the Aero Object has a lift model, returns the lift coefficient stored in the lift model. More...
 
float GetLiftCoefficient (float referenceArea)
 Uses the resolved net force of the object orthogonal to the wind direction and the provided reference area to determine a lift coefficient. More...
 
Vector3 GetAerodynamicCentreGlobalPosition ()
 Returns the position of the object's aerodynamic centre. More...
 
override void FixedUpdate ()
 
void GetDynamicPressure ()
 Calculate the dynamic pressure, based on the body relative velocity. More...
 
void RunAerodynamics ()
 Perform all of the necessary calculations to find the aerodynamic forces acting on the object, based on the state of the object and the surrounding fluid. More...
 
void AddMonoBehaviourModel< T > ()
 Adds the given aerodynamic model to the aerodynamic object. More...
 
void AddModel< T > ()
 Adds the given aerodynamic model to the aerodynamic object. More...
 
void RemoveMonoBehaviourModel< T > ()
 Looks for a monobehaviour component which implements the IAerodynamicModel interface and removes it from this object's game object. More...
 
void RemoveModel< T > ()
 Remove the specified aerodynamic model from this object. More...
 
void ClearModels ()
 Remove all aerodynamic models from this object. More...
 
GetModel< T > ()
 Get the instance of the specified aerodynamic model for this object. More...
 
int GetModelIndex< T > ()
 Get the index of the specified aerodynamic model for this object in the aerodynamicModels array. More...
 
void SetFluidVelocity (Vector3 velocity)
 Sets the velocity of the fluid around the object using a velocity in the global (earth) frame of reference. More...
 
void AddToFluidVelocity (Vector3 velocity)
 Add to the velocity of the fluid around the object. More...
 
float GetEllipsoidSurfaceArea ()
 The approximate surface area of the ellipsoid (m^2) More...
 
void GetAnglesOfAttackAndSideslip ()
 Calculate the angles of attack and sideslip for the object, based on its velocity. More...
 
float DynamicPressure ()
 
- Public Member Functions inherited from AerodynamicObjects.FlowSensor
override void FixedUpdate ()
 
override void Awake ()
 
void GetObjectVelocity ()
 Determine the velocity and angular velocity of the object. More...
 
- Public Member Functions inherited from AerodynamicObjects.FlowAffected
void GetInteractionID ()
 Obtains a unique interaction ID for the object. More...
 
void IgnoreInteraction (FlowPrimitive primitive)
 Tells the flow interaction manager that this object and the provided flow primitive should not interact. More...
 
void IgnoreInteraction (FluidVolume fluidVolume)
 Tells the flow interaction manager that this object and the provided fluid volume should not interact. More...
 
virtual void OnDestroy ()
 
virtual void Awake ()
 
virtual void FixedUpdate ()
 
void SubscribeToFluidVolume (FluidVolume fluidVolume)
 Add this fluid volume to the object's list of fluid volumes. More...
 
void UnsubscribeFromFluidVolume (FluidVolume fluidVolume)
 Remove this fluid volume from the object's list of fluid volumes. More...
 
void UpdateFluidVolumes ()
 Looks at the fluid volumes which are currently affecting this object and removes any that have become null or are now ignored. More...
 
void RemoveNullVolumes ()
 Removes any fluid volumes which have become null from the list of interacting fluid volumes for this object. More...
 
Vector3 GetFluidVelocity (Vector3 position)
 Gets the fluid velocity at the provided position and checks whether to include the global fluid velocity or not. More...
 
Vector3 GetFluidVelocityNoInteractionCheck (Vector3 position)
 Gets the fluid velocity at the provided position and checks whether to include the global fluid velocity or not. More...
 
Vector3 GetFluidVelocityWithGlobal (Vector3 position)
 Gets the fluid velocity at the provided position under the assumption that the object IS affected by the global fluid. More...
 
Vector3 GetFluidVelocityWithGlobalNoInteractionCheck (Vector3 position)
 
Vector3 GetFluidVelocityWithoutGlobal (Vector3 position)
 

Public Attributes

bool hasDrag
 
bool hasLift
 
bool hasRotationalDamping
 
bool hasRotationalLift
 
bool hasBuoyancy
 
bool updateDimensionsInRuntime = false
 Set to true if the dimensions of this object will change during play mode. More...
 
ReferenceAreaShape referenceAreaShape = ReferenceAreaShape.Ellipse
 What shape should reference areas use. More...
 
AeroGroup myGroup
 The aerodynamic group that this object belongs to. More...
 
float BodyCamber
 Body camber is the camber due to the shape of the object. More...
 
List< ControlSurfacecontrolSurfaces = new List<ControlSurface>()
 All the control surfaces affecting the aero object. More...
 
float ControlCamber
 Control camber is the camber due to the deflection of the control surface attached to the (m) More...
 
Vector3 dimensions
 Overall size of the object in the local frame of reference. More...
 
Vector3 relativeDimensions = Vector3.one
 The dimensions of the object in the local frame of reference, relative to the scale of the object's transform. More...
 
Vector3 camber
 Camber of the object along each axis in the local frame of reference. More...
 
IAerodynamicModel[] aerodynamicModels = new IAerodynamicModel[0]
 The collection of aerodynamic models which will be applied to this object. More...
 
AerodynamicLoad[] aerodynamicLoads = new AerodynamicLoad[0]
 The aerodynamic loads acting on the object. More...
 
AerodynamicLoad netAerodynamicLoad = new AerodynamicLoad()
 The sum of all the aerodynamic loads acting on the object. More...
 
float dynamicPressure
 The dynamic pressure due to motion of the object through the fluid. More...
 
Vector3 groupDimensions
 
Vector3 lift
 Resolve the net force on this aero object into lift and drag using the local relative velocity. More...
 
- Public Attributes inherited from AerodynamicObjects.FlowSensor
Rigidbody rb
 
VelocitySource velocitySource = VelocitySource.Rigidbody
 Which component should this object use to determine its velocity. More...
 
Vector3 velocity = Vector3.zero
 Velocity of the object in the global (earth) frame of reference. More...
 
Vector3 localVelocity = Vector3.zero
 Velocity of the object in the object's local frame of reference. More...
 
Vector3 relativeVelocity = Vector3.zero
 Velocity of the object relative to the fluid. More...
 
Vector3 localRelativeVelocity = Vector3.zero
 Velocity of the object relative to the fluid. More...
 
Vector3 angularVelocity = Vector3.zero
 Angular velocity of the object in the global (earth) frame of reference. More...
 
Vector3 localAngularVelocity = Vector3.zero
 Angular velocity of the object in the object's local frame of reference. More...
 
- Public Attributes inherited from AerodynamicObjects.FlowAffected
bool affectedByGlobalFluid = true
 Will the global fluid velocity affect this object? More...
 
int interactionID = 0
 The unique ID number for this object, used for identifying pairs of ignored interactions by the FlowInteractionManager. More...
 
List< FluidVolumelocalFluidVolumes = new List<FluidVolume>()
 The local fluid volumes that are currently affecting this object. More...
 
Fluid fluid = new Fluid()
 The state and properties of the fluid around the object. More...
 

Properties

float TotalCamber [get]
 Total camber is the combination of body camber and camber due to control surface deflection. More...
 

Detailed Description

Used to calculate the aerodynamic forces and moments acting on an object based on geometry and flow velocity.

Member Enumeration Documentation

◆ ReferenceAreaShape

Used to descripe what shape the reference area of an aerodynamic object is.

Member Function Documentation

◆ AddModel< T >()

void AerodynamicObjects.AeroObject.AddModel< T > ( )

Adds the given aerodynamic model to the aerodynamic object.

If the object already has a model of the same type then an additional model will NOT be added.

Type Constraints
T :IAerodynamicModel 
T :new() 

◆ AddMonoBehaviourModel< T >()

void AerodynamicObjects.AeroObject.AddMonoBehaviourModel< T > ( )

Adds the given aerodynamic model to the aerodynamic object.

If the object already has a model of the same type then an additional model will not be added.

Type Constraints
T :MonoBehaviour 
T :IAerodynamicModel 
T :new() 

◆ AddToFluidVelocity()

void AerodynamicObjects.AeroObject.AddToFluidVelocity ( Vector3  velocity)

Add to the velocity of the fluid around the object.

Velocity is measured in the global (earth) frame of reference.

Parameters
velocityVelocity increment for the fluid in the global (earth) frame of reference. (m/s)

◆ Awake()

override void AerodynamicObjects.AeroObject.Awake ( )
virtual

Reimplemented from AerodynamicObjects.FlowAffected.

◆ ClearModels()

void AerodynamicObjects.AeroObject.ClearModels ( )

Remove all aerodynamic models from this object.

◆ DynamicPressure()

float AerodynamicObjects.AeroObject.DynamicPressure ( )

◆ FixedUpdate()

override void AerodynamicObjects.AeroObject.FixedUpdate ( )
virtual

Reimplemented from AerodynamicObjects.FlowAffected.

◆ GetAerodynamicCentreGlobalPosition()

Vector3 AerodynamicObjects.AeroObject.GetAerodynamicCentreGlobalPosition ( )

Returns the position of the object's aerodynamic centre.

If no lifting model is present, this is assumed to be the centre of the aero object

Returns

◆ GetAnglesOfAttackAndSideslip()

void AerodynamicObjects.AeroObject.GetAnglesOfAttackAndSideslip ( )

Calculate the angles of attack and sideslip for the object, based on its velocity.

◆ GetDragCoefficient() [1/2]

float AerodynamicObjects.AeroObject.GetDragCoefficient ( )

If the Aero Object has a drag model, calculates and returns the pressure drag coefficient.

Returns
Pressure drag coefficient

◆ GetDragCoefficient() [2/2]

float AerodynamicObjects.AeroObject.GetDragCoefficient ( float  referenceArea)

Uses the resolved net force of the object in the wind direction and the provided reference area to determine a drag coefficient.

Returns
Net drag coefficient

◆ GetDynamicPressure()

void AerodynamicObjects.AeroObject.GetDynamicPressure ( )

Calculate the dynamic pressure, based on the body relative velocity.

◆ GetEllipsoidSurfaceArea()

float AerodynamicObjects.AeroObject.GetEllipsoidSurfaceArea ( )

The approximate surface area of the ellipsoid (m^2)

◆ GetGlobalLiftAndDrag()

Vector3 Vector3 drag AerodynamicObjects.AeroObject.GetGlobalLiftAndDrag ( )

◆ GetLiftCoefficient() [1/2]

float AerodynamicObjects.AeroObject.GetLiftCoefficient ( )

If the Aero Object has a lift model, returns the lift coefficient stored in the lift model.

Returns
Lift coefficient

◆ GetLiftCoefficient() [2/2]

float AerodynamicObjects.AeroObject.GetLiftCoefficient ( float  referenceArea)

Uses the resolved net force of the object orthogonal to the wind direction and the provided reference area to determine a lift coefficient.

Returns
Net lift coefficient

◆ GetLocalLiftAndDrag()

Vector3 Vector3 drag AerodynamicObjects.AeroObject.GetLocalLiftAndDrag ( )

◆ GetModel< T >()

T AerodynamicObjects.AeroObject.GetModel< T > ( )

Get the instance of the specified aerodynamic model for this object.

Returns default (which should be null) if the specified model type is not stored by this object.

Template Parameters
TThe model type to get.
Returns
Instance of T for this object. Null if no model of type T is found.
Type Constraints
T :IAerodynamicModel 

◆ GetModelIndex< T >()

int AerodynamicObjects.AeroObject.GetModelIndex< T > ( )

Get the index of the specified aerodynamic model for this object in the aerodynamicModels array.

Returns -1 if the specified model type is not stored by this object.

Template Parameters
TThe model type to get.
Returns
Index of T in the aerodynamicModels array for this object. -1 if no model of type T is found.
Type Constraints
T :IAerodynamicModel 

◆ GlobalNetForce()

Vector3 AerodynamicObjects.AeroObject.GlobalNetForce ( )

The net aerodynamic force acting on this object in the global frame of reference.

◆ GlobalNetTorque()

Vector3 AerodynamicObjects.AeroObject.GlobalNetTorque ( )

The net aerodynamic torque acting on this object in the global frame of reference.

◆ Initialise()

void AerodynamicObjects.AeroObject.Initialise ( )

Adds the specified models to the object and performs any dimension-related calculations.

Also stores the current transform position and rotation ready for use in velocity calculations which use the object's transform (used when useTransformVelocity is true).

◆ LocalNetForce()

Vector3 AerodynamicObjects.AeroObject.LocalNetForce ( )

The net aerodynamic force acting on this object in the local frame of reference.

◆ LocalNetTorque()

Vector3 AerodynamicObjects.AeroObject.LocalNetTorque ( )

The net aerodynamic torque acting on this object in the local frame of reference.

◆ OnValidate()

void AerodynamicObjects.AeroObject.OnValidate ( )

◆ RemoveModel< T >()

void AerodynamicObjects.AeroObject.RemoveModel< T > ( )

Remove the specified aerodynamic model from this object.

Template Parameters
TThe model type to remove.
Type Constraints
T :IAerodynamicModel 
T :new() 

◆ RemoveMonoBehaviourModel< T >()

void AerodynamicObjects.AeroObject.RemoveMonoBehaviourModel< T > ( )

Looks for a monobehaviour component which implements the IAerodynamicModel interface and removes it from this object's game object.

Also cleans up the list of aerodynamic models stored by this object.

Template Parameters
TThe model type to remove.
Type Constraints
T :MonoBehaviour 
T :IAerodynamicModel 
T :new() 

◆ RunAerodynamics()

void AerodynamicObjects.AeroObject.RunAerodynamics ( )

Perform all of the necessary calculations to find the aerodynamic forces acting on the object, based on the state of the object and the surrounding fluid.

◆ SetFluidVelocity()

void AerodynamicObjects.AeroObject.SetFluidVelocity ( Vector3  velocity)

Sets the velocity of the fluid around the object using a velocity in the global (earth) frame of reference.

Parameters
velocityVelocity of the fluid in the global (earth) frame of reference. (m/s)

◆ SetPositionAndRotation()

void AerodynamicObjects.AeroObject.SetPositionAndRotation ( Vector3  position,
Quaternion  rotation 
)

Set the position and rotation of the object's transform.

Also stores the position and rotation in case the transform is being used to determine velocity.

Parameters
positionPosition of the object in the global frame of reference. (m)
rotationQuaternion rotation of the object in the global frame of reference.

◆ SetVelocity()

void AerodynamicObjects.AeroObject.SetVelocity ( Vector3  velocity)

Set the velocity and local velocity of the object.

Assumes the angular velocity is zero and will set the values accordingly.

Parameters
velocityThe translational velocity for the object in the global frame of reference. (m/s)

◆ UpdateDimensions()

void AerodynamicObjects.AeroObject.UpdateDimensions ( )

Update the dimensions for the aero object using its transform scale and the relative dimensions.

Then update the dimension values for any aerodynamic models associated with this aero object.

Member Data Documentation

◆ aerodynamicLoads

AerodynamicLoad [] AerodynamicObjects.AeroObject.aerodynamicLoads = new AerodynamicLoad[0]

The aerodynamic loads acting on the object.

Given by the aerodynamic models attached to the object.
In the local frame of reference.

◆ aerodynamicModels

IAerodynamicModel [] AerodynamicObjects.AeroObject.aerodynamicModels = new IAerodynamicModel[0]

The collection of aerodynamic models which will be applied to this object.

◆ BodyCamber

float AerodynamicObjects.AeroObject.BodyCamber

Body camber is the camber due to the shape of the object.

This does not include the camber due to control surface deflection. (m)

◆ camber

Vector3 AerodynamicObjects.AeroObject.camber

Camber of the object along each axis in the local frame of reference.

(m)

◆ ControlCamber

float AerodynamicObjects.AeroObject.ControlCamber

Control camber is the camber due to the deflection of the control surface attached to the (m)

◆ controlSurfaces

List<ControlSurface> AerodynamicObjects.AeroObject.controlSurfaces = new List<ControlSurface>()

All the control surfaces affecting the aero object.

These are added automatically by including a component on the same game object as this Aero Object.

◆ dimensions

Vector3 AerodynamicObjects.AeroObject.dimensions

Overall size of the object in the local frame of reference.

Accounting for relative dimensions and the scale of this object's transform. (m)

◆ dynamicPressure

float AerodynamicObjects.AeroObject.dynamicPressure

The dynamic pressure due to motion of the object through the fluid.

Given by 0.5 * rho * V^2 (Pa)

◆ groupDimensions

Vector3 AerodynamicObjects.AeroObject.groupDimensions

◆ hasBuoyancy

bool AerodynamicObjects.AeroObject.hasBuoyancy

◆ hasDrag

bool AerodynamicObjects.AeroObject.hasDrag

◆ hasLift

bool AerodynamicObjects.AeroObject.hasLift

◆ hasRotationalDamping

bool AerodynamicObjects.AeroObject.hasRotationalDamping

◆ hasRotationalLift

bool AerodynamicObjects.AeroObject.hasRotationalLift

◆ lift

Vector3 AerodynamicObjects.AeroObject.lift

Resolve the net force on this aero object into lift and drag using the local relative velocity.

Resolve the net force on this aero object into lift and drag using the global relative velocity.

Returns
The lift and drag forces in the object's local frame of reference.
Returns
The lift and drag forces in the global frame of reference.

◆ myGroup

AeroGroup AerodynamicObjects.AeroObject.myGroup

The aerodynamic group that this object belongs to.

Groups control the aspect ratio when aero objects are used to create a wing, ensuring that sensible values of lift are produced.

◆ netAerodynamicLoad

AerodynamicLoad AerodynamicObjects.AeroObject.netAerodynamicLoad = new AerodynamicLoad()

The sum of all the aerodynamic loads acting on the object.

Given by the aerodynamic models attached to the object.
In the local frame of reference.

◆ referenceAreaShape

ReferenceAreaShape AerodynamicObjects.AeroObject.referenceAreaShape = ReferenceAreaShape.Ellipse

What shape should reference areas use.

This is useful when an AO represents a lifting surface and the area should be rectangular. If we took an ellipse with major and minor axes equivalent to a rectangle's width and height, the ellipsoid's area would be 1/(4*PI) times smaller than the rectangular area.

◆ relativeDimensions

Vector3 AerodynamicObjects.AeroObject.relativeDimensions = Vector3.one

The dimensions of the object in the local frame of reference, relative to the scale of the object's transform.

I.e. relative dimensions of (2,2,2) will yield an aero object twice the size of the transform object.

◆ updateDimensionsInRuntime

bool AerodynamicObjects.AeroObject.updateDimensionsInRuntime = false

Set to true if the dimensions of this object will change during play mode.

Having this set to false saves a fairly costly update to the frames of reference used by the aerodynamics.

Property Documentation

◆ TotalCamber

float AerodynamicObjects.AeroObject.TotalCamber
get

Total camber is the combination of body camber and camber due to control surface deflection.

(m) (Read Only)


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