This is a graphic that helps visualize Burger's vector in the context of periodic boundary conditions.
In 2D linear convection, we see the original function that we will then analyze.
In reference to the previous figure in 2D linear convection, we see our solution graphed as a surface.
CAD softwares used in industry have integrated tools for analysis, including thermal, loading, and fluid dynamics. Fusion 360 has effectively merged the strengths of many different softwares into a user-friendly environment for creating both functional and aesthetic models. This has quickly become a very powerful tool, and includes integrated tools for thermal and loading analysis, but not CFD. We'd like to change that, as it is consistently a battle of filetypes and compatibility to analyze one file in a different software.
What it does
Our MVP was a Python script that performs calculations to describe a velocity gradient in a 2D non-linear flow. For simplicity, our intention was to take input data from a simple pipe in Fusion and utilize this data to create a structured, uniform, grid-type mesh that discretizes the calculation. The calculations are based on Navier-Stokes Equations, which are derived from the principles of conservation of mass, momentum, and energy. These equations can be used to describe the velocity, pressure, temperature, and density of a fluid in motion. For our purposes, we made a few assumptions to simplify, including: laminar, single-phase, incompressible flow, constant density, and constant viscosity. Our goal was the end product of a velocity gradient plotted along the axis of the pipe.
Assuming that a geometry within Fusion is already created, we use the built-in API to prompt the user to select a circular edge, define initial velocity and the fluid. We use this input to calculate the force due to kinematic viscosity within the pipe.
Related, we utilized an online tutorial to write Python scripts that describe convection and diffusion in both 1D and 2D, linear and non-linear flows. In these scripts, we discretize a defined space and use backward, forward, and central differencing to approximate velocity of an element based off its nearest neighbors.We then plot this solution array in a 2D or 3D space for visualization. The script can be used to demonstrate how the calculated solution changes as the number of elements change. This is relevant to our goal as we learned to discretize a complex non-linear partial differential equation. It is accepted in literature that an analytical solution to the Navier Stokes equations is impossible, therefore the calculations for computational fluid dynamics are based off of a mesh or grid discretization. Demonstrating fluency in mesh generation will be critical to future iterations of the project.
How we built it
Utilizing the Fusion 360 API, we created a pipe with a Python script from which to pull geometric data. In order to use this data in our calculations, we needed to understand the API object tree, utilizing many of their built-in libraries and functions. The scripts that describe convection and diffusion were created using Anaconda, referencing numpy, sympy, scipy, matplotlib, and mpl_toolkits.mplot3d. The tutorial we used is called "CFD Python: 12 Steps to Navier-Stokes" written by Professor Lorena Barba at Boston University for use in her classroom (http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-stokes/).
Challenges we ran into
TLDR: Navier-Stokes equations are hard. Meshes are hard. Math is hard. Coding is hard. Learning a new API is hard. CAD is hard. We have much to learn. We learned much.
Accomplishments that we're proud of
- leveraged python scripts to create surface plots of
- used Fusion 360 API to request user input, then use user input to perform calculation
- team synergy--we all learned new things and achieved personal goals for hackathon
- SO. MUCH. LEARNING.
What we learned
- how to use an API
- how to visualize CFD using Python
- how to write add-ins for a software
- learned a lot about Python, making graphs
- what is CFD?
- fluid dynamics, physics of fluids
- what are derivatives
- learned about how to create a simple grid mesh and iterate a calculation through each element
- setting up a python IDE on a computer
- create a geometry in Fusion with code!
What's next for CFDpyFusion
Better integration between Fusion and Python; compute more complex analyses via the creation and refinement of mesh elements.