# UDF for Sorption in Species Transport through Porous Medium

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

September 5, 2017, 01:02
UDF for Sorption in Species Transport through Porous Medium
#1
New Member

Kosch
Join Date: Jul 2017
Posts: 9
Rep Power: 7
Hi,

Intro
As part of a project I have to simulate a multispecies flow through a porous medium. One of the species shows sorption characteristics (absorption, adsorption, no one knows). Through experiments we can characterize the sorption (empirical model) and my task is now to implement that as UDF in Fluent. I personally never worked with UDF but I have some experience with programming. So my problem is not programming, more the understanding of Fluent UDF interna.

Equations
I attached a picture of the equations I want to implement. The equation is from:
Z.M. Isa et al. ‘Mathematical modelling and numerical simulation of phosphine flow during grain fumigation in leaky cylindrical silos’. In: Journal of Stored Products Research 67 (May 2016).

The source of the equations is about fumigation of grain with Phosphine, therefore the species has the index ph, gas (mixed species) has index g, Grain as the porous medium has index gr. I want to implement it more general but I kept the indicies for now.

is the porosity of the porous medium
is the density of the gas (vol. average of species)
is the mass fraction of the species "ph" in the gas
is the mass fraction of the species "ph" in the grain
Diffusion coeff.

The first line in equation G.3 is basically the Species Transport Equation (7-1 in Fluent Theory Guide) with added source terms with empirical B1 and B2 on the second line. They describe both directions of the sorption (B1 from Gas to Porous Medium, B2 from Porous Medium to Gas). Equation G.4 describes the development of the species in the porous medium, with B4 ( from Gas to Porous Medium) and B3 (from Porous Medium to Gas).

Where I got stuck

I did read the manual and different tutorials and I think I have a good idea how to add source terms to the mass conservation equation and I know I have to add the terms (B1 and B2 terms). My problem is that the B2 term depends on the species content of the porous media . As far as I know the porous medium is only a momentum sink for Fluent and there is no species content in porous medium by default.

Do I have to somehow implement that myself or is there a "fluent way" to implement that, especially with the second differential equation G.4 ?

Thank you

PS: I am from Germany and English isn't my first language. I hope I was able to describe the problem, otherwise don't hesitate to ask.
Attached Images
 fumi_sorp.jpg (38.6 KB, 300 views)

 October 2, 2017, 19:01 solved #2 New Member   Kosch Join Date: Jul 2017 Posts: 9 Rep Power: 7 If anyone finds it on google on wonders about a solution: The keywords in the fluent help are UDS and UDS transport equations. The idea is to create a user defined scalar (in each cell) for the bound material. In the transport equation the diffusion and convection terms are disabled and I used a UDF source term. Without going into detail: - in UDF: DEFINE_SOURCE macros - in Fluent GUI: on the zone, enable source, fumigant 1 source, uds-0 1 source and there selecting the UDFs

 October 19, 2017, 00:11 #3 Senior Member     Lolita Join Date: Aug 2016 Posts: 115 Rep Power: 8 hello Kosch I am working on similar problem but without the porous medium, it's water vapor mixed in air being absorbed by a liquid mixture and the water vapor condenses due to absorption or adsorption (god only knows). i am good with working through udf in fluent but the problem is, i am weak in programming, so if you could help me with that, it will be of great help. thanks

 June 28, 2020, 03:17 #4 New Member   amin Join Date: Aug 2014 Posts: 20 Rep Power: 10 hello Kosch Did you find the solution of your problem with UDF for adsorption? I got stuck with the same problem as you, and I don't know anything about UDF programming. If you help me, it will be great and I'll appreciate it. Thanks

 June 28, 2020, 12:02 #5 New Member   Kosch Join Date: Jul 2017 Posts: 9 Rep Power: 7 It was a while ago, but just to outline what I did at the end: I used fluent UDS to save the currently absorbed gas. For each iteration I then used the empirical equations to describe how much goes into and out of the porous medium. That worked well and I was able to validate my method for a benchmark case. Unfortunately, the actual conditions I wanted to simulate were completely different to the condition that were used to derive the empirical equations. That means I would have to set up an experiment to validate that the empirical equations still hold true and that never happened. It might happen at some point, but the current situation with the pandemic and everything... About writing UDF: I worked through the manual and tutorials and it worked okay. I also got a little mini workshop about the topic from the provider of my fluent license. I highly recommend to learn as much as possible beforehand and use these kind of workshops to ask specific questions to your project. In general: some kind of workshop or uni short course on that topic is good to have. Better than I can explain here in the forum anyways. Kind Regards

 June 28, 2020, 14:00 #6 New Member   amin Join Date: Aug 2014 Posts: 20 Rep Power: 10 Thanks a lot It was helpful

October 21, 2020, 17:46
#7
New Member

khedidja
Join Date: Mar 2020
Posts: 6
Rep Power: 5
Quote:
 Originally Posted by Kosch It was a while ago, but just to outline what I did at the end: I used fluent UDS to save the currently absorbed gas. For each iteration I then used the empirical equations to describe how much goes into and out of the porous medium. That worked well and I was able to validate my method for a benchmark case. Unfortunately, the actual conditions I wanted to simulate were completely different to the condition that were used to derive the empirical equations. That means I would have to set up an experiment to validate that the empirical equations still hold true and that never happened. It might happen at some point, but the current situation with the pandemic and everything... About writing UDF: I worked through the manual and tutorials and it worked okay. I also got a little mini workshop about the topic from the provider of my fluent license. I highly recommend to learn as much as possible beforehand and use these kind of workshops to ask specific questions to your project. In general: some kind of workshop or uni short course on that topic is good to have. Better than I can explain here in the forum anyways. Kind Regards
hello
I have to implement the radiation model, momentum source term in porous media; but I didn't have any experience about UDF. I find several difficulties to simulate heat transfer and flow through porous media. I need some help please

 Tags porous medium, species transport, udf