
[Sponsors] 
July 5, 2016, 22:39 
Momentum source term

#1 
New Member
AnsysUser
Join Date: Jul 2016
Posts: 8
Rep Power: 6 
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 komega Scheme: PISO Second order Upwind Boundary conditions: airfoil is a noslip 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; // xcentre of my source real YGS=2.5; // yheight 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_locXGS)<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 

December 6, 2016, 05:28 

#2 
New Member
Johannes Hall
Join Date: Sep 2016
Posts: 21
Rep Power: 6 
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 

December 6, 2016, 10:23 
Reply

#3 
New Member
AnsysUser
Join Date: Jul 2016
Posts: 8
Rep Power: 6 
We are still doing research on gust simulation. How do you evaluate if results are satisfying or not?
Shreman 

December 7, 2016, 12:44 

#4 
New Member
Johannes Hall
Join Date: Sep 2016
Posts: 21
Rep Power: 6 
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 yvalues or plot a points value over time, that's a good way to see how the gust behaves Regards 

November 16, 2017, 08:58 

#5 
New Member
Misa
Join Date: Oct 2017
Posts: 10
Rep Power: 5 

November 16, 2017, 12:19 

#6 
New Member
AnsysUser
Join Date: Jul 2016
Posts: 8
Rep Power: 6 

November 21, 2017, 03:49 

#7  
New Member
Misa
Join Date: Oct 2017
Posts: 10
Rep Power: 5 
Quote:
Quote:
Firstly thankyou 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 

Tags 
fluent  udf  parallel, momentum source, navier stokes equations, source terms, source udf 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
[foamextend.org] problem when installing foamextend1.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 sourcebuilt 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 