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

use of porous media with sonicFoam or rhoCentralFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2018, 16:54
Default use of porous media with sonicFoam or rhoCentralFoam
  #1
New Member
 
Join Date: Aug 2017
Posts: 18
Rep Power: 9
Calmly is on a distinguished road
Hello!

How can I use a porous media/cell zone with transient solver like sonicFoam or rhoCentralFoam? Do I need to implement the code for the porous zones in the solver or there is another way to do it?

I want to use the porous zone near the walls and the sonicFoam/rhoCentralFoam for the far-field domain.

Regards.
Calmly is offline   Reply With Quote

Old   February 8, 2018, 07:49
Default
  #2
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Were you able to use those sovlers (esp. sonicFoam) for your case? Could you share the outcome please?
deepbandivadekar is offline   Reply With Quote

Old   February 11, 2018, 02:02
Default
  #3
Member
 
rezaeimahdi's Avatar
 
mahdi
Join Date: Nov 2015
Location: Paris, France
Posts: 32
Rep Power: 10
rezaeimahdi is on a distinguished road
Quote:
Originally Posted by Calmly View Post
Hello!

How can I use a porous media/cell zone with transient solver like sonicFoam or rhoCentralFoam? Do I need to implement the code for the porous zones in the solver or there is another way to do it?

I want to use the porous zone near the walls and the sonicFoam/rhoCentralFoam for the far-field domain.

Regards.
Hello,

If I understand correctly your question, you want to simulate a porous zone with a transient solver? right?

you can define a porous zone in your mesh and then use fvOptions.

If my answer is what you are looking for and you need further information please don't hesitate to ask.

Bests
rezaeimahdi is offline   Reply With Quote

Old   February 13, 2018, 13:46
Default
  #4
New Member
 
Join Date: Aug 2017
Posts: 18
Rep Power: 9
Calmly is on a distinguished road
Quote:
Originally Posted by rezaeimahdi View Post
Hello,

If I understand correctly your question, you want to simulate a porous zone with a transient solver? right?

you can define a porous zone in your mesh and then use fvOptions.

If my answer is what you are looking for and you need further information please don't hesitate to ask.

Bests
Hello,

Thank you for your answer.

Yeah, that's what I need, more or less.

I tried to define the porous zone with topoSetDict and then use the fvOptions as you said. It looks like it reads the porous zone when i run the solver but after 3 iterations i get this:


Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v1706
Arch   : "LSB;label=32;scalar=64"
Exec   : rhoCentralFoam
Date   : Feb 13 2018
Time   : 19:16:39
Host   : "themistoklis-desktop"
PID    : 14946
Case   : /home/themistoklis/VKI/3D/LES/cases_folder/ss-LES-porosity1
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

Reading field U

Creating turbulence model

Selecting turbulence model type LES
Selecting LES turbulence model kEqn
Selecting LES delta type vanDriest
Selecting LES delta type cubeRootVol
LES
{
    LESModel        kEqn;
    turbulence      on;
    printCoeffs     on;
    delta           vanDriest;
    cubeRootVolCoeffs
    {
        deltaCoeff      1;
    }
    PrandtlCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        smoothCoeffs
        {
            delta           cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }
            maxDeltaRatio   1.1;
        }
        Cdelta          0.158;
    }
    vanDriestCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        smoothCoeffs
        {
            delta           cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }
            maxDeltaRatio   1.1;
        }
        Aplus           26;
        Cdelta          0.158;
    }
    smoothCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        maxDeltaRatio   1.1;
    }
    Ce              1.048;
    Ck              0.094;
}

Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type explicitPorositySource
    Source: porosity_wall
    - selecting cells using cellZone porosity_wall
Porosity region porosity_wall:
    selecting model: DarcyForchheimer
    creating porous zone: porosity_wall
    coordinateSystem origin: (0 0 0)
    e1              (1 0 0);
    e2              (0 1 0);
    e3              (0 0 1);

    local bounds: (-2e+300 -2e+300 -2e+300)

fluxScheme: Kurganov

Starting time loop

--> FOAM Warning : 
    From function virtual void Foam::probes::findElements(const Foam::fvMesh&)
    in file probes/probes.C at line 122
    Did not find location (0.5 0.5 0.35) in any cell. Skipping location.
Mean and max Courant Numbers = 0.0011493 26.4788
deltaT = 1.8883e-10
Time = 1.8883e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 5.90703e-08, Final residual = 2.44838e-17, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1.26004e-08, Final residual = 6.01289e-18, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 3.90837e-07, Final residual = 1.92179e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 1.58267e-08, Final residual = 1.84018e-17, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 9.37399e-20, No Iterations 2
ExecutionTime = 6.42 s  ClockTime = 7 s

