something wrong when compiling udf, however the code is correct when interpreting
I began to change my udf from interpet to compile, however meet some problem and have no idea how to do.
1. The diffusivity
when I load this code, the uds goes to divergence. However, when I change "s_lamda*(1.0-POR)/3.0" into a constant, it works fine. In fact, s_lamda*(1.0-POR)/3.0 is a constant in my code since I defined "s_lamda" and "POR" in the begining of the code. This is weird
2. The source term
real Re, P, alamda_f, h,source_f;
I can load this source without any problem when interpreting, however in compiling it doesn't work at all. And the error is:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f
I have no idea what's wrong with my code or is there any difference between compile and interpret?
I will appreciate a lot for your help.
You could use "THREAD_STORAGE" as the keyword to search in the fluent udf manual. You have tried to access the pointers before the spaces they associated to are allocated.
Thank you very much for your reply. I didn't get you. I can load this source term in interpreted UDFs. And when I load it in compiled UDFs, I have two UDSs. And I can display C_UDSI(c,t,0) but just cannot load this source term.
I know the reason but still have no idea how to solve it.
the problem locates in this code : alamda_f=C_K_L(c,t)
when I change C_K_L(c,t) into a constant, it works fine.
So the problem is I can't cite using C_K_L(c,t) ? Why?
Do you have any ideas? Or this is the problem you mentioned.
Access it without allocated?
Give it a try.
thank you for your suggestion. it didn't work. however i solved this problem by setting the thermal conductivity into a picewise-polynomial function related to the temperature. if the thermal conductivity is set to be a constant then it didn't work and the same error. i don't know why but it is solved.
however i met another problem. do you know what is the meaning of this code?
when i compiled the udfs the warnings are:
'initializing' : 'struct thread_struct *' differs in levels of indirection from 'int '
local variable 't0' used without having been initialized
although i can ignore these two wranings, when i load this udf containing this code
it doesn't work. so i check the code one by one, and found that this code might be the problem.
but have no idea how to intialize 't0'
do you have any ideas? i will appreciat a lot for your help.
Could it be thread_t0? This line can only be understood in context.
thank you for your help and sorry for the delayed reply.
This code is copied in the UDF manual Charpter 220.127.116.11.
I assumed it was wrong and thought it should be Thread *t0=thread
Is it ok?
|All times are GMT -4. The time now is 22:21.|