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 (https://www.cfd-online.com/Forums/openfoam-solving/135962-porous-media.html)

realfear May 20, 2014 13:24

Porous Media
 
hi everybody
i am new to openFoam and i have a few problems for solving Porous media in openFoam
first of all , i have used gambit to sketch my model . after transferring my mesh to openfoam i have a problem that i dont know how to define porous media in openFoam!!!!
i am a rookie in this program So sorry for asking basic question !!!
i appreciate any help
tnx!

adambarfi May 20, 2014 14:23

Quote:

Originally Posted by realfear (Post 493165)
hi everybody
i am new to openFoam and i have a few problems for solving Porous media in openFoam
first of all , i have used gambit to sketch my model . after transferring my mesh to openfoam i have a problem that i dont know how to define porous media in openFoam!!!!
i am a rookie in this program So sorry for asking basic question !!!
i appreciate any help
tnx!

Hi and welcome to the forum,

you should define your porous zone using topoSetDict or setSetDict.
the following links may help you:

http://openfoamwiki.net/index.php/TopoSet
http://www.cfd-online.com/Forums/ope...dertocell.html
http://www.cfd-online.com/Forums/ope...cell-mesh.html

realfear May 20, 2014 17:11

thank you for helping
but i realy can't understand what are those commands are and what are their use
i have just started working with openfoam!!!
i just want to define a zone for porous media ! :D
can you describe the process of doing it in a very very basic language!!!??:o
plzzzzzzzzzzzzzzzzz

adambarfi May 21, 2014 00:45

dear realfear, woow! what a name!!!

after u transfer your mesh to FOAM (in your case maybe u used fluentMeshToFoam), you should make a file in system case named: topoSetDict. then you must define the geometry of your porous zone in this file (first link of my last post will help you). finally you need to run topoSet in terminal to specify the porous zone.

here is an example of topoSetField which specify a square as c0 zone (these code are for OF-2.1.0)

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(


{
    name c0;
    type cellSet;
    action new;
    source rotatedBoxToCell;
    sourceInfo
    {
//    box (0 0 0) (0.1 0.1 0.2);
    origin (-0.5 -0.5 0);
    i (1 0 -1);
    j (0 1 0);
    k (0 0 1);
    }
}

);

// ************************************************************************* //

and the porousZones file in constant case should be as:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      porousZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
    c0
    {
        coordinateSystem
        {
            e1  (1 0 0);
            e2  (0 0 1);
        }

        Darcy
        {
            d  d [0 -2 0 0 0 0 0] (9e3 9e3 0);
            f  f [0 -1 0 0 0 0 0] (0 0 0);
        }
    }
)

// ************************************************************************* //

hope this help you.

Regards
Mostafa

realfear May 21, 2014 02:45

tnx again
i used this username when i was very young and i just sitcked with it!!

i made a change in your post
i just changed cellset to cellZoneSet
and it worked!
but i still have few questions to ask:
1- what is the origin? does it mean the origin of the coordinate system i used in gambit to start the drawing
2- does i,j ,k means the coordinate directions ??
for Cartesian coordinate system i(1 0 0) j(0 1 0) k(0 0 1)?
:rolleyes:

merci

adambarfi May 21, 2014 03:17

Quote:

Originally Posted by realfear (Post 493253)
tnx again
i used this username when i was very young and i just sitcked with it!!

i made a change in your post
i just changed cellset to cellZoneSet
and it worked!
but i still have few questions to ask:
1- what is the origin? does it mean the origin of the coordinate system i used in gambit to start the drawing
2- does i,j ,k means the coordinate directions ??
for Cartesian coordinate system i(1 0 0) j(0 1 0) k(0 0 1)?
:rolleyes:

merci

the origin is the point which u wanna start your zone from there, i.e. in above example origin (-0.5 -0.5 0) is the coordinate of bottom-left point of a box and i,j, and k are the vectors which represent the rotation and length of sides, e.g:
Code:

    origin (0 -0.5 0);
    i (0.5 0.5 -1);
    j (-0.5 0.5 0);
    k (0 0 1);

