# Fluid Dynamics, Stream function in polars

I'm just running through a fluids dynamics course and I could use some verification that I'm on the right course (in terms of direction of understanding)

I've been given the following question

Let $$\vec{u} = U \cos{\theta}\vec{\hat{r}} - U \sin{\theta}\vec{\hat{\theta}}$$

compute $$\vec{\nabla} \cdot \vec{u}$$ find the streamfunction and identify what this flow represents.

so first I start with $$u_r = U \cos \theta~\&~ u_{\theta} = -Usin \theta$$ then $$\vec{\nabla} \cdot \vec{u} = \frac{1}{r}\frac{\partial (ru_r)}{\partial r}+\frac{1}{r}\frac{\partial u_{\theta}}{\partial \theta}$$ $$=\frac{1}{r}\frac{\partial}{\partial r}(Ur \cos \theta)+\frac{1}{r}\frac{\partial }{\partial \theta}(-Usin\theta)$$ $$=0$$ so our flow is incompressible

To find the stream function I equate $$u_r = \frac{1}{r}\frac{\partial \psi}{\partial \theta} ~\&~ u_{\theta} = -\frac{\partial \psi}{\partial r}$$ giving $$\psi = ru \int \cos \theta~d\theta$$ $$\psi = u\sin\theta \int~dr$$ this gives $$\psi = ru\sin\theta + f(r)$$ $$\psi = ru \sin\theta + g(\theta)$$

from here i'm a little confused, if I equate these two then I get a combination of two polynomials so what do these actually represent?

any help would be greatly appreciated.

The stream function exists for a two-dimensional incompressible flow and is unique up to a constant that can be set arbitrarily to $$0$$. Since the velocity components depend on partial derivatives of the stream function and the volumetric flow rate is the difference in stream function values at two points, the constant is irrelevant.

As you have done, starting with

$$- \frac{\partial \psi}{\partial r} = u_\theta = -U \sin \theta,$$

and integrating, we get

$$\psi = Ur \sin \theta + g(\theta)$$

Upon differentiating with respect to $$\theta$$ we find

$$U \cos\theta = \frac{1}{r}\frac{\partial\psi}{\partial \theta} = \frac{1}{r}\frac{\partial}{\partial \theta}\left(Ur \sin \theta + g(\theta) \right) = U \cos \theta + \frac{g'(\theta)}{r}$$

Thus, $$g'(\theta) = 0$$, which implies that $$g(\theta) = C$$ -- a constant that can be arbitrarily set to $$0$$ as discussed above. In this way we obtain $$\psi(r,\theta) = U r \sin \theta$$.