User Defined Memory
I use a nonlinear k-e model and the Reynolds Stress is stored in the User defined memory. Is it possible to clear that user defined memory after a set number of iterations while running the case??
|
Sure. Is it a transient case or a steady-state case? The define_adjust macro will run once per iteration, and thus you'd need to simply hook your reset macro (with appropriate logic) into define_adjust.
I haven't tried the code below, but it should give you an idea of what to do. Code:
#include "udf.h" |
Thanks for the code. It's a transient code. Will it make any difference if it's a steady case? If so, how?
|
I asked because doing something based on iterations in a transient code doesn't make a lot of sense (while they're correlated with flow time, it's not a fixed relationship, and you'd be resetting at random intervals). By iterations, do you mean time step?
ComputerGuy Quote:
|
Yes. By iterations I mean the time steps. Is it possible to delete that data at the completion of a case. If I'm running the case for 100seconds, is there someway to delete the user defined memory after 100s from the data file?
|
Yes. The simple fix to the code below should clear the UDM after 100 seconds. It's a define on demand to prevent running every iteration for flow times beyond 100s
Code:
#include "udf.h" ComputerGuy Quote:
|
this is my udf to calculate gradient of temperature dt/dy,it write me error fluent reveice .....()
what's wrong ? #include "udf.h" DEFINE_ON_DEMAND(store_grad) { 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_T_G(c,t)[1]; } end_c_loop(c,t) } } thx |
Quote:
Did you patch the UDM before use? |
All times are GMT -4. The time now is 17:07. |