Porous medium modelisation -CS v.5

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
emilie.powaga
Posts: 6
Joined: Wed Sep 30, 2020 11:07 am

Porous medium modelisation -CS v.5

Post by emilie.powaga »

Hello,
i'm wondering how to model a porous medium in Code-Saturne v5.0. The theory guide and general documentation are very light on the subject and I didn't find clear answer on this forum too.

1) With Volume condition "Porosity" activated in GUI and the porosity value entered in mathematical expression editor.

How CS handled this porosity in NS equation ?


2) As an addition of a momentum source term corresponding to Forchheimer law. the source term is composed of two components : a viscous loss term (Darcy's law) and an inertial loss term :

Image


Which way is the better ?

Additionnal question : How imposed a direction of fluid direction through porous medium ? I want the fluid be normal to the inlet/outlet faces of the porous medium. I still can't managed to do that (as illustrated below).

Image

Thank you in advance for your help,
Emilie
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Porous medium modelisation -CS v.5

Post by Yvan Fournier »

Hello,

If you are trying to model groundwater flows (as I understand from the Forchheimer law), I assume you may be using the groundwater model. In this case, I will check with a colleague more familiar with this part of the code.

In any case, v5.0 is not supported anymore, so I strongly suggest upgrading to v7.0.

Best regards,

Yvan
emilie.powaga
Posts: 6
Joined: Wed Sep 30, 2020 11:07 am

Re: Porous medium modelisation -CS v.5

Post by emilie.powaga »

Hello,

I actually try to model air passing through perforated board.

I'm using windows version of Code-saturne as my school cannot install the linux version on one of their compute servers because of GUI compatibility.

Thanks in advance for your help,
Emilie
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Porous medium modelisation -CS v.5

Post by Yvan Fournier »

Hello,

Ok, so in this case, you want to run the standard "Navier-Stokes"and no groundwater flow model.

Regarding the documentation, I do not have any good solution (except reading the code itself, but that is very time consuming).

In any case, to force a flow direction in the porous medium, there are 2 solutions:

- Use the tensorial porosity model (iporos=2). Should work in theory, but rarely tested, and I have no examples/experience with it

- Use an associated head loss model (in the same zone), with very large head loss coefficients in the y and z directions, and the coefficient matching the plate in the x direction).

Best regards,

Yvan
emilie.powaga
Posts: 6
Joined: Wed Sep 30, 2020 11:07 am

Re: Porous medium modelisation -CS v.5

Post by emilie.powaga »

Hello,

I've tried the first solution without success so far in a simplified geometry (cf. figure below).
Image
I've added cs_user_parameters.f90 with iporos=2; (attached filed) to the "SRC" folder.
and tried to enter in the GUI mathermatical expression editor
"porosity = 0.5;
porosity[XX] = 0.5;
porosity[YY] = 0.;
porosity[ZZ] = 0.;
porosity[XY] = 0.;
porosity[XZ] = 0.;
porosity[YZ] = 0.;"

or
"porosity = 0.5;
porosity[XX] = 1.;
porosity[YY] = 0.;
porosity[ZZ] = 0.;
porosity[XY] = 0.;
porosity[XZ] = 0.;
porosity[YZ] = 0.;"

But the code stop at the first iteration with this error.
"../../../../src/code_saturne-5.0.9/src/base/cs_log_iteration.c:403: Fatal error.
Invalid (not-a-number) values detected for array k."

I've made another test with same SRC "cs_user_paremters.f90" with in the mathematical expression GUI editor :
" porosity = 0.5;
porosity[XX] = 0.5;
porosity[YY] = 0.5;
porosity[ZZ] = 0.5;
porosity[XY] = 0.;
porosity[XZ] = 0.;
porosity[YZ] = 0.;"

and the code succeed to run calculations, but I've the nearly the same results as if my porous volume is isotropic (see figures below)
anisotropic porosity [XX][YY][ZZ] 0.5 run case
Image
isotropic porosity 0.5 run case
Image

I will try now to use an associated head loss model (in the same zone), with very large head loss coefficients in the y and z directions, and the coefficient matching in the x direction).
Emilie
Attachments
cs_user_parameters.f90
(17.76 KiB) Downloaded 115 times
emilie.powaga
Posts: 6
Joined: Wed Sep 30, 2020 11:07 am

Re: Porous medium modelisation -CS v.5

Post by emilie.powaga »

So I've tried the second solution and it seems to work.
I've set an isotropic porosity value to my porous medium equal to 0,5 and I've had head losses in the same zone with very large head losses coefficients (m-1) in the y and z directions (axx=0. ; ayy=1000.;azz=1000.; ).
I've removed cs_user_parameter file for these runs as my porous medium is considered to have isotropic caracteristics.
The figure belows gives the velocity and pressure results for my case for isotropic porosity alone and isotropic porosity associated with head losses. We can see there is no major shifts in velocity magnitude and in pressure but the flow direction in the second run is only in xx direction.

isotropic porosity 0.5 run case
Image
isotropic porosity 0.5 run + Head losses in yy and zz directions case
Image

I hope this solution can fit my problem,
Emilie
Post Reply