# help adding the energy equation to porousinterfoam using the enthalpy formulation

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

 March 9, 2013, 16:26 help adding the energy equation to porousinterfoam using the enthalpy formulation #1 Member   nadine moussa Join Date: Mar 2012 Posts: 30 Rep Power: 6 Hello All, I am adding the enrgy equation to porousinterfoam using the enthalpy formulation. So for my conductivity calculation, i need to multiply each material conductivity with the cell porosity. I search around to find out how to use the cell porosity but I didn't have any luck, so please can anyone lead me with his or her suggestions? Thank you all, Nadine

 May 13, 2013, 05:30 #2 Member   Join Date: Feb 2013 Posts: 30 Rep Power: 5 Hi! I'm afraid I cannot help you with your original question but I wonder whether you tried some simple cases with porousInterFoam? for example, if a so-called "rectilinear flow" is considered which is basically a 1D flow (imagine a rectangle where you have the inlet on the left hand side and the outlet on the right) there is an analytical solution to the flow front progression, xf = sqrt(2*K*P0*t/(mu*eps)) where xf denotes the flow front progression, K the permeability of the porous medium, P0 the injection pressure, mu the viscosity in Pa*s and eps the porosity. Now, as far as I have gleaned, the porosity eps is not taken into account when using the porousInterFoam solver but even if I assume eps=1, the solver does not yield correct results. Have you /has anyone experienced this problem? There have been some discussions last year to that topic and I also found a debugged version of the porousInterFoam solver (http://sourceforge.net/apps/mantisbt...iew.php?id=129) which should repair the problem of not taking the porosity into account. I'm trying to compile this debugged version and I will let you know whether this fixes the problem I described above, but still, I'm curious of your experiences with porousInterFoam. Greetings, Natalie

May 13, 2013, 07:47
#3
Senior Member

Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 251
Rep Power: 10
Quote:
 Originally Posted by Natalie2210 Hi! I'm afraid I cannot help you with your original question but I wonder whether you tried some simple cases with porousInterFoam? for example, if a so-called "rectilinear flow" is considered which is basically a 1D flow (imagine a rectangle where you have the inlet on the left hand side and the outlet on the right) there is an analytical solution to the flow front progression, xf = sqrt(2*K*P0*t/(mu*eps)) where xf denotes the flow front progression, K the permeability of the porous medium, P0 the injection pressure, mu the viscosity in Pa*s and eps the porosity. Now, as far as I have gleaned, the porosity eps is not taken into account when using the porousInterFoam solver but even if I assume eps=1, the solver does not yield correct results. Have you /has anyone experienced this problem? There have been some discussions last year to that topic and I also found a debugged version of the porousInterFoam solver (http://sourceforge.net/apps/mantisbt...iew.php?id=129) which should repair the problem of not taking the porosity into account. I'm trying to compile this debugged version and I will let you know whether this fixes the problem I described above, but still, I'm curious of your experiences with porousInterFoam. Greetings, Natalie

Actually, porousInterFoam does not simulate two phase flow in porous media, expect in some very special cases (as the Hele-Shaw cells). This solver is not consistent with the two-phase flow physic in porous media.

You have to keep in mind that porous media laws are in fact averaged equations. That means that in one cell of the mesh, you have both fluid and solid, even if this latter is not physically represented. In two-phase flow through porous material, we use the concept of saturation S, which is the rate of liquid over the void space volume of the cell. Basically, S varyies on the range [0,1].

The problem with porousInterFoam, is that this solver is just a VOF solver with additionnal resistance source terms. With that solver, the saturation does not exist and the phase indicator is either equal to 0 or 1. You can't have value in between (for exemple, S=0.4 means that the void space of a cell is filled by 40% liquid and 60% gas). So, in my opinion, this solver has absolutely no meanings.

I think the right solution is to program a solver based on IMPES method (see a presentation I made at OFW7 for additionnal details).

Best regards,
Cyp

