|
[Sponsors] |
August 15, 2014, 08:47 |
kronecker delta user defined function fluent
|
#1 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi,
I would like to define following expresion in UDF: it is for Eulerian multiphase gas-solid flow.. S_prime_12ij=S_12ij-1/3*S_12mm*kronecker delta_ij; S_12ij-strain rate tensor. But I can not define the kronecker delta in udf. So Is there anybody who had the same problem or do you know how to do it? Thanks in advance! |
|
August 15, 2014, 11:09 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
This is not so difficult. The implementation follows directly from the definition of the Kronecker Delta.
If you write down the definition of the Kronecker Delta in English words, you practically have the code to implement in your udf, only a little of syntax changes... How would you define the Kronecker Delta? (I could give you the answer directly, but I prefer to teach you how to solve these problems, this will help you more in the long term.) |
|
August 15, 2014, 11:38 |
|
#3 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi,
Thanks for the answer!I know that Kronecker Delta is: δij(Kronecker Delta) = 1, if i = j 0, if i not = j but in udf there is no indexes in the macros for example for velocity C_U(c,t), C_V(c,t) only we can understand the direction from the letters U and V right? how we can define a if statement for it? thanks in advance! Quote:
|
||
August 15, 2014, 12:04 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
So the code for kronecker delta:
Code:
if (i==j) kroneckerdelta=1; else kroneckerdelta=0; But it turns out that the kronecker delta is not really your problem, but how to get the indices of the strain rate tensor... You are correct, the only way to do this is by explicitly writing out the components. So S11 would be C_DUDX(c,t), etc. The strain rate tensor is not directly defined in Fluent, but you need to use its nine components that are defined. (edit: after you take the symmetric part of course, so S12 would be (C_DUDY(c,t)+C_DVDX(c,t))/2.) Technically the strain rate tensor is also defined through three vectors, namely C_U_G, C_V_G and C_W_G, which put together also form the strain rate tensor, but I don't think this will help anything. But, your question started with "I would like to define following expresion in UDF". What do you want to use that expression for? Plot the result? Use it in a different calculation? |
|
August 15, 2014, 12:19 |
|
#5 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
thanks a lot!
I would like to use it for calculation of turbulence model.. yes you are right I can not get the indexes! I defined them as below: PHP Code:
thanks again! Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
The fluent stopped and errors with "Emergency: received SIGHUP signal" | yuyuxuan | FLUENT | 0 | December 3, 2013 23:56 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |
user defined function | Thomas Lescot | FLUENT | 1 | May 4, 2007 11:13 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |