CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

help adding the energy equation to porousinterfoam using the enthalpy formulation

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

Like Tree5Likes
  • 2 Post By Cyp
  • 1 Post By Natalie2210
  • 1 Post By mecman
  • 1 Post By nadine

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 9, 2013, 16:26
Default help adding the energy equation to porousinterfoam using the enthalpy formulation
  #1
Member
 
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14
nadine is on a distinguished road
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
nadine is offline   Reply With Quote

Old   May 13, 2013, 06:30
Default
  #2
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
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
Natalie2210 is offline   Reply With Quote

Old   May 13, 2013, 08:47
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
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

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

Last edited by Cyp; May 13, 2013 at 14:14.
Cyp is offline   Reply With Quote

Old   May 13, 2013, 16:51
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Old   May 13, 2013, 16:56
Default
  #5
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Quote:
Originally Posted by ngj View Post
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 ?
Cyp is offline   Reply With Quote

Old   May 13, 2013, 17:07
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   May 14, 2013, 04:07
Default
  #7
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
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
Natalie2210 is offline   Reply With Quote

Old   May 14, 2013, 04:51
Default
  #8
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Old   May 14, 2013, 09:35
Default
  #9
Member
 
Pierre HORGUE
Join Date: May 2009
Posts: 33
Rep Power: 16
Pedro24 is on a distinguished road
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
Pedro24 is offline   Reply With Quote

Old   May 16, 2013, 12:09
Default
  #10
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
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.
Cyp is offline   Reply With Quote

Old   May 23, 2013, 03:40
Default
  #11
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
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.
Natalie2210 is offline   Reply With Quote

Old   September 20, 2013, 16:14
Default
  #12
Member
 
Mohammad Bahreini
Join Date: Dec 2012
Posts: 36
Rep Power: 13
mecman is on a distinguished road
Quote:
Originally Posted by Cyp View Post
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,
mizzou likes this.
mecman is offline   Reply With Quote

Old   June 8, 2014, 19:06
Default
  #13
New Member
 
David
Join Date: May 2012
Location: Canada
Posts: 12
Rep Power: 13
salehda is on a distinguished road
Hi Nadine ,

Did you figure out a solution to your problem ??

Thanks
salehda is offline   Reply With Quote

Old   June 9, 2014, 03:44
Default
  #14
Member
 
santhosh
Join Date: Apr 2009
Location: India
Posts: 70
Rep Power: 17
santoo_cfd is on a distinguished road
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.
santoo_cfd is offline   Reply With Quote

Old   June 9, 2014, 05:30
Default
  #15
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Old   June 17, 2014, 09:14
Default
  #16
Member
 
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14
nadine is on a distinguished road
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!!!
nadine is offline   Reply With Quote

Old   June 17, 2014, 09:21
Default
  #17
New Member
 
David
Join Date: May 2012
Location: Canada
Posts: 12
Rep Power: 13
salehda is on a distinguished road
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
salehda is offline   Reply With Quote

Old   June 17, 2014, 09:25
Default
  #18
Member
 
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14
nadine is on a distinguished road
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.
nadine is offline   Reply With Quote

Old   June 17, 2014, 09:39
Default
  #19
New Member
 
David
Join Date: May 2012
Location: Canada
Posts: 12
Rep Power: 13
salehda is on a distinguished road
Thanks Nadine ,

I will try this and see how it goes

David
salehda is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding viscous dissipation term to energy equation newbee OpenFOAM Running, Solving & CFD 6 March 3, 2021 11:37
error message cuteapathy CFX 14 March 20, 2012 07:45
energy equation in rhoCentralFoam nakul OpenFOAM 0 October 10, 2010 16:07
k-e turbulence model and energy equation Blob Main CFD Forum 0 May 29, 2009 09:35
Why FVM for high-Re flows? Zhong Lei Main CFD Forum 23 May 14, 1999 14:22


All times are GMT -4. The time now is 11:24.