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

Momentum source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2016, 22:39
Question Momentum source term
  #1
New Member
 
AnsysUser
Join Date: Jul 2016
Posts: 9
Rep Power: 10
Shreman is on a distinguished road
Dear All, could you help me to resolve issue with my UDF function.
I am trying to implement gust in Ansys Fluent. It was already implemented with different software in AIAA research paper. In the picture QuestionSource.jpg square box is the region where gust is generated and it is carried by mean flow. i.e. yellow and blue contours move to the right. (This picture was taken from the paper I mentioned above)
Basically I just need to add source term in x and y momentum equations. However, for some reason when I look at vorticity contours (another picture QuestionAnsysRes.PNG) I can see only vorticity generated in source region, it does not move in x direction.


Could you, please, tell me what is wrong with my udf function?
For the run I use:
Pressure based solver,
Transient
Energy on
Viscous SST k-omega
Scheme: PISO
Second order Upwind

Boundary conditions:
airfoil is a no-slip wall;
inlet is a pressure far field; (velocity 170m/s, mach 0.5 ,standard sea level conditions)
outlet is pressure outlet;




Here is my udf function for source in x momentum Sx) {function for Sy is similar}
#include "udf.h"

DEFINE_SOURCE(harmGustX, cell, thread, dS, eqn)
{
real source=0;
real PI=3.14159;
real GOMEGA=2; // circular frequency
real GEPS=80;//amplitude of gust
real GTANGLE=1.0;//inclination of gust
real XGS=-1.5; // x-centre of my source
real YGS=2.5; // y-height of the source
real BGS=5; //pi/BGS is width of my source region
real dth=10.0; // gust duration
real dts=0.02; // gust start time

real flowTime=CURRENT_TIME;
real centroid[2];
C_CENTROID(centroid,cell,thread);
real x_loc=centroid[0];
real y_loc=centroid[1];
real rho=C_R(cell,thread);
real vol=C_VOLUME(cell,thread);

real GVEL=170.0; //freestream velocity
real GALF=GOMEGA*85/GVEL;//wavenumber in x direction (reduced //frequency) kx
real GBET=GALF*GTANGLE;//wavenumber in y direction ky

// this if checks if time came to start adding source to the right hand side of Navier Stokes(NS)
if(flowTime>dts && flowTime<dts+dth)
{
// if current cell is in the region of a source then add source to the RHS(right hand side of NS)
if(fabs(x_loc-XGS)<PI/BGS)
{

real UTERM= // calculating formulas from paper
real VTERM= // calculating formulas from paper
source=source + rho*UTERM*vol;
dS[eqn]=0;


}
else
{
source=0;
dS[eqn]=0;

}

else
{
source=0;
dS[eqn]=0;

}
}
else
{
source=0;
dS[eqn=0];
//printf("Not a valid timestep\n");
}
if(source!=0)
{
// printf("Source term\n");
}
return source;
}


//thanks
Shreman is offline   Reply With Quote

Old   December 6, 2016, 05:28
Default
  #2
New Member
 
Johannes Hall
Join Date: Sep 2016
Posts: 21
Rep Power: 10
yonpanman is on a distinguished road
Hello!

Very late reply here but I was trying with the same source term and I didn't really get satisfying results neither. However, the finer the mesh the better results. Did you find a good way to a solution or another way to simulate a gust?

Regards,
Johannes
yonpanman is offline   Reply With Quote

Old   December 6, 2016, 10:23
Default Reply
  #3
New Member
 
AnsysUser
Join Date: Jul 2016
Posts: 9
Rep Power: 10
Shreman is on a distinguished road
We are still doing research on gust simulation. How do you evaluate if results are satisfying or not?

-Shreman
Shreman is offline   Reply With Quote

Old   December 7, 2016, 12:44
Default
  #4
New Member
 
Johannes Hall
Join Date: Sep 2016
Posts: 21
Rep Power: 10
yonpanman is on a distinguished road
Should I interpret your reply as if you didn't continue with the momentum source term approach?

You can plot a line over the domain to see how the velocity differs at different y-values or plot a points value over time, that's a good way to see how the gust behaves

Regards
yonpanman is offline   Reply With Quote

Old   November 16, 2017, 08:58
Default
  #5
New Member
 
Misa
Join Date: Oct 2017
Posts: 10
Rep Power: 9
mmj_blackforce is on a distinguished road
Quote:
Originally Posted by Shreman View Post
We are still doing research on gust simulation. How do you evaluate if results are satisfying or not?

-Shreman
Dear Shreman and Johannes Hall:

may you please tell if the approach explained in this thread worked? or did you use some other technique.
Regards
mmj_blackforce is offline   Reply With Quote

Old   November 16, 2017, 12:19
Default
  #6
New Member
 
AnsysUser
Join Date: Jul 2016
Posts: 9
Rep Power: 10
Shreman is on a distinguished road
Quote:
Originally Posted by mmj_blackforce View Post
Dear Shreman and Johannes Hall:

may you please tell if the approach explained in this thread worked? or did you use some other technique.
Regards
Dear misa,

for the gust simulation ,mentioned thread worked well .
Shreman is offline   Reply With Quote

Old   November 21, 2017, 03:49
Default
  #7
New Member
 
Misa
Join Date: Oct 2017
Posts: 10
Rep Power: 9
mmj_blackforce is on a distinguished road
Quote:
Originally Posted by Shreman View Post
Dear misa,

for the gust simulation ,mentioned thread worked well .
Quote:
Originally Posted by Shreman View Post
Dear misa,
for the gust simulation ,mentioned thread worked well .
Dear Shreman,

Firstly thank-you for your reply, i tried to use your udf for gust simulation and need few clarification. when you find time please do reply i really need help.

(a) What does the "UTERM" stands for if it is velocity in x direction how did you calculate it, what formulae did you use to define "UTERM"

(b) Why have you defined width of source region as "PI/BGS" can it be BGS

(c) Why is the ds[eqn] term equal to zero

(d) Why have you not included the gust perturbation in the source equation is it embedded in the "UTERM"

Thanks in advance, i will be waiting for your reply please

Regards
Misa
mmj_blackforce is offline   Reply With Quote

Reply

Tags
fluent - udf - parallel, momentum source, navier stokes equations, source terms, source udf


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
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 22:53
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
How does fluent handles the momentum source term? QBeast FLUENT 0 April 22, 2013 15:12


All times are GMT -4. The time now is 12:16.