|
[Sponsors] |
May 21, 2020, 09:01 |
The source term in the UDS
|
#1 |
New Member
MengqiangHu
Join Date: Feb 2019
Posts: 13
Rep Power: 7 |
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. |
|
May 21, 2020, 09:47 |
Source Term
|
#2 |
Senior Member
|
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 publicly. PM is considered to be of the least priority. |
|
May 21, 2020, 10:15 |
|
#3 |
New Member
MengqiangHu
Join Date: Feb 2019
Posts: 13
Rep Power: 7 |
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.
|
|
May 21, 2020, 11:46 |
Integral
|
#4 |
Senior Member
|
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 publicly. PM is considered to be of the least priority. |
|
|
|
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 |