Gradient question for fluid simulation

In summary, the conversation discusses a simple gradient question about a kernel function in Cartesian coordinates. The conversation explores the use of a gradient vector to replace the scalar distance 'r' in the equation, with suggestions to use Cartesian coordinates and restructure the equation. The conversation ends with the acknowledgement that it is a newb question and not for homework.
  • #1
johnnyk427
2
0
Simple gradient question.. I have a kernel function that determines the influence of each water droplet given a radius r:

(10/pi*h^5)*(h-r)^3

The gradient of that is:
(-30/pi*h^5)*(h-r)^2

But 'r' is not a vector, its a scalar, its just the distance to the point in question. So how do I get a gradient vector out of that equation? Maybe I want to replace 'r' with the x distance and use that to determine the 'x' component of the gradient, and same for 'y'? But that doesn't seem right..

(yes, i know this is a newb question, thanks for any help! It's not homework just a project I'm working on for fun.)
-John
 
Physics news on Phys.org
  • #2
johnnyk427 said:
Simple gradient question.. I have a kernel function that determines the influence of each water droplet given a radius r:

(10/pi*h^5)*(h-r)^3

The gradient of that is:
(-30/pi*h^5)*(h-r)^2

But 'r' is not a vector, its a scalar, its just the distance to the point in question. So how do I get a gradient vector out of that equation? Maybe I want to replace 'r' with the x distance and use that to determine the 'x' component of the gradient, and same for 'y'? But that doesn't seem right..

(yes, i know this is a newb question, thanks for any help! It's not homework just a project I'm working on for fun.)
-John

Welcome to Physics Forums!

It depends what you mean by "r" here. What coordinate system are you using? Are you in spherical coordinates? Then you simply have to look up the gradient in spherical coordinates
[tex] \vec{\nabla} V = \frac{\partial V}{\partial r} \hat{r} + \frac{1}{r} \frac{\partial V}{\partial \theta} \hat{\theta} + \frac{1}{r sin \theta} \frac{\partial V}{\partial \phi} \hat{\phi} [/tex]
 
  • #3
Welcome to Physics Forums!

Thanks :)

It depends what you mean by "r" here. What coordinate system are you using? Are you in spherical coordinates? Then you simply have to look up the gradient in spherical coordinates

It's actually in Cartesian coordinates, x and y (it's 2d, not 3d). When I calculate this function, I first compute the distance from 0,0 to x,y, and assign that to 'r'. 'h' is a constant (representing the size of the kernel I'm applying).

So maybe I want something like:

(gradient f) = { (change in x)/(change in f), (change in y)/(change in f) }

And then restructure my equation, substituting '(sqrt(x^2 + y^2))' for r... Does that sound right?
 

1. What is a gradient question for fluid simulation?

A gradient question for fluid simulation refers to the calculation of changes in a fluid's properties, such as velocity, temperature, or pressure, over a given distance or surface. It is an essential component of fluid simulation because it helps determine how a fluid will behave in a given scenario.

2. How is the gradient question calculated in fluid simulation?

The gradient question is typically calculated using a mathematical concept called partial derivatives. This involves taking the derivative of a function with respect to each variable and combining them to determine the overall change in the function. In fluid simulation, this is used to calculate the changes in fluid properties over time and space.

3. What is the significance of the gradient question in fluid simulation?

The gradient question is crucial in fluid simulation because it helps determine the forces and motion of a fluid in a given environment. By understanding how fluid properties change over space, we can create more accurate simulations that can be used in various fields such as weather forecasting, aerodynamics, and oceanography.

4. Are there different types of gradient questions in fluid simulation?

Yes, there are several types of gradient questions used in fluid simulation, including the velocity gradient, temperature gradient, and pressure gradient. Each type focuses on a different property of the fluid and helps us understand how it will behave in different situations. Combining these gradients allows for a more comprehensive understanding of fluid dynamics.

5. How is the gradient question used in real-world applications?

The gradient question is used in various real-world applications, including weather prediction models, aircraft design, and ocean current simulations. Understanding how fluids behave and change over time is crucial in these fields, and the gradient question allows for accurate and efficient simulations that can aid in decision-making processes.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
452
Replies
0
Views
296
  • Advanced Physics Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
Replies
4
Views
1K
Replies
16
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
0
Views
651
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
979
Back
Top