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/)
-   -   Adding porous zones in icoFoam solver (https://www.cfd-online.com/Forums/openfoam-solving/149395-adding-porous-zones-icofoam-solver.html)

josephn March 3, 2015 16:31

Adding porous zones in icoFoam solver
 
I am trying to simulate a fluid leak from a capillary into surrounding porous media. I was experimenting with porousSimpleFoam, but my Reynolds number is around 1e-3 so what I really need is a laminar solver and it seems icoFoam is the best option. My problem is that the porous regions do not seem to affect fluid flow regardless of the porosity values that I use. I am not sure if icoFoam is acknowledging the porous zones at all.

Here is my checkMesh file

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : checkMesh
Date  : Mar 03 2015
Time  : 14:28:34
Host  : "josephn-NY639AA-ABA-p6213w"
PID    : 27184
Case  : /home/josephn/Work/porousSimpleFoam/EruptionTest
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          99432
    internal points:  0
    faces:            196790
    internal faces:  97360
    cells:            49025
    faces per cell:  6
    boundary patches: 5
    point zones:      0
    face zones:      0
    cell zones:      4

Overall number of cells of each type:
    hexahedra:    49025
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:    0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch              Faces    Points  Surface topology                 
    inlet              10      22      ok (non-closed singly connected) 
    outlet              10      22      ok (non-closed singly connected) 
    porousTumorSide    625      1252    ok (non-closed singly connected) 
    capWall            735      1476    ok (non-closed singly connected) 
    frontAndBack        98050    99432    ok (non-closed singly connected) 

Checking geometry...
    Overall domain bounding box (0 0 0) (0.0002405 0.000201 1e-06)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-1.07221e-18 3.85003e-19 -1.18515e-15) OK.
    Max cell openness = 1.00974e-16 OK.
    Max aspect ratio = 10 OK.
    Minimum face area = 2e-14. Maximum face area = 1e-12.  Face area magnitudes OK.
    Min volume = 2e-20. Max volume = 1e-18.  Total volume = 4.81005e-14.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
 ***Max skewness = 4.54296, 205 highly skew faces detected which may impair the quality of the results
  <<Writing 205 skew faces to set skewFaces
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

You can see that the cellZones are being read in. Is there another trick to adding porous resistance to an icoFoam solver?

Thanks,

Joe

alexeym March 4, 2015 01:55

Hi,

It is rather interesting switch, from porousSimpleFoam to icoFoam. The first is steady-state solver, the second is transient solver.

It is much easier to make (for example) pimpleFoam to behave like icoFoam (i.e. set number of outer correctors to 1, set RASModel to laminar) then to add porous zones to icoFoam (add corresponding pieces of code to solver, recompile solver, test new solver). Also with pimpleFoam (or simpleFoam if you need steady state solution) you can use explicitPorositySource to set porous zones.

josephn March 5, 2015 23:12

PimpleFoam still not recognizing porosity
 
I converted to pimpleFoam as you suggested, but I am still struggling to see any resistance.

When I ran the tutorial for porousSimpleFoam, the start of the simulation read like this.

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : porousSimpleFoam
Date  : Mar 05 2015
Time  : 20:49:04
Host  : "josephn-NY639AA-ABA-p6213w"
PID    : 6908
Case  : /home/josephn/OpenFOAM/josephn-2.3.0/run/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: no convergence criteria found. Calculations will run for 10 steps.

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model laminar
No finite volume options present

No MRF models present

Creating porosity model list from porosityProperties

Porosity region porosity1:
    selecting model: DarcyForchheimer
    creating porous zone: porosity
Using pressure implicit porosity


Starting time loop

Time = 1

GAMG:  Solving for p, Initial residual = 1, Final residual = 0.0331908, No Iterations 5
time step continuity errors : sum local = 4.52244, global = 0.448809, cumulative = 0.448809
ExecutionTime = 0.21 s  ClockTime = 0 s

When I run my project using pimpleFoam, however, I don't see any message about creating porous zones.

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : pimpleFoam
Date  : Mar 05 2015
Time  : 21:00:54
Host  : "josephn-NY639AA-ABA-p6213w"
PID    : 6995
Case  : /home/josephn/OpenFOAM/josephn-2.3.0/run/tutorials/incompressible/pimpleFoam/pimpleTutorial
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
No finite volume options present


PIMPLE: Operating solver in PISO mode


Starting time loop

Courant Number mean: 0 max: 0
deltaT = 1.11111e-09
Time = 1.11111e-09

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 1.83397e-07, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 9.04806e-06, No Iterations 4
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.00943383, No Iterations 1
time step continuity errors : sum local = 1.59183e-09, global = -1.55676e-09, cumulative = -1.55676e-09
GAMG:  Solving for p, Initial residual = 0.23809, Final residual = 8.59885e-07, No Iterations 26
time step continuity errors : sum local = 2.71317e-14, global = 8.34192e-15, cumulative = -1.55675e-09
ExecutionTime = 4.87 s  ClockTime = 5 s

Looking over the fvSolutions and fvSchemes files, I cannot see any way to inform the solver to look for porous zones. Again the cell zones are being picked up when I run blockMesh, but I don't think there is any recognition by the solver. What am I missing?

alexeym March 6, 2015 01:47

Hi,

If you reread my previous message, it contains "you can use explicitPorositySource to set porous zones", while your execution log shows:

Code:

No finite volume options present
That means you have ignored my suggestion on the way to add porous drag to cellZones and yet complain about porosity absence. You can learn how to use fvOptions and explicitPorositySource in tutorial and source code (or using search on this Forum).

josephn March 7, 2015 00:28

Working now
 
Thank you!

That was just the hint that I needed. I created the fvOptions file in the system folder and added the contents of the porosity properties file. There were a few more formatting related hiccups, but it looks like everything works now.

Thanks for taking the time to help.

Joe


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