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

Boundary condition from information of other boundary surface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2020, 09:27
Default Boundary condition from information of other boundary surface
  #1
New Member
 
ShOh
Join Date: Jul 2020
Posts: 12
Rep Power: 6
Shoh is on a distinguished road
Hello. I would really appreciate if you could give me an answer.

I'd like to apply a boundary condition so that the UDS of the present surface is 10% of the sum of UDS of the other surface of which id is 7.

Here is my udf code.
-------------------------------------------
#include "udf.h"
#define idoutlet 7

DEFINE_PROFILE(udf_filter,t,i)
{
real sumudf;
face_t f;

sumudf=0;
begin_f_loop(f,idoutlet)
{
sumudf+=F_UDSI(f,idoutlet,0);
}
end_f_loop(f,idoutlet)

begin_f_loop(f,t)
{
F_PROFILE(f,t,i)=sumudf*0.1;
}
end_f_loop(f,t)

}
-------------------------------------------

But, when the calculation starts, the solver stops and the program is shut down.

Could you tell me where is the problem in my code?
Shoh is offline   Reply With Quote

Old   July 28, 2020, 02:26
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"
#define idoutlet 7
real sumudf;

DEFINE_PROFILE(udf_filter,t,i)
{
	face_t f;
	begin_f_loop(f,t)
	{
		F_PROFILE(f,t,i)=sumudf*0.1;
	}
	end_f_loop(f,t)
}

DEFINE_ADJUST(surf_avg,d)
{
	Thread *t;
	face_t f;
	t = Lookup_Thread(d,idoutlet);
	sumudf=0.0;
	thread_loop_f(t,d)
	{
		begin_f_loop(f,t)
		{
			sumudf+=F_UDSI(f,t,0);
		}
		end_f_loop(f,t)
	}
	# if RP_NODE
		sumudf = PRF_GRSUM1(sumudf);
	# endif
	Message0("**** sumudf = %f ****\n",sumudf);
}
Shoh likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
several fields modified by single boundary condition schröder OpenFOAM Programming & Development 3 April 21, 2015 06:09
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 07:49


All times are GMT -4. The time now is 16:14.