CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2018, 12:15
Default 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
wasim_03 is on a distinguished road
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
File Type: jpg Pressure_drop.jpg (56.9 KB, 12 views)
File Type: jpg mass_flow_rate.jpg (57.6 KB, 8 views)
wasim_03 is offline   Reply With Quote

Old   January 6, 2018, 12:40
Default
  #2
New Member
 
wasim
Join Date: Aug 2015
Posts: 9
Rep Power: 10
wasim_03 is on a distinguished road
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)
}
wasim_03 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressure drop in pipe flow with Large Eddy Simulation xerox FLUENT 1 October 16, 2019 08:55
sonicFoam - pressure driven pipe: flow continuity violation and waveTransmissive BC Endel OpenFOAM Running, Solving & CFD 3 September 11, 2014 16:29
"Closing" a pressure inlet via UDF? dave88 Fluent UDF and Scheme Programming 0 August 27, 2013 18:14
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 13:19
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 15:00


All times are GMT -4. The time now is 08:56.