demonstrate a diamond-shape zone which starts from (0 -0.5 0) relative to the source coordinate system and it's height and width are 1.

realfear May 21, 2014 03:43

Quote:

Originally Posted by adambarfi (Post 493263)
the origin is the point which u wanna start your zone from there, i.e. in above example origin (-0.5 -0.5 0) is the coordinate of bottom-left point of a box and i,j, and k are the vectors which represent the rotation and length of sides, e.g:
Code:

    origin (0 -0.5 0);
    i (0.5 0.5 -1);
    j (-0.5 0.5 0);
    k (0 0 1);

demonstrate a diamond-shape zone which starts from (0 -0.5 0) relative to the source coordinate system and it's height and width are 1.

So if i want a simple cube i won't need rotation
what should i do then??

adambarfi May 21, 2014 04:24

yeah, you can just use:
Code:

    box (0 0 0) (0.1 0.1 0.2);
which the two points are the coordinates of points at the beginning and end of your cube's diagonal, respectively.

realfear May 21, 2014 05:26

Quote:

Originally Posted by adambarfi (Post 493274)
yeah, you can just use:
Code:

    box (0 0 0) (0.1 0.1 0.2);
which the two points are the coordinates of points at the beginning and end of your cube's diagonal, respectively.

it does not work
it requires sourceinfo
can you write the whole code for making a cube for a zone?
tnx

adambarfi May 21, 2014 05:52

Quote:

Originally Posted by realfear (Post 493283)
it does not work
it requires sourceinfo
can you write the whole code for making a cube for a zone?
tnx

dear realfear,

here you are the topoSetDict:
Code:

actions
(


{
    name c0;
    type cellSet;
    action new;
    source boxToCell;
    sourceInfo
    {
    box (-0.5 -0.5 -0.5) (0.5 0.5 0.5);
/*    origin (0 -0.5 0);
    i (0.5 0.5 -1);
    j (-0.5 0.5 0);
    k (0 0 1);*/
    }
}

);

if you searched the forum, you could find the solution yourself, the best way to learn something is struggling with it and searching other aspect of that problem!

Regards,
Mostafa

realfear May 21, 2014 06:01

Quote:

Originally Posted by adambarfi (Post 493288)
dear realfear,

here you are the topoSetDict:
Code:

actions
(


{
    name c0;
    type cellSet;
    action new;
    source boxToCell;
    sourceInfo
    {
    box (-0.5 -0.5 -0.5) (0.5 0.5 0.5);
/*    origin (0 -0.5 0);
    i (0.5 0.5 -1);
    j (-0.5 0.5 0);
    k (0 0 1);*/
    }
}

);

if you searched the forum, you could find the solution yourself, the best way to learn something is struggling with it and searching other aspect of that problem!

Regards,
Mostafa


thank you for your kindness and patience!
:)
tnx

zahraa December 17, 2014 20:22

Hi all
I work with chtmultiregionFoam . I want to make my solid part porous. But i do not know how i should do it.
Regards
Zahra

adambarfi December 17, 2014 23:43

Quote:

Originally Posted by zahraa (Post 524433)
Hi all
I work with chtmultiregionFoam . I want to make my solid part porous. But i do not know how i should do it.
Regards
Zahra

Greetings,

The concept of porous media in openFoam is not defined geometrically, you add a source term in your equations in the porous region and that source term simulates the porous media conditions.

to getting started, I suggest reading the Haukur Elvar Hafsteinsson report.

Regards,
Mostafa

zahraa December 19, 2014 12:05

Dear Mostafa
I am new to openfoam. Could you please explain more detailed. I had read that report before i comment here. but i realy do not know how i should start to add porousity and what i should do!!:confused::o:confused:

