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

mesh morpher/optimizer

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 28, 2011, 12:08
Unhappy mesh morpher/optimizer
  #1
New Member
 
Ava
Join Date: Nov 2011
Posts: 4
Rep Power: 5
scsasha is on a distinguished road
Hi every body.
I have a problem with my UDF for defining the objective function for design optimization of an airfoil. Here is my UDF:

#include"udf.h"
#include"dynamesh_tools.h"
#include"morpher.h"
# define ZONEID 3
DEFINE_ON_DEMAND(objective_function)
{
real x_cg[2];
real f_glob[2];
real m_glob[2];
real drag=0.0;
Domain *domain;
Thread *thread;
domain=Get_Domain(1);
thread = Lookup_Thread(domain,ZONEID);
x_cg[0] = 0;
Compute_Force_And_Moment(domain,thread,x_cg,f_glob ,m_glob,TRUE);
drag=f_glob[0]*0.9962+f_glob[1]*0.08716;
RP_Set_Real(
"morpher/objective_function",drag);
}

It is compiled successfully but when I check it through execute on demand or when I use it in the optimization, I receive this error message:

Error: rp-var-value-local-set!: undefined variable
Error Object: morpher/objective_function

I use win 64 bit and Visual Stodio 2010 and Fluent 13. I would be happy if anybody can help me with this problem.
scsasha is offline   Reply With Quote

Old   November 29, 2011, 11:42
Default http://www.cfd-online.com/Forums/newreply.php?do=newreply&noquote=1&p=333824#
  #2
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 7
fox000002 is on a distinguished road
Execute following command before loading your own UDF.

Code:
/define/enable-mesh-morpher-optimizer? yes
fox000002 is offline   Reply With Quote

Old   December 1, 2011, 11:51
Default
  #3
New Member
 
Ava
Join Date: Nov 2011
Posts: 4
Rep Power: 5
scsasha is on a distinguished road
Quote:
Originally Posted by fox000002 View Post
Execute following command before loading your own UDF.

Code:
/define/enable-mesh-morpher-optimizer? yes

Thank you so much but it still doesnt work!
scsasha is offline   Reply With Quote

Old   December 1, 2011, 12:02
Default
  #4
New Member
 
Ava
Join Date: Nov 2011
Posts: 4
Rep Power: 5
scsasha is on a distinguished road
Thank you so much but it still doesnt work!
scsasha is offline   Reply With Quote

Old   December 2, 2011, 06:52
Default
  #5
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 7
fox000002 is on a distinguished road
The rpvar name is wrong.

Code:
RP_Set_Real("morpher/objective-function",drag);
fox000002 is offline   Reply With Quote

Old   December 5, 2011, 06:33
Thumbs up
  #6
New Member
 
Ava
Join Date: Nov 2011
Posts: 4
Rep Power: 5
scsasha is on a distinguished road
Thank you so much for your help. It is working now!
scsasha is offline   Reply With Quote

Old   January 11, 2013, 12:01
Default
  #7
New Member
 
Join Date: Jan 2013
Posts: 1
Rep Power: 0
Ibrar is on a distinguished road
Hi all
I think you people are very good with optimization
I am also trying to optimize the shape of chemical reactor. I have some basic questions
1) what is the meaning of parameters in the optimizer windows??
2) how can we set their max and minimum values?
3) I am solving 2D axisymmetic flow through a pipe" with a chemical reaction taking place inside it" and i want to optimize the shape of that pipe"optimized shape would be something like combination of nozzle diffuser type" should I define the optimization region over the whole axisymmetric domain or just on the area close to the wall.
4) i leant from the blog that people are interfacing matlab with fluent to do geometric optimization, I want to know why they are not using these biult in optimizer. of course there are certain limitation can you please give a take of that??
5) finally some idea of how to link matlab with fluent
Thanks in advance for your rime and concern
Ibrar
Ibrar is offline   Reply With Quote

Old   August 31, 2014, 18:23
Default
  #8
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 178
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by scsasha View Post
Hi every body.
I have a problem with my UDF for defining the objective function for design optimization of an airfoil. Here is my UDF:

#include"udf.h"
#include"dynamesh_tools.h"
#include"morpher.h"
# define ZONEID 3
DEFINE_ON_DEMAND(objective_function)
{
real x_cg[2];
real f_glob[2];
real m_glob[2];
real drag=0.0;
Domain *domain;
Thread *thread;
domain=Get_Domain(1);
thread = Lookup_Thread(domain,ZONEID);
x_cg[0] = 0;
Compute_Force_And_Moment(domain,thread,x_cg,f_glob ,m_glob,TRUE);
drag=f_glob[0]*0.9962+f_glob[1]*0.08716;
RP_Set_Real(
"morpher/objective_function",drag);
}

It is compiled successfully but when I check it through execute on demand or when I use it in the optimization, I receive this error message:

Error: rp-var-value-local-set!: undefined variable
Error Object: morpher/objective_function

I use win 64 bit and Visual Stodio 2010 and Fluent 13. I would be happy if anybody can help me with this problem.
Dear scsasha

Could you tell us How many control points you have considered around the airfoil?

Thanks
syavash is offline   Reply With Quote

Reply

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
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 39 June 5, 2013 19:02
[ICEM] Problem making structural mesh on a surface froztbear ANSYS Meshing & Geometry 1 November 10, 2011 09:52
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
Meshing aifoil in ICEM student123a ANSYS Meshing & Geometry 13 December 8, 2010 11:40
2d irregular grid Remy Main CFD Forum 1 December 22, 2008 05:49


All times are GMT -4. The time now is 18:19.