Last edited by Cyp; May 13, 2013 at 13:14.

 May 13, 2013, 15:51 #4 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,713 Rep Power: 27 Hi Cyp, Please allow me to disagree, since I exactly know the debugged version that Natalie referred to, as I myself posted that particular report. The debugged version corrects for the previous error that computational cells with a solid present did not fill faster than cells without a solid. The solution to this error was straight forward, because MULES was actually prepared to this type of flows, though the interface was not utilised in porousInterFoam. We had a master student, who tested the solver and he obtained good results in comparison with experimental data for coastal engineering size problems (dimensions of many meters in each direction). Kind regards, Niels P.S. There has not been a response to the bug report, since the error is still present in version 2.2.0.

May 13, 2013, 15:56
#5
Senior Member

Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 251
Rep Power: 10
Quote:
 Originally Posted by ngj Hi Cyp, Please allow me to disagree, since I exactly know the debugged version that Natalie referred to, as I myself posted that particular report. The debugged version corrects for the previous error that computational cells with a solid present did not fill faster than cells without a solid. The solution to this error was straight forward, because MULES was actually prepared to this type of flows, though the interface was not utilised in porousInterFoam. We had a master student, who tested the solver and he obtained good results in comparison with experimental data for coastal engineering size problems (dimensions of many meters in each direction). Kind regards, Niels P.S. There has not been a response to the bug report, since the error is still present in version 2.2.0.

