# About time dependant viscous resistance in porous media model

 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 4, 2019, 10:21 About time dependant viscous resistance in porous media model #1 New Member   shivam salokhe Join Date: Feb 2017 Posts: 10 Rep Power: 5 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, 00:28 #2 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,206 Rep Power: 20 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 helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 November 5, 2019, 06:41 #3 New Member   shivam salokhe Join Date: Feb 2017 Posts: 10 Rep Power: 5 #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, 01:51 #4 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,206 Rep Power: 20 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 helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 November 7, 2019, 23:28 #6 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,206 Rep Power: 20 the logic looks correct for me, but you should check, how it works sshivam likes this. __________________ best regards ****************************** press LIKE if this message helped you How to ask questions: https://www.cfd-online.com/Forums/si...tml#post612025

 November 8, 2019, 08:40 #7 New Member   shivam salokhe Join Date: Feb 2017 Posts: 10 Rep Power: 5 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