Ball valve flow in solidworks
Hello readers,
Recently I have been assigned a task of simulating the ball valve flow. Fortunately, I could find plenty of instructions and tutorials to simulate such a flow in Solidworks and I have managed to work them out after working hard on it for a few days. I, however have one question in mind. The tutorials deal with flow at a particular angle of the valve position. My task has been to calculate the amount of water (masskg) coming out of the outflow when the valve moves from fully closed to fully open position. Is such an option of flow simulation available in solidworks? If so, please shed me some light on it. If not, is there any way to approach the results that I desire? Thanks in advance. Nikesh. 
Hi Nikesh,
are you trying to model the actual transient opening of the valve or do you mean to do various angles all steady state? If you consider transient then this is not porrible at the moment, also it is of course heavily dependent on how fast you open the valve. However, there is the possibility to do several angles in a step wise approach in fine steps and then when you know how fast you turn from 0° to 90° you can estimate it by using the single mass flow rates for each angle and integrate over time. So basically if you say you open the valve in 9 seconds then the rotational speed of the valve is 10°/second and with a coarse angle step as an example 10° steps you can create a curve from 0° to 90° where the xaxis is the time and the yaxis is the mass flow rate (kg/s). The whole curve of course starts at 0 kg/s for 0° as the valve is closed and then x kg/s for 10° angle at 1 second and y kg/s for 20° at 2 seconds etc. If you then use the fitting curve in Excel you get a polynomial curve that describes roughly the behavior of that opening of the valve and if you integrate that polynomial function over the time from 0s to 9s you should get an estimate of it. Of course in this case you are not considering the transient effects that might influence the flow but it should give you an idea already. It would be interesting to compare it with measurements. Of course the steps should be smaller but with the parametric study capability you can set this up in no time and let it run over the weekend or night. I would be interested in the accuracy of this method in case you have any comparison with measurements later. The deviation should be mostly because of the transient effects of the flow when opening but what you would be doing is basically a little more rough iteration of the real transient opening of the valve. I hope this helps, Boris 
Hi Boris,
Thank you very much for your reply. That is exactly what I had in mind and that is how I have been proceeding so far. I was a bit unsure if this process would be reasonable since I don't have people around me in the company with whom I can share the idea and discuss about its realizability, but after hearing from you it's giving me more confidence in this approach. So I'm gonna continue working on it. At the moment I am taking coarse angle setup9deg per casesince my valve fully opens itself from a fully closed position in 10 sec. However, the main objective of this project does not end there for me. This valve can operate at varying speed so obviously my steady state turbulent flow simulation will not be able to calculate flow rate for all the timecases. However, the good news (as I think it is) is that I won't need to simulate for all those cases but simply depend on interpolation method but obviously I would want to take very fine angle interval, 1deg case per simulation is what I have in mind. I would like to hear your expert opinion on this. I have managed to run a couple of cases so far and I now need to extract the results from them. I am struggling a bit with this again as I am new to solidworks flow simulation. I would really appreciate it if you gave me some heads up in this. 1. I would like to compare the streamwise velocity profile at a certain crosssection normal to a certain point in that crosssection (for grid test cases). I can't really figure out a way to do so. Or you could give me some other ideas for the grid test if you can think of any. 2. How can I extract and calculate the mass flow rate through the inlet and outlet regions, or say any crosssectional region in the computational domain (the pipe)? I still have few more doubts in mind but I don't want to scribble them all here at the same place. First thing's first, and after sorting this out I'll get back to you. And yes in a month or so we are expected to get the experimental results as well. I would be more than happy to share it with you. But for now, I really need your opinion. I hope to hear from you soon. Thank you! Nikesh 
1 Attachment(s)
After playing around for a bit, I managed to obtain the mass flowrate at the inlet and outlet crosssections by using the Surface Parameters option. Now here's another problem that I just noticed. For these two different cases  81 deg and 72 deg, it shows different values of crosssectional area at both the inlet and outlet sections. Shouldn't they be the same? Also that the Mass flow rate for both these cases should be the same at inlet position, right? After looking around I again noticed that there is a small gap between the fluid region and the pipe. I don't understand why this appears here. Let me post a pic as well.

