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

The source term in the UDS

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2020, 09:01
Default The source term in the UDS
  #1
New Member
 
MengqiangHu
Join Date: Feb 2019
Posts: 11
Rep Power: 3
POSTHU is on a distinguished road
Hi,

I am working on the UDS by fluent, and I want to set a source by UDF, I have coded a UDF like:

#include "udf.h"
DEFINE_SOURCE(uds1_source,c,t,dS,eqn)
{
real x[ND_ND];
real source;
real time;
C_CENTROID(x,c,t);
if (x[0]<3 && x[0]>2.9 && x[1]>=2.7 && x[1]<=2.8)
{
source = 1;
dS[eqn] = 0.;
}
else
{
source=0.;
dS[eqn] = 0.;
}
return source;
}

As you can see, I want the release rate of the source to be 1. But when I run the simulation, for example, until time 8.65s (The time step size is 0.001s). The integral of the scalar in the whole domain is 14.92015, which is strange. I think that the value should be 1*8.65=8.65, why this phenomenon happened? I am really confused about that.

Thank you.
Attached Images
File Type: jpg 30.jpg (70.5 KB, 4 views)
POSTHU is offline   Reply With Quote

Old   May 21, 2020, 09:47
Default Source Term
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,552
Blog Entries: 1
Rep Power: 28
vinerm will become famous soon enough
That's because sources are always volumetric. That means you have to divide by the volume. For source value to be 1, you need to return 1/C_VOLUME.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared on the Forum
vinerm is online now   Reply With Quote

Old   May 21, 2020, 10:15
Default
  #3
New Member
 
MengqiangHu
Join Date: Feb 2019
Posts: 11
Rep Power: 3
POSTHU is on a distinguished road
Quote:
Originally Posted by vinerm View Post
That's because sources are always volumetric. That means you have to divide by the volume. For source value to be 1, you need to return 1/C_VOLUME.
Thanks for the reply, but I think there must be something wrong expect that. Because I have tried to modified the 1 by 1/C_VOLUME, but the phenomenon still exists. And 14.9 turned to 149000, so I think this may not be the real problem.
POSTHU is offline   Reply With Quote

Old   May 21, 2020, 11:46
Default Integral
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,552
Blog Entries: 1
Rep Power: 28
vinerm will become famous soon enough
That's because you are looking at something else while expecting something else. The area integral that you are reporting is product of area with the scalar and not scalar multiplied by time. This is not time integral but area integral.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared on the Forum
vinerm is online now   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
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 03:43


All times are GMT -4. The time now is 08:34.