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

Porous media in openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2005, 20:25
Default I'm new to OpenFoam, and my ap
  #1
New Member
 
Arturo O
Join Date: Mar 2009
Location: Mexico
Posts: 3
Rep Power: 17
arturo is on a distinguished road
I'm new to OpenFoam, and my applications are about porous media.
I've searched the forum (not exhaustive, though) without any mention to this application.
So far fluent and the like have tackled the subject by including a source term on the momentum equation and I don't expect this to be too hard to implement in openFoam.
My question is of course if someone has already done that.
Also if it is possible to implement it in a multiphase Eulerian N-phase model.
So far I think there is only 2 phase Eulerian model, am I right?

Thanks folks in advance

Thanks.

Arturo O.
arturo is offline   Reply With Quote

Old   July 11, 2005, 07:20
Default Hi, I have done a number of
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Hi,

I have done a number of porous media flow model implementations, including scalar or tensorial resistance, using Darcy's law. They were typically a part of more complex model, like for example the biscuit baking model (mass transfer for air, liquid water and water vapour + heat transfer + stress analysis with large deformations) or similar complex heat/mass transfer models.

In these cases, the flow equations lose the momentum term and you can solve them just by solving for pressure. Currently, there's no top-level example code for porous media, because it's "too simple" and interesting only with some other phenomena.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 11, 2005, 07:50
Default I implemented the generalised
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I implemented the generalised laplacian with tensorial viscosity (currently limited to an orthogonal grid in the region of the porous medium) in version 1.1 which can be used to include porous media effects into any of the basic solvers with a little bit of effort. I have used it to write a catalytic-converter simulation code and other specialised applications but it is a lot of effort to write example codes, FoamX configurations, documentation etc. so until someone is prepared to pay for this work we are unlikely to do it because our spare time is already taken up with basic maintenance and core development tasks.
henry is offline   Reply With Quote

Old   July 11, 2005, 11:35
Default I have completed a multiphase
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I have completed a multiphase version of interFoam but haven't yet done the same for the Eulerian two-phase code although it is perfectly possible.
henry is offline   Reply With Quote

Old   July 13, 2005, 00:17
Default My main interest are chemical
  #5
New Member
 
Arturo O
Join Date: Mar 2009
Location: Mexico
Posts: 3
Rep Power: 17
arturo is on a distinguished road
My main interest are chemical reactions and other physics on porous media, the so called packed bed reactors, so many other phenomena must be accounted for such as heat transfer, chemical reaction and mass transfer, its good to know that OpenFoam can tackle those cases.
Thanks for the answer and I hope I can post my questions if stucked.

Thanks to all

Arturo
arturo is offline   Reply With Quote

Old   July 13, 2005, 00:24
Default BTW I work also with multiphas
  #6
New Member
 
Arturo O
Join Date: Mar 2009
Location: Mexico
Posts: 3
Rep Power: 17
arturo is on a distinguished road
BTW I work also with multiphase flows on porous media.

Thnx

Arturo
arturo is offline   Reply With Quote

Old   January 17, 2006, 15:39
Default Hi @Hrvoje Jasak: How did y
  #7
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Hi

@Hrvoje Jasak: How did you implement darcys law for tensoral resistant? For scalar resistant I simply add +fvm::SuSp(nu*G,U) to the simpleFoam solver, where U is the inverse of K and K is the specific viskosity of my porous media (unit of K :m2). But how to do this for a volTensorField? I tried +nu*(G&U), but it did not converge.

bye
nico is offline   Reply With Quote

Old   January 17, 2006, 18:38
Default Several things: please note th
  #8
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Several things: please note that this kind of thing is really consultancy, i.e. I will rarely be prepared to give away this level of explanation for free.

Firstly, when you say fvm::SuSp you mean that the term may be both positive (source) or negative. In your case, we are talking about porous drag (unless you porous medium is capable of producing energy = accelerating the fluid). This the term is always a sink - use fvm::Sp.


