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

About time dependant viscous resistance in porous media model

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By AlexanderZ
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2019, 11:21
Default About time dependant viscous resistance in porous media model
  #1
New Member
 
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9
sshivam is on a distinguished road
Hello, I am trying to model the flow in swelling porous media for LCM applications. Right now I have an equation which is the function of the wetting time of element and flow time. The idea is that permeability of the element behind the flow front should change according to time. how can I add this effect using UDF?
Right now I am using VOF method to model the liquid front locations. The following functions I expect an UDF should do,
1. When the volume fraction in a cell becomes 1, then the corresponding time should be saved as tw (wetting time).
2. Then the viscous resistance for secondary phase in porous media should be modified using the equation a= (1/(3.7E-15*(current_time-tw)^2-1.75E-12*(current_time-tw)+6E-10))

where,
tw is the wetting time which is constant for each cell
sshivam is offline   Reply With Quote

Old   November 5, 2019, 01:28
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
macro C_VOF(c,t) shows volume fraction for the phase, vary between 0 and 1

check C_VOF(c,t), if =1, save time moment.

using define_property macro, you can make time dependent viscous resistance
sshivam likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 5, 2019, 07:41
Default
  #3
New Member
 
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9
sshivam is on a distinguished road
#include "udf.h"

DEFINE_PROFILE(vis_res,t,i)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
real xc[ND_ND];

real current_time;
current_time = CURRENT_TIME;


sub_domain_loop(subdomain, mixture_domain, phase_domain_index) /* loop over all subdomains (phases) in the superdomain (mixture) */
{
if (DOMAIN_ID(subdomain) == 2) /* loop if secondary phase */

thread_loop_c (cell_thread,subdomain) /* loop over all cell threads in the secondary phase domain */
{

begin_c_loop_all (cell,cell_thread) /* loop over all cells in secondary phase cell threads */
{

C_CENTROID(xc,cell,cell_thread);

if

C_VOF(cell,cell_thread) = 1.; /* if volume fraction to 1*/

tw = C_time(c,t); /*wetting time*/

C_UDMI(c,t,0)=tw; /*saving wetting time*/

a = (1/(3.7E-15*(current_time-tw)^2-1.75E-12*(current_time-tw)+6E-10));

else

a =(1/9E-10);

F_PROFILE(c,t,i) = a;
}
}
}
end_c_loop_all (cell,cell_thread)
}

Previously I developed this UDF using the ANSYS manual but it seems that the code is wrong. Would you suggest some modifications for the same?
sshivam is offline   Reply With Quote

Old   November 6, 2019, 02:51
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
your if statement is wrong.
your else statement is wrong

there is no macro C_time(c,t) use CURRENT_TIME
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 6, 2019, 12:01
Default
  #5
New Member
 
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9
sshivam is on a distinguished road
Hello, just for simplification I have following code to capture time at which the volume fraction in a cell becomes 1. is the logic is right?

#include "udf.h"
#include "sg_mphase.h"

DEFINE_ADJUST(wetting_time,d)
{
Thread *t;
Thread **pt;
cell_t c;
real current_time;
real VOF_resin=C_VOF(c,pt[3]);
int zone_ID=1;
Thread *mixture_thread = Lookup_Thread(d,zone_ID);
pt = THREAD_SUB_THREADS(mixture_thread);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
if
VOF_resin==1 /* phase_thread 0 - air, phase thread 3 - resin */
{
C_UDMI(c,t,0)=current_time;
}
end_c_loop(c,t)
}
}
sshivam is offline   Reply With Quote

Old   November 8, 2019, 00:28
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
the logic looks correct for me, but you should check, how it works
sshivam likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   November 8, 2019, 09:40
Default
  #7
New Member
 
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9
sshivam is on a distinguished road
Hello Alexander,

It complies with no errors. However, as I mentioned earlier, I need to modify the viscous resistance for the second phase. In the Fluent UDF manual, they don't mention the usage of the DEFINE_PROFILE for viscous resistance. so is there any other way that I can modify the same or else I would have to change the VOF model to mixture model.
sshivam is offline   Reply With Quote

Reply

Tags
fluent - udf, porous media flow, vof multiphase


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
Porous media setup issues in Fluent Bernard Van FLUENT 29 January 26, 2017 05:09
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 08:09
How to define the porous inertial resistance and viscous resistance of porous media? pinfan143 STAR-CCM+ 5 July 21, 2015 12:52
Hardware-Configuration for Fluent HPC-Pack (8x) JohHaas Hardware 9 March 3, 2015 14:25
Multiphase porous media model:inertial and viscous resistance button doesn't show up Tanjina Fluent Multiphase 3 July 21, 2013 13:08


All times are GMT -4. The time now is 13:38.