
[Sponsors] 
September 18, 2013, 03:46 
modelling Differential equations in a udf

#1 
New Member
Rikard Meyer Norén
Join Date: Sep 2013
Posts: 6
Rep Power: 12 
Hi!
I'm working on a CFDmodel as part of my master thesis. I'm pretty alone in using CFD in my research group so i have to figure out how to do most things myself. I have good knowledge of the Ansys fluent software but I have never programmed a UDF file before and that is why I seek help here. I have articles describing all the governing equations and what methods to use but I have trouble figuring out how to translate this into a working C code. Basically I have to implement the DQMOMIEM model for a competitive reaction that have the following form: B and D are added in one inlet and A in the other. The DQMOMIEM model will use two environments two describe the mixing of the two flows. The first reaction is treated as instantaneous and only the second have a chemical source term. The k[math\epsilon[/math] model will be used to calculate the turbulent dissipation I need five conserved scalars which will be implemented as user defined scalars . I also have five transport equations describing the mixing and reaction Transport equation for volume fraction of environment 1 : is the mean velocity which is together with k and given by the model and is the mean density, which is known. The transport equations for the mixture fraction in the two environments are. For the first environment The second is very similar The last two equations are for the reaction transport variables, and . They both consider only reaction two since one is considered instantaneous. The chemical reaction source term have the following equation: Since the first reaction is treated as instantaneous can be determined by the following formula. The last parts of the equations follow. This is all I should need to implement the DQMOMIEM method in my model in the stream that contains A and . Finally the concentration on the different species in each environment (n) can be written. These are all the equations. It might seam much but they are all very similar to each other. According to the article i got this from the solution can be divided into three steps (1) Solving the turbulence model for , k and (2) Solving the nonreactiong DQMOMIEM model (in effect equations 2, 3 and 4) to find , , and (3) Solve the reaction equations (5 and 6) to get and and then concentrations can be calculated with equations 1012. Now on to my question. I want to program these equation into a UDFfile. I know the basics behind the programming like how to import the velocity and how to extract the variables in the end. But i don't know how to go about solving these differential equations. Should i solve them by hand and then implement the solutions into the UDF or is it possible to program a coupled UDFsolver in C, which of course would be the best option? I'm pretty sure i will experience more problem on the way but this is what i need to know before i start the programming. If anyone would be interested in coaching me a little on this problem it would be greatly appreciated, and not that it might matter that much but you would get your name on the thank you list of my master's thesis I also don't know how to distinguish between the to different environments. I think i should use domains, threads and cells but if anyone have a example code used for similar cicrumstances that i could look at. I hope i haven't forgotten any important information and that the equations are readable. I Once again sincerely thank anyone who has any input on this problem. Rikard Meyer Norén Studying at ECUST, Shanghai originally from Chalmers University of Technology, Gothenburg. 

September 28, 2013, 06:07 

#2 
Member
Georgy
Join Date: Apr 2011
Location: Russia
Posts: 32
Rep Power: 15 
Rikard,
You can find an example in flu_udf.pdf on pp. 175176. As I understand you need to look in direction of "DEFINE_UDS_FLUX". Sorry for small answer, I'm not a specialist in your area. 

October 1, 2013, 03:36 

#3 
New Member
Rikard Meyer Norén
Join Date: Sep 2013
Posts: 6
Rep Power: 12 
Thanks for the tip.
I did, after a lot of searching find out that this feature in now days programmed into ansys fluent. so luckily i wont have to do any programming. 

Tags 
udf 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
modelling heat flux in udf  dzuodoka  Fluent UDF and Scheme Programming  0  November 24, 2010 05:10 
Advice on multiphase flow modelling  Martin  Main CFD Forum  3  October 14, 2008 05:16 
free " ordinary differential equations solver"  ztdep  Main CFD Forum  2  March 21, 2006 01:58 
MultiDimensional Partial Differential Equations.  Aditya  Main CFD Forum  2  October 28, 2005 05:03 
differential pressure UDF  Phil  Main CFD Forum  1  August 20, 2004 10:10 