|
|
[Sponsors] |
|
|
#1 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 13 |
Debugging Fluent UDF is always the pain point for users. Intermediate variables can't be inspected and the source can't be traced step by step. User's progress remains stagnant especially because of inexplicable errors. Here, we recommend a UDF debugging tool that can directly inspect intermediate variables and trace the UDF source step by step.
https://vcudfstudio.bitbucket.io/dow...uent%20UDF.pdf |
|
|
|
|
|
#2 | |
New Member
Join Date: Oct 2019
Posts: 3
Rep Power: 3 |
Quote:
For those of you who would prefer not to pay for shady additional software and would like to keep information free, I am proposing the following following GENUINELY-FREE-OF-CHARGE approach, which I find even simpler than your FREE-TO-TRY slash GIVE-ME-YOUR-MONEY solution: - Remember to back original files up before you make any changes. - Change the makefile template makefile_nt.udf (in one of the Fluent installation folders): CFLAGS = /c /Za /Zi /DUDF_EXPORTING /DUDF_NT /DWIN64 /EHa /wd4224 link $(LIBS) /dll /debug /assemblydebug /out:$(TARGET) In words, you add the compiler flag /Zi and linker flags /debug /assemblydebug, nothing else. These options generate the program database (.pdb) files that you'll later find in the binary output folders. - Compile the UDF code in Fluent GUI and load the libudf library. This seems to be the best (most stable and universal) approach for compilation these days, earlier you had to run nmake in command prompt. - Open the source file in the "libudf/src" folder in Visual Studio (a free Express version will do fine). - In Visual Studio, attach the code to fl_mpi1950.exe (Fluent 2019R3). This works in serial mode, in parallel you may have to attach to all Fluent processes (haven't used in years, don't remember anymore). You should see debug symbols loaded in VS. - Try adding a breakpoint on a code row. The red circle on the left hand side should be filled, if the attach was successful. - When you run the simulation, whenever the code with the breakpoint is called within Fluent, you should now break in Visual Studio and be able to see the variable content and track program flow. Please see https://ibb.co/K2pPh6K for a screenshot. No need to extend your wallet. Cheers, Eero Last edited by eeroi; October 6, 2019 at 04:35. |
||
|
|
|
|
#3 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 13 |
Please do not disparage a car just because you have a pair of muscular legs. Not everyone master or prefer "Marathon" like you. Quite a few people enjoy the convenience even if cars "extend their wallet".
Quote:
|
||
|
|
|
|
#4 | |
New Member
Join Date: Oct 2019
Posts: 3
Rep Power: 3 |
Quote:
What really bothers me is that you pretend to be helpful while promoting your commercial stuff. Nothing wrong with being a vendor, but you should say it openly. Forum rules (I quote): State your affiliation explicitly in your message if you: Recommend a product sold by your employer. Write bad things about a product and you are employed by a company selling similar products. Forbidden content: Advertising, both commercial and personal |
||
|
|
|
|
#5 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 13 |
Quote:
|
||
|
|
|
|
#6 |
New Member
Join Date: Oct 2019
Posts: 3
Rep Power: 3 |
||
|
|
|
|
#7 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 13 |
||
|
|
|
|
#8 | |
New Member
Rodolfo
Join Date: Jun 2020
Location: Brazil
Posts: 2
Rep Power: 0 |
Hello, could you provide the screenshots of the step-by-step procedure, please?
Quote:
|
||
|
|
Tags |
debug, fluent, udf |
|
|
|
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Two questions on Fluent UDF | Steven | Fluent UDF and Scheme Programming | 7 | March 23, 2018 03:22 |
Problem running fluent with udf on batch | tobi b. | Fluent UDF and Scheme Programming | 3 | April 14, 2016 13:54 |
Running UDF with Supercomputer | roi247 | FLUENT | 4 | October 15, 2015 13:41 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 10:16 |
UDF problem caused by various version of Fluent | Yurong | FLUENT | 3 | January 15, 2006 10:57 |