|
[Sponsors] |
About time dependant viscous resistance in porous media model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 4, 2019, 11:21 |
About time dependant viscous resistance in porous media model
|
#1 |
New Member
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9 |
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 |
|
November 5, 2019, 01:28 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 5, 2019, 07:41 |
|
#3 |
New Member
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9 |
#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? |
|
November 6, 2019, 02:51 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
November 6, 2019, 12:01 |
|
#5 |
New Member
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9 |
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) } } |
|
November 8, 2019, 00:28 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
the logic looks correct for me, but you should check, how it works
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 8, 2019, 09:40 |
|
#7 |
New Member
shivam salokhe
Join Date: Feb 2017
Posts: 10
Rep Power: 9 |
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. |
|
Tags |
fluent - udf, porous media flow, vof multiphase |
|
|
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 |