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

Porous Media

Register Blogs Community New Posts Updated Threads Search

Like Tree21Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2014, 13:24
Default Porous Media
  #1
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
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!
realfear is offline   Reply With Quote

Old   May 20, 2014, 14:23
Default
  #2
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by realfear View Post
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
adambarfi is offline   Reply With Quote

Old   May 20, 2014, 17:11
Default
  #3
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
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 !
can you describe the process of doing it in a very very basic language!!!??
plzzzzzzzzzzzzzzzzz
realfear is offline   Reply With Quote

Old   May 21, 2014, 00:45
Default
  #4
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
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
Annier, realfear, Kittipos and 2 others like this.
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 02:45
Default
  #5
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
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)?


merci
realfear is offline   Reply With Quote

Old   May 21, 2014, 03:17
Default
  #6
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by realfear View Post
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)?


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.
Annier and realfear like this.
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 03:43
Default
  #7
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
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??
realfear is offline   Reply With Quote

Old   May 21, 2014, 04:24
Default
  #8
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
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.
mizzou likes this.
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 05:26
Default
  #9
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
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
realfear is offline   Reply With Quote

Old   May 21, 2014, 05:52
Default
  #10
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by realfear View Post
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
Annier, realfear and mizzou like this.
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 06:01
Default
  #11
New Member
 
Join Date: Mar 2014
Posts: 16
Rep Power: 12
realfear is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
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
realfear is offline   Reply With Quote

Old   December 17, 2014, 20:22
Default
  #12
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
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
zahraa is offline   Reply With Quote

Old   December 17, 2014, 23:43
Default
  #13
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by zahraa View Post
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
Annier likes this.
adambarfi is offline   Reply With Quote

Old   December 19, 2014, 12:05
Default
  #14
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
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!!
zahraa is offline   Reply With Quote

Old   December 23, 2014, 11:48
Default
  #15
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by zahraa View Post
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!!
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
Annier likes this.
adambarfi is offline   Reply With Quote

Old   March 3, 2015, 19:01
Default Porous media simulations
  #16
New Member
 
Join Date: Mar 2014
Posts: 23
Rep Power: 12
Majed is on a distinguished road
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.
Majed is offline   Reply With Quote

Old   March 3, 2015, 22:38
Default
  #17
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Dear Majid,

Quote:
Originally Posted by Majed View Post
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 View Post
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.
yuming yuan likes this.
adambarfi is offline   Reply With Quote

Old   March 3, 2015, 23:10
Default
  #18
New Member
 
Join Date: Mar 2014
Posts: 23
Rep Power: 12
Majed is on a distinguished road
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 View Post
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.
Attached Images
File Type: jpg Untitled.jpg (26.7 KB, 165 views)
File Type: jpg Untitled2.jpg (18.7 KB, 78 views)
Majed is offline   Reply With Quote

Old   June 16, 2015, 05:35
Default
  #19
New Member
 
Ipos
Join Date: Feb 2015
Posts: 7
Rep Power: 11
Kittipos is on a distinguished road
hi foamer
i have a question. how to calculate d and f in darcy?
could you describe me plzzzzz
thx
Kittipos is offline   Reply With Quote

Old   June 16, 2015, 11:06
Default
  #20
New Member
 
Join Date: Mar 2014
Posts: 23
Rep Power: 12
Majed is on a distinguished road
Quote:
Originally Posted by Kittipos View Post
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.
Kittipos, mizzou and Caio Martins like this.
Majed 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
Multiphase Porous Media Flow - Convergence Issues VT_Bromley FLUENT 7 May 14, 2020 16:34
Porous media setup issues in Fluent Bernard Van FLUENT 29 January 26, 2017 04:09
How to model granular flow through porous media Axius FLUENT 2 August 7, 2014 10:34
species mass source in porous media ? PK FLUENT 0 February 16, 2007 11:12
porous media: Fluent or Star-CD? Igor Main CFD Forum 0 December 5, 2002 15:16


All times are GMT -4. The time now is 14:55.