CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to Produce a Multiregion Porous Media - simpleFoam (

DavidOuellette March 3, 2013 12:19

How to Produce a Multiregion Porous Media - simpleFoam
Hey all,

I recently setup a simple case where I have flow between parallel plates and the media between these plates is a porous material. The flow is also governed by Darcy's Law. Now, I want to expand this case to have flow through multiple porous layers, where each porous layer has different properties. Unfortunately, I'm having trouble with the 'easy case' of creating a second layer.

I played around with chtMultiRegionSimpleFoam as well as the tutorial case of multiRegionHeater. However, when I ran the tutorial as is, without any modification, it did not converge. I also did not get convergence when I play around with mesh size and boundary conditions. I also noticed that a lot of people seem to have trouble with the same solver. My question though, has anyone tried making a multilayer porous media with this solver (chtMultiRegionSimpleFoam)? One of the challenges that I can foresee is that the fluid and solid regions will coincide. Can chtMultiRegionSimpleFoam handle that?

I was also looking into Maria Garcia Camprubi's PhD thesis ( where she modeled a solid oxide fuel cell using OpenFOAM (her version of OF was part of the ext branch, mine is OF 2.1.1). She explained that we can map properties to different regions within a mesh. Does anyone have experience with this technique or know of any good references or start points for this technique? Also, does anyone know of any other possible ways to have multiple regions with different properties?


wyldckat March 3, 2013 13:01

Greetings David,

If I understand you correctly, what you want are only multiple porous zones, but with not clear separation between fluid zones (i.e. the same fluid goes across all porous zones). If this is the case, check the example I made some time ago: post #5

Best regards,

DavidOuellette March 3, 2013 13:14

Hi Bruno,

Thanks for your quick reply! I just downloaded the suggested files from your post and I will begin playing around with the model soon. I'll let you know how it all turns out.

Thanks again for your help Bruno. Much appreciated!

DavidOuellette March 6, 2013 17:54

Hey Bruno and fellow Foamers,

I started playing with snappyHexMesh (sHM) where the geometry is a simple cube. The tutorial that I followed is shown in this link (, where the files can be found in:

After running the cases and playing around with the geometry, I now want to create a 2D mesh so it better represents my scenario. Unfortunately, when I try this, my solver doesn't agree and crashes after viewing the results in ParaView. The terminal gives the error below.

HTML Code:

size 500 is not equal to the given value of 4000

file: /home/fuelcell-laptop/OpenFOAM/fuelcell-laptop-2.1.1/run/FuelCellModels/porousParallelPlatesStl/81/p from line 18 to line 544.

    From function Field<Type>::Field(const word& keyword, const dictionary&, const label)
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/Field.C at line 236.

So, my question is, does anyone know of anyway to have sHM create only one cell in the z-direction, and have the required number of cells in the x and y-directions?


wyldckat March 6, 2013 18:08

Quick answer:

DavidOuellette March 6, 2013 18:23

Awesome! Thanks Bruno! I'm not sure how I missed that page when I originally checked OpenFoam Wiki. But nonetheless, thanks!


All times are GMT -4. The time now is 06:20.