CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   FLUENT UDF (https://www.cfd-online.com/Forums/fluent/28141-fluent-udf.html)

sanjib das sharma January 13, 2001 07:28

FLUENT UDF
 
Is it possible to use the UDF in FLUENT to include a separate model not in FLUENT?For eg. I want to use k-e-kp model instead of k-e model,but that model is not there in FLUENT.If possible,how? please answer quickly.....

Greg Perkins January 14, 2001 18:53

Re: FLUENT UDF
 
If you can construct the mathematical source terms that need to be added to a particular equation then you should be able to implement them in Fluent. If your source terms need to make changes to the convective terms in the equation you can use the divergence theorem to convert them into volume source terms rather than face fluxes.

One warning - It may not be easy to implement though - it really depends on what you want to do.

On how - please read the UDF manual.

Greg

sanjib das sharma January 15, 2001 00:45

Re: FLUENT UDF
 
Thanks a lot,Greg.That means,I can use any turbulence model I want and use them in Fluent.Actually,I am modelling gas-solid two phase flow in a circulating fluidized bed.For the turbulence model I would like to replace the existing k-e model with another new model k-e-kp,where kp is another parameter like k,and involves a similar equation as an addition.Other extra terms follow.Also if I want to take particle-particle interaction I have to use additional equations.As far as I have understood from the manual,the UDF can only be used to modify a simple term,eg. A->3A etc.Am I right?

Greg Perkins January 15, 2001 01:06

Re: FLUENT UDF
 
The examples in the udf manual are starting points but you can make them arbitrarily complex - in reality I think you could implement pretty much anything - but as I said it can be difficult.

Think of the general equation form

accumulation + convection = diffusion + source

Now fluent gives you acces to the source part and depending on the equation you can also modify the co-efficients for convection, diffusion and in scalars the accumulation as well.

The thing to do is to determine your equation mathematically - then compare with Fluent equations. In case of turbulence your equation may differ from the standard k-e eqns by one source term or the computation of the diffusivity etc. In this case you may write a udf to modify or add the appropriate term. If your equation is unlike anything in Fluent you may use a scalar eqn to solve it. In this case you;d write other udf's to add sources etc to the momentum eqn or heat transfer eqn to get coupling between your scalar eqn and the normal Navier-Stokes eqns etc (if you take this approach you'd turn off Fluent's turbulence models). I can't see why you can't implement you own turbulence model using scalar transport eqns and couple it back to the other usual eqns. But I wouldn't recommend it because you;d also have to write routines to handle the boundary conditions and they are pretty complex in turbulence - so I'd try and modify the existing models first.

The only major issue is when you want to write terms which need to be computed using face fluxes - eg. convection terms. In this case you need to access a lot of internal Fluent data-structures which aren't explained in the manual. Its possible as I've found - just takes a bit of time that's all. Talk to the fluent engineers if you are unsure on implementation issues.

Oh and of course adding things may make fluent less robust - but I've found that so long as you're udfs are well written robustness isn't a big issue. It may take a while to get a good convergence procedure.

Greg

Greg Perkins January 15, 2001 01:37

Re: FLUENT UDF
 
By the way what version of Fluent are you using? v4.5 with Eulerian two-phase model??

Greg

sanjib das sharma January 15, 2001 02:59

Re: FLUENT UDF
 
no,FLUENT 5.0 SANJIB

Greg Perkins January 15, 2001 03:03

Re: FLUENT UDF
 
How do you model a fluidised bed in fluent 5.0? have you written a lot of udfs for this - or are you using the lagrangian dpm method - which I would have thought would not be that good for a fluidised bed where the solid volume fractions can be reasonably high??

Greg

sanjib das sharma January 15, 2001 06:09

Re: FLUENT UDF
 
well,till now i have only simulated gas-particle flow through a vertical pipe.i have used dilute concentrations,so that only lagrangian technique is useful.but as soon as i tried to increase the concentrations in case of a CFB,it didn't work that way.actually,i didn't use the udf in any of my previous simulations.but now i think i have to use that option.however,Fluent 4.5 has the eulerian-eulerian technique which i didn't use till now.what is your idea about that

cfd January 15, 2001 13:49

Re: FLUENT UDF
 
Could you give me some idea of how to run UDF code.

Greg Perkins January 15, 2001 18:38

Re: FLUENT UDF
 
In general I would have thought you would need to use a Eulerian-Eulerian model for the fluidised bed under normal operating conditions. Perhaps have a look in the literature for how others have done it. The Lagrangian method is only applicable for dilute concentrations (low volume fraction, low loading) as you mentioned.

Greg

sanjib das sharma January 16, 2001 00:39

Re: FLUENT UDF
 
Greg,can you send me an example of an UDF,where a new model has been used that is not there in Fluent?I'll be very thankful to you.I read the manual several times,but still could not figure out how it is to be done.It seems that you have written a lot of UDFs,so your suggestions will be of great help to me. Thanks anyway, Sanjib.

Greg Perkins January 16, 2001 00:41

Re: FLUENT UDF
 
Check out the udf repository at this forum or see www.perkins-software.com.au/Fluent for some examples.

Greg

sanjib das sharma January 16, 2001 08:19

Re: FLUENT UDF
 
Thanks a lot Greg.Seems you are an expert in writting UDFs.However,is the model,that you have used,already there in Fluent?I mean as I myself didn't solve the specific problem,so I could not understand eaxctly what modification your code did to the existing software.Could you please expalin in brief?It will be of great help to me. Best wishes, Sanjib


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