Hydrodynamics, Liquid Crystals, and VFX
So....While researching quantum physics and NASA's current ongoing studies I stumbled across something called hydrodynamic simulations and I was transfixed. So I wanted to talk about them a bit, because I think now is the moment to stop watching resin pours, and start understanding how they work.
What is a Hydrodynamic Simulation?
If you've ever made a resin pour, or your own homemade soap, you probably already have some basic knowledge of a hydrodynamic simulation without even knowing it.
Hydrodynamics is a branch of physics that deals with the motion of fluids and the forces and motions acting on solid bodies immersed in fluids. However, this field can also be extended to the dynamics of many condensed systems including liquid crystals, super-fluid liquids, crystals, magnetic systems etc. It is also a hugely used application of many scientific studies. Such as hydraulic and aeronautical engineering, chemical engineering, meteorology, and zoology.
The most basic fluid that this study covers is water. As this is the most common fluid found across the globe. In hydrodynamics, scientists can study how water travels through tubes, pipes, how it reacts under pressure, how ships travel through water, etc. The same goes for pretty much any other fluid. Hydrodynamics is also based around the idea that in a condensed system; for example two liquids mixed together or under pressure, that certain processes should happen. There should be a small number of long living processes taking place as these two liquids mix, and a large number of smaller and faster processes. You can think of these "processes" as interacting currents between the two fluids, or changes between them on a macroscopic level.
There is one majorly important law in hydrodynamics, and that is Bernoulli’s law.
Bernoulli’s Law states that an increase in the speed of a fluid occurs simultaneously with a decrease in static pressure or a decrease in the fluid's potential energy. Basically, any fluid that is in a steady motion can be covered by Bernoulli’s Law.
- It is important to note that in hydrodynamics this law is referenced in some different terminology. Scientists often talk about flow patterns in fluids and their corresponding "streamlines". Any flow pattern that is steady, may be seen in terms of a set of streamlines. These streamlines are trajectories of imaginary particles suspended in the fluid and carried along with it. In steady flow, the fluid is in motion but the streamlines are fixed. If the flow is uneven or the velocity is high, these lines crowd together. In a Houdini/VFX sense, you can think of these streamlines as markers that show an attribute of motion for the liquid.
Weirdly, when scientists are calculating the flow of a liquid, they rarely take into consideration the viscosity of the fluids. This is because the founding fathers of fluid dynamics Euler and Bernoulli treated all fluids as an ideal in-viscid substances. (Substances that have no or negligible viscosity.) They calculated fluids at their resting point (equilibrium), and therefore the shear stresses associated with their viscosity were zero, and their pressure was isotropic. (A physical property which has the same value when measured in different directions.)
Scientists also use Bernoulli’s law to establish a formula for the speed at which disturbances travel over the surface of shallow water. Bernoulli’s law is great at explaining water based dynamics, and water waves. It can also be used to explain the dynamics of gaseous flows. Or just gases in general.
Let's talk briefly about gases......
When studying gases, it is important to understand their compressible flow, or the way they act under pressure. Most gases act and behave like fluids at certain temperatures or rates. This is why they are a key staple in hydrodynamics.
Compressible flow refers to flow at velocities that are comparable to, or exceed, the speed of sound. This sounds like something pretty weird to gauge a gas's movement at, but in reality it is pretty common for gases to move fast. If you look up at the sky on a windy day, you might see clouds rapidly flowing through the air. Or if a fighter jet goes through the air, you might see an air pocket form on the wings of the plane. Or perhaps hear a sonic boom. These movements are formed by gases traveling through our atmosphere. Sometimes they oscillate to create sound waves, other times they are heated or cooled into a liquid like state. They really can do anything.
What are Liquid Crystals?
Liquid crystals are described as a state of matter that is a mix between a liquid and crystalline solid state. Liquids can flow, for example, while solids cannot, and crystalline solids possess special symmetry properties that liquids lack. Ordinary solids melt into ordinary liquids as the temperature increases, but some solids like crystalline solids, actually melt twice as fast. Liquid crystals share with liquids the ability to flow but also display symmetries inherited from crystalline solids. This means they have the ability to act like a liquid while still refracting light like a crystal. Liquid crystals are used in displays of wristwatches, calculators, portable computers, and flat-screen televisions.
Regular crystal molecules exhibit special symmetries when they move in certain directions or rotate through certain angles. These symmetries can be compared to those encountered when walking in a straight line through empty space. They can be viewed from any angle and still look the same in any direction. This is called Continuous Translational Symmetry because all positions look identical. Liquid crystal lattices break the continuous translational symmetry of free space. Some translational symmetry is present in these crystal lattices. However, while these lattices are moving the proper distance in the proper direction, their molecules are not ordered correctly and their structure is a bit uneven. This property is called Discrete Translational Periodicity. The two-dimensional picture of a crystal displays translational periodicity in two independent directions. Real, three-dimensional crystals display translational periodicity in three independent directions.
Liquid crystal molecules can also be shaped differently, and less symmetric than regular crystals. This can change a crystal's discrete set of angles. A crystal possesses a certain discrete set of angles of rotation that leave the appearance unchanged. However, when the Continuous Rotational Symmetry of empty space is broken, only a discrete symmetry will exist. Broken Rotational Symmetry is an important property of crystals. Crystals also have a resistance to compression, and transparent crystals, such as quartz, may exhibit an optical property known as Birefringence. This means a material (Crystal) can have a refractive index that depends on the polarization and propagation direction of light passing through it. This is why one sees a double image when looking through crystals. The light is being split into different streams.
There are two ways to describe a crystal's symmetry. Isotropic and nematic.
Isotropic liquid: Describes a full continuous translational and rotational symmetry.
Nematic: Describes a molecular orientation that breaks it's rotational symmetry.
Liquid crystals are sometimes called mesophases. As they occupy the middle ground between crystalline solids and ordinary liquids with regard to symmetry, energy, and properties. The most widely studied liquid-crystal-forming molecules are elongated, rod-like molecules, rather like grains of rice in shape.
Electrohydrodynamics and Crystal Thermography
In order to talk about hydrodynamic and it's interaction with liquid crystals, we need to peer down an interesting rabbit hole. Often hydrodynamics is paired with electromagnetic experiments. This is because fluids and crystals can react differently to electromagnetic currents.
Electrohydrodynamics is also known as electro-fluid-dynamics (EFD) or electrokinetics. It is the study of the dynamics of electrically charged fluids.
Liquid Crystal Thermography(LCT) correlates the color response of a heat surface treated with Thermochromic Liquid Crystal (TLC) to temperature. An example of this process in action is a mood ring. The colder it it, the darker the color, the warmer the ring, the more red and vibrant it will be.
Thermochromic Liquid Crystals (TLC) are materials that change their reflected color as a function of temperature when
illuminated by white light. (AKA regular light)
A unique feature of nematic liquid crystals is orientational order of molecules that can be controlled by electromagnetic fields, surface modifications and pressure gradients. Liquid crystals can also be altered by thermal expansion. It won't change the overall structure of the atoms and molecules of the crystals, instead it will cause the nematic liquid to flow and change it's optical axis. Thermal changes to a liquid crystal can also cause the liquid to change it's volume. All of these changes can be viewed under 3D optical microscopy.
Experiments with liquid crystals and electrohydrodynamics has been seen all the way back since 1971. In the early days those experiments were able to prove that crystalline liquids change their momentum based on interaction with electrodynamic fields.
Traditional Visualization Methods, and Developments
Yaaaaa! Most of our theory is done. However, we still need to talk about how hydrodynamics is visualized and how scientists are using it as a tool to demonstrate visual systems. So let's talk about how traditionally one would go about creating a hydrodynamic system. As well as combining the study with liquid crystals.
As we've mentioned up above, the easiest way to observe a fluid is when it is in a resting state. Or through seeing how it can interact with stationary solids. However, sometime you need a particular set of environments to answer questions of how fluids, crystals, or gases might behave.
Two popular systems that scientists use rotate around the use of hydraulic systems. They mainly use them to monitor the flow of liquids though pipes are based on Bernoulli’s law. One is the Venturi Tube. This tube is used to conduct processes where scientist have to use a constant amount of pressure over a certain fluid. This tube system contains a huge amount of accuracy for calculating forms of highly viscous liquids.
Another system that is used is called a Pitot Tube. This device is a flow measurement tool used to measure fluid flow velocity. The basic pitot tube consists of a tube pointing directly into the fluid flow. As this tube contains fluid, the pressure can be measured, and the moving fluid is brought to rest.
Now onto liquid crystal dynamics! The simplest state to observe thermo-optical effects in liquid crystals is to use nematic liquid crystals (NLC), or thermochromic liquid crystals. Then by placing them in the apparatuses described above, they become easier to experiment with.
Liquid crystals also alter the polarization of light passing through them. Therefore, light experiments are key to understanding the true nature of these fluids. Light waves are actually waves in electric and magnetic fields. The direction of the electric field is the polarization of the light wave. Scientists can use polarizing filters to edit the fields of the light waves, and customize the direction, waves, and order of the light passing through the NLC.
Sometimes making a practical simulation of a fluid system can be a bit too complex to carry out. This can be due to a lot of outlying factors. Sometime it might be too hard to simulate a full scale ocean in the lab, or a university may not have access to certain tools, etc. Because of these factors, hydrodynamics has started to move into the 3D world. Let's explore some of the simulations...
The first type of simulations we'll talk about will be Hydrodynamic Models. Hydrodynamic and morphological models are the backbone of water-quality models. Hydrodynamic models are valuable tools for predicting the evolution of lake thermal structure and analyzing water motions beneath a lake's surface. However, their accuracy and believability depends on model selection, setup, validation, and analysis.
By using 3D hydrodynamic models, we can also link them to ecosystem models. This can help us better understand our waterways, shorelines, and how our lakes and oceans interact with our world. However, 3D ecosystem models are very demanding computationally. They use the Monte Carlo methods to determine probability density distributions of predictions. These can sometimes be infinite.
Before we jump into a popular tool that is being used to simulate ocean currents, let's talk about Smoothed-Particle Hydrodynamics (SPH).
Smoothed-particle hydrodynamics (SPH) is a computational method used for simulating the mechanics of constant and equilibrium based media, such as solid mechanics and fluid flows. It was first developed in 1977 for astrophysical visualization. But it is being used in many other different field such as astrophysics, ballistics, volcanology, and oceanography.
Smoothed-particle hydrodynamics is being increasingly used to model fluid motion as well. SPH computes pressure from weighted contributions of neighboring particles rather than by solving linear systems of equations. SPH also creates a free surface for two-phase interacting fluids. It can also be simulated in real-time. SPH techniques still require the generation of renderable surface geometry using a polygonization techniques, so no matter how real-time the render, it might be held back on the output of it's own geometry. SPH can also be used for simulating gases. It uses a kernel function produce a rendering of gas column density, and it's corresponding movements.
Now onto VFX and simulation software!
WaveDyn was the first fully coupled simulation tool designed for wave energy. It allows you to simulate the performance and loading on a wave energy device. It enables you to model hydrodynamics calculations and control and power take-off systems. It also is considered a multi-body software tool. It can simulate hydrodynamics, diffraction, radiation, and nonlinear hydrostatics, and processing of flow solver data. This software is used by a lot of simulation companies and researchers regarding the various topics in hydrodynamics.
How Can We Use This in VFX?
Well....hydrodynamics is an interesting question in VFX. We should, can, and will be able to simulate a lot of things from this topic. Let's first talk about underlying systems that are in place for us to use right now.
Inside of Houdini we have our good old FLIP and ocean body systems. But how exactly do they work?
Fluid simulation is one of the most researched subjects in computer graphics. Thankfully the wonderful team at SIdeFX has done their research and based the entire system of both gases, smoke, fire, and liquids off of actual formulas from fluid theories.
The FLIP solver is a type of hybrid between a particle based and volume based fluid simulation. So you can think of it as a similar system to the WaveDyn mentioned above. It's velocity transfers easily handle and implement Splashy Kernel and a Swirly Kernel functions. As well as Vorticity Scale functions, and rest attributes. Or an equilibrium as you will.
Houdini's ocean system is quite advanced as well. Some functions of it act exactly as our SPH mentioned above, as well as generating layers of FLIP particles on the ocean surface. Or filling a whole tank with FLIP Particles. The fluid simulation gear of Houdini is quite extensive. As you can already see, implementing the functions of hydrodynamics is very easy, and probably will be implemented further.
One interesting grad student has started to push Houdini a bit further. He has started to create his own fluid solvers to better calculate velocity fields and the Navier-Stokes equation while handling fluids. Sydney Dimitra Kyrtsia from the University of Bournemouth has created something rather beautiful. He implemented a FLIP solver in Houdini using the basic nodes to solve the Navier-Stokes equation and produce realistic looking water waves that collide with different objects or fall from a certain height. Using his own methods he was able to solve the incompressibility of a fluid in 3D space, and preserve the mass of the fluid as the divergence of the velocity field equals to zero. You can read his full thesis HERE.
The National Center for Computer Animation (NCCA) has also been pushing boundaries with fluid solvers as well. They have build their base as a "World-class computer animation teaching with wide scientific and creative applications". In their Master Degree Show from 2011, they were able to display numerous functions of editing liquid dynamics. You can see their showcase HERE.
Hydrodynamics and Electrohydrodynamics of Liquid Crystals: https://www2.mpip-mainz.mpg.de/~pleiner/papers/mbuch.pdf
RECENT DEVELOPMENTS OF ANALYSIS FOR HYDRODYNAMIC FLOW OF NEMATIC LIQUID CRYSTALS: https://arxiv.org/pdf/1408.4138.pdf
Dynamics of a simple model micro swimmer in an anisotropic fluid: implications for alignment behavior and active transport in a nematic liquid crystals: https://arxiv.org/pdf/1809.01531.pdf
Recent developments of analysis for hydrodynamic flow of nematic liquid crystals: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4223669/
Molecular reorientation of a nematic liquid crystal by thermal expansion: https://www.nature.com/articles/ncomms2073
Hydrodynamics of Polar Liquid Crystals : https://surface.syr.edu/cgi/viewcontent.cgi?article=1086&context=phy
Bioinspired underwater locomotion of light-driven liquid crystal gels: https://www.pnas.org/content/117/10/5125
LIQUID CRYSTAL HYDRODYNAMICS: https://www.doostmohammadilab.com/liquid-crystal-hydrodynamics
Nonlinear reversible hydrodynamics of liquid crystals and crystals: https://hal.archives-ouvertes.fr/jpa-00209279/document
Electromagnetic Hydrodynamics of Liquid Crystals: https://journals.aps.org/pra/abstract/10.1103/PhysRevA.6.414
Liquid Crystal Visualization of Surface Heat Transfer on a Concavely Curved Turbulent Boundary Layer : https://asmedigitalcollection.asme.org/gasturbinespower/article-abstract/106/3/619/407126/Liquid-Crystal-Visualization-of-Surface-Heat?redirectedFrom=fulltext
Hydrodynamic Simulations using GPGPU Architectures: https://arxiv.org/abs/1907.07137#:~:text=Smoothed%20particle%20hydrodynamics%20(SPH)%20is,structures%20and%20highly%20deformable%20bodies.
Fluid Solver built in Houdini: https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc17/03/thesis.pdf
Surface Turbulence for Particle-Based Liquid Simulations: http://www.cim.mcgill.ca/~derek/files/surfaceWaves.pdf
Introduction to Liquid Crystal Thermography: https://www.ewh.ieee.org/soc/cpmt/presentations/cpmt0201b.pdf