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

Is this correct

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2020, 12:01
Default Is this correct
  #1
Member
 
zobekenobe
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 72
Rep Power: 17
zobekenobe is on a distinguished road
I am trying to find the amount of a user defined scalar passing through a interior edge/wall.

especially the line in bold

Code:
DEFINE_ADJUST(func_name, domain)
{
        Thread* s1 = Lookup_Thread(domain, segment1);
	Thread* t0 = s1->t0;
	face_t facet;
	cell_t c0;

	begin_f_loop(facet, s1)
	{
		c0 = F_C0(facet, s1);
		value1 	= fabs(F_FLUX(facet, s1)) * C_UDSI(c0,t0,r);
	}
	end_f_loop(facet, s1)
thanks
zobekenobe is offline   Reply With Quote

Old   May 6, 2020, 14:16
Default
  #2
Member
 
mCiFlDk's Avatar
 
mCiFlDk
Join Date: Feb 2020
Posts: 56
Rep Power: 6
mCiFlDk is on a distinguished road
Hi zobekenobe,

Have you thought about doing it in the post-proc? I mean, create an iso-surface and measure the amount of a certain variable passing though it. In the "report" label, "fluxes" in the main fluent command menu.

Regards
mCiFlDk is offline   Reply With Quote

Old   May 6, 2020, 15:30
Default Flux
  #3
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
The value returned by the UDF will just be a field showing product of mass flow rate and scalar value. That's not the flow rate of scalar. Firstly, you need to sum over the faces. Secondly, the flow rate of the scalar depends upon the scalar's definition. E.g., if the scalar represents temperature, then you also need to multiply the product of mass flow rate and temperature with specific heat. If the scalar represents species mass fraction, then the formulation is correct. But in any case, you need to sum over the face loop. Or as suggested by mCiFlDk, you can use surface integral. Reports > Flux will not give flow rate of scalars but you can define a custom-field-function and then take its surface integral over the boundary. Again, cff depends on the type of scalar.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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
Is my Dynamic mesh setup correct? cfd seeker FLUENT 16 October 30, 2020 06:16
interFoam | Hydraulic Jump | Correct boundary condition p_rgh pythag0ra5 OpenFOAM Running, Solving & CFD 17 September 5, 2014 04:31
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Is this understanding of turbulence models correct? 3kha Main CFD Forum 3 January 31, 2011 21:31
Correct lift but wrong pressure drag - possible? zx Main CFD Forum 4 July 27, 2007 23:38


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