CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

C_UDSI_G() use in DEFINE_ADJUST

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2009, 05:34
Default C_UDSI_G() use in DEFINE_ADJUST
  #1
Gemini
Guest
 
Posts: n/a
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


----------------------------
  Reply With Quote

Old   July 5, 2013, 01:12
Default
  #2
New Member
 
Chuang Wei
Join Date: Aug 2012
Posts: 8
Rep Power: 14
danieldmgy is on a distinguished road
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.


Quote:
Originally Posted by Gemini
;156362
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


----------------------------
danieldmgy is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C_UDSI_G(c,t,UU) returning NAN Travis FLUENT 1 February 17, 2009 06:51
Could I use DEFINE_ADJUST to set B.C ? pour FLUENT 0 May 22, 2008 14:07
C_UDSI_G() in DEFINE_ADJUST shuqin FLUENT 2 June 18, 2006 01:12
About DEFINE_ADJUST sagga FLUENT 1 February 3, 2006 10:49
DEFINE_ADJUST Tomm FLUENT 0 December 7, 2005 11:53


All times are GMT -4. The time now is 18:41.