Yes, but with porousInterFoam, even with the debugged version, you can't have gas AND liquid in the same cell, can you ?

 May 13, 2013, 16:07 #6 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,713 Rep Power: 27 Hi Cyp, I have just gone through your presentation, and I now understand what you mean. For your problems, where the saturation is of importance, then porousInterFoam will not work, because the two fluids are considered as immiscible. For coastal engineering problems, however, where there is a pretty clear interface between air and water, capillary effects can largely be neglected in man made structure and grain sizes are say 10 cm or larger, porousInterFoam does a pretty good job. I have tried reading the posts by Nadine and Natalie, however, it is a bit unclear to me, which effects are of importance to them. All the best, Niels

 May 14, 2013, 03:07 #7 Member   Join Date: Feb 2013 Posts: 30 Rep Power: 5 Hi! Thank you all for your replies! @Cyp: I'm afraid I cannot find the presentation you referred to, could you post a link? Although I think, I know the concept of introducing the saturation S as an independent variable. However, in my case, I can assume that the interface is sharp without taking capillary effects into account, so it sounds to me as if the debugged version of the porousInterFoam solver would solve my problem :-) @Niels: Great to "meet" you in person! I have tried to compile your debugged version of the porousInterFoam solver, but I'm running into some problems. It is to say I am quite new to OpenFoam and thats the first additional piece of code I'm trying to compile. However, here is what I do and get: I'm using OpenFoam version 2.1.1 on Ubuntu 12.04. I have downloaded your file and put the entire directory "debuggedPorousInterFoam" into \$FOAM_INST_DIR/applications/multiphase/interFoam and added the line wmake debuggedPorousInterFoam to the file Allwmake in \$FOAM_INST_DIR/applications/multiphase/interFoam . Running Allwmake, I get the following errors when it comes to compiling the debuggedPorousInterFoam solver: + wmake debuggedPorousInterFoam In file included from /home/openfoam/TryoutOF/openfoam211/applications/solvers/multiphase/interFoam/createFields.H:96:0, from debuggedPorousInterFoam.C:60: /home/openfoam/TryoutOF/openfoam211/src/finiteVolume/lnInclude/readGravitationalAcceleration.H: In function ‘int main(int, char**)’: /home/openfoam/TryoutOF/openfoam211/src/finiteVolume/lnInclude/readGravitationalAcceleration.H:5:9: error: redeclaration of ‘Foam::uniformDimensionedVectorField g’ /home/openfoam/TryoutOF/openfoam211/src/finiteVolume/lnInclude/readGravitationalAcceleration.H:2:35: error: ‘Foam::uniformDimensionedVectorField g’ previously declared here In file included from debuggedPorousInterFoam.C:61:0: createPorousZones.H:21:45: error: ‘class Foam:orousZone’ has no member named ‘zoneId’ In file included from debuggedPorousInterFoam.C:63:0: /home/openfoam/TryoutOF/openfoam211/applications/solvers/multiphase/interFoam/correctPhi.H:37:12: error: ‘pimple’ was not declared in this scope In file included from debuggedPorousInterFoam.C:76:0: /home/openfoam/TryoutOF/openfoam211/applications/solvers/multiphase/interFoam/setDeltaT.H:37:36: error: ‘maxAlphaCo’ was not declared in this scope /home/openfoam/TryoutOF/openfoam211/applications/solvers/multiphase/interFoam/setDeltaT.H:37:48: error: ‘alphaCoNum’ was not declared in this scope In file included from debuggedPorousInterFoam.C:84:0: alphaEqnSubCycle.H:3:15: error: ‘piso’ was not declared in this scope In file included from alphaEqnSubCycle.H:22:0, from debuggedPorousInterFoam.C:84: alphaEqn.H:20:45: error: ‘class Foam:orousZone’ has no member named ‘zoneId’ In file included from alphaEqnSubCycle.H:30:0, from debuggedPorousInterFoam.C:84: alphaEqn.H:20:45: error: ‘class Foam:orousZone’ has no member named ‘zoneId’ .. and so on. Did I put the code at the wrong place in the source or do I need to (re)compile something else before? I would also be very interested in this master's thesis you mentioned, is it online available? Kind regards, Natalie

 May 14, 2013, 03:51 #8 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,713 Rep Power: 27 Good morning Natalie, Unfortunately, the version you have downloaded is meant for version 1.6-ext, and there are always small differences between the versions. Therefore: 1. Compare the debugged and your versions of porousInterFoam. 2. Transfer the differences into your 2.1.1. version of porousInterFoam, however, please note that some interfaces in the classes could have changes since 1.6-ext. 3. Compile. A very pronounced difference is the call to Code: `MULES::explicitSolve();` and the construction of the porosity field, which is missing in the original versions. Kind regards Niels P.S. As far as I know the thesis is not available online, and since I am no longer at University, I cannot help you in that regard.

 May 14, 2013, 08:35 #9 New Member   Pierre HORGUE Join Date: May 2009 Posts: 24 Rep Power: 9 I totally agree with Cyp. The VOF model is defined at the miscroscopic scale (or pore-scale) while the darcy-type penalization term in the momentum equation is defined at the macroscopic scale where the computation cell is composed about thousand pores. The capillary force term depending on the local interface curvature : Code: `fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)` has no sense in a macroscopic model because you don't know the phase distribution in each computational cell (for that reason, we use empirical capillary pressure law in multiphase porous models). In your case, considering really strong simplifications : 1) capillary effect are negligible in the porous media. 2) your interface is always sharp in the porous media whatever the flow properties you can use the model but it remains in my opinion an ill-defined model. In all cases, i think that is necessary to remove the capillary term in the porous medium (even if it has probably no effect, it is a physical non sense to keep it) and change the name of the solver because it misleads some people. Regards, Pierre

 May 16, 2013, 11:09 #10 Senior Member   Cyprien Join Date: Feb 2010 Location: Stanford University Posts: 251 Rep Power: 10 dear all, If you are looking for some good references regarding multiphase flow in porous media, have a look at : Petroleum reservoir simulation - Khalid Aziz, Antonín Settari it's the bible ! A more recent book is : Computational Methods for Multiphase Flows in Porous Media (Computational Science and Engineering) - Zhangxin Chen, Guanren Huan, Yuanle Ma All concepts and equations are detailed! Moreover, I am curious about the derivation of your analytical solution. Can you provide a reference ? Best, Cyp santoo_cfd and Pedro24 like this.

 May 23, 2013, 02:40 #11 Member   Join Date: Feb 2013 Posts: 30 Rep Power: 5 Hi Cyp, have a look at this paper: http://www.scielo.br/scielo.php?pid=...pt=sci_arttext Here the RTM process (resin flow through fibrous preform) is modelled. Although the analytic solution stems from the reduction of the Navier-Stokes equations to Darcy's law, a simulation in that regime should give similar results, I believe. Best, Natalie santoo_cfd likes this.

