|
[Sponsors] |
August 20, 2008, 11:47 |
GRID_MOTION updating problems
|
#1 |
Guest
Posts: n/a
|
I am using the DEFINE_GRID_MOTION udf to move nodes at a small incremental rate inside of a while loop. I am comparing the volume after the node movement to a volume in which I would like to achieve, the target volume. If the updated volume is close to the target volume, then I break the loop. However, if the updated volume is still far from the target volume, then I continue to loop it and move the nodes again until the two converge.
The problem that is occuring is that the nodes are moving like I would like but the while loop is never breaking because I am unable to calculate the new/changed volume correctly during the while loop. The only time the volume is calculated correctly is after the GRID_MOTION udf has completed running and I use a DEFINE_EXECUTE_AT_END udf. The same function is used to calculate the volume in both UDF's. It is as if the nodes move, but the mesh is staying with the old nodal positions and the volume remains the same throughout the duration of the while loop even though nodes are moving. Is there a way to ensure that the correct volume is measured or computed after each nodal position change? My function for calculating the volume that I am using is: double get_volume() { Domain *d = Get_Domain(1); Thread *t; cell_t c; real TotVol=0.0; int i; thread_loop_c(t, d) { i = t->id; if (FLUID_THREAD_P(t)) { begin_c_loop(c, t) { TotVol += C_VOLUME(c, t); } end_c_loop(c, t) } } return (TotVol*1.0e6); } Thanks for any help, Ted |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Updating dynamic mesh | Willem | FLUENT | 3 | July 11, 2008 19:52 |
updating UDF by using residual | Omri Mohamed | FLUENT | 0 | February 20, 2008 18:36 |
moving wall with grid_motion? | Joerg | FLUENT | 0 | October 18, 2005 14:03 |
updating dynamic mesh | greg | FLUENT | 1 | April 27, 2005 14:51 |
updating file | jack | CFX | 2 | December 2, 2002 08:02 |