- **OpenFOAM Programming & Development**
(*https://www.cfd-online.com/Forums/openfoam-programming-development/*)

- - **help adding the energy equation to porousinterfoam using the enthalpy formulation**
(*https://www.cfd-online.com/Forums/openfoam-programming-development/114362-help-adding-energy-equation-porousinterfoam-using-enthalpy-formulation.html*)

help adding the energy equation to porousinterfoam using the enthalpy formulationHello 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 |

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 |

Quote:
Dear Natalie and Nadine, I would like to add some lights about porousInterFoam. 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 |

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. |

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

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 |

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 linewmake 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::porousZone’ 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::porousZone’ has no member named ‘zoneId’ In file included from alphaEqnSubCycle.H:30:0, from debuggedPorousInterFoam.C:84: alphaEqn.H:20:45: error: ‘class Foam::porousZone’ 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 |

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();` 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. |

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)` 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 |

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 Settariit'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 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 |

Quote:
: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, |

Hi Nadine ,
Did you figure out a solution to your problem ?? Thanks |

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. |

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 |

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!!! |

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 |

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 |

Thanks Nadine ,
I will try this and see how it goes David |

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