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

Global variables were initialized to 0

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2023, 12:34
Default Global variables were initialized to 0
  #1
New Member
 
Join Date: Jun 2022
Posts: 27
Rep Power: 4
Mars35 is on a distinguished road
Hi guys,

I have define_init to read a text file and store my data in an array (global variable). This was working fine. In the same C file, I also used define_profile such that as long as my position coordinate matches, I would use the velocity at that coordinates. However, it was not working. Because I found out the arrays that stored my coordinates data was 0. I went to check on post on C program which I found the static and global variables were initialized to 0.

Is there other ways that I can keep my values in array? Thank you.
Mars35 is offline   Reply With Quote

Old   February 16, 2023, 14:27
Smile Problem solved
  #2
New Member
 
Join Date: Jun 2022
Posts: 27
Rep Power: 4
Mars35 is on a distinguished road
Hi guys,

The problem was solved without defining a global variable. However, it would still be great if I could learn how to update the values for global variable in the UDF. Thank you for reading this post and have a nice day!
Mars35 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
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" bigphil OpenFOAM CC Toolkits for Fluid-Structure Interaction 686 December 22, 2022 10:10
p_rgh initial residual no change with different settings manuc OpenFOAM Running, Solving & CFD 3 June 26, 2018 16:53
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
lid-driven cavity in matlab using BiCGStab Don456 Main CFD Forum 1 January 19, 2012 16:00


All times are GMT -4. The time now is 14:44.