Secondly, my Darcy's law says that the velocity field is in equilibrium with the pressure gradient. In other words, U is proportional to grad p. If you read this once again, this means that both the convection and the diffusion term in the momentum equation are negligible and should be thrown out. The last term is left is the ddt term and this is a question of taste: is the equilibrium immediate (no ddt) or is there a relaxation towards the equilibrium (ddt remains and complicates matters a little bit).

With this in mind, could you please temm me why you are solving the momentum equation in the first place: U is proportional to grad p (Darcy's law) and convection and diffusion in the prorous medium should be neglected.

So, now we are in business: no mementum equation and U is in equilibrium with the pressure gradient. Thus, all I need to do is to solve the pressure equation, using the porous resistance (please derive yourself!).

Finally, the story above is valid both for isotropic resistance and directional resistance. When you derive it, you will find that for the latter, the pressure laplace needs a tensorial diffusivity term! There you can use:

template<class>
tmp<fvmatrix<type> > laplacian
(
const volTensorField&,
GeometricField<type,>&
);

(that should now make sense!).

Enjoy (courtesy of),

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 18, 2006, 03:32
Default Thank you very much. But th
  #9
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Thank you very much.

But there ist still a question. In my case there is a porous region and a non porous region, and therefor I found the Navier-Stokes-Brinkman equation. I understand that the convection and the diffusion term are negligible in the porous region. But only there, so that they cannot be thrown out in my case. Am I right?

I hope it is not too boring for you. I am a real beginner. Sorry

Bye
nico is offline   Reply With Quote

Old   January 18, 2006, 04:52
Default That's all fine: you can knock
  #10
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
That's all fine: you can knock out the fluxes and diffusion in the porous region and have the complete momentum elsewhere.

However, the primary coupling in the system is p-U and not the momentum equation. Thus, as long as you keep messing about with the sink terms in the momentum equation instead of rewriting the pressure laplacian - this handles the dominant coupling - you won't get this to work (for any serious porous medium).

My advice (step by step, make it work, understand it and then generalise)
1) write a simple porous medium solver, no momentum equation
2) do the same for directional resistance
3) include the ddt term only in the momentum
4) do the same, with the porous medium covering a part of the domain. Beware of continuity problems on the porous interface!!!
5) introduce tensorial resistance. Rinse. Repeat :-)

Have fun,

Hrv
mhdhoseiny likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 18, 2006, 07:52
Default I see it's getting more compli
  #11
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
I see it's getting more complicated than expected.
Thanks a lot.

Last Question: How can I knock out the fluxes and the diffusion in the porous region and have the complete momentum elsewhere? Define a field for it? Perhaps a volScalarField with the value 0 in the porous medium and the value 1 elsewhere? So that i can use it as a switch?
nico is offline   Reply With Quote

Old   January 18, 2006, 07:56
Default P.S. What do accurately mean w
  #12
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
P.S. What do accurately mean with pressure laplacian?
nico is offline   Reply With Quote

Old   January 24, 2006, 11:14
Default Hi Hrv! Is it right, that I
  #13
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Hi Hrv!

Is it right, that I have to solve the following eqaution:

fvScalarmatrix pEqn
(
fvm::laplacian(K/nu, p)
== fcv::div(phi)
);
?

In Simple Foam we solve at first the UEqn. After that we caculate phi. And then we solve the pEqn.
In my case I will at first solve the presserue equation and because of that i don't know how to calculate phi.
I hope you understand my problem.

Thanks
nico is offline   Reply With Quote

Old   January 24, 2006, 11:26
Default Better, but there's no flux to
  #14
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Better, but there's no flux to start with: it's all in the pressure gradient. So, just lose the rhs. and you will get the flux when you solve for the pressure.

Keep digging :-)

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 24, 2006, 11:37
Default Sorry, but i don't know what y
  #15
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Sorry, but i don't know what you mean with rhs...
nico is offline   Reply With Quote

