|
[Sponsors] |
October 13, 2014, 06:32 |
Wrong UDM contour plot
|
#1 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Hi!
I'm working on coding a new cavitational model for transient cases and I don't understand one thing..In the udf I need to access variables of the previous time step, so I'm using UDMI to store density, vapor volume fraction and some other calculated variables in the udf itself. The udf compiles successfully. At the end of each time step I'm using a DEFINE_EXECUTE_AT_END macro to move the current value of densities from C_UDMI(c,t,2) to C_UDMI(c,t,4) and values of volume fractions from C_UDMI(c,t,3) to C_UDMI(c,t,5). C_UDMI(c,t,4) and C_UDMI(c,t,5) are used inside udf to access values of previous time step. The problem is that I don't undestand why the contour plots of C_UDMI(c,t,3) and secondary phase volume fraction are not the same (even if vofM is restricted to a minimum and maximum value the contour plots are totally different)... Can somebody explain why? I can't find the error in udf.. Thanks! Code:
#include "udf.h" #define min_vofV 1.e-5 #define max_vofV 0.99999 DEFINE_CAVITATION_RATE(Rayleigh, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, m_dot) { real p_vapor = *p_v; real dp, vofV, vofM, timestep; [some code here] dp = p_vapor-ABS_P(p[c],op_pres); vofM = MIN(MAX(min_vofV, mafV[c]*C_R(c, t)/rhoV[c]), max_vofV); vofV = mafV[c]*C_R(c, t)/rhoV[c]; timestep = CURRENT_TIMESTEP; if (dp > 0.0) { [some code here] C_UDMI(c,t,2) = rhoV[c]; C_UDMI(c,t,3) = vofM; } else { [some code here] C_UDMI(c,t,2) = rhoV[c]; C_UDMI(c,t,3) = vofM; if (vofV < min_vofV) { [some code here] C_UDMI(c,t,2) = rhoV[c]; C_UDMI(c,t,3) = vofM; } } *m_dot = [some code here] } DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t; cell_t c; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { C_UDMI(c,t,0) = C_UDMI(c,t,1); C_UDMI(c,t,4) = C_UDMI(c,t,2); C_UDMI(c,t,5) = C_UDMI(c,t,3); } end_c_loop(c,t) } } I don't think the problem is that I'm saving UDMI values at the mixture thread level. Last edited by ghost82; October 13, 2014 at 13:26. |
|
October 14, 2014, 06:53 |
|
#2 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
It seems another bug in the post processing...
When I open the dat file in cfd post and plot the phase-2 volume fraction I obtain near the same (due to vofM limits) contour plot as udm-3. Daniele |
|
November 18, 2014, 08:52 |
|
#3 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
[Solution]
See here why udmi and vapor volume fraction values are different: http://www.cfd-online.com/Forums/flu...ation-udf.html
__________________
Google is your friend and the same for the search button! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] plot the iso-level contour in Paraview | hz283 | ParaView | 1 | May 15, 2013 20:45 |
Matlab PP: Generating X-vel Contour Error Plot | Bennp2000 | FLUENT | 5 | March 4, 2011 16:58 |
Contour plot with negative velocity | J | CFX | 11 | November 3, 2008 17:46 |
Contour plot in Star-CD | Yasir | Siemens | 0 | August 22, 2004 09:01 |
contour plot of stream function | liu | FLUENT | 6 | August 19, 2003 23:30 |