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

Capillary diffusion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2019, 04:57
Default Capillary diffusion
  #1
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Hello everyone!
I am try to add Capillary force to porous media ,I made changes on the basis of CSF.Multiply the volume fraction by Fvol,then add into the source term of each phase.The results show an increase in pressure but no change in liquid volume fraction.The capillary dispersion is not happen.I don't know why? Is my udf wrong.if you can tell me something,i will vervy thank you.
part of udf
DEFINE_ADJUST(adjust_gradient1, domain)
{
Thread *t;
cell_t c;
domain = Get_Domain(2);
/* Fill UDS with the variable. */
thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
C_UDSI(c, t, 0) = C_VOF(c, t);
C_UDMI(c, t, 4) = C_UDSI(c, t, 0);
}
end_c_loop(c, t)
}

}

DEFINE_ON_DEMAND(store_gradient1)
{
Domain *domain;
cell_t c;
Thread *t;
domain = Get_Domain(2);
/* Fill the UDM with magnitude of gradient. */
thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
C_UDMI(c, t, 5) = NV_MAG(C_UDSI_G(c, t, 0));
}
end_c_loop(c, t)
}
}

DEFINE_SOURCE(gas_phase_xmom_source, cell, t, dS, eqn)
{
real sigma, ttt, dp, a, dmin, Fvol, source;
cell_t c;
dp = 0.0016;
ttt = sqrt(3) / 3.14159 - 0.5;
dmin = sqrt(ttt)*dp;
a=C_UDMI(c, t, 9);
sigma = 0.07275 * 2 * pow(a, 0.33333)*1.108117;
Fvol = C_UDMI(c, t, 4) * sigma*(C_UDMI(c, t, 4)*1.225*dmin*C_UDMI(c, t, 5) + C_UDMI(c, t, 8)*998.2*dp*C_UDMI(c, t, 7)) / 0.5 / (998.2 + 1.225);
source = - Fvol;
dS[eqn] = 0;
return source;

}
wuming is offline   Reply With Quote

Old   February 26, 2019, 08:16
Default
  #2
Member
 
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9
annan is on a distinguished road
Dear Wuming,

Did you check if all the UDMs you are using in Fvol are defined and have values that are different from zero ?

Did you define the store_gradient1 deliberately as a DEFINE_ON_DEMAND function ? This means that the gradient of your UDS is going to be store only if you manually run the store_gradient1 function in post-processing.

Best regards,
Annan
annan is offline   Reply With Quote

Old   February 26, 2019, 09:22
Default
  #3
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Quote:
Originally Posted by annan View Post
Dear Wuming,

Did you check if all the UDMs you are using in Fvol are defined and have values that are different from zero ?

Did you define the store_gradient1 deliberately as a DEFINE_ON_DEMAND function ? This means that the gradient of your UDS is going to be store only if you manually run the store_gradient1 function in post-processing.

Best regards,
Annan
thank you ,when i calculate, I will let fluent calculate some steps,then use execute on demand load store_gradient1,the UDM are not zero, as i ask,my pressure is increase.
wuming is offline   Reply With Quote

Old   February 27, 2019, 21:37
Default
  #4
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Sorry, I made a mistake, but the reply could not be deleted, so I can only do this.
wuming is offline   Reply With Quote

Old   February 27, 2019, 21:39
Default
  #5
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Quote:
Originally Posted by wuming View Post
thank you ,when i calculate, I will let fluent calculate some steps,then use execute on demand load store_gradient1,the UDM are not zero, as i ask,my pressure is increase.
I know what you talk,the gradient is not change when case calculation,so how i should modify the udf,can make me get gradient of the Volume fraction,thank you
wuming is offline   Reply With Quote

Old   February 27, 2019, 21:42
Default
  #6
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Quote:
Originally Posted by annan View Post
Dear Wuming,

Did you check if all the UDMs you are using in Fvol are defined and have values that are different from zero ?

Did you define the store_gradient1 deliberately as a DEFINE_ON_DEMAND function ? This means that the gradient of your UDS is going to be store only if you manually run the store_gradient1 function in post-processing.

Best regards,
Annan
I know what you talk,the gradient is not change when case calculation,so how i should modify the udf,can make me get gradient of the Volume fraction,thank you
wuming is offline   Reply With Quote

Old   February 27, 2019, 22:28
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
Fvol = C_UDMI(c, t, 4) * sigma*(C_UDMI(c, t, 4)*1.225*dmin*C_UDMI(c, t, 5) + C_UDMI(c, t, 8)*998.2*dp*C_UDMI(c, t, 7)) / 0.5 / (998.2 + 1.225);
in your code C_UDMI(c, t, 4) is defined, but what about other UDMs?
C_UDMI(c, t, 5)
C_UDMI(c, t, 7)
C_UDMI(c, t, 8)
are they defined? where?

best regards
AlexanderZ is offline   Reply With Quote

Old   February 27, 2019, 22:44
Default
  #8
New Member
 
wuming
Join Date: Nov 2018
Posts: 26
Rep Power: 7
wuming is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Code:
Fvol = C_UDMI(c, t, 4) * sigma*(C_UDMI(c, t, 4)*1.225*dmin*C_UDMI(c, t, 5) + C_UDMI(c, t, 8)*998.2*dp*C_UDMI(c, t, 7)) / 0.5 / (998.2 + 1.225);
in your code C_UDMI(c, t, 4) is defined, but what about other UDMs?
C_UDMI(c, t, 5)
C_UDMI(c, t, 7)
C_UDMI(c, t, 8)
are they defined? where?

best regards
in my code C_UDMI(c, t, 4) and C_UDMI(c, t, 5) are defined,and it's gas phase;C_UDMI(c, t, 7) and C_UDMI(c, t, 8) it's liquid phase
wuming is offline   Reply With Quote

Reply

Tags
udf capillary force


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
Harmonic average of Diffusion Tensors in Finite Volume Method Yurie_Breschnef Main CFD Forum 4 September 6, 2018 05:51
Diffusion in Porous Media kdep FLUENT 1 March 28, 2016 17:50
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
[ANSYS Meshing] Issue with modeling dynamic capillary rise in a capillary tube cp703 ANSYS Meshing & Geometry 13 March 22, 2013 21:11
How to stop diffusion and advection in a zone for selected species. hda FLUENT 0 March 19, 2012 00:59


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