# How to store pressure and flux at last step?

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

 May 24, 2013, 18:31 How to store pressure and flux at last step? #1 Member   Edison Join Date: Mar 2009 Posts: 40 Rep Power: 10 Hi, I am trying to implement a pressure outlet boundary condition by UDF in fluent. The model is 3D and this boundary condition involves the pressure and inlet flux at last time step. I meet some problem in my implementation, especially how to store the previous pressure and flux. Below is part of the code: DEFINE_PROFILE(pressure_wk_profile,t,i) //t means thread { sumFlow = 0;//total flux at inlet current time step sumFlow_M1 = 0;// for previous time step tot_vol = 0;// total volume p_M1 = 0; //pressure at last time step begin_f_loop(f, t) { //… sumFlow = sumFlow + F_FLUX(f,t); //calculate total mass flow rate. //I am not sure what F_FLUX return is the inlet flux or previous outlet flux. c0 = F_C0(f, t); t0 = THREAD_T0(t); tot_vol = tot_vol + C_VOLUME(c0,t0); sumFlow_M1 = sumFlow_M1 + C_UDMI(c0,t0,1);// p_M1 = p_M1 + C_UDMI(c0,t0,0)*C_VOLUME(c0,t0); //It seems not work, and is there any simpler way to store/visit pressure at last step? } end_f_loop(f, t) p_M1 = p_M1 / tot_vol; begin_f_loop(f, t) { F_PROFILE(f,t,i) = somefunction(p_M1, sumFlow, sumFlow_M1); } end_f_loop(f,t) } DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t, *t0; cell_t c, c0; face_t f; real tt; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) C_UDMI(c,t,0) = C_P(c,t); end_c_loop(c,t) } thread_loop_f(t,d) { begin_f_loop(f,t) { c0 = F_C0(f, t); t0 = THREAD_T0(t); C_UDMI(c0, t0, 1) = F_FLUX(f,t); //store flux at each face } end_f_loop(f,t) } }

 May 24, 2013, 20:54 #2 Senior Member   Join Date: Aug 2011 Posts: 315 Rep Power: 14 Not sure what you want but try C_P_M1(c,t) if you want to retrieve the pressure in previous time step for a given cell c and thread t.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Saturn CFX 48 October 25, 2017 06:07 volo87 CFX 5 June 14, 2013 17:44 Don456 Main CFD Forum 1 January 19, 2012 16:00 Pankaj CFX 9 November 23, 2009 05:05 Antech Main CFD Forum 0 April 25, 2006 02:15

All times are GMT -4. The time now is 01:42.