Have a Question ?
Ask about our products, services, or latest research. Let's discuss how we can help you solve your problem.
Tuesday, May 22, 2018
Building a Machine Learning Valve Design App
Sandip Jadhav
Machine learning (ML) techniques are now widely being used in almost all areas of application. Six months back, CCTech Research started investigating how we may use ML in the area of Design of Mechanical Systems. One of the key application we were particularly interested is in Control Valve industry. Control Valve Performer - a cloud app developed by our simulationHub team is already helping valve manufacturers get quick results. Given a 3D model, our app provides the flow performance parameters such as flow coefficient CV, Coefficient of Hydrodynamic Torque Cdt in less than an hour. Although this is a drastic time saving over traditional CFD (which could take a week) and experimental techniques (a month), one still yearns for a solution that could predict the flow performance in less than 5 seconds. Once this kind of solution becomes available to the designer, he will do away with excel sheet formula based design basis calculation.
Setting the goal
We decided that the first version of our app will have limited scope, supporting only one most used control valve i.e. Symmetric Butterfly Valve. Objective of the app was defined as : given the design parameters for the disc of the valve, our application should instinctively be able to predict flow coefficient CV and Coefficient of Hydrodynamic Torque Cdt with a high level of accuracy (less than 5% error as that of CFD). We also wanted the app to accurately answer whether new output disc-shaft parametric design can withstand pressure forces i.e. predict Factor of Safety FoS from structural point of view. The second major feature we wanted was if user changes the flow performance curve then our app should be able to answer inverse query i.e. to predict design parameters. This inverse problem is much more difficult for design engineers in practice as all CFD tools are able to give Design CV and but not CV Design. One of the fundamental reasons for the inverse problem to be complex is that there can be many possible viable solutions. So, designer has no choice but to try out/experiment with several designs to achieve the desired flow performance.
Did we succeed in our objective?
Yes, we did it and with overwhelmingly fast, accurate solution!! We ourselves had few doubts about whether this exercise would work as it involves building a prediction model of the underlying physics. Design => CV prediction is a complex problem, as in this case underlying physics is fluid dynamics and structural mechanics. On this dichotomy, I had even written my musings on the use of ML as a tool for predicting physics in my last blog.
Valve design by ML app interface
The app interface consists of a simple, single interactive HTML page. On the left side are the design parameters for the valve disc and on the right side is the performance prediction. A user can edit the parameters in the left or the right tile anytime.
The app is a web app developed using Semantic UI components and powered by Amazon Web Services (AWS). The left side of app interface consists of valve disc parameters and right side provides valve performance curves.
valve performance prediction by machine learning
When the user modifies any of the design parameters in the left tile, then immediately he is provided the option to "Predict performance" for the updated design. In less than 5 seconds the app draws the new flow coefficient CV curves and Factor of Safety(FoS) values.
In Predict Performance mode, valve performance parameters are calculated based on valve disc geometry parameters. The valve performance is calculated using machine learning algorithm in less than 5 seconds.
generate valve by machine learning
If user want to solve the inverse problem, he can edit the CV curves by clicking and dragging a control points in the right tile and then he gets an option called “Generate Design” which immediately provides the new design parameters such as disc thickness, shaft diameter, various fillet radius.
valve design generated by machine learning
The predicted new design typically provides the closest possible CV value as shown by a red curve. Application also generates new 3D model in top left corner for your immediate investigation.
Generating the design based on required valve performance is a very challenging reverse problem to be solved. A user can provide the desired valve performance and Generate Design will predict the design parameters of the valve disc.
What went in to create the app?
Initially we created a parametric model of a Symmetric Butterfly Valve with key disc parameters. For machine learning one need the response data, in our case it was flow physics outcome based on design parameters. We required CV, Cdt and FoS data for every possible design parameter combination. Doing physical experiment for all these combinations of design was not practical for us, CFD simulation was the only choice. Therefore for CFD simulations we decided to use our simulationHub web services (SWS) platform, which is a set of REST callable micro web services that allow developers to run the complete CFD workflow from a simple Javascript & HTML app.
butterfly valve disc design parameters
By CAD scripting, 3D models of permutations of all design parameters for various angles of opening are generated. This created configurations of around 960 unique CFD simulations. Traditional CFD with office workstations would have taken months to complete those many CFD runs. Thanks to SWS which is powered by AWS compute servers, it just took few hours to complete all the 960 simulations and reporting back all the CV and Cdt .
For machine learning, disc parameters were defined as variables and performance parameters as a target. Traditional CFD and experimentation were estimated for months to complete for 960 unique design combinations. With simulationHub Web Services and AWS compute power, the calculations were completed in few hours.
valve safety factor
error between actual and prediction ml
Once we had all the data, the actual machine learning process started. We used TensorFlow from google to build our ML model. We used deep neural network algorithms in TensorFlow. It took some tweaking to figure out the final settings for our machine learning configuration.
We trained the model till we achieved the desired accuracy. Once we had validated our machine learned model, we decided to deploy the final model on AWS Lambda, serverless compute so that we can invoke them anytime from our ML WebApp
The deep neural network algorithms in TensorFlow is used to train the machine. The model loss was reduced with some manual tweaking and deployed on AWS Lambda, serverless compute so that we can invoke them anytime from our ML WebApp.
valve parmeter and 3d geometry download
We used Autodesk Forge web services to provide instant 3D visualization for modified design parameters. Forge services are also used to export STEP file of 3D model. The app exports all flow coefficients in an excel file for further investigation.
3D CAD model can be downloaded. Autodesk Forge Platform's model derivative and viewer APIs were used for providing instant visualization of valve model and export STEP file of a 3D model.
Our learnings
The very first thought we get from AI or ML is to start expecting human brain like capabilities. Rather it is a way of programming, you still need software developers and, even more important, you need persons with substantial expertise in machine learning and domain. As TechCrunch article rightly says : Despite evocative names like “artificial intelligence,” “machine learning” and “neural networks,” such technologies have little to do with human thought or intelligence. Rather, they are alternative ways of programming computers, using vast amounts of data to train computers to perform a task.
The "alternative ways" is the interesting aspect of ML which makes it an attractive technological proposition to be used in many similar applications. Machine learning's uncanny ability to figure out the relationship between the large amount of data and user parameters makes it a very special tool.
Do you want to try out this app?
We have now started working on adding more parameters, more types of butterfly valves such as double and triple offset valves. Since it is still under development, we are providing limited access of our app to a selected few. If you are keen upon trying this app and from the valve industry, please post an access request in the comment section.
About author
Sandip Jadhav
Sandip is a successful serial entrepreneur in CAx space. He co-founded CCTech, LearnCAx, Zeus Numerix, and Adaptive 3D Technologies in the span of last twelve years. Sandip has more than 15 years of product development experience, in the field of CAD, CAM and CFD. He has done major contribution in conceptualizing, designing, and developing 3D CAD application, faceted geometry kernel, faceted Boolean, mesh generation software with automatic fluid volume extraction for dirty CAD assemblies.