Mean and max Courant Numbers = 2.14605e-05 0.466437
deltaT = 2.02418e-10
Time = 3.91248e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.22091e-08, Final residual = 1.2556e-18, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 4.60887e-09, Final residual = 4.60887e-09, No Iterations 0
smoothSolver:  Solving for Uz, Initial residual = 2.09171e-07, Final residual = 6.71802e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 5.00931e-09, Final residual = 5.00931e-09, No Iterations 0
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source porosity_wall defined for field U but never used
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source porosity_wall defined for field U but never used


This is my fvOption file:
Code:
porosity_wall 
{
    type           explicitPorositySource;
    active         true;

    explicitPorositySourceCoeffs
    {
        type           DarcyForchheimer;
        selectionMode  cellZone;
        cellZone       porosity_wall; // Specify the name of the cellZone

        DarcyForchheimerCoeffs
        {
            // Negative coeffs are multiplied by largest positive coeff,
            // taking the magnitude, e.g. for -1000, coeff = |1e7*-1000| = 1e10

            d          [0 -2 0 0 0 0 0] (1e7 -1000 -1000);
            f          [0 -1 0 0 0 0 0] (0 0 0);

            coordinateSystem // Cartesian coordinates for the cellZone
            {
                x          (1 0 0);
                y          (0 1 0);
                #includeEtc "caseDicts/general/coordinateSystem/cartesianXY"
            }
        }
     }
}
And this is my topoSetDict file:
Code:
actions
(
    {
        name    porosity_wall;//center
        type    cellZoneSet;
        action  new;//add
        source  boxToCell;
        sourceInfo
        {
            box (0.125 0 0)(0.12494365 0.75 0.1);//building_wall
        }
    }


);
Calmly is offline   Reply With Quote

Old   February 14, 2018, 00:50
Default
  #5
Member
 
rezaeimahdi's Avatar
 
mahdi
Join Date: Nov 2015
Location: Paris, France
Posts: 32
Rep Power: 10
rezaeimahdi is on a distinguished road
Quote:
Originally Posted by Calmly View Post
Hello,

Thank you for your answer.

Yeah, that's what I need, more or less.

I tried to define the porous zone with topoSetDict and then use the fvOptions as you said. It looks like it reads the porous zone when i run the solver but after 3 iterations i get this:


Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v1706
Arch   : "LSB;label=32;scalar=64"
Exec   : rhoCentralFoam
Date   : Feb 13 2018
Time   : 19:16:39
Host   : "themistoklis-desktop"
PID    : 14946
Case   : /home/themistoklis/VKI/3D/LES/cases_folder/ss-LES-porosity1
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

Reading field U

Creating turbulence model

Selecting turbulence model type LES
Selecting LES turbulence model kEqn
Selecting LES delta type vanDriest
Selecting LES delta type cubeRootVol
LES
{
    LESModel        kEqn;
    turbulence      on;
    printCoeffs     on;
    delta           vanDriest;
    cubeRootVolCoeffs
    {
        deltaCoeff      1;
    }
    PrandtlCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        smoothCoeffs
        {
            delta           cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }
            maxDeltaRatio   1.1;
        }
        Cdelta          0.158;
    }
    vanDriestCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        smoothCoeffs
        {
            delta           cubeRootVol;
            cubeRootVolCoeffs
            {
                deltaCoeff      1;
            }
            maxDeltaRatio   1.1;
        }
        Aplus           26;
        Cdelta          0.158;
    }
    smoothCoeffs
    {
        delta           cubeRootVol;
        cubeRootVolCoeffs
        {
            deltaCoeff      1;
        }
        maxDeltaRatio   1.1;
    }
    Ce              1.048;
    Ck              0.094;
}

Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type explicitPorositySource
    Source: porosity_wall
    - selecting cells using cellZone porosity_wall
Porosity region porosity_wall:
    selecting model: DarcyForchheimer
    creating porous zone: porosity_wall
    coordinateSystem origin: (0 0 0)
    e1              (1 0 0);
    e2              (0 1 0);
    e3              (0 0 1);

    local bounds: (-2e+300 -2e+300 -2e+300)

fluxScheme: Kurganov

Starting time loop

--> FOAM Warning : 
    From function virtual void Foam::probes::findElements(const Foam::fvMesh&)
    in file probes/probes.C at line 122
    Did not find location (0.5 0.5 0.35) in any cell. Skipping location.
Mean and max Courant Numbers = 0.0011493 26.4788
deltaT = 1.8883e-10
Time = 1.8883e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 5.90703e-08, Final residual = 2.44838e-17, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1.26004e-08, Final residual = 6.01289e-18, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 3.90837e-07, Final residual = 1.92179e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 1.58267e-08, Final residual = 1.84018e-17, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 9.37399e-20, No Iterations 2
ExecutionTime = 6.42 s  ClockTime = 7 s

