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

Mass source term

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

Like Tree1Likes
  • 1 Post By ghost82

Reply
 
LinkBack Thread Tools Display Modes
Old   March 5, 2014, 07:54
Default Mass source term
  #1
New Member
 
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 5
sadegh1068 is on a distinguished road
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;
}
by using this udf velocity filed predict wrongly



Can any one help me?

any reply can be helpful.
thanks in advance

"Sadegh"
sadegh1068 is offline   Reply With Quote

Old   March 5, 2014, 07:56
Default
  #2
New Member
 
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 5
sadegh1068 is on a distinguished road
one more question
in fluent, can apply source term to a node?
sadegh1068 is offline   Reply With Quote

Old   March 5, 2014, 08:00
Default
  #3
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
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
sadegh1068 likes this.
ghost82 is offline   Reply With Quote

Old   March 5, 2014, 08:03
Default
  #4
New Member
 
Sadegh Tafakor
Join Date: May 2012
Location: Tehran
Posts: 14
Rep Power: 5
sadegh1068 is on a distinguished road
yes my model is 2D
thanks for your reply Daniele
i will check it now
sadegh1068 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM 24 August 23, 2015 22:41
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 2 September 3, 2014 21:24
Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Installation 27 April 16, 2014 15: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 03:43


All times are GMT -4. The time now is 03:05.