CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

How to do Design Optimization in Fluent 13.0?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By fox000002

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2011, 15:26
Default How to do Design Optimization in Fluent 13.0?
  #1
New Member
 
WangLei
Join Date: Mar 2011
Posts: 2
Rep Power: 0
p36288 is on a distinguished road
How to do Design Optimization in Fluent 13.0?
Anyone noticed that the latest version ANSYS 13.0 FLUENT solver have integrated Automatic shape flow optimization? I'm trying to do a simple optimization case, however, the objective function can only be provided in one of two ways: either as a UDF, or as a Scheme source file. Here are what the UserGuide said on the definition of objective function:
"
A. If you want to provide the objective function as a user-defined function (UDF), perform the steps that follow.
1. Write a UDF using the DEFINE_ON_DEMAND macro to define the objective function. The function name must be objective_function. At the end of the objective function, the rpvar morpher/objective_function needs to be set to the (current - target) value. It is this value that the optimizer will attempt to minimize.
2. Compile the UDF using the Compiled UDFs dialog box. Make sure libudf appears as the Library Name. Define User-Defined Functions Compiled...

B.If you want to provide the objective function as a Scheme source file, perform the following steps:
1. Write a Scheme source file to define the objective function. The procedure name must be objective-function. At the end of the objective function, the rpvar morpher/objective-function needs to be set to the (current - target) value. It is this value that the optimizer will attempt to minimize.
2. Load the Scheme source file.
"
After reading the guide, i'm still not clear how to define the objective function. Anyone could provide me an example about how to do it?
Thanks a lot.
p36288 is offline   Reply With Quote

Old   July 20, 2011, 01:37
Default
  #2
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 17
fox000002 is on a distinguished road
1 UDF

Code:
#include "udf.h"
 
DEFINE_ON_DEMAND(objective_function)
{
    real obj = 0.0;
    /* ... */
    rp_set_real(morpher/objective_function, obj); 
}


2 Scheme

Code:
(define (objective-function)
;...
  (rpsetvar 'morpher/objective_function obj)
)
fox000002 is offline   Reply With Quote

Reply

Tags
design optimization, fluent 13.0, objective function, scheme, udf


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
Fluent - license problem. Marcin FLUENT 3 April 13, 2018 17:33
problem of running parallel Fluent on linux cluster ivanbuz FLUENT 15 September 23, 2017 20:12
Porous media setup issues in Fluent Bernard Van FLUENT 29 January 26, 2017 05:09
Fluent connection with simulink by TCP/IP Tanktruck Fluent UDF and Scheme Programming 1 June 28, 2009 13:56
mesh from Star design and use in FLUENT?? Waseem Main CFD Forum 0 December 17, 2008 07:25


All times are GMT -4. The time now is 03:21.