CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Local permeability in porousSimpleFoam or icoFoam

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

LinkBack Thread Tools Display Modes
Old   August 13, 2014, 11:46
Default Local permeability in porousSimpleFoam or icoFoam
New Member
James minto
Join Date: Nov 2012
Posts: 3
Rep Power: 6
james_minto is on a distinguished road
Hi everyone,

I'm using OpenFOAM 2.3.0 and would like to model flow through a porous media such as a sandstone core in which the permeability of the media varies spatially.

I think one approach (mentioned here) would be to use porousSimpleFoam but modify the DarcyForchheimer porosityModel so that the d and f coefficients are volume scalar fields that can be set with setFields (instead of being constants specified in the porosityProperties dictionary).

I am having two problems with this. Firstly the DarcyForchheimer class is located in src/finiteVolume/cfdTools/general/porosityModel and I am having trouble separating DarcyForchheimer from all the other finiteVolume classes so that it can be compiled separately in my user directory without getting a lot of dependency issues. Secondly I can create the new volume scalar fields for d and f (called d_local and f_local) following the adding temperature to icoFoam tutorial, but don't know where to start with changing references to d and f to d_local and f_local.

Another approach may be to modify the icoFoam solver so that d_local and f_local are included within the calculation of p and U in icoFoam.C. This might not be as nice a solution as using the existing porosityModel class but if it is a lot simpler then I would prefer this option as I have been using OpenFOAM for 2 years now but I'm new to modifying solvers.

And advice on how to implement either of these solutions (or any other solutions you may know) would be greatly appreciated. If anyone knows of a beginners guide/tutorial for creating your own solver than could you please send me a link to it.

If I make any progress on my own I'll post an update here.

Thanks a lot

james_minto is offline   Reply With Quote

Old   August 15, 2014, 14:57
New Member
James minto
Join Date: Nov 2012
Posts: 3
Rep Power: 6
james_minto is on a distinguished road



I've made a little progress. The attached solver was created following the guidance in this document and solves Darcy's Law for flow through porous media based on pressure head and permeability. I modified the solver so that permeability is a volume scalar field. A random initial permeability field was set with funkySetFields.

The results show that velocity and pressure vary with permeability (which is what I am after) but I have doubts about the solver. The next step is to create a new porosityModel based on the existing DarcyForchheimer model and create d_local and f_local volume scalar fields as described in the post above. This should allow the porousSimpleFoam solver to be used.

Any advice on how to isolate the porosityModels from finiteVolume so that I can compile a new model without 1) having to re-compile all the finiteVolume class and 2) get lots of dependency issues.
james_minto is offline   Reply With Quote

Old   August 21, 2014, 05:39
Hao Chen
Join Date: Aug 2014
Posts: 66
Rep Power: 0
hchen is on a distinguished road
Hi James:

I think that compiling a new library is not difficult. what you need to do is just to copy the file you need to the user directory, and copy the make file in the finite volume directory, and remove the irrelevant stuff in the make file, just keep lines related to the porous media class. And compile it.

Best regards
hchen is offline   Reply With Quote

Old   August 26, 2014, 07:57
New Member
James minto
Join Date: Nov 2012
Posts: 3
Rep Power: 6
james_minto is on a distinguished road
Hi Hao,

Thanks for the advice. I was able to compile just the porousMedia class following your suggestion. But so far I haven't been able to make any meaningful changes to the new class.

Instead, I've created lot's of cell zones (16,000), each with a different name, using topoSet and a topoSetDict created in EXCEL. Each of the 16,000 cell zones has a corresponding porosity entry (with its own d and f coefficients) in porosityProperties (again, created in EXCEL).

The existing porosity models can then be used without alteration. topoSet with this many cellZones is slow to run but only needs to be run once for each mesh. d and f coefficients can be changed for any/all cellZones by modifying the porosityProperties file.

Using EXCEL for this is a bit clumsy... but it works for my purposes. I hope to learn more coding so that I can create a more elegant solution one day.


james_minto is offline   Reply With Quote

Old   January 16, 2017, 05:03
New Member
Roberto Cirolini
Join Date: May 2016
Location: Kaiserslautern
Posts: 8
Rep Power: 2
RobertoCirolini is on a distinguished road
Hello James, I would like to know if you could improve your coding. I also want to set different permeability for each cell of my porous medium. Unfortunately, doing it in excel would not work for me in this situation

If you have any suggestions, please let me know.

Best regards,

RobertoCirolini is offline   Reply With Quote


darcy-forchheimer, local permeability, openfoam 2.3.0, poroussimplefoam

Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
BlockMeshmergePatchPairs hjasak OpenFOAM Native Meshers: blockMesh 11 August 15, 2008 07:36
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07

All times are GMT -4. The time now is 07:45.