September 20, 2013, 15:14
#12
Member

Join Date: Dec 2012
Posts: 36
Rep Power: 5
Quote:
 Originally Posted by Cyp dear all, If you are looking for some good references regarding multiphase flow in porous media, have a look at : Petroleum reservoir simulation - Khalid Aziz, Antonín Settari it's the bible ! A more recent book is : Computational Methods for Multiphase Flows in Porous Media (Computational Science and Engineering) - Zhangxin Chen, Guanren Huan, Yuanle Ma All concepts and equations are detailed! Moreover, I am curious about the derivation of your analytical solution. Can you provide a reference ? Best, Cyp
Hi CyprienI want simulate Heat pipe (Heat pipe:At the hot interface of a heat pipe a liquid in contact with a thermally conductive solid surface turns into a vapor by absorbing heat from that surface. The vapor then travels along the heat pipe to the cold interface and condenses back into a liquid - releasing the latent heat. The liquid then returns to the hot interface through either capillary action by wick structure ) with porousInterFoam solver. But I read this this page and I dont know,this solver useful for my case or not?
can you guide me for this subject?
Regards,

 June 8, 2014, 18:06 #13 New Member   David Join Date: May 2012 Location: Canada Posts: 12 Rep Power: 6 Hi Nadine , Did you figure out a solution to your problem ?? Thanks

 June 9, 2014, 02:44 #14 Member   santhosh Join Date: Apr 2009 Location: India Posts: 70 Rep Power: 9 Hi, I am also looking for a solution where porousInterFOAM takes into account of porosity of computation cell. I thought by modifying the temporal term wherein, you have the porosity term in the equation, will solve the problem. Good to see the debuggedInterFoam here. Thanks. I will look into it now to see if I can modify work with 2.2.0 version.

 June 9, 2014, 04:30 #15 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,713 Rep Power: 27 Good day, A lot of other things was also done to have (large scale) porosiy effects included, so take e.g. a look at the solver porousWaveFoam in the waves2Foam toolbox. Kind regards, Niels __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 June 17, 2014, 08:14 #16 Member   nadine moussa Join Date: Mar 2012 Posts: 30 Rep Power: 6 Hello David, well I sort of did but without using porousinterFoam! I changed the interFoam code where I added the energy equation and modified the momentum equation to account for the porosity. sorry not much help!!!

 June 17, 2014, 08:21 #17 New Member   David Join Date: May 2012 Location: Canada Posts: 12 Rep Power: 6 Hi Nadine, Were you able to add the effect of porosity [ the thermal conductivity of the porous material] in the energy equation? From my knowledge OpenFOAM doesn't take into account this effect and the only thermal model available for porous media is Fixed temperature !! I will appreciate any guidance in this point Thanks

 June 17, 2014, 08:25 #18 Member   nadine moussa Join Date: Mar 2012 Posts: 30 Rep Power: 6 David, In my case I used the porosity approach in order to get two different regions (solid and fluid) so the porosity is either 1 or 0 no intermediate values. I wrote the thermophysical properties as function of the porosity and added a source term to the momentum equation as function of the porosity as well. hope this will help Nadine mizzou likes this.

 June 17, 2014, 08:39 #19 New Member   David Join Date: May 2012 Location: Canada Posts: 12 Rep Power: 6 Thanks Nadine , I will try this and see how it goes David

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post cuteapathy CFX 14 March 20, 2012 07:45 nakul OpenFOAM 0 October 10, 2010 15:07 Blob Main CFD Forum 0 May 29, 2009 08:35 newbee OpenFOAM Running, Solving & CFD 4 August 25, 2006 14:33 Zhong Lei Main CFD Forum 23 May 14, 1999 13:22

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