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

UDF not computing correctly

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2023, 15:43
Default UDF not computing correctly
  #1
New Member
 
EmmaKate
Join Date: Aug 2023
Posts: 11
Rep Power: 3
emmakateh is on a distinguished road
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!
emmakateh is offline   Reply With Quote

Old   August 3, 2023, 21:42
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
did you hook functions before running calculations?
you should show code to get answer regarding your code
emmakateh likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 4, 2023, 13:47
Default
  #3
New Member
 
EmmaKate
Join Date: Aug 2023
Posts: 11
Rep Power: 3
emmakateh is on a distinguished road
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
emmakateh is offline   Reply With Quote

Reply

Tags
memory, udf, zeros


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
does Hyperthreading affect the application of UDF? SJSW Fluent UDF and Scheme Programming 11 October 10, 2018 22:28
Error code: 126 when loading parallel UDF Coop Fluent UDF and Scheme Programming 0 July 13, 2018 08:33
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Help for Fluent udf on parallel computing KAILI FLUENT 0 September 18, 2008 00:52
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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