CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > 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 Search this Thread 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: 13
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: 13
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
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
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: 13
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 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
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


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