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

[TUTORIAL] Implementing porous zones to PisoFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By ssss

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2014, 14:04
Default [TUTORIAL] Implementing porous zones to PisoFOAM
  #1
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
  1. Run the following to make a copy of the original pisoFoam
Code:
cp -r $WM_PROJECT_DIR/applications/solvers/incompressible/pisoFoam/ $WM_PROJECT_USER_DIR/applications/solvers/my_pisoFoamPOROUS
  • Change names
Code:
cd $WM_PROJECT_USER_DIR/applications/solvers/my_pisoFoamPOROUS
Code:
mv pisoFoam.C my_pisoFoamPOROUS.C
  • Change link options so that we can compile
Change Make/files to

Code:
my_pisoFoamPOROUS.C

EXE = $(FOAM_USER_APPBIN)/my_pisoFoamPOROUS
First line says which is the main file for the compilation, second line tells the compiler where to save the new solver and the new of the new solver (the name you will use to call the new solver)

Change Make/options to:

Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude 

EXE_LIBS = \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lincompressibleTransportModels \
    -lfiniteVolume \
    -lmeshTools
The \ tells the compiler there is a new line, and we added meshTools library in order to access the mesh object during runTime
  • Remove old compiled files
Code:
rm -rf Make/linux* pisoFoam.dep
  • Create new file createPorousZones.H
Code:
touch createPorousZones.H
This will create the file. Then add to it the following


Code:
    porousZones pZones(mesh); //creates the object porousZones from the mesh object
    Switch pressureImplicitPorosity(false);// Sets the pressure solver as explicit
  • Open my_pisoFoamPOROUS.C and add this before the main function
Code:
...
#include "porousZones.H" // object porousZone 
int main(){
...
}
This is needed to have the porousZones constructor

  • Add the following after the main function
Code:
int main(){

    #include "CourantNo.H"
    #include "createPorousZones.H"
    
    // PISO LOOP
    ....

}
This will create the object porousZones as stated before
  • Inside the PISO corrector add the following
Code:
//PISO corrector

{
            fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
            );
           pZones.addResistance(UEqn);
          ...

}
  • Compile the solver
Code:
wmake
  • The solver is completed now you need to put inside your constant/ folder a file with name porousZones where you will write your porous properties. You can get one from
    Code:
    $WM_PROJECT_DIR/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/constant/
  • To set a porous zone inside your mesh
Run
Code:
topoSet
with your topoSetDict, example setting a box:


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;
    object      topoSetDict;
}

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

actions
(
    {
        name    porosity;
        type    cellSet;
        action  new;
        source  boxToCell;
        sourceInfo
        {
           box (10 0 0) (35 2 0.5); //box (minVertex) (maxVertex)
        }
    }
After that run
Code:
setsToZones
because we have selected only Cells, but the solver needs zones.

At last call
Code:
my_pisoFoamPOROUS
inside your case folder, and it should hopefully run with porous zones.

Hope you found it helpful.
wyldckat, abhi22, Joe Wang and 2 others like this.
ssss is offline   Reply With Quote

Old   October 30, 2016, 22:58
Default
  #2
Member
 
Anirudh Kulkarni
Join Date: May 2016
Posts: 62
Rep Power: 10
Tempest is on a distinguished road
I get the error "fatal error: porousZones.H: No such file or directory
compilation terminated".

What can be the possible reasons?>
Tempest is offline   Reply With Quote

Old   November 2, 2016, 18:16
Default
  #3
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 18
wouter is on a distinguished road
Hello
To make this work you either need to have the same version as OF that is used by ssss or get the right name of the include file for porousSimpleFoam.
#include "IOporosityModelList.H" in stead of
#include "porousZones.H"

This change also needs to be made in the code exchange porousZones by IOporosityModelList.

( I tried this with OF-dev and I had to change the tutorial also quite a lot because there are links to files that I could not copy)

Hope this helps
Wouter
wouter is offline   Reply With Quote

Old   November 2, 2016, 22:00
Default
  #4
Member
 
Anirudh Kulkarni
Join Date: May 2016
Posts: 62
Rep Power: 10
Tempest is on a distinguished road
Yeah I figured that out.

To add porous zones in any solver:

1. Create createPorousZones.H file.

Add

IOporosityModelList pZones(mesh); //creates the object porousZones from the mesh object

Switch pressureImplicitPorosity(false);// Sets the pressure solver as explicit

2. Add #include "IOporosityModelList.H" in header of .C
#include "createPorousZones.H" in main prog.

3. Add pZones.addResistance(UEqn); after the governing equations.

Peace!
Tempest is offline   Reply With Quote

Old   November 25, 2016, 22:44
Default
  #5
Member
 
Anirudh Kulkarni
Join Date: May 2016
Posts: 62
Rep Power: 10
Tempest is on a distinguished road
Quote:
Originally Posted by wouter View Post
Hello
To make this work you either need to have the same version as OF that is used by ssss or get the right name of the include file for porousSimpleFoam.
#include "IOporosityModelList.H" in stead of
#include "porousZones.H"

This change also needs to be made in the code exchange porousZones by IOporosityModelList.

( I tried this with OF-dev and I had to change the tutorial also quite a lot because there are links to files that I could not copy)

Hope this helps
Wouter
Is it necessary to multiply porosity explicitly in the Ueqn as given in various articles on porous media or OF takes care of it when you define darcyForchheimer type fvOptions?
Tempest is offline   Reply With Quote

Old   September 26, 2017, 13:55
Default
  #6
Member
 
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 10
ashishmagar600 is on a distinguished road
Hello everyone.

Is there a similar method for including cellzones inside a solver, maybe icofoam or simplefoam??
ashishmagar600 is offline   Reply With Quote

Old   July 31, 2018, 15:23
Default
  #7
New Member
 
naufal
Join Date: May 2018
Posts: 11
Rep Power: 8
mnaufalazwar is on a distinguished road
what is the different if i want to implement porous zones to icoFoam? thanks
mnaufalazwar is offline   Reply With Quote

Reply

Tags
piso, pisofoam, porous


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
Direction vectors and adsorption in porous zones Toplaa FLUENT 0 August 16, 2013 15:22
Wall between porous zones roupcik FLUENT 0 April 15, 2013 08:10
Wall between porous zones roupcik FLUENT 1 April 15, 2013 08:06
Wall between porous zones roupcik Main CFD Forum 1 April 15, 2013 08:05
Help:What's wrong with my porous zones setting!!? jjw FLUENT 2 August 26, 2005 06:16


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