My Sailing Story: Unity Game Development Part 1
I decided to develop my own yacht simulator and want to share my findings of sailing physics and its implementation using the Unity game development platform. Sources are available on my GitHub: https://github.com/vlytsus/unity-3d-boat
Though I read tons of blogs and books regarding ships & water physics there are almost no examples and explanations about sails & wind forces. So, I decided to do the research and post here the results.
Let’s review the most important forces and components that should be implemented to make yacht simulator more realistic:
- Apparent wind
- Wind lift & drag forces
- Water buoyancy force
- Hull viscous pressure resistance
- Hull friction resistance
- Keel lift & drag (resistance) forces
- Waves resistance
- Steering rudder lift & drag forces
- Hull air resistance
- Hull lateral resistance
Apparent wind
If you drive a cabrio you feel the wind blowing toward your face. That wind is caused by the car movement against still air. If there is side wind from the left, you’ll feel it like the front-left wind. Because two winds join and form a new wind vector. The same happens when the yacht goes fast. Two winds form a new wind velocity vector, called Apparent Wind.
It is very easy to calculate apparent wind vector in Unity because Vector3 class that you can use to represent wind and boat velocities supports vector operations.
Wind lift & drag forces
Any fluid or air that flows around a surface will produce two forces, lift and drag. The sail lift force is similar to the wing lift force and is always perpendicular to the wind direction. Lift is created by different pressures on opposite sides of a surface due to fluid flow past the object. Lift is always accompanied by a drag force, which is the component of the surface resistance force parallel to the wind/flow direction.
Lift & drag forces can be calculated using the famous Bernoulli equation, widely used in fluid mechanics.
Most parts of the equation are known from the simulator context. Sail area sailAreaM2 = sailWidth * sailHeight / 2 (because the sail has the shape of the right triangle). Velocity and apparent wind angle can be calculated from yacht and true wind speed & directions. The most important parts of equations, which we don’t know from the simulator context are drag and lift coefficients.
Lift & Drag Coefficients
Drag coefficient is used to quantify the resistance of an object in a fluid environment, such as air or water. Lift is a force generated by body and fluid or air (caused by different air density at up and bottom wing sides). That pushes the body perpendicularly up to the wind direction. Both coefficients are calculated experimentally for different object shapes https://en.wikipedia.org/wiki/Drag_coefficient. In the case of sails that coefficients are not constant and depend on the wind angle and sails shape.
Sail shape plays a very important role in ship maneuverability. Since ancient history ships used to have square sails. It was very difficult to sail into the wind. During the Renaissance in the 15th-16th centuries, the lateen sails were invented that allowed upwind sailing. Triangle lateen sails have a much better lift force effect. In the 17th century the Bermuda rig was invented, the basis for all modern sailing yachts.
The dominant factor that affects sail efficiency is the sail aspect ratio, . As the lift force is more effective than drag in contributing to the advancement of the ship, sailmakers trying to increase the lift. The aspect ratio is a proportion between sail width and height. A high aspect ratio indicates a long, narrow sail, whereas a low aspect ratio indicates a short, wide sail.
This plot shows relations between lift & drag coefficients for different sail aspect ratios and apparent wind angles. As you see for low aspect ratios maximum lift shifts further towards increased drag (rightwards in the diagram). Also, for lower angles of attack, a higher aspect ratio generates more lift and less drag than for lower aspect ratios.
All modern yacht sails have high aspect ratios AR~6 which produces the best lift force & very effective upwind sailing. However, for downwind sailing the special low aspect ratio (AR~1 to 2) sails are used (f.e. Spinnaker). Because they have a much better drag force coefficient which is a dominant force for downwind sailing.
In the next article, I will explain how I prepared the data to calculate lift & drag coefficients that are used to calculate yacht moving forces. Meantime you can check my Unity 3D project on the GitHub: https://github.com/vlytsus/unity-3d-boat
References:
To understand the basics about buoyancy force, fluid resistance, airlift, and drag forces I recommend reading the following articles:
- https://en.wikipedia.org/wiki/Forces_on_sails
- https://en.wikipedia.org/wiki/Ship_resistance_and_propulsion
- https://en.wikipedia.org/wiki/Skin_friction_drag
- https://en.wikipedia.org/wiki/Drag_(physics)
- https://en.wikipedia.org/wiki/Wave-making_resistance
- http://www.shipstructure.org/pdf/193.pdf
- https://www.usna.edu/NAOE/_files/documents/Courses/EN400/02.07%20Chapter%207.pdf
- http://grizzly.colorado.edu/~rmw/files/papers/PhysicsofSailing.pdf
- https://www.academia.edu/19483242/The_secret_of_sailing_Applied_Mathematics_Body_and_Soul_Vol_7
I thank Erik Nordeus and his Habrador blog that helped me a lot to understand the basics of the sailing simulator physics: https://www.habrador.com/tutorials/unity-boat-tutorial