|
[Sponsors] |
February 16, 2023, 12:34 |
Global variables were initialized to 0
|
#1 |
New Member
Join Date: Jun 2022
Posts: 27
Rep Power: 4 |
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. |
|
February 16, 2023, 14:27 |
Problem solved
|
#2 |
New Member
Join Date: Jun 2022
Posts: 27
Rep Power: 4 |
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! |
|
|
|
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 |