|
[Sponsors] |
August 3, 2023, 16:43 |
UDF not computing correctly
|
#1 |
New Member
EmmaKate
Join Date: Aug 2023
Posts: 11
Rep Power: 3 |
I am working on a UDF code for magnetic field and in order to test the code quicky without waiting for initialization in Fluent, I have a version without the face and cell loops to run in VSC.
They are exactly the same but the code going into fluent returns zeros. I have reduced it to very simple equations to ensure that the face and cell loops are not the problem. I don't think it is the code itself because the VSC version works perfectly. I think its a memory thing but I cant figure out how to change the memory within fluent. I do have parts of my code that use factorial and pochhammer equations so the numbers get very large, but it works when going through VSC. If anyone has any advice, please let me know! |
|
August 3, 2023, 22:42 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
did you hook functions before running calculations?
you should show code to get answer regarding your code
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 4, 2023, 14:47 |
|
#3 |
New Member
EmmaKate
Join Date: Aug 2023
Posts: 11
Rep Power: 3 |
yes I make sure to hook the functions before initializing. The code will run when I simplify it down to just a coordinate shift so I know that it CAN run, ex:
thread_loop_c(t,domain) /* loops over all cell threads in domain */ { begin_c_loop_all(c,t) /* loop over cells in a thread to get information stored in cells */ { C_CENTROID(pos,c,t); x = pos[0] + r + R; /* shift coordinates to match equation coordinates */ y = pos[1]; z1 = pos[2] - l; /* shift coordinates to match equation coordinates */ C_UDSI(c,t,0) = x; } end_c_loop_all(c, t) /* END: Looping over all cells */ } but if it is more complex it doesnt run properly. I just tried increasing the solver processes used from 1 to 2 and it was able to run and give non zero results. unfortunately the results are 100% error. The results from Fluent are twice as large as the results coming from my code in VSC. I am running the code using 3 solver processes to test |
|
Tags |
memory, udf, zeros |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
does Hyperthreading affect the application of UDF? | SJSW | Fluent UDF and Scheme Programming | 11 | October 10, 2018 23:28 |
Error code: 126 when loading parallel UDF | Coop | Fluent UDF and Scheme Programming | 0 | July 13, 2018 09:33 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Help for Fluent udf on parallel computing | KAILI | FLUENT | 0 | September 18, 2008 01:52 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |