
[Sponsors] 
May 16, 2013, 05:36 
adapting "debuggedPorousInterFoam" to OF version 2.1

#1 
Member
Join Date: Feb 2013
Posts: 30
Rep Power: 4 
Hi!
First of all, I want to give a short overview over the problem I'm facing. The porousInterFoam solver shipped with OF 2.1.1 does not take the porosity into account. Therefore, the solution the solver computes does not coincide with the (analytical) solution of the corresponding problem, i.e. the penetration of a porous medium by a liquid. This fact is known and a corresponding bug report has been filed at http://openfoam.org/mantisbt/view.php?id=477. However, a debugged version of porousInterFoam has been published at http://sourceforge.net/apps/mantisbt...iew.php?id=129 by Niels which differs from the "original" porousInterFoam version by the construction of the porosity field and the corresponding integration of the porosity in the alphaEquation. However, this code has been written to be integrated into the OpenFoam 1.6ext version and so I face certain compatibility problems. The first major problem I encounter is that in the file "createPorousZones.H" the porosity field is created by Code:
volScalarField porosity ( IOobject ( "porosity", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("NULL", dimless, 1.0), "zeroGradient" ); forAll( pZones, zoneI ) { const label & zoneId( pZones[zoneI].zoneId() ); const labelList & cells(mesh.cellZones()[cellZoneIds_[zoneI]]); const scalar & zonePorosity( pZones[zoneI].porosity() ); forAll( cells, cellI ) { porosity[cells[cellI]] = zonePorosity; } } porosity.write(); Then I have another question, mainly to Niels if he is somewhere around :) The same piece of code I posted above  the creation of the porosity field  is not only found in createPorousZones.H but also in the file alphaEqn.H  why is it defined doubly? Furthermore, I found no difference in the UEqn.H to the original file ../multiphase/interFoam/porousInterFoam.H/UEqn.H . However, I believe that in the volumeaveraged NavierStokes equation describing the flow through porous media the porosity also enters the time derivative? I.e. the NSequation goes d/dt(rho * U * gamma) = ... where gamma denotes the porosity. However, this does not enter the calculation even in debuggedPorousInterFoam? I hope anyone reads this although its quite a long post :)) Kind regards, Natalie 

May 16, 2013, 06:39 

#2 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,660
Rep Power: 25 
Hi Natalie,
Let me try to answer your questions onebyone. 1. Compilation problems. The following bit of code is written from the top of my head without compilation (targeted for 2.1), so it might not be completely successful. I have modified the code, which you posted, as it differs a bit from the debugged version. However, try the following: Code:
forAll( pZones, zoneI ) { const labelList & zoneIds( pZones[zoneI].zoneIds() ); const scalar poro( pZones[zoneI].porosity() ); forAll( zoneIds, zi ) { const labelList & cells( mesh.cellZones()[zoneIds[zi]] ); forAll( cells, celli ) { porosity[cells[celli]] = poro; } } } porosity.correctBoundaryConditions(); porosity.write(); 3. With respect to adding a constant on the temporal derivative, yes, it is true that there should be a correction. We came across this fact after the debugged version was submitted, and since no one responded to the bug report, we left it at the most significant problem. Please note that the correction in OF2.1 might not be correct, however, I cannot remember, if we did something different in the end. Good luck Niels 

May 16, 2013, 07:09 

#3  
Member
Join Date: Feb 2013
Posts: 30
Rep Power: 4 
It compiles!! Great, thank you so much!
What do you mean by Quote:


May 16, 2013, 07:33 

#4 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,660
Rep Power: 25 
Good.
I meant that Code:
pZones.ddt(rho, U) Kind regards Niels 

May 16, 2013, 07:34 

#5 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,660
Rep Power: 25 
P.S. Remember to visualise the porosity field written in the first time folder. This will help you to check, whether the code works.


May 16, 2013, 09:59 

#6 
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Singapore
Posts: 254
Rep Power: 8 
Hi Natalie,
may I suggest you a reference? http://www.sciencedirect.com/science...78383912000245 In this paper you can find a very comprehensive review of the porous media equations. Best, Pablo 

June 9, 2014, 04:47 

#7 
Member
santhosh
Join Date: Apr 2009
Location: India
Posts: 69
Rep Power: 8 
Hi Natalie,
Is it possible for you share the debuggedPorousInterFoam solver you have modified for the 2.1.0 version. I started modifying the original version from Mantis to able to work with version 2.2.0, and landed up with same compilation trouble you have posted above in createPorousZones.H file. I tried with above suggested modification as well, but still facing compilation errors. Code:
createPorousZones.H: In function ‘int main(int, char**)’: createPorousZones.H:20:5: error: request for member ‘size’ is ambiguous /opt/openfoam230/src/OpenFOAM/lnInclude/PtrListI.H:34:20: error: candidates are: Foam::label Foam::PtrList<T>::size() const [with T = Foam::porosityModel, Foam::label = int] 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Precompiled disk images of version 2.1 for Mac?  einatlev  OpenFOAM Installation on Windows, Mac and other Unsupported Platforms  11  October 12, 2012 15:48 
wmake error  zxj160  OpenFOAM  0  March 26, 2012 10:52 
paraview installation woes  vex  OpenFOAM Installation  15  January 30, 2011 08:11 
Problem with paraFoam on a linux64 bit  bunni  OpenFOAM Paraview & paraFoam  4  April 14, 2010 20:55 
paraFoam reader for OpenFOAM 1.6  smart  OpenFOAM Installation  13  November 16, 2009 22:41 