Mean and max Courant Numbers = 2.14605e-05 0.466437
deltaT = 2.02418e-10
Time = 3.91248e-10

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.22091e-08, Final residual = 1.2556e-18, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 4.60887e-09, Final residual = 4.60887e-09, No Iterations 0
smoothSolver:  Solving for Uz, Initial residual = 2.09171e-07, Final residual = 6.71802e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 5.00931e-09, Final residual = 5.00931e-09, No Iterations 0
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source porosity_wall defined for field U but never used
--> FOAM Warning : 
    From function virtual void Foam::fv::option::checkApplied() const
    in file cfdTools/general/fvOptions/fvOption.C at line 125
    Source porosity_wall defined for field U but never used


This is my fvOption file:
Code:
porosity_wall 
{
    type           explicitPorositySource;
    active         true;

    explicitPorositySourceCoeffs
    {
        type           DarcyForchheimer;
        selectionMode  cellZone;
        cellZone       porosity_wall; // Specify the name of the cellZone

        DarcyForchheimerCoeffs
        {
            // Negative coeffs are multiplied by largest positive coeff,
            // taking the magnitude, e.g. for -1000, coeff = |1e7*-1000| = 1e10

            d          [0 -2 0 0 0 0 0] (1e7 -1000 -1000);
            f          [0 -1 0 0 0 0 0] (0 0 0);

            coordinateSystem // Cartesian coordinates for the cellZone
            {
                x          (1 0 0);
                y          (0 1 0);
                #includeEtc "caseDicts/general/coordinateSystem/cartesianXY"
            }
        }
     }
}
And this is my topoSetDict file:
Code:
actions
(
    {
        name    porosity_wall;//center
        type    cellZoneSet;
        action  new;//add
        source  boxToCell;
        sourceInfo
        {
            box (0.125 0 0)(0.12494365 0.75 0.1);//building_wall
        }
    }


);
Hello

Can you test your case with another solver like sonicFoam and let me know if it worked?

I have no idea about rhoCentralFoam, but just check the source code and it seems it doesn't care about fvOptions in momentum equation:

// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));

U.ref() =
rhoU()
/rho();
U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();

if (!inviscid)
{
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
}

And this could be the reason for this warning: Source porosity_wall defined for field U but never used

However, for the other solvers like sonicFoam momentum equation solve like this:

// Solve the Momentum equation

MRF.correctBoundaryVelocity(U);

fvVectorMatrix UEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
);

UEqn.relax();

fvOptions.constrain(UEqn);

if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));

fvOptions.correct(U);
K = 0.5*magSqr(U);
}

And as you can see, there is fvOptions in RHS of the equation as the source term.



Regards,
rezaeimahdi is offline   Reply With Quote

Old   September 15, 2018, 21:34
Default
  #6
New Member
 
Join Date: Aug 2017
Posts: 18
Rep Power: 9
Calmly is on a distinguished road
Quote:
Originally Posted by rezaeimahdi View Post
Hello

Can you test your case with another solver like sonicFoam and let me know if it worked?

I have no idea about rhoCentralFoam, but just check the source code and it seems it doesn't care about fvOptions in momentum equation:

// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));

U.ref() =
rhoU()
/rho();
U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();

if (!inviscid)
{
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
}

And this could be the reason for this warning: Source porosity_wall defined for field U but never used

However, for the other solvers like sonicFoam momentum equation solve like this:

// Solve the Momentum equation

MRF.correctBoundaryVelocity(U);

fvVectorMatrix UEqn
(
fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
);

UEqn.relax();

fvOptions.constrain(UEqn);

if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));

fvOptions.correct(U);
K = 0.5*magSqr(U);
}

And as you can see, there is fvOptions in RHS of the equation as the source term.



Regards,
Thank you very much for your post, it really helped me.

You were right, rhocentralfoam couldn't 'read' the porous medium on the wall. In order to do so, I modified the momentum equation of rhocentralfoam and it works.

Sorry for the late reply.
Calmly is offline   Reply With Quote

Old   May 7, 2020, 12:12
Default
  #7
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
Quote:
Originally Posted by Calmly View Post
Thank you very much for your post, it really helped me.

You were right, rhocentralfoam couldn't 'read' the porous medium on the wall. In order to do so, I modified the momentum equation of rhocentralfoam and it works.

Sorry for the late reply.



Dear Calmly,


could you post your solution for rhoCentralFoam?
I am very interested how you changed the code to make it work.


Regards,
shock77
shock77 is offline   Reply With Quote

Reply

Tags
media, porous, rhocentralfoam


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 8 May 30, 2024 03:59
Thermal non-equilibrium porous media model with conjugate heat transfer Hexahedron FLUENT 9 February 22, 2023 03:55
Porous media setup issues in Fluent Bernard Van FLUENT 29 January 26, 2017 05:09
How to model granular flow through porous media Axius FLUENT 2 August 7, 2014 11:34
porous media: Fluent or Star-CD? Igor Main CFD Forum 0 December 5, 2002 16:16


All times are GMT -4. The time now is 16:31.