|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Zhandos Baizhuma
Join Date: Nov 2019
Posts: 12
Rep Power: 7 ![]() |
Dear all!
I am trying to simulate Eulerian multi phase flow around the airfoil and I need to add source terms to airfoil wall. see Source terms and my udf file in attachments. As example I took continuity equation In source terms: αd the droplet volume fraction, ρd the droplet density and A the face area vector and vd the droplet impingement vector. I am new in UDF writing, so please can you give me any feedback, Best Zhandos |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
your code
Code:
#include "udf.h" #include "mem.h" #include "metric.h" #define d=1000; DEFINE_SOURCE (continuity,c,t,ds,eqn) { real NV_VEC(v); real NV_VEC(A); F_Area(A,f,t); source = -NV_DOT(v,A)*C_VOF(c,t)*d; ds[eqn]=0; return source; } 2. what is the unit of source you want to apply? 3. to use F_Area(A,f,t); macro you need face, but DEFINE_SOURCE makes a loop over cells (not faces) -> f is not defined 4. to define f inside DEFINE_SOURCE macro is challenging (from my point of view)
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Zhandos Baizhuma
Join Date: Nov 2019
Posts: 12
Rep Power: 7 ![]() |
Alexander Z, thank you for reply.
Actually I need to add 4 source terms, such as in picture v - droplet velocity vector, I thought that Fluent will pass value from inlet if face area vector is not applicable, maybe use x[ND_ND]? |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
what is the unit of source you want to apply?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Zhandos Baizhuma
Join Date: Nov 2019
Posts: 12
Rep Power: 7 ![]() |
kilogram per second
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
DEFINE_SOURCE macro applying volumetric source W/m3 or kg/m3
you can get more information in Ansys Fluent customization manual
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Zhandos Baizhuma
Join Date: Nov 2019
Posts: 12
Rep Power: 7 ![]() |
I am still trying to solve Eulerian Muldtiphase with UDF
I made some improvement to my UDF. Please can you give some feedback on it? #include "udf.h" DEFINE_SOURCE(phase_cont,c,t,dS,eqn) { real con, source; real NV_VEC(v), NV_VEC(A); int ro=1000; NV_D(v, =, C_U(c,t), C_V(c,t), C_W(c,t)); F_AREA(A,c,t); con = NV_DOT(v,A); source = -con*ro*C_VOF(c,t); dS[eqn] = 0; return source; } |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
code seems to be correct, what problems do you have with it?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Zhandos Baizhuma
Join Date: Nov 2019
Posts: 12
Rep Power: 7 ![]() |
It loads normally. But just after initialization there is a message in TUI
999999: mpt_accept: error: accept failed: No error 999999: mpt_accept: error: accept failed: No error MPI Application rank 0 exited before MPI_Finalize() with status 2 The fl process could not be started. I can not figure out why it happens |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
initialize first, then load UDF
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
Tags |
define_source, multi phase flow, udf code |
Thread Tools | Search this Thread |
Display Modes | |
|
|