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

Simulating simple shear flow in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2021, 07:49
Default Simulating simple shear flow in OpenFOAM
  #1
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
Shibi is on a distinguished road
Hello to all,

I am trying to simulate a 2D simple shear flow case with OpenFOAM using simpleFOAM. Afterwards, I would like to use the steady-state velocity field in some pimpleFoam simulations.

I am having a problem with simpleFoam. I get complete convergence of the x-component of velocity, however, I cannot converge the pressure and the z-component. I have run out of ideas, and would appreciate some help!

The dictionaries I am using are:
Code:
convertToMeters 0.1;

vertices
(
    (0 0 0)
    (1 0 0)
    (1 0.25 0)
    (0 0.25 0)
    (0 0 0.25)
    (1 0 0.25)
    (1 0.25 0.25)
    (0 0.25 0.25)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (40 10 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    top
    {

        type patch;
        faces
        (
            (4 5 6 7)
            
        );
    }

    bottom
    {

        type patch;
        faces
        (
           (0 3 2 1)
            
        );
    }
    wall1
    {
        type cyclic;
        neighbourPatch wall2;
        faces
        (   
             (2 6 5 1)
        );
    }

    wall2
    {
        type cyclic;
        neighbourPatch wall1;
        faces
        (   
            (0 4 7 3)
        );
    }
    
    emptyFaces
    {
        type empty;
        faces
        (   
           (1 5 4 0)
            (3 7 6 2) 
        );
    }
);

mergePatchPairs
(
);
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];


internalField   uniform (0 0 0);

boundaryField
{
    top
    {
        type            fixedValue;
        value           uniform (1 0 0);
    }
    bottom
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    "(wall.*)"
    {
       type                      cyclic;
    }
   emptyFaces
    {
        type            empty;
    }
}


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    "(.*)"
    {
        type    zeroGradient;
    }

    "(wall.*)"
    {
       type     cyclic;
    }

    emptyFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      Gauss linear;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        /*solver          GAMG;
        smoother        DIC;
        tolerance       1e-6;
        relTol          0.01;*/
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0.1;
    }

    "(U|sigma)"
    {
        /*solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-6;
        relTol          0.1;*/
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-06;
        relTol          0.1;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    "(U|sigma)Final"
    {
        $U;
        relTol          0;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell 0;
    pRefValue 0;
    residualControl
    {
        p               1e-6;
        U                1e-6;
    }
}


relaxationFactors
{
    fields
    {
        p   0.3;
    }

    equations
    {
        U   0.7;
    }
}

// ************************************************************************* //
Shibi is offline   Reply With Quote

Old   March 5, 2021, 08:50
Default
  #2
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 9
keitaro7_14 is on a distinguished road
Try to fix the value of the pressure in a cell or in a whole patch of a boundary.

Like here:

https://github.com/OpenFOAM/OpenFOAM...pipeCyclic/0/p
keitaro7_14 is offline   Reply With Quote

Old   March 8, 2021, 06:00
Default
  #3
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
Shibi is on a distinguished road
Quote:
Originally Posted by keitaro7_14 View Post
Try to fix the value of the pressure in a cell or in a whole patch of a boundary.

Like here:

https://github.com/OpenFOAM/OpenFOAM...pipeCyclic/0/p

Hi,


Thank you for the reply. However, this is already being made in the Simple subdict with the parameters


Code:
    
pRefCell 0;
pRefValue 0;
I can get it to converge it I put a very small value for pRefValue, e.g., 0.1. However I do not understand why...
Shibi is offline   Reply With Quote

Reply

Tags
simple shear, simplefoam convergence


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
Buoyant environmental flow including salinity in OpenFOAM Jost K OpenFOAM Programming & Development 18 September 4, 2020 05:44
OpenFOAM course for beginners Jibran OpenFOAM Announcements from Other Sources 2 November 4, 2019 09:51
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 07:15
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
Open channel flow with icoFoam solver in openFoam yash lakhani Main CFD Forum 0 May 23, 2016 09:03


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