CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   how to run fluent from matlab without using aas toolbox? (https://www.cfd-online.com/Forums/ansys/236350-how-run-fluent-matlab-without-using-aas-toolbox.html)

artemis96 May 26, 2021 03:12

how to run fluent from matlab without using aas toolbox?
 
hi everyone

I'm working on robust optimization for vascular stents design. for that I have to link matlab and fluent to each other so I can use matlab as a master and fluent as a slave. when I searched about the methods on how to do that, I figured for doing so we should download matlab AAS toolbox from ansys customer portal. but the problem is I'm a student and using student version of ansys so I do not have any access to that toolbox. so my question is how can I run ansys from matlab without using that toolbox? is there any other ways to do so?
I'd appreciate it if someone help me because I am looking for solutions for weeks and still couldn't find the answer.

thank you

Ames June 2, 2021 04:37

Hi,

Did you see this post and the answer from Sorin?

https://www.cfd-online.com/Forums/fl...ab-fluent.html
I did get this working with the student version.

Hope it helps you out!

artemis96 June 4, 2021 04:07

Quote:

Originally Posted by Ames (Post 805116)
Hi,

Did you see this post and the answer from Sorin?

https://www.cfd-online.com/Forums/fl...ab-fluent.html
I did get this working with the student version.

Hope it helps you out!


hi Ames,
thank you for replying to my question. sorin replied with a link that when i click on it , the homepage of ansys site opens and there is nothing else . it feels like the site sorin was refering to unfortunately has been removed. do you know where i can get the student version?

Ames June 4, 2021 08:05

Does this link work for you?

https://www.ansys.com/academic/students/ansys-student

artemis96 June 4, 2021 14:12

Quote:

Originally Posted by Ames (Post 805303)


hi,

this link goes to ansys software student version download link, how can i access the matlab aas toolbox download link there? apparently it should be installed from customer portal which is not available for student :(

jangdong June 4, 2021 21:52

Quote:

Originally Posted by artemis96 (Post 805325)
hi,
friday night funkin slope unblocked
this link goes to ansys software student version download link, how can i access the matlab aas toolbox download link there? apparently it should be installed from customer portal which is not available for student :(

This is great content! I am swept away by your presentation and unique viewpoints. I agree with so much of your article. Thank you that is very helpful.

Ames June 7, 2021 04:42

Did you check the second post of Sorin? I believe you don't need to install the matlab aas toolbox for that.

Quote:

Originally Posted by Sorin (Post 455986)
Hi Wang

I will need more information to help but I will just make some assumptions, for simplicity of the blog post:

Assumption 1: Matlab is running on a Windows 64 bits machine
Assumption 2: Fluent is running on the same machine or on a network accessible remote machine
Assumption 3: Fluent version is R14.5
Assumption 4: You have a resonable understanding of Fluent UDFs, rpvars or parameters
Assumption 5: you have administrative rights on the Matlab machine
Assumption 6: Fluent client (no license required) is installed on the Matlab machine

Let me know if your specific case is different.

Step1: Modify your Fluent case such that all entities that you want in Matlab are mapped to Fluent rpvars or Fluent parameters
- rpvars are requiring a little bit more advanced Fluent skills, but they have the benefit that they can be used on both a UDF running on the Fluent machine and Matlab running on the Matlab machine
- parameters are easier to use and more stable. They are accesible in Fluent GUI and Matlab but not in the UDF (unless you map one to an rpvar)
Step2: start Fluent on Fluent machine in server mode. Do not start a journal (-i option) because you will do the journaling from Matlab. To start fluent in server mode you will have to add in the command line the -aas option.
For example instead of running "fluent 3ddp" you will execute "fluent 3ddp -aas".
Step3: collect the Fluent session key from the Fluent machine and transfer it to the Matlab machine. the Fluent session key is stored in a file called aaS_FluentId.txt
Step4: make sure that the Fluent client is registered on the Matlab machine
You will have to run a command like the following:
regsvr32 "C:/Program Files/ANSYS Inc/v145/fluent/fluent14.5.0/addons/corba/win64/COMCoFluentUnit.dll"

Step5:Start Matlab
Step6:Connect Matlab to Fluent. You will have to run a Matlab script like the following:
fluent = actxserver(‘ANSYS.CoFluentUnit.1′);
tui=fluent.getSchemeControllerInstance();
fid=fopen(‘aaS_FluentId.txt’,'r’)
fluentkey=fscanf(fid,’%s’)
fclose(fid)
fluent.ConnectToServer (fluentkey)

Step7: Execute you Matlab-Fluent program.

You have two Matlab objects (fluent and tui) that you can use drive Fluent.

If you want to do Fluent journaling from matlab, you can use
tui.DoMenuCommand(tuiCommand)
this will have Fluent execute the tuiCommand with no return
tui.DoMenuCommandToString(tuiCommand)
this will have Fluent execute the tuiCommand and return the output
tuiCommand is pretty much any valid command that you put in a Fluent journal file
Example:
tui.DoMenuCommand('solve iterate 10')
report=tui.DoMenuCommandToString('report summary no')

If you want to set or get the value of a rpvar, you can use
tui.GetRpVar(rpvarName)
this will have Fluent returning the value of the rpvar
tui.SetRpVar(rpvarName,stringifiedRpVarValue)
this will have Fluent set the value of a rpvar
Example
valuePressureRelax=tui.GetRpVar('pressure/relax')
tui.GetRpVar('pressure/relax','0.5')

If you want to set or get the value of a parameter, you can use
fluent.GetOutputParameterValueByname(parameterName )
this will have Fluent returning the value of the parameter
tui.SetInputParameterValueByName(parameterName,par ameterValue)
this will have Fluent set the value of a parameter
Example
valueAvgTemperature=fluent.GetOutputParameterValue ByName('avgtemperature')
fluent.SetInputParameterValueByName('massflowrate' ,0.5)

Of course you will need to have an output parameter called 'avgtemperature' and an input parameter called 'massflowrate' previously configured in the Fluent case.

Please let me know if this post was helpful to you. If you give me your e-mail, I will contact you.

I tried my best to have the code examples syntactically correct, but there might be some typos. You can refer to Fluent documentation or you can mention the issue to me and I will figure it out.

Thank you

Sorin


quanghieupro May 23, 2022 12:16

FNF Mods is a most attractive game today. This is a simple game but very difficult and is currently one of the most prominent games and is still receiving love from the community. When playing it, you have to try to beat your opponent with beautiful dance moves to win your girlfriend's heart. At kbh games you are allowed to play this game right in your web browser without having to install it on your PC.


All times are GMT -4. The time now is 01:36.