CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

C_UDSI_G use in momentum source term in eulerian model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 29, 2017, 19:25
Default C_UDSI_G use in momentum source term in eulerian model
  #1
New Member
 
Nishan
Join Date: May 2017
Posts: 1
Rep Power: 0
Nishan is on a distinguished road
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;
}
Nishan is offline   Reply With Quote

Old   May 30, 2017, 07:13
Default
  #2
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10
kirmaks is on a distinguished road
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
kirmaks is offline   Reply With Quote

Reply

Tags
c_udsi_g, fluent - udf, fluent multiphase model


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 17:28.