|
[Sponsors] |
March 30, 2009, 21:18 |
Reserving UDM/UDS memory locations
|
#1 |
New Member
Eric Doran
Join Date: Mar 2009
Posts: 3
Rep Power: 17 |
I'm having trouble using the DEFINE_EXECUTE_ON_LOADING functionality to reserve a certain number of UDM/UDS variables for the UDF library that I am using. I'm using the basic code provided in the example from the documentation (below), however on initial loading I always receive the error stating that I need to allocate additional UDM/UDSs and reload, regardless of how many locations are already present and free. Oddly enough, if I simply reload the case at that point it will work fine, but it never works on the initial loading. It doesn't make sense to use this functionality if I have to load my casefiles twice. If anybody else recognises this problem and has found a solution, please let me know.
< begin code > /* general FLUENT header files */ #include "udf.h" #include "mem.h" static int udsOffset = UDS_UNRESERVED; #define N_TESTLIB_UDS 2 static int udmOffset = UDM_UNRESERVED; #define N_TESTLIB_UDM 2 DEFINE_EXECUTE_ON_LOADING(testLoad, libname) { /* ---- reserve user-defined memory ----- */ if (udmOffset == UDM_UNRESERVED) udmOffset = Reserve_User_Memory_Vars(N_TESTLIB_UDM); if (udmOffset == UDM_UNRESERVED) Message("\nDefine %d extra UDMs in GUI and reload %s\n", N_TESTLIB_UDM, libname); else { Message("%d UDMs have been reserved by the current library %s\n", N_TESTLIB_UDM, libname); /* set names of user defined memory */ Set_User_Memory_Name(udmOffset, "M1"); Set_User_Memory_Name(udmOffset+1, "M2"); Message("UDM offset for current loaded library = %d\n", udmOffset); } /* ---- reserve user-defined scalars ----- */ if (udsOffset == UDS_UNRESERVED) udsOffset = Reserve_User_Scalar_Vars(N_TESTLIB_UDS); if (udsOffset == UDS_UNRESERVED) Message("\nDefine %d extra UDS in GUI and reload %s\n", N_TESTLIB_UDS, libname); else { Message("%d UDS have been reserved by the current library %s\n", N_TESTLIB_UDS, libname); /* set names of user defined memory */ Set_User_Scalar_Name(udsOffset, "Var1"); Set_User_Scalar_Name(udsOffset+1, "Var2"); Message("UDS offset for current loaded library = %d\n", udsOffset); } } |
|
March 31, 2009, 10:20 |
|
#2 |
Member
Henrik Ström
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
I have the same problem. It is enough to unload and reload your UDF library, you don't have to reload the entire case. Anyway, a solution to this issue would be nice of course...
|
|
March 31, 2009, 19:27 |
|
#3 |
New Member
Eric Doran
Join Date: Mar 2009
Posts: 3
Rep Power: 17 |
Right, however that option is a bit too tedious for my taste. Plus, it's not really an option when submitting a batch job. Is there anywhere on Fluent's website to check bug reports to see if anybody else has reported something similar?
|
|
April 1, 2009, 04:13 |
|
#4 |
Member
Henrik Ström
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
When I run batch jobs with cases that have this issue, I supply a text file with the corresponding commands to do this. It does not really solve the issue, I know, but at least it makes things work for me.
If you run Fluent from the command line with the handle "-i text.txt", then it will do whatever is stated in text.txt. You can for example have file read-case-data myfile.cas q define user-defined compiled-functions unload libudf compiled-functions load libudf q q solve ... etc Maybe this helps you. /Henrik |
|
May 10, 2009, 17:39 |
|
#5 |
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17 |
Hi,
I have same problem too. Every time, I have to load my saved cases two times to successfully rename the uds/udms. The solutions mentiond above here is working but boring However, there should be a solution for this issue. Why? because fluent pem fuel cell module makes this uds/udm renaming and if you load the previously saved case and data file renaming process works very well. So, there must be a solution and I am currently working on it. |
|
August 7, 2012, 08:41 |
happen History repeat it self.
|
#6 |
New Member
|
guess what happenHistory repeat it self.
I have the same problem as you I am using the Fluent 14 and I want to simulate a PEM fuel cell. The only tutorial of PEM fuel cell of Fluent is from 6.3 version. I use it to Fluent 14 and I follow the steps but the results does not the same, also some data and parameters are different. Anybody know if the tutorial of 6.3 Fluent is working to Fluent 14 too? I think now you had finish your thesis peacefully. Can you help me to overcome my problems. or send me your cas files. Thank you Emad G. elemad1987@gmail.com |
|
Tags |
reserve, udm, uds |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to optimize the memory usage when using FEM | vasilis | Main CFD Forum | 11 | August 25, 2009 00:57 |
Memory error? | Young | CFX | 3 | September 30, 2008 12:33 |
Number of User-Defined Memory Locations to 12. | Michael | FLUENT | 1 | February 6, 2008 05:48 |
CFX CPU time & real time | Nick Strantzias | CFX | 8 | July 23, 2006 18:50 |
Run-Time memory conifguration Error | Graeme | CFX | 1 | February 21, 2006 00:04 |