C_UDSI_G() use in DEFINE_ADJUST
Hi, I found a solution for the archived post below. Here an example for C_UDSI_G() use in DEFINE_ADJUST
real my_mag = 0.0; thread_loop_c (t,domain) { if (NULL != THREAD_STORAGE(t,SV_UDS_I(uds_index)) && NULL != T_STORAGE_R_NV(t,SV_UDSI_G(uds_index))) { begin_c_loop (c,t) { my_mag = NV_MAG(C_UDSI_G(c,t,uds_index)); } end_c_loop (c,t) } } -----------ARCHIVED POST------------ When I use a C_UDSI_G in DEFINE_ADJUST, the access_violation error came out. if I start iteration without hooking the adjust fuction,the iteration executed ,after some steps, I hooked the adjust function and initialized ,the iteration continues . I guess this is because the gradient of C_UDSI(C_UDSI_G ) isn't allocated yet ,but the codes do contain the if (! Data_Valid_P())return; sentence? I check the id.h in the src file as: FLUENT_EXPORT boolean Data_Valid_P(void); The FLUENT_EXPORT usually provides a GUI operation interface.am i right? can some one give me some suggestion that how to let Fluent iterate when hooked a adjust function which contains C_UDSI_G other then let it iterate some step without hooking this adjust function? and the reason for this? thanks in advance ---------------------------- |
I have the same problem to solve a transient problem. I guess you are right that C_UDSI_G needs couple of timesteps to be allocated.
It turns out no more than 4 timesteps works for me. The reason for that is unknown and I cannot find explaination in UDF manual. But anyway, just don't use the serveral inital timesteps. This may work.:cool: Quote:
|
All times are GMT -4. The time now is 06:33. |