Hi Nikesh,
I think in order to see if 1° steps are necessary you could also do a study on the convergence of your results but I guess that 23° should be fine enough. Such a calculation for a valve like the one in your image should be very fast in order to test it. 1. This is very easy, you can create reference planes in SW at any point you are interested and then apply a cut plot onto that plane so you get the exact location. You can then still set an offset of the cut plot to that reference plane. The velocity and pressure contours are one thing to check for grid convergence but you should deactivate the interpolation in the plot to the the real values as the interpolation is smoothening them and can be misleading. But most important are values such as the mass flow rate (if not defined as a boundary condition, as it won't change then) or the pressure drop. I think the pressure drop shows the convergence the best way.You can set a manual mesh level but you can also use the adaptive mesh refinement which will be based on the gradients in the flow during the solver run and refine those regions more. A good way to do mesh studies is with the parametric study. Here you can select also mesh settings and change for example the level in order to study the influence or the number of cells of the narrow gap refinement. The whole evaluation can be done with the compare configuration. You can create automatic comparison of plots or goal values. 2. This is what I meant with goal values. You should use goals for the parameters that are important for you. Use mass flow rate in cases you haven't defined them as an inlet or outlet boundary condition. If you have defined it this way they will not be any different than the defined values as the mass balance is controlled during the solver run so if you define 5 kg/s then you will aslo get 5kg/s so it would be useless to look after that but you can still check if that is correct. If you use a surface goal on the inlet and outlet lid you can select mass flow rate as a parameter as well as total pressure, velocity or in case the fluid temperature is changing de to some thermal influence from a heat source you can also select that parameter or many more. You can basically select goals on all surfaces you like, it can be the forces on the ball of your valve or the pressure on the walls of the valve etc. Simply select surface goal if you want to know a parameter of a surface or volume goal for any parameters inside a volume. You can also define equation goals to directly calculate the pressure loss (total pressure inlet  total pressure outlet) and this way you can directly compare different mesh settings with that pressure los parameter in the compare configuration tool. About your image. The image is taken in the solver monitor preview mode, it is hard to tell what it is and it depends on the setup of your project or model. Since you are new to SWFS it might be a user mistake in the definition of the simulation but it might also be a graphical error. For an internal flow calculation such as a valve, make sure the simulation is set as internal analysis and only use the pipe with valve and the two lids on inlet and outlet.The recognized fluid volume should then be only inside the pipe. Also you will most likely not need any heat conduction, so just fluid flow. The image really looks weird but it is hard to tell from a 2D plot without any geometry to see what this might be. You are showing the pressure in this plot and it seems there is some fluid in the same shape of the pipe around of your geometry but as I said I cannot really tell without the model in any way. Yes, the cross sectional area should be the same if the mesh doesn't change. The surface area value listed in the surface parameter feature at the end of the line of the parameter you are looking at is the aproximated area of the mesh. The mesh is always an approximation of the original CAD area and depending on the mesh resolution that area can be closer or further away from the actual value of the CAD surface. The other parameter named "Aera (Fluid)" and "Area (Solid)" give the exact CAD surface value, the latter one is only available if you consider heat conduction as the solid is then taken into account in the similation also. I hope this helps, Boris 
5 Attachment(s)
Hi Boris,
Thanks again. I got your idea on points on 1 and 2. But before I move any further with the simulation, I would like to confirm if there's anything wrong with my model or the boundary conditions or other setups that I've used. I have attached the pics with the 3D model. Fig1 is my 3D model of the pipe and valve assembled together. The rectangular crosssectional region shows the Computational domain. Inlet being on the opening of the shorter side of the pipe where I have used uniform velocity Vx=12.82 m/s as the boundary condition with Vy and Vz = 0. Outlet is on the far downstream opening with Static pressure BC, P=101325 Pa and T=293.2K left as they are by default. I am only dealing with fluid flow without the Heat and roughness effects. And yes, I have used the internal flow simulation. Now, the tutorial that I am referring to does not talk about assigning the boundary conditions on the wall so I have only assigned these two BCs for the simulation. Should that be alright? Fig2 is the zoomedin inlet section with the lid I generated using "Create lids" option which is highlighted in blue. This is where I see the problem. We can see various circles there. I'm not able to understand why do i get those there? Because the way i created the pipe is as shown in Fig3. There are just two linesinner and outer diameter of the pipe, which were then revolved to generate the pipe using "Revolved Boss/Base" option in Features list. Could it be the problem because I've made it transparent even during the simulation? Why I think so is because I don't see those other circles when I change transparency of the pipe as can be seen in Fig4. While I wait for your reply, I'm gonna try simulating by removing the transparency to see if I can get anything different. One last question, is it alright that the lid I generated for inlet and outlet has slightly larger diameter than the inner diameter of the pipe? Fig5 suggests so! The face highlighted in orange is the thickness of the pipe. The lid diameter goes slightly beyond the inner diameter of the pipe. Also take a look at Fig6 & 7, these are the figures at the inlet region of the pipe. Highlighted in blue is the inlet lid. The green contour on either side of the pipe's inner diameter shows that there is fluid in that region too which is a little absurd. Although I believe it has not affected the flow inside the pipe, I am wondering why is it even there? Is this how SW works? Or is there any problem with my model generation? I would really appreciate it if you lent me some of your expert opinion on this. Thank you once again Boris for your time and consideration. Nikesh. 
Figs 6&7
2 Attachment(s)
Here are Figs 6&7.

Dear Boris,
I'm sorry again. I managed to figure out the problem associated with my 3D model as in Fig1,2,3,6&7. I had to remove the thickness option while utilizing the "Revolved Boss/Base" tool. With this done, I also managed to solve few of my other geometry related problems too. I, however need your opinion on the BCs that I have used. And also it would be of great help if you cleared my doubt on the inlet and outlet lids that I had previously posted. Thank you once more! Nikesh. 
Hi Nikesh,
Yes, from your fourth image I could see that you used the thickness option. Unfortunately I am travelling and don't have much time to answer. No, it is normal that the lids are creatednwith a small overlap into the geometry. Your boundary conditions are not optimal. Usually for valves one uses mostly either pressure or mass or volume flow rate as inlet conditions. That depends on what you are trying to define. If it is a pressure loss you define pressure inlet and outlet and if it is a certain flow rate you would define that but usually not a velocity. Boris 
1 Attachment(s)
Hi Boris,
Now that the problem with the geometry is solved, I've run quite a number of simulations and few things about the boundary condition still baffles me. Here's my flow scenario in Fig 1. All I know is the reservoir height and the diameter of the pipe and valve. I can assume that water continues to fillin in the reservoir while it leaves out through the pipe and valve on the bottom. So based on this assumption I used Bernoulli's principle to obtain velocity at the center of the pipe. My final objective is to find out the total mass of water flowing out of the pipe outlet while the valve operates from:: Full Close to Full Open (10sec) > Stays Put (for 6 sec) > Full Open to Full Close (10 sec). Pressure drop too is one other very important parameters in this kind of flow. So yes I would like to consider that as well. The length of the pipes that I have used are pretty much arbitrary at the moment. INLET:: I have used this velocity uniformly (12.82 m/s, 0, 0) to create inlet boundary condition for my simulation. As I understand, mass flow rate can be obtained explicitly at the inlet using the expression Q=rho*Velocity*Area. Can you tell me and why which one is a more appropriate inlet BC? OUTLET:: Until now, I have been using Static Pressure (1 atm) as my outlet boundary condition. Mesh for my initial simulations used Result Resolution 3 setup without using the minimum gap size or wall thickness. The results during postprocessing showed to have the same assigned pressure (101325 Pa) on the outlet for all the valve angle cases. Now that I've refined my grids and simulated with the same setup, the pressure on the outlet surface differs from the preassigned valve (less than 1 atm) for all the valve angle cases.....Something that I'm not able to understand. The Velocity and mass flow rate in the inlet should almost be the same in all the cases, right? It seems alright in both my first and second set of simulations, although they differ by a small amount in some of the cases. Similarly, based on the setups that I've used, pressure at the outlet boundary should always be equal to 1 atm or 101325 Pa for all the cases right? I'm not getting this in my second set of simulations. I do have an option of extending the length of the pipe in the downstream region, should that be a solution. A little more insight into selecting proper BCs for my case would be of great help Boris! Thank you very much. Nikesh. 
Hi Nikesh,
if you calculated the pressure at the center of the pipe with such a reservoir then why are you using velocity as an inlet condition? Simply use Total pressure and fully developed flow. Outlet looks good with static pressure and 1atm. I cannot tell why you get different pressure, this shouldn't happen as long as the goal you are checking is the same parameter you defined. For example if you define static pressure as a BC, then the goal of static pressure should have the same value. You should check if there is no error message during the solver such as "vortex crossing the pressure opening". In this particular case you need to extend the pipe downstream to have the full vortex in the pipe and therefore resolved with the calculation. The mass flow rate may change with a better mesh as a coarse mesh will calculate the losses wrong and if you have 2 pressure BC there is no fixed mass flow defined, only a pressure difference and the mass flow is then calculated and depending on the losses in the model. If the losses are resolved correctly by a fine mesh you should see no change in the mass flow with and even finer mesh (mesh convergence). Boris 
All times are GMT 4. The time now is 13:46. 