CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Porous media in openfoam (https://www.cfd-online.com/Forums/openfoam-solving/57894-porous-media-openfoam.html)

arturo July 10, 2005 20:25

I'm new to OpenFoam, and my ap
 
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.

hjasak July 11, 2005 07:20

Hi, I have done a number of
 
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

henry July 11, 2005 07:50

I implemented the generalised
 
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 July 11, 2005 11:35

I have completed a multiphase
 
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.

arturo July 13, 2005 00:17

My main interest are chemical
 
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 July 13, 2005 00:24

BTW I work also with multiphas
 
BTW I work also with multiphase flows on porous media.

Thnx

Arturo

nico January 17, 2006 15:39

Hi @Hrvoje Jasak: How did y
 
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

hjasak January 17, 2006 18:38

Several things: please note th
 
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

nico January 18, 2006 03:32

Thank you very much. But th
 
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

hjasak January 18, 2006 04:52

That's all fine: you can knock
 
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

nico January 18, 2006 07:52

I see it's getting more compli
 
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 January 18, 2006 07:56

P.S. What do accurately mean w
 
P.S. What do accurately mean with pressure laplacian?

nico January 24, 2006 11:14

Hi Hrv! Is it right, that I
 
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

hjasak January 24, 2006 11:26

Better, but there's no flux to
 
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

nico January 24, 2006 11:37

Sorry, but i don't know what y
 
Sorry, but i don't know what you mean with rhs...

nico January 24, 2006 11:42

Ok,i think with rhs you mean r
 
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.

hjasak January 24, 2006 11:43

Sorry: that would be the "righ
 
Sorry: that would be the "right-hand-side" of the equation. In other words:

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

pEqn.solve();

Hrv

nico January 28, 2006 09:31

Hi Hrvoje Jasak, you told m
 
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

ultrafast February 26, 2009 03:38

Hello, all I'm new to OpenF
 
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

Zinedine September 11, 2010 06:26

Quote:

Originally Posted by hjasak (Post 192400)
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.


All times are GMT -4. The time now is 09:01.