Old   January 24, 2006, 11:42
Default Ok,i think with rhs you mean r
  #16
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Ok,i think with rhs you mean right side?!

like this:

fvScalarmatrix pEqn
(
fvm::laplacian(K/nu, p)
);

??
Isn't it possible that you send me one of your solver.C to understand what to do? I only need this for university. I would be a greate help.
nico is offline   Reply With Quote

Old   January 24, 2006, 11:43
Default Sorry: that would be the "righ
  #17
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Sorry: that would be the "right-hand-side" of the equation. In other words:

fvScalarmatrix pEqn
(
fvm::laplacian(K/nu, p)
);

pEqn.solve();

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 28, 2006, 09:31
Default Hi Hrvoje Jasak, you told m
  #18
Member
 
Nico Petry
Join Date: Mar 2009
Posts: 36
Rep Power: 17
nico is on a distinguished road
Hi Hrvoje Jasak,

you told me that my first way to solve flow in porous media was wrong. I found an article about different methods to do this. There are two
macroscopic model. One is solving darcys law in the porous region and ns in the fluid region. That is what you told me.
But there is another method. That is what i have done, the socalled "Reformulated problem" :

Brinkman model for the porous media, Navier-Stokes for the fluid region, and continuos stress tensor interface conditions, are reformulated, so that a single system of partial differential equations is govering the flow in the pure liquid and in the porous media. This is done in the fictitious regions method manner.

link:
http://kluedo.ub.uni-kl.de/volltexte.../bericht51.pdf

Thanks a lot for all your help and efforts.

Nico
nico is offline   Reply With Quote

Old   February 26, 2009, 03:38
Default Hello, all I'm new to OpenF
  #19
New Member
 
fan
Join Date: Mar 2009
Location: langfang, hebei, china
Posts: 1
Rep Power: 0
ultrafast is on a distinguished road
Hello, all

I'm new to OpenFoam, and also to CFD problems.
I was used to discretize PDE to ODE and leave everything else to the solver (such as ode15s in matlab).

Now I start to learn algorithms like PISO, and it seems really confusing for me.

One question is, if I'm dealing with flows in porous media governed by simple darcy's law. Is it still necessary to use PISO loop?

Because every textbook said PISO is used to solve the pressure-velocity coupling. But now the velocity can be calculated directly from pressure gradient and we don't even have a momentum balance equation.

I hope this is a corret thread for this question, and thanks a lot for any hints or suggestion.

Fan
ultrafast is offline   Reply With Quote

Old   September 11, 2010, 06:26
Default
  #20
New Member
 
Zinedine
Join Date: Sep 2010
Posts: 19
Rep Power: 15
Zinedine is on a distinguished road
Quote:
Originally Posted by hjasak View Post
Hi,

I have done a number of porous media flow model implementations, including scalar or tensorial resistance, using Darcy's law. They were typically a part of more complex model, like for example the biscuit baking model (mass transfer for air, liquid water and water vapour + heat transfer + stress analysis with large deformations) or similar complex heat/mass transfer models.

In these cases, the flow equations lose the momentum term and you can solve them just by solving for pressure. Currently, there's no top-level example code for porous media, because it's "too simple" and interesting only with some other phenomena.

Hrv
Hi,
I have just completed a very useful and interesting Openfoam training.
I was wondering if it would be possible to get some test case files like those used in "Biscuit baking model". It would be kindly appreciated.
Thanks in advance.
Z.
Zinedine is offline   Reply With Quote

Reply


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
Porous media model in OpenFOAM 14 gac OpenFOAM Running, Solving & CFD 21 August 5, 2013 17:49
POROUS MEDIA Sean Cody FLUENT 8 March 6, 2013 10:33
Free media&porous media.Big changes in properties. Isi Main CFD Forum 1 July 14, 2008 07:18
porous media Kurt Malinski FLUENT 3 September 13, 2004 12:31
Porous baffle and porous media Jan Siemens 0 June 8, 2002 09:23


All times are GMT -4. The time now is 04:46.