|
[Sponsors] |
March 5, 2014, 07:54 |
Mass source term
|
#1 |
New Member
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 13 |
Hi everybody,
I trying to model a mass source term (source/sink) in my project but my UDF doesn't work correctly. figure of my project is: the length of every edge is 1 [m] and alpha is 45 degree. the UDF that i use fro this project is: Code:
#include "udf.h" #include "math.h" #define CON 20.0 DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source; real x[ND_ND]; C_CENTROID (x, cell, thread); if (sqrt(pow(x[1],2)+pow(x[2],2)) <= 0.005) { /* source term */ source = -100; dS[eqn] = 0; } else { source = 0.; dS[eqn] = 0.; } return source; } Can any one help me? any reply can be helpful. thanks in advance "Sadegh" |
|
March 5, 2014, 07:56 |
|
#2 |
New Member
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 13 |
one more question
in fluent, can apply source term to a node? |
|
March 5, 2014, 08:00 |
|
#3 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
Hi,
are you working on a 2d simulation? For 2d simulation you have x that is x[0] and y which is x[1] x[2] in your udf is z coordinate. Check this. Daniele |
|
March 5, 2014, 08:03 |
|
#4 |
New Member
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 13 |
yes my model is 2D
thanks for your reply Daniele i will check it now |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term due to evaporation in energy transport equation | styleworker | OpenFOAM Programming & Development | 3 | September 7, 2022 04:09 |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |