|
[Sponsors] |
C_UDSI_G use in momentum source term in eulerian model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 29, 2017, 19:25 |
C_UDSI_G use in momentum source term in eulerian model
|
#1 |
New Member
Nishan
Join Date: May 2017
Posts: 1
Rep Power: 0 |
I am trying to simulate 2D multiphase flow and heat transfer in porous media in FLUENT. My domain is simple square domain with the liquid flow coming in from the top boundary. The side boundaries are symmetry. Half of the bottom boundary is heat inlet while the other half is flow outlet. The phase change from liquid to vapor occurs near the heated boundary.
I am incorporating momentum source terms in x and y directions for just the liquid phase. First I use DEFINE_ADJUST to store a value in C_UDSI and then i use C_UDISI_G to calculate the source terms.I tried comparing between simulations with the momentum source and no source terms but the results are identical. I displayed some messages within the code and found that nothing is being stored in C_UDSI. Can anybody tell me where I am going wrong in the code?? The code is written below. DEFINE_ADJUST(cap_pressure, domain) { Thread *t; real eps = 0.4; real K = 10 ^ -11; real sig = 0.0738; cell_t c; real a; Domain *liquiddomain = DOMAIN_SUB_DOMAIN(domain, 0); /* Getting liquid domain from the mixture domain passed onto the DEFINE_ADJUST macro*/ Thread *mixture = Lookup_Thread(domain, 1); /*Here 1 is the zone id for the interior domain in boundary conditions panel*/ Thread *liq = THREAD_SUB_THREAD(mixture, 0); thread_loop_c(t, liquiddomain) /*should it be just domain or liquiddomain??*/ /*Both doesnt work*/ { if (t == liq) { begin_c_loop(c, t) { a = C_VOF(c, t); C_UDSI(c, t, 0) = sqrt(eps / K) *sig*(1.417*(1 - a) - 2.12*(1 - a)*(1 - a) + 1.263*(1 - a)*(1 - a)*(1 - a)); } end_c_loop(c, t) } } } DEFINE_SOURCE(liquid_x, c, t, ds, eqn) { real source = 0.0; real a = C_VOF(c, t); source = -a*C_UDSI_G(c, t, 0)[0]; ds[eqn] = 0; return source; } DEFINE_SOURCE(liquid_y, c, t, ds, eqn) { real source = 0.0; real b = C_VOF(c, t); source = -b*C_UDSI_G(c, t, 0)[1]; ds[eqn] = 0; return source; } |
|
May 30, 2017, 07:13 |
|
#2 |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
Hallo,
please check if this solution works (You need to populate gradients in DEFINE_ADJUST): UDF-How to calculate gradient of a scalar Best regards, Maks |
|
Tags |
c_udsi_g, fluent - udf, fluent multiphase model |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 02:41 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |