# Viscosity and volume mixing in fluid dynamics

This topic is 1275 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've been working on a rather simple fluid dynamics implementation that I now wish to expand. I have my single-fluid vortices up and tracer particles following the velocity grid. However, I'm trying to figure out a way to create a mix of fluids that interact upon friction.

Since I'm not up to speed with the terminology, I'll just describe what I want in my own words: what I have in mind is a "non-particulate" (eg closed, fixed volume) flow map that always fills the entire region. Though it would be my next step, compressible fluids isn't something I outright need. So far as my knowledge goes, while the latter would be a solution, I'm not sure whether the answer in this case is somehow propagating the material type based on the density map or populating the entire chart with particles and making them all one unit in size.

Another thing I'm not entirely sure how to implement is shearing and fluid mixing based on viscosity differentials. Here's my test setup:

[attachment=22818:fluid dyanmics.jpg]

The screenshot is of a horizontally wrapping velocity grid where blue tones = left-moving and red tones = right-moving. Green = stationary. Color brightness denotes velocity, also shown by arrow lengths. The bright lines between the bands are the regions where flow directions cancel each other out, so shearing occurs as expected, but no mixing.

The reddish dots are tracer particles used to gauge flow.

Ideally I'd like to see adjacent bands start mixing at the boundary layer due to viscosity while none of the layers loses volume (eg the amount of material that each band comprises remains the same throughout the system). I suppose the closest example to this would be any horizontally closed system, such as a gas giant.

I'm looking for resources with less emphasis on the math and more on implementation (seeing as I'm not as mathematically well-endowed as I would like to be) - Googling has had me jump around from one place to another and it turns out finding good information isn't quite as straightforward as I would've hoped.

##### Share on other sites

The search term you need is multiphase and/or multicomponent flow. There is plenty of good information on this though you have to embrace the math, this is arguably the most challenging field of computational fluid dynamics. The maths is complicated, and the calculations involved are extremely intensive.

The simplest way I know of is to use SPH with van der waals forces hacked in. I say hacked, because strictly speaking this isn't the correct way, but its the easiest way to get a model that looks about right.

An added bonus is that most SPH implementations follow a weakly compressible assumption.

##### Share on other sites

Thanks! I think this got me started down the path I was looking for!

##### Share on other sites

Van der Vaal relies on a random facing real phenimena law. You realy should not relly on this in case of fast aproximantion. Though I have noidea what result you wish to simulate