Obi Official Forum
Velocity profile - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Velocity profile (/thread-238.html)



Velocity profile - mimarilker - 30-11-2017

Hi,

Is it possible to attach a wind-speed profile to the Emitter? You may check the attached image for the desired result. I want to use a logarithmic equation for the profile. Thanks a lot.


RE: Velocity profile - josemendez - 30-11-2017

(30-11-2017, 10:56 AM)mimarilker Wrote: Hi,

Is it possible to attach a wind-speed profile to the Emitter? You may check the attached image for the desired result. I want to use a logarithmic equation for the profile. Thanks a lot.

Hi,

Speed increases linearly with wind intensity for fluid (Note to ObiCloth users: for cloth it doesn't, there the airfoil lift/drag equations are used). That means you can do 


Code:
wind intensity = f(x)


where f() is a logarithmic function (or any other function), and the speed response will be the same as if you did:


Code:
speed = f(wind intensity)


cheers,


RE: Velocity profile - mimarilker - 30-11-2017

(30-11-2017, 03:48 PM)josemendez Wrote: Hi,

Speed increases linearly with wind intensity for fluid (Note to ObiCloth users: for cloth it doesn't, there the airfoil lift/drag equations are used). That means you can do 







Code:
wind intensity = f(x)


where f() is a logarithmic function (or any other function), and the speed response will be the same as if you did:







Code:
speed = f(wind intensity)


cheers,

Hi,

I am not sure if I explain it correctly, actually I need this wind speed profile at the emitter location. So I dont need any increasing or decreasing wind speed with distance based on a function. 

Wind speed should change in the emitter with respect to the particles' locations (height from the ground or zero). Let's assume a vertical edge emitter, the particles at the lower levels will have low speeds gradually. This is exactly "atmospheric boundary layer". In reality wind speed at higher altitudes has high velocity due to the lower roughness height (since number of obstacles decrease). The attached file includes wind speed power law equation which is very easy to use. Btw, I have alpha values which changes according to the different roughness heights.

Thanks for your response.


RE: Velocity profile - josemendez - 30-11-2017

(30-11-2017, 03:58 PM)mimarilker Wrote: Hi,

I am not sure if I explain it correctly, actually I need this wind speed profile at the emitter location. So I dont need any increasing or decreasing wind speed with distance based on a function. 

Wind speed should change in the emitter with respect to the particles' locations (height from the ground or zero). Let's assume a vertical edge emitter, the particles at the lower levels will have low speeds gradually. This is exactly "atmospheric boundary layer". In reality wind speed at higher altitudes has high velocity due to the lower roughness height (since number of obstacles decrease). The attached file includes wind speed power law equation which is very easy to use. Btw, I have alpha values which changes according to the different roughness heights.

Thanks for your response.

Oh, ok. So you didn't mean changing the wind/speed response curve, but the distance/wind response.

You can implement your own wind emitter if you wish to (by inheriting ObiExternalForce and implementing your own ApplyForcesToActor() method), or modify the existing ones. 

Take for instance the ObiSphericalForceZone component. The wind decay is linear with respect to distance to its center: (line 44 of ObiSphericalForceZone.cs)
Code:
float falloff = Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius);

But you can use any custom method to control it. For instance, quadratic decay:
Code:
float falloff = Mathf.Pow(Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius),2.0f);

If you just want wind speed to change depending on particle height (distance to the floor), your best bet is to create your own ObiExternalForce component and implement it in ApplyForcesToActor().


RE: Velocity profile - mimarilker - 30-11-2017

(30-11-2017, 05:06 PM)josemendez Wrote: Oh, ok. So you didn't mean changing the wind/speed response curve, but the distance/wind response.

You can implement your own wind emitter if you wish to (by inheriting ObiExternalForce and implementing your own ApplyForcesToActor() method), or modify the existing ones. 

Take for instance the ObiSphericalForceZone component. The wind decay is linear with respect to distance to its center: (line 44 of ObiSphericalForceZone.cs)

Code:
float falloff = Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius);

But you can use any custom method to control it. For instance, quadratic decay:

Code:
float falloff = Mathf.Pow(Mathf.Clamp01((sqrRadius - sqrMag) / sqrRadius),2.0f);

If you just want wind speed to change depending on particle height (distance to the floor), your best bet is to create your own ObiExternalForce component and implement it in ApplyForcesToActor().

Hi,

In the ObiEmitterShapeEdge script which I need to use, there is a definition for velocity:

Vector3 vel = Quaternion.AngleAxis(i*radialVelocity,Vector3.right) * Vector3.forward;

I am trying to change it to:

Vector3 vel = velRef * Mathf.Pow (height2 / heightRef, alpha);

height2 = height of a particle from ground (actually all of the particles should change accordingly)
heightRef = reference height
velRef = reference velocity (it gives error, since its a float value, not a Vector)
alpha= roughness coefficient

However, this script don't have a definition for ApplyForcesToActor() method Triste Actually, as I suppose it uses distribution.


RE: Velocity profile - josemendez - 01-12-2017

(30-11-2017, 06:13 PM)mimarilker Wrote: Hi,

In the ObiEmitterShapeEdge script which I need to use, there is a definition for velocity:

Vector3 vel = Quaternion.AngleAxis(i*radialVelocity,Vector3.right) * Vector3.forward;

I am trying to change it to:

Vector3 vel = velRef * Mathf.Pow (height2 / heightRef, alpha);

height2 = height of a particle from ground (actually all of the particles should change accordingly)
heightRef = reference height
velRef = reference velocity (it gives error, since its a float value, not a Vector)
alpha= roughness coefficient

However, this script don't have a definition for ApplyForcesToActor() method Triste Actually, as I suppose it uses distribution.
Hi,

You don´t need to modify the emitter at all. That only determines the emission speed of the particles, not their behavior once they've been emitted. 

You need to create your own force zone by inheriting the ObiExternalForce class as I pointed out before.  Guiño


cheers,