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

How to do Design Optimization in Fluent 13.0?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By fox000002

Reply
 
LinkBack Thread Tools 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, 00:37
Default
  #2
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 8
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)
)
metmet likes this.
fox000002 is offline   Reply With Quote

Reply

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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porous media setup issues in Fluent Bernard Van FLUENT 26 July 24, 2015 18:24
problem of running parallel Fluent on linux cluster ivanbuz FLUENT 11 March 10, 2010 16:13
Fluent connection with simulink by TCP/IP Tanktruck Fluent UDF and Scheme Programming 1 June 28, 2009 12:56
mesh from Star design and use in FLUENT?? Waseem Main CFD Forum 0 December 17, 2008 07:25
Fluent - license problem. Marcin FLUENT 1 March 4, 2005 12:41


All times are GMT -4. The time now is 22:24.