CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Cfx - matlab

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 11, 2009, 13:42
Default Cfx - matlab
  #1
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 16
camilo_costa is on a distinguished road
Dear members

Is possible use MATLAB together with ANSYS-CFX? More specifically, is possible create a user routine ou user function in MATLAB and read this routine or function in ANSYS-CFX?

I canīt believe that the only way to insert a aditional function in CFX is through FORTRAN!

Thx for all!!
camilo_costa is offline   Reply With Quote

Old   June 11, 2009, 13:52
Default
  #2
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 18
ckleanth is on a distinguished road
short answer NO you cant

this is because
1 the solver is written in FORTRAN
2 you need the FORTRAN compiler to write your script and create the program in the low level programing language( i think its assembly but might be wrong)
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   June 11, 2009, 14:27
Default
  #3
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 16
camilo_costa is on a distinguished road
Thx!! for your objective reply!

I will try to create a user function by FORTRAN. But I am new in this program language. Can you or someone help me to find many examples for study how to implement a new user routine by FORTRAN in CFX.

Is very dificult to understood the explanation about user FORTRAN in CFX help.

THX!!
camilo_costa is offline   Reply With Quote

Old   June 11, 2009, 17:27
Default
  #4
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 18
ckleanth is on a distinguished road
why would you want to create a user function in fortran? what you want to archive
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   June 11, 2009, 18:32
Default
  #5
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 16
camilo_costa is on a distinguished road
I study heat exchangers with the tow-phase flow thermosiphons tecnology!

The heat transfer between evaporator and condenser is modelate by a analitical equation (in MATLAB) that nowadays I change the values manualy every 200 steps.

I want to automate through a user routine!!

thx!!
camilo_costa is offline   Reply With Quote

Old   June 11, 2009, 18:36
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Hi,

CFX has the expression language CEL so most of the time fortran is not required to do functions.

Glenn Horrocks
ghorrocks is offline   Reply With Quote

Old   June 11, 2009, 19:08
Default
  #7
Member
 
Camilo Costa
Join Date: Jun 2009
Posts: 34
Rep Power: 16
camilo_costa is on a distinguished road
Thx! but CEL is not sufficient for me!! the work fluid that contais inside of the tubes (heat pipes) have physical characteristics that change whit temperature and pressure that are modelate by a analyticall expression.

Why is so difficult to have access the one book our pdf that explain step by step how to implement a user function in CFX? Thx!!
camilo_costa is offline   Reply With Quote

Old   June 11, 2009, 19:19
Default
  #8
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 18
ckleanth is on a distinguished road
It always amazes me how many times people start a task the difficult way. I'm pretty confident you can model the HE without even touching fortran

you can easily model real fluids in cfx, you just need to setup the appropriate materials.
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   June 13, 2009, 18:18
Smile
  #9
Senior Member
 
Jack
Join Date: Mar 2009
Posts: 106
Rep Power: 16
rogbrito is an unknown quantity at this point
I think itīs possible, you can use FORTRAN, C or MATLAB.
rogbrito is offline   Reply With Quote

Old   June 13, 2009, 20:44
Default
  #10
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 18
ckleanth is on a distinguished road
Quote:
Originally Posted by rogbrito View Post
I think itīs possible, you can use FORTRAN, C or MATLAB.
yea ok then.. could you please enlighen us how on earth you would write a code in any other language apart fortran that would work and communicate with the CFX solver ?
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   June 14, 2009, 06:40
Default
  #11
New Member
 
Martijn
Join Date: Mar 2009
Posts: 14
Rep Power: 17
Martijn is on a distinguished road
Quote:
Originally Posted by ckleanth View Post
yea ok then.. could you please enlighen us how on earth you would write a code in any other language apart fortran that would work and communicate with the CFX solver ?
Well you could use perl to analyse the output of a simulation whilst adapting the CCL for the next (short) simulation ;-) .
Martijn is offline   Reply With Quote

Old   June 14, 2009, 09:19
Default
  #12
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 18
ckleanth is on a distinguished road
Quote:
Originally Posted by Martijn View Post
Well you could use perl to analyse the output of a simulation whilst adapting the CCL for the next (short) simulation ;-) .
didnt think of using perl
will keep that in mind
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   June 14, 2009, 20:40
Default
  #13
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Hi,

Just repeating chleanth's comment - most functions like this can be done using CEL with no need for fortran. Can you explain what in your function cannot be done in CEL?

How to implement fortran in CFX is described in the documentation. For simple stuff like just returning a CEL variable it is not too bad (I think you use a junction box for that. But I have never had to use fortran in CFX since I was using CFX4 in 1999. Ever since CFX5 was developed I have managed to do everything in CEL.

Glenn Horrocks
ghorrocks is offline   Reply With Quote

Old   June 16, 2009, 23:39
Default
  #14
New Member
 
hun
Join Date: May 2009
Posts: 27
Rep Power: 16
hung is on a distinguished road
Hi,

I got the same problem. for example. i have to measure velocity in pipe. it is transient simulation, and at different timestep i got different velocity values at the output and i can see that value in CFX post. if i want to integrate that value from 0 to T. do i have to write the function of CEL at the CFX-Pre or CFX Post?. how to access with different timestep? because as same as camilo_costa i might have to export 200 steps to data matrix end then do all the calculation in Matlab.
thanks,

hung
hung is offline   Reply With Quote

Old   October 14, 2013, 08:15
Default how to couple
  #15
New Member
 
rajesh natarajan
Join Date: Aug 2013
Posts: 3
Rep Power: 12
astrorajesh is on a distinguished road
hello friends

i am going to optimize rotor 37,for that is there any coupling tools are available

I have a MATLAB optimization code and the objective function will require results from ANSYS CFX. The Setup is like this: Ansys Turbogrid - CFX Pre - Solver - Post - Result to MATLAB - MATLAB create new geometry - Start new cycle again starting with turbogrid.

The ANSYS Programme will be in Ansys workbench. I dont know how to link it with MATLAB and vice versa

thanks in advance
astrorajesh is offline   Reply With Quote

Old   October 14, 2013, 17:18
Default
  #16
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The look you describe sounds simple to implement as a batch (windows) or shell ([L]unix) script.
ghorrocks is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pros and Cons for CFX, CFdesign, COMSOL Val Main CFD Forum 3 June 10, 2011 02:20
Matlab & CFX Meri CFX 1 March 16, 2006 00:39
CFX 7.1 and Matlab Juan G. CFX 1 March 5, 2006 21:37
CFX & MatLab Walid CFX 4 March 8, 2005 16:30
How to make data file for matlab from CFX? cfxbeginner CFX 4 October 19, 2002 07:56


All times are GMT -4. The time now is 07:52.