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

Define new turbulence model in Fluent

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

Like Tree10Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2014, 11:19
Default
  #41
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 13
Kanarya is on a distinguished road
I am using damping function, not wall function ,but I think You should save it in face memory....
Quote:
Originally Posted by behest View Post
Hello,
May I ask you about that how you consider y+ and wall shear stress near the wall in your UDF? Did you get them from Fluent by these expressions? C_UDMI(c0,t0,0)=C_STORAGE_R(f,t,SV_WALL_YPLUS_UTAU ); /* Y+*/
C_UDMI(c0,t0,2)=C_STORAGE_R(f,t,SV_WALL_SHEAR); /* wall shear */ C_UDMI(c0,t0,3)=C_STORAGE_R(f,t,SV_WALL_YPLUS); /* Ystar */

and did you save them in C_UDMI or in F_UDMI?

thanks alot for your consideration.
Kanarya is offline   Reply With Quote

Old   November 20, 2014, 11:40
Default
  #42
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
I do not use wall function, too. But, you need to calculate shear stress on the wall boundary.
Here, you can find my UDF and my Fluent case/data files. May I ask you to glimpse them,
https://www.dropbox.com/sh/rg87mkr95...MyjuKLP-a?dl=0

It would be appreciated if you let me know about your idea.

Quote:
Originally Posted by Kanarya View Post
I am using damping function, not wall function ,but I think You should save it in face memory....
behest is offline   Reply With Quote

Old   November 20, 2014, 12:39
Default
  #43
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 13
Kanarya is on a distinguished road
you said that you running the code but you did not compile it at all and the code is not hooked as well how do you know that code is not working?
are you a student?
Quote:
Originally Posted by behest View Post
I do not use wall function, too. But, you need to calculate shear stress on the wall boundary.
Here, you can find my UDF and my Fluent case/data files. May I ask you to glimpse them,
https://www.dropbox.com/sh/rg87mkr95...MyjuKLP-a?dl=0

It would be appreciated if you let me know about your idea.
Kanarya is offline   Reply With Quote

Old   November 20, 2014, 14:03
Default
  #44
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
Actually, I just sent the case/data files and UDF code without compiling. In this case/data file, I did not compile the UDF, this is my solution without adding UDF. I just sent this case/data files to see the SST results obtained by Fluent. If you compile the UDF and start runnig, you'll find different answer.

For compiling, I have done these steps:
1-go to define/user-defined/functions/compile and add the UDF and then bottom "Build" and "Load"
2-go to define/user-defined/scalars and put 2 UDS
3-go to model/viscous and hook Turbulent viscosity
4-go to "Fluid" and click on "Source terms" and hook two source terms for two UDS
4-go to Boundary conditions and select "plate" as wall and then select "fixed value" for both UDS, put zero for UDS1 (as turbulent kinitic energy) and select wall UDF for UDS2 (as specific dissipation rate)
5-go to pressure outlet boundary condition and click on "UDS" tap, then put the value of UDS1 and 2. I do the same procedure for velocity inlet boundary, too
6-go to solution control/equations, and select User Scalar 0" and "User Scalar 1". Moreover, I uncheck "Turbulence"
7-start calculation
These are the whole works that I have done.

I am student and really need to write an UDF for SST model and valid it with Fluent results. Please help me,

Quote:
Originally Posted by Kanarya View Post
you said that you running the code but you did not compile it at all and the code is not hooked as well how do you know that code is not working?
are you a student?
behest is offline   Reply With Quote

Old   December 2, 2014, 08:02
Default
  #45
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
Hello my friend,
what do you think about my steps for running UDF? Are those steps correct?
May I know your comment?


Quote:
Originally Posted by Kanarya View Post
you said that you running the code but you did not compile it at all and the code is not hooked as well how do you know that code is not working?
are you a student?
behest is offline   Reply With Quote

