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

user defined function

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

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2018, 09:14
Default user defined function
  #1
New Member
 
sree charan teja
Join Date: Oct 2018
Posts: 8
Rep Power: 7
ASCT is on a distinguished road
hi guys,

I am facing an error called no function prototype.
can you guys please help me with that. my code is
#include "udf.h"
DEFINE_PROFILE(heatflux,thread,nv)
{
int p=110.111;
int i;
int h[6]={123800,3033966,6067932,788100,62205,45600};
float n[0];

int num=6;
face_t f;
begin_f_loop(f,thread);
{
F_CENTROID(n,f,thread);

for(i=1;i<num;i++);
{
F_PROFILE(f, thread, nv) = h(i) + ((h(i+1)-h(i))*(p-n(i)))/(n(i+1)-n(i));
}
/*return 1;*/
}
end_f_loop(f,thread);
}

I am trying to do piecewise linear approximation for heat flux variation along the length of the rocket nozzle.
ASCT is offline   Reply With Quote

Old   December 3, 2018, 00:25
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
DEFINE_PROFILE(heatflux,thread,nv)
{
real p=110.111;
int i;
real h[]={123800,3033966,6067932,788100,62205,45600};
real n[]={123800,3033966,6067932,788100,62205,45600};
int num=6;
face_t f;
begin_f_loop(f,thread);
	{
		F_CENTROID(n,f,thread); 
		for(i=1;i<num;i++);
		{
			F_PROFILE(f, thread, nv) = h[i] + ((h[i+1]-h[i])*(p-n[i]))/(n[i+1]-n[i]);
		}
	}
end_f_loop(f,thread);
}
best regards
ASCT likes this.
AlexanderZ is offline   Reply With Quote

Old   December 3, 2018, 02:26
Default
  #3
New Member
 
sree charan teja
Join Date: Oct 2018
Posts: 8
Rep Power: 7
ASCT is on a distinguished road
Thank you @Alexanderz
ASCT is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 11:51
How to use date from previous time step in user defined field function? samantkumarnagraj STAR-CCM+ 2 December 12, 2014 07:08
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 01:35
Help: user defined function alice FLUENT 3 December 13, 2000 01:10


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