modelling Differential equations in a udf
I'm working on a CFD-model 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 DQMOM-IEM model for a competitive reaction that have the following form:
B and D are added in one inlet and A in the other. The DQMOM-IEM 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 DQMOM-IEM 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 DQMOM-IEM 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 10-12.
Now on to my question. I want to program these equation into a UDF-file. 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 UDF-solver 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.
You can find an example in flu_udf.pdf on pp. 175-176.
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.
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.
|All times are GMT -4. The time now is 10:23.|