|
[Sponsors] |
June 13, 2014, 05:12 |
Monitor a variable of a UDF
|
#1 |
New Member
Christoph Gradl
Join Date: Feb 2014
Posts: 18
Rep Power: 12 |
Hello,
I want to use a monitor in fluent to plot the value of a variable of a UDF. Is there a possibility in fluent? I only found the possibility to write the values to a file. For example I want to monitor the variable v_prev: Code:
DEFINE_CG_MOTION(piston, dt, vel, omega, time, dtime) { Thread *t; face_t f; real NV_VEC (A); real force, dv; /* reset velocities */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); if (!Data_Valid_P ()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD ((Dynamic_Thread *)dt); /* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop (f, t) { F_AREA (A, f, t); force += F_P (f, t) * NV_MAG (A); } end_f_loop (f, t) /* compute change in velocity, i.e., dv= F * dt/ mass; velocity update using explicit eulerformula */ dv= dtime* force / 50.0; v_prev+= dv; CX_Message ("time = %f, x_vel= %f, force = %f\n", time, v_prev, force); /* set x-component of velocity */ vel[0] = v_prev; } Christoph |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
UDF extern variable - mean time moment coefficient | enry | Fluent UDF and Scheme Programming | 0 | November 14, 2009 07:51 |
name variable in UDF using Thread : syntax error before numeric constant | Laurence Wallian | FLUENT | 0 | October 8, 2009 10:18 |
UDF: exporting a variable between two DEFINE function | Carlo | FLUENT | 3 | August 19, 2009 13:21 |
Yplus UDF variable | Matthew Brannock | FLUENT | 0 | June 23, 2003 04:41 |