Old   December 2, 2014, 10:58
Default
  #46
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 13
Kanarya is on a distinguished road
everything is correct…If your code is correct then maybe the BC or mesh is wrong…I am not familiar with k-omega SST but you should check BC and mesh
What is the mesh size, you are using near the plate?
Quote:
Originally Posted by behest View Post
Hello my friend,
what do you think about my steps for running UDF? Are those steps correct?
May I know your comment?
Kanarya is offline   Reply With Quote

Old   December 2, 2014, 11:37
Default
  #47
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
Y+ is less than 1 and I use velocity inlet, pressure outlet and wall as boundary condition

Quote:
Originally Posted by Kanarya View Post
everything is correct…If your code is correct then maybe the BC or mesh is wrong…I am not familiar with k-omega SST but you should check BC and mesh
What is the mesh size, you are using near the plate?
behest is offline   Reply With Quote

Old   December 2, 2014, 13:08
Default
  #48
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 13
Kanarya is on a distinguished road
did you try y+ 10?
are u using first order or second order scheme ?
what is the relaxation factors for UDSI terms?
Kanarya is offline   Reply With Quote

Old   December 2, 2014, 13:14
Default
  #49
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
I have not tried with y+=10 yet.
I use first order for UDSI themes and the relaxation factor is 0.01

Quote:
Originally Posted by Kanarya View Post
did you try y+ 10?
are u using first order or second order scheme ?
what is the relaxation factors for UDSI terms?
behest is offline   Reply With Quote

Old   December 2, 2014, 13:54
Default
  #50
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 13
Kanarya is on a distinguished road
fine.. what did you use for omega in boundary of the plate?
where are u from by the way?
Quote:
Originally Posted by Kanarya View Post
did you try y+ 10?
are u using first order or second order scheme ?
what is the relaxation factors for UDSI terms?
Kanarya is offline   Reply With Quote

Old   December 2, 2014, 14:57
Default
  #51
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
In wall boundary condition, I fix k=0 and Omgea is obtained as bellow:

/*==============Wall boundary=======================*/
DEFINE_PROFILE(wall_d_bc,t,i)
{
Thread *t0;
face_t f;
cell_t c, c0;
double F_x,area,A[ND_ND],yplus,wshear;

begin_f_loop(f,t)
{
c0 = F_C0(f,t);
t0 = THREAD_T0(t);

yplus = C_STORAGE_R(f,t,SV_WALL_YPLUS_UTAU); /* Y+*/

F_x = F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[0];
F_AREA(A, f, t);
area = NV_MAG(A);
wshear=-1*F_x/area;
F_PROFILE(f,t,i) = 6.*wshear/(0.075*C_MU_L(c0,t0)*SQR(yplus));
}

To put them, I go to Define/boundary condition/wall and then select "edit". A new window for the plate will be opened. I select UDS tab and then put fixed value of k=0 and a fixed value of Omega according to the "wall_d_bc" UDF

I put a fixed value of k and omega at inner and outer boundary conditions.

Anyway, I have a question about the initialization, as you see in my UDF, I have not initialized any UDS. How do you initialize them in your code?
Did you add the turbulence contributions to momentum equation as sources?

Quote:
Originally Posted by Kanarya View Post
fine.. what did you use for omega in boundary of the plate?
where are u from by the way?

Last edited by behest; December 4, 2014 at 07:12.
behest is offline   Reply With Quote

Old   December 6, 2014, 20:14
Default hi
  #52
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 75
Rep Power: 10
m zahid is on a distinguished road
i want ot modify the Production term of k. i have UDF but i don't know how can i add my UDF. please help me .
thanks
m zahid is offline   Reply With Quote

Old   December 7, 2014, 07:20
Default
  #53
Member
 
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 13
behest is on a distinguished road
If you would like to modify production term of k, you may need an UDF for the turbulence model. It is not possible to write an UDF and change production trem. Fluent does not allow us to access this term.

Quote:
Originally Posted by m zahid View Post
i want ot modify the Production term of k. i have UDF but i don't know how can i add my UDF. please help me .
thanks
behest is offline   Reply With Quote

Old   December 7, 2014, 18:08
Default hi
  #54
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 75
Rep Power: 10
m zahid is on a distinguished road
hi behest, thanks for the answer, you mean i need full turbulence model UDF instead of one term UDF just for production term of k.
regards,
m zahid is offline   Reply With Quote

Old   October 26, 2016, 20:09
Default
  #55
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 14
alinik is on a distinguished road
Quote:
Originally Posted by msaeedsadeghi View Post
It is an scalar equation. I have written so many scalars for fluent. for k-omega you should define at least two UDS. Then write sources and diffusion fluxes that needed for each equation.
Hi,

I am struggling with implementing a new intermittency transport equation that I have derived in fluent and you seem to be a very knowledgable person in this regard.

I understand that I have to use UDS. But I am not sure how I should change the value of intermittency inside the UDF? I am guessing that I have to use DEFINE_ADJUST for that reason but then again I do not know how to access (read) the value of intermittency from the solver.

Also two other problems:
1) For adding source terms to intermittency can I simply add it through the sources tab in the fluids window or it has to be done through UDF as well.

