|
[Sponsors] |
October 31, 2007, 09:22 |
Dilatation field
|
#1 |
Guest
Posts: n/a
|
Hi! I want to visualize velocity/pressure dilatation field of compressible flow in Fluent. I've got a formula calculating it by means of fluctuating velocity gradient
dilatation = d/dx(u``) where: u`` = u(actual) - u(avg) I already have a data file of average values of velocity u(avg) during my unsteady simulation saved in UDM, but still have problem to show fluctuating velocity gradient C_UDSI_G, which seems to be zero... Here is my UDF: #include "udf.h" DEFINE_ON_DEMAND(vel_x_to_udm0) { float velx; Thread *tc; cell_t c; extern Domain *domain; thread_loop_c(tc,domain) { begin_c_loop(c,tc) { velx=C_U(c,tc); C_UDMI(c,tc,0)=velx; } end_c_loop(c,tc) } } DEFINE_ON_DEMAND(vel_y_to_udm1) { float vely; Thread *tc; cell_t c; extern Domain *domain; thread_loop_c(tc,domain) { begin_c_loop(c,tc) { vely=C_V(c,tc); C_UDMI(c,tc,1)=vely; } end_c_loop(c,tc) } } DEFINE_ON_DEMAND(vel_fluctuation_to_udm2_and_uds0) { float udmi0,udmi1; float velx, vely, velMagAvg, velMagActual, delta; Thread *tc; cell_t c; extern Domain *domain; thread_loop_c(tc,domain) { begin_c_loop(c,tc) { udmi0=C_UDMI(c,tc,0); udmi1=C_UDMI(c,tc,1); velx=C_U(c,tc); vely=C_V(c,tc); velMagAvg=sqrt(pow(udmi0,2)+pow(udmi1,2)); velMagActual=sqrt(pow(velx,2)+pow(vely,2)); delta=velMagActual-velMagAvg; C_UDMI(c,tc,2)=delta; C_UDSI(c,tc,0) = C_UDMI(c,tc,2); C_UDSI(c,tc,1) = NV_MAG(C_UDSI_G(c,tc,0)); } end_c_loop(c,tc) } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 04:49 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 06:20 |
Turbulence dampening due to magnetic field in LES and RAS | eelcovv | OpenFOAM | 0 | June 8, 2010 11:35 |
Zero size field | taranov | OpenFOAM Bugs | 2 | April 20, 2010 04:51 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 06:51 |