|
[Sponsors] |
Problem in compiling fluent UDF lunched from MATLAB |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2016, 17:01 |
Problem in compiling fluent UDF lunched from MATLAB
|
#1 |
New Member
Join Date: Oct 2016
Posts: 4
Rep Power: 10 |
Hi friends,
I am not a very professional user of fluent. Here is the problem description: I try to open fluent(+ a journal file) using MATLAB but the problem is that when the fluent lunches, the UDFs don't compile correctly and the libudf.dll file can not be created. Fluent states this error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64). The system cannot find the file specified. I know what it is and I have installed visual studio and when I open fluent directly, I manage to compile UDFs manually and also there is nothing wrong with the journal file. I guess there is probably something wrong with the fluent startup options I use in MATLAB. I would really appreciate if someone could help me. FLUENT STARTUP OPTIONS IN MATLAB Code:
! [fluent] 2ddp -wait -i [journal] -OS: windows 7(64 bit) -ANSYS Fluent v16.1 (64 bit) -visual studio 2010 ultimate -Microsoft .NET Framework 4.5.2 -I also have SDK Thank you in advance for your helps |
|
October 10, 2016, 04:13 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If you start up Fluent from the SDK shell (I guess that is what you call Visual Studio), then this shell knows where the compiler is.
If you start up Fluent from Matlab, you are in a different shell, and the Matlab shell does not know where the compiler is. So there are three options I see logically: 1. Make sure that the Matlab shell knows where the compiler is and how to compile. I don't know how to do this. 2. In Matlab, open the SDK shell, and open Fluent from within this shell. Insert inception-joke here. 3. Compile the UDFs in Visual Studio (you said that worked), and only load them from Matlab. If your work flow allows option 3, I would use that one because it is the most simple. |
|
October 10, 2016, 17:54 |
|
#3 | |
New Member
Sorin Munteanu
Join Date: Apr 2013
Posts: 27
Rep Power: 14 |
Hi cfdman10,
I am not sure what is goal... I presume that you start Fluent from Matlab because you intend to exchange data between the two programs. Probably the data is exchanged either through journal/transcript file maybe or you haveco-simulation functionality in UDF. The mechanism you are using seems to require you to run Fluent and Matlab on the same machine. My advise for you will be to use the aaS functionality in ANSYS, since it will give you more flexibility. When using aaS (as a Server) you can start Fluent and Matlab separately. You can launch them even on two different machines with different platforms. Starting Fluent from Matlab is just a particular case. You will have to start Fluent in aaS mode (just add "-aas" to command line) If you intent to have Matlab issuing Fluent commands, I will advise to start Fluent in idle mode (without the -i option) and then have Matlab connected and either load the journal (using aaS.read.journal command) or by executing the lines in the journal file one at the time. When starting Fluent in idle + aaS mode (including -aas, but without -i), Fluent will generate an aaS key file (default name aaS_FluentId.txt) and wait for commands either from another program(Matlab in your case) or from its own UI. The Matlab program will have to collect the aaS key from Fluent working directory, connect to Fluent and then issue the commands as needed. As a matter of fact, it is easier to write the code than to explain the technique. You will have to download a the ANSYS Matlab aaS toolbox. I will advise you to start with the following blog post: http://www.ansys-blog.com/how-to-mak...pps-for-ansys/ The post covers ANSYS Mechanical APDL aaS, ANSYS Fluent aaS and ANSYS Workbench aaS and includes code example (~20 lines of code) . It includes also a reference to toolbox available for download from support.ansys.com. Hope it helps Sorin Quote:
|
||
October 13, 2016, 13:42 |
|
#4 | |
New Member
Join Date: Oct 2016
Posts: 4
Rep Power: 10 |
Quote:
1.Well, actually I think if I could somehow address the environmental variables in matlab it would compile correctly. do you know how to do that(in matlab or in SDK)? 2.I have also thought about this method but I don't know how to command SDK in Matlab. Can you give me more explanation? 3.This one will definitely work! I guess i have to use this solution as the last one because it needs some efforts(number of cases are too much) Also please take a look at my last reply, you can find more explanation about my problem. Thanks for your reply Last edited by cfdman10; October 13, 2016 at 14:43. |
||
October 13, 2016, 14:35 |
|
#5 | |
New Member
Join Date: Oct 2016
Posts: 4
Rep Power: 10 |
Quote:
More explanation: Actually there is a number of cases with different UDFs that I want to solve using Fluent. My goal is to manipulate the journal and UDF files with the help of Matlab in order to make changes automatically. Therefore, I open fluent in Matlab after making changes in UDFs and journal, but the version of fluent that Matlab opens is not capable of compiling UDFs. As I mentioned before, I have the required softwares to compile a UDF (not using matlab) from Fluent luncher. So logically there must be a way that will make Matlab recognize the compiler.(I don't want to use matlab as the compiler, I just want to open Fluent and run each case after making any changes in UDFs) I was not familiar with the aaS, this feature seems very helpful, I'll read more about it. best regards |
||
October 13, 2016, 15:12 |
|
#6 | |
New Member
Sorin Munteanu
Join Date: Apr 2013
Posts: 27
Rep Power: 14 |
Hi cfdman10,
It seems like aaS is your way to go, but I do not want to push in a direction you might not be comfortable with. Please accept my apology if I am offering unwanted information, but the information below might be useful to you: Fluent aaS main feature is to offer a flexible mechanism to "manipulate a Fluent journal' as you say go along. I will show you side by side, the procedure with aaS and without aaS: Without aaS
With aaS
Based on the result of a TUI or Matlab commands you can take execute additional TUI commands. You do not need to shutdown and restart Fluent from Matlab anymore since Matlab is a connecting process to Fluent, unlike in the non-aaS version where Matlab is the parent process of Fluent. With aaS you will have the ability of essentially "modifying the journal file and the control the UDF" as you go along. I am adding the quotes, because there is no journal file anymore, the Fluent commands, instead of being in a separate file are bundled in your Matlab code. You can have Fluent running on a remote machine. The environment of Fluent and of Matlab can be substantially different without conflicts. Thank you Sorin Quote:
|
||
October 13, 2016, 17:10 |
|
#7 | |
New Member
Join Date: Oct 2016
Posts: 4
Rep Power: 10 |
Thank you very much for your detailed introduction of aaS. As I told you it seems a wonderful feature. I will read more about it and I will try to apply it to my case.
Quote:
|
||
December 4, 2019, 05:51 |
|
#8 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
could you give me your email please ?
|
|
December 4, 2019, 05:53 |
|
#9 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
Sorin , i want your email address please
|
|
December 4, 2019, 05:53 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I hope Sorin is smart enough not to give his email address. If you have questions, you should ask them here, then there are more people who can answer, and more people who can learn from the answer.
|
|
December 4, 2019, 06:08 |
|
#11 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
Okay i will make a post with my problem so everyone can see and learn from the answers ( i wish to get answers for it )
|
|
December 4, 2019, 06:21 |
|
#12 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
I have MATLAB Code and i need to take the output from MATLAB which is temperature value and use it as Input in ANSYS FLUENT at on specific boundary condition then i will solve ansys and get heat transfer coefficient (HTC) and i want to take the HTC value from ANSYS FLUENT and use it in MATLAB code again to get new value for the temperature and this is a repeated cycle.
|
|
December 4, 2019, 10:31 |
|
#13 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You forgot to ask your question. Which step is giving you problems?
|
|
December 4, 2019, 10:39 |
|
#14 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
I want to know how to make this coupling using matlab toolbox ansysaas...i spent too much time to find any tutorial for this toolbox but unfortunately I didn't find any useful information except Sorine answers that's why I asked for his email but you told it's against the rules.
|
|
December 4, 2019, 10:41 |
|
#15 |
New Member
Abdelrahman
Join Date: Dec 2019
Posts: 6
Rep Power: 6 |
So Could you please help me ?
|
|
December 5, 2019, 00:01 |
|
#16 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
coupling technique through running fluent as server (fluent aas) works
google "fluent ass" for instance https://www.ansys.com/blog/ansys-fluent-matlab-example
__________________
best regards ****************************** press LIKE if this message was helpful |
|
December 5, 2019, 06:32 |
|
#17 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Sorin posted this message more than three years ago, and posted his last message on this board more than two years ago. He might not visit this board anymore, or not work with the toolbox anymore. |
||
Tags |
compile, fluent, libudf.dll, matlab |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
problem with compiling boundary condition udf in parallel mode | chem engineer | Fluent UDF and Scheme Programming | 11 | June 29, 2015 07:23 |
having problem in writing a UDF for specific heat in fluent 14.0 | nands_bullwalker | Fluent UDF and Scheme Programming | 1 | June 29, 2013 11:32 |
PROBLEM in UDF on parallel fluent mode | rakadit | Fluent UDF and Scheme Programming | 0 | July 13, 2012 07:51 |
Problem with compiling the UDF | raghu mohan | Fluent UDF and Scheme Programming | 10 | December 17, 2011 00:34 |