# About time dependant viscous resistance in porous media model

 User Name Remember Me Password
 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: 8 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: 2,309 Rep Power: 33 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

 November 5, 2019, 06:41 #3 New Member   shivam salokhe Join Date: Feb 2017 Posts: 10 Rep Power: 8 #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: 2,309 Rep Power: 33 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 7, 2019, 23:28 #6 Senior Member   Alexander Join Date: Apr 2013 Posts: 2,309 Rep Power: 33 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

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

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Bernard Van FLUENT 29 January 26, 2017 04:09 xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 07:09 pinfan143 STAR-CCM+ 5 July 21, 2015 11:52 JohHaas Hardware 9 March 3, 2015 13:25 Tanjina Fluent Multiphase 3 July 21, 2013 12:08

All times are GMT -4. The time now is 16:34.

 Contact Us - CFD Online - Privacy Statement - Top