|
[Sponsors] |
May 24, 2013, 19:31 |
How to store pressure and flux at last step?
|
#1 |
Member
Edison
Join Date: Mar 2009
Posts: 40
Rep Power: 17 |
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) } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
lid-driven cavity in matlab using BiCGStab | Don456 | Main CFD Forum | 1 | January 19, 2012 16:00 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |