# Simulation of ball-valve opening w.r.t to varying inlet pressure

 Register Blogs Members List Search Today's Posts Mark Forums Read

January 6, 2018, 13:15
Simulation of ball-valve opening w.r.t to varying inlet pressure
#1
New Member

wasim
Join Date: Aug 2015
Posts: 9
Rep Power: 10
Hello everyone...
Here i am posting a problem related to simulation of inlet pressure variation at the inlet of valve. Imagine there is valve in pipeline located far away distance from source or tank. Now at t=0 valve is opened and suppose at steady state pressure drop inside the pipeline is Del_P=2 bar and steady pressure drop in downstream circuit let say is one bar. Now when i closed the valve pressure at the inlet of valve w.r.t to source pressure will vary from 2-0 bar. when i am simulate this situation using UDF by monitoring mass flow rate using FLUX_F function and converting this flow rate using Delta_P =K*m^2; where k is constant for pipeline and is given by 8fl/PI^2*roh*d^5 and altering inlet pressure using PROFILE function i am not getting desired output....can anyone guide and tell some other method to alter inlet pressure at every time steps....
Actually in my simulation flow is occurring in steady state and i am closing the valve as the valve start closing flow through the valve starts decreasing and pressure at the inlet of valve should decrease as in steady state pressure drop is maximum and inlet pressure should be that of tank/source pressure minus delta_p. But when i am simulating this using UDF pressure at t=0 i am getting that of source/tank pressure and bcoz of high inlet pressure flow through the valve start increasing as shown in attach figures and flow instead of decreasing it start increasing.......how to resolve this problem.......can any one guide...

Regards
Wasim
Attached Images
 Pressure_drop.jpg (56.9 KB, 12 views) mass_flow_rate.jpg (57.6 KB, 8 views)

 January 6, 2018, 13:40 #2 New Member   wasim Join Date: Aug 2015 Posts: 9 Rep Power: 10 Following UDF program i am using to modify the inlet pressure...... #include "udf.h" FILE *fp; real flow_tot; DEFINE_EXECUTE_AT_END(pressure) { Domain *d; float flow; cell_t c; Thread *t; face_t f; d = Get_Domain(1); t= Lookup_Thread(d, 12); begin_f_loop(f,t) { flow+=F_FLUX(f,t); } end_f_loop(f,t) flow_tot =flow; flow=0.; } DEFINE_PROFILE(inlet_pressure, thread, position) { face_t f; float P_i=903063;/* 199625Pa steady state pressure drop in feed circuit*/ real t= CURRENT_TIME;/* steady state inlet pressure 703438Pa*/ /*float flow_t=0;*/ float Del_P=0; fp = fopen("output.txt","a"); fprintf(fp,"MASS Flow Rate: %f kg/s \n",flow_tot); fclose(fp); Del_P=(0.79215*flow_tot*flow_tot); begin_f_loop(f, thread) { F_PROFILE(f, thread, position)=P_i-Del_P; } end_f_loop(f, thread) }