2) Diffusion term: This is the part that I literally do not have any clue about. Any help is much appreciated.

Sorry if my problems sound childish to you. I have been using CFX for quite a while and I know how to work with that but I am quite a newbe in fluent.

I would really really appreciate it if you can help me with that. I am lost and do not have much time. As a thank you I will gladly promote your publications in CFD field in my upcoming papers.

Thanks a lot,

Ali
alinik is offline   Reply With Quote

Old   October 27, 2016, 17:25
Default
  #56
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 14
alinik is on a distinguished road
Quote:
Originally Posted by micro11sl View Post
Hi all,
I get stuck today. I find there's more work that I expected before.

Question 1:
Because I am implementing a compressible turbulence model, does this imply that I need to define an energy equation as well? Because turbulent kinetic energy should be presented in the energy equation.

Question 2:
After I load the UDF for user defined scalars, when setting the boundary condition tab, is there any difference between the "specific value" and "specific flux" if I am going to use my own boundary condition profile?

Question 3:
How to get the "turbulence intensity" and "viscosity ratio" I set for k-omega based model before for my newly defined model? Do I need to calculate the value of k and omega explicitly and assign them to my UDS? A related question is do I need to write up an udf for the initialization of my UDS? Also udfs for postprocessing?

Question 4:
As I read from many other threads in this forum, I guess some modification should be done before the udf can be run in parallel. Is this guess correct?

Considering from Question 1 to 4, I feel there's lots of work to finish. It seems I can't finish shortly. To simplify, I have a very rough idea. Because the original k-omega model will be selected but not solved (the UDS equations are solved instead), I might transfer the value of the initialized k and omega to my UDS in the beginning, and transfer my UDS back to the original k and omega scalars at the end of one computation. In this way, there's no need to write up udfs to initialize and postprocessing my UDS. But I don't know it's possible or not that Fluent will let me assign values back and forth between UDS and original k and omega transport equations.

Are there any simple approaches? Any comments?

Regards,
Sheng
HI Sheng,

It has been more than 3 years since the last time you updated this post. Just wanted to know if you were successful in solving your problems?
I want to replace the transport equation for intermittency with some other transport equation that we have derived. The problem is I can not find the Macro name for intermittency and do not know how to bypass the default transport equation for intermittency in FLUENT (Langtry-Menter transport equations)

P.S. I want to continue using transitional SST turbulence model and just have fluent use my transport eq. instead if its own
alinik 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
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
how to define the symmetric boundary condition for Menter's SST turbulence model? flyingseed Main CFD Forum 8 November 24, 2012 02:53
What model of turbulence choose to study an external aerodynamics case raffale OpenFOAM 0 August 23, 2012 05:45
Reynolds Stress Model in Fluent Vs CFX Tim FLUENT 0 December 6, 2005 22:03
Sinclair Model + secondary turbulence Yi FLUENT 0 October 26, 2001 13:37


All times are GMT -4. The time now is 06:21.