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

UDF for Sorption in Species Transport through Porous Medium

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2017, 01:02
Question UDF for Sorption in Species Transport through Porous Medium
  #1
New Member
 
Kosch
Join Date: Jul 2017
Posts: 9
Rep Power: 9
Kosch is on a distinguished road
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.

\epsilon_g is the porosity of the porous medium
\rho_g is the density of the gas (vol. average of species)
\omega_{ph} is the mass fraction of the species "ph" in the gas
\omega_{ph}^{gr} is the mass fraction of the species "ph" in the grain
D_{eff}^{ph} 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 \omega_{ph}^{gr}. 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
File Type: jpg fumi_sorp.jpg (38.6 KB, 356 views)
Kosch is offline   Reply With Quote

Old   October 2, 2017, 19:01
Default solved
  #2
New Member
 
Kosch
Join Date: Jul 2017
Posts: 9
Rep Power: 9
Kosch is on a distinguished road
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
Kosch is offline   Reply With Quote

Old   October 19, 2017, 00:11
Default
  #3
Senior Member
 
rupak504's Avatar
 
Lolita
Join Date: Aug 2016
Posts: 118
Rep Power: 10
rupak504 is on a distinguished road
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
rupak504 is offline   Reply With Quote

Old   June 28, 2020, 03:17
Default
  #4
New Member
 
amin
Join Date: Aug 2014
Posts: 20
Rep Power: 12
amin_67323 is on a distinguished road
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
amin_67323 is offline   Reply With Quote

Old   June 28, 2020, 12:02
Post
  #5
New Member
 
Kosch
Join Date: Jul 2017
Posts: 9
Rep Power: 9
Kosch is on a distinguished road
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
Kosch is offline   Reply With Quote

Old   June 28, 2020, 14:00
Default
  #6
New Member
 
amin
Join Date: Aug 2014
Posts: 20
Rep Power: 12
amin_67323 is on a distinguished road
Thanks a lot
It was helpful
amin_67323 is offline   Reply With Quote

Old   October 21, 2020, 17:46
Default
  #7
New Member
 
khedidja
Join Date: Mar 2020
Posts: 6
Rep Power: 6
khadi is on a distinguished road
Quote:
Originally Posted by Kosch View Post
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
khadi is offline   Reply With Quote

Reply

Tags
porous medium, species transport, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
user defined scalar vs species transport gvj_mech FLUENT 0 March 27, 2014 14:33
mass transfer and occupying porous medium borhan_sd@yahoo.com FLUENT 0 June 26, 2013 03:34
species transport and occupying sites of porous medium borhan_sd@yahoo.com FLUENT 0 June 19, 2013 03:34
How to use non-equilibrium thermal model for porous medium in Ansys CFX 13.0? Chander CFX 3 November 28, 2011 14:26
UDF reading species data of pdf simulations Jamiro FLUENT 0 June 20, 2001 17:15


All times are GMT -4. The time now is 10:43.