adambarfi December 23, 2014 11:48

Quote:

Originally Posted by zahraa (Post 524704)
Dear Mostafa
I am new to openfoam. Could you please explain more detailed. I had read that report before i comment here. but i realy do not know how i should start to add porousity and what i should do!!:confused::o:confused:

Dear Zahra,

If I wanna say it in brief:
  1. Create your porous zone using topoSet utility, see http://www.cfd-online.com/Forums/ope...tml#post493288
  2. Modify the porousZones file
  3. Run your case, i.e. porousSimpleFoam

that's it!
hope it helps you

Regards,
Mostafa

Majed March 3, 2015 19:01

Porous media simulations
 
Dear Foamers,

I have some questions about running openfoam in porous media. Could you tell me how we can define the hydraulic conductivity (k) in openfoam? Also, according to Adambafi's posts we define the porous zone in topoSetDict. so what should be defined in blockMeshDict.

Thank you.

adambarfi March 3, 2015 22:38

Dear Majid,

Quote:

Originally Posted by Majed (Post 534251)
I have some questions about running openfoam in porous media. Could you tell me how we can define the hydraulic conductivity (k) in openfoam?

the hydraulic conductivity definitions is:
K=\kappa \frac{\rho g}{\mu}
which \kappa is the permeability (m^2), \rho, \mu, g are density, kinematic viscosity and acceleration due to gravity, respectively.
so, you just need to define the viscosity and permeability in a way that the above relation leads to your desired K.

Quote:

Originally Posted by Majed (Post 534251)
Also, according to Adambafi's posts we define the porous zone in topoSetDict. so what should be defined in blockMeshDict.

porousSimpleFoam uses Darcy-Forchheimer equation to model the flow in a porous media. it's a source term that we add to the momentum equation when we are solving the porous part in the domain. topoSetDict can specify a zone in your mesh to the porous part so that when the entire domain is solving, in this zone the momentum equation has an extra source for considering the effects of porous media on the flow field.

Majed March 3, 2015 23:10

2 Attachment(s)
Dear Mostafa,

Thank you for your reply. At first I should tell you that I am Iranain, so don't care about my name in here. :) Second, I should mention that I am kind of new to OpenFOAM.
Let me describe my geometry in details. What I want to simulate is the flow similar to the first picture.


I have already simulated the surface flow, and now what I want to do is deriving an equation for the pressure distribution on the bed of the river, and then simulating the groundwater flow. So my geometry would be a box similar to the second picture. From your reply this is implied that I should create this box in blockmesh, and then using the same coorditares define such a box in toposetdict as all the area of this box is the porous medium. Am I right?

Thank you so much

Quote:

Originally Posted by adambarfi (Post 534268)
Dear Majid,



the hydraulic conductivity definitions is:
K=\kappa \frac{\rho g}{\mu}
which \kappa is the permeability (m^2), \rho, \mu, g are density, kinematic viscosity and acceleration due to gravity, respectively.
so, you just need to define the viscosity and permeability in a way that the above relation leads to your desired K.



porousSimpleFoam uses Darcy-Forchheimer equation to model the flow in a porous media. it's a source term that we add to the momentum equation when we are solving the porous part in the domain. topoSetDict can specify a zone in your mesh to the porous part so that when the entire domain is solving, in this zone the momentum equation has an extra source for considering the effects of porous media on the flow field.


Kittipos June 16, 2015 05:35

hi foamer
i have a question. how to calculate d and f in darcy?
could you describe me plzzzzz
thx

Majed June 16, 2015 11:06

Quote:

Originally Posted by Kittipos (Post 550537)
hi foamer
i have a question. how to calculate d and f in darcy?
could you describe me plzzzzz
thx

Hello,

Take a look at page 34 of the pdf file in the link below:

https://www.politesi.polimi.it/bitst..._DiStefano.pdf

I hope it will be useful.


All times are GMT -4. The time now is 19:38.