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/)
-   -   how to accurately simulate flow around cylinder (https://www.cfd-online.com/Forums/openfoam-solving/117911-how-accurately-simulate-flow-around-cylinder.html)

kkpal May 17, 2013 04:39

how to accurately simulate flow around cylinder
 
hi everyone!
I've been doing simulation about flow around cylinder recently.
Some information about the case is listed below.

2D simulation;
U=1, D=1, rho=1, nu=0.01, so Re=100;
domain size: upstream 20D, downstream 40D, topwall and bottom wall 20D.
mesh size: about 40000 vertices

The problem is that no matter how I tried, I can not get the accurate result in terms of strouhal number, which in my case is 1.44. An accurate St for RE100 should be 1.65.

Could someone send me a similar case file which has been verified and yields accurate results so I can check what went wrong in my own case? I will be very grateful!
my email address is kai-zhang-kf@ynu.ac.jp

sasanghomi May 17, 2013 06:41

Hi ,
I think you use icoFoam as a solver. So I think two parameters have vital role for getting the exact result : 1) discretization method of terms in equations 2)Mesh generation.
So change your fvSchemes and fvSolution as below :
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance        1e-06;
        relTol          0;
    };

    U
    {
        solver        BiCG;
        preconditioner  DILU;
        tolerance        1e-05;
        relTol          0;
    };
}


PISO
{
  nCorrectors    2;
  nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;
 }

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default backward;
}

gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss GammaV 0.5 ;

}

laplacianSchemes
{
    default        Gauss linear limited 0.5;
    laplacian(nu,U) Gauss linear limited 0.5;
    laplacian(rUA,pcorr) Gauss linear limited 0.5;
    laplacian(rAU,p) Gauss linear limited 0.5;
}

interpolationSchemes
{
    default        linear;
    interpolate(HbyA) linear;
}

snGradSchemes
{
    default        limited 0.5;
}

fluxRequired
{
    default        no;
    pcorr;
    p;
}


Hope this helps,
Sasan.

kkpal May 17, 2013 10:55

dear sasan
thanks very much! your post solved the problem, I used icoFoam this time, now my St number is 1.62, which is much better than the previous ones. Now it is clear that it is not the problem of my mesh, but the discretization method of terms in equations that is giving me bad results.

However, in my previous simulations, I used pimpleFoam because for the long run I need to do much higher Re simulations, for which icoFoam is not appropriate.

Here is my fvschemes and fvsolutions, which is for pimpleFoam and did not give right result.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-06;
        relTol          0.01;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
    }

    pFinal
    {
        solver          GAMG;
        tolerance      1e-06;
        relTol          0;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
    }

    "(U|k|epsilon)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }

    "(U|k|epsilon)Final"
    {
        $U;
        tolerance      1e-05;
        relTol          0;
    }
}

PIMPLE
{
    nOuterCorrectors 1;
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;
}

relaxationFactors
{
    fields
    {
    }
    equations
    {
        "U.*"          0.9;
        "k.*"          1;
        "epsilon.*"    1;
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss limitedLinearV 1;
    div(phi,k)      Gauss limitedLinear 1;
    div(phi,epsilon) Gauss limitedLinear 1;
    div(phi,R)      Gauss limitedLinear 1;
    div(R)          Gauss linear;
    div(phi,nuTilda) Gauss limitedLinear 1;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        none;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
    interpolate(U)  linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}


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

It seems that settings in pimpleFoam is much more complex than those in icoFoam, can you guide me how to make adjustment to these files?

kkpal May 17, 2013 11:56

I just tried changing the settings in pimpleFoam to the ones you provided, hoping that it would also give good result, but it did not.
It seems in my case ,icoFoam does a better job than pimpleFoam.

or pimpleFoam requires something other different settings?

kkpal May 17, 2013 12:36

dear sasan
I think I found the cause for the inaccuracy of the Str number in pimpleFoam.

HTML Code:

http://www.cfd-online.com/Forums/openfoam-solving/94785-icofoam-vs-pisofoam-laminar.html
in this thread it is noted that relaxation may affect the Str number. So I removed the relaxation parameters and magically the good result came out!! Though I don't know what is the particular reason for this improvement.

it is found out that for unsteady cases relaxation is more than necessary. however, in pimpleFoam relaxation is allowable, should we never use relaxation in pimpleFoam when dealing with unsteady cases?

sasanghomi May 17, 2013 15:31

Hi kia ,
You are welcome .
I tried to simulate turbulent flow around a cylinder with pisoFoam 6-7 month ago.But I had some problems and the case didn't converge and amplitude of Lift didn't get a fix value(oscillation was not regular ). Actually I didn't succeed to simulate the flow accurately.
About relaxation factor I should say that I have heard when you use PISO algorithm for solving equations if you use relaxation factor only final result (after convergence) is accurate.
Anyway I am interested in simulation of turbulent flow around a cylinder and I will try to do it.
Let me know your progress.

Thanks and best regards,
Sasan.

sherandlock September 20, 2013 16:27

Help
 
Hi Sasan,

Thank you for your help very much.

This is my error. When time is 1.45s. I have no idea why this is happenning, Would you like to enlighten me a little bit?

Courant Number mean: 1.11225e+91 max: 2.80651e+96
#0 Foam::error::printStack(Foam::Ostream&) in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/lib/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/lib/libOpenFOAM.so"
#4 Foam::fvMatrix<Foam::Vector<double> >::solve(Foam::dictionary const&) in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/bin/icoFoam"
#5 Foam::fvMatrix<Foam::Vector<double> >::solve() in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/bin/icoFoam"
#6 main in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/bin/icoFoam"
#7 __libc_start_main in "/lib64/libc.so.6"
#8 Foam::UOPstream::write(char) in "/home/yzhou/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64Gcc44DPOpt/bin/icoFoam"
Floating exception

sasanghomi September 20, 2013 17:37

Hi sherandlock ,

Your case has diverged . The Courant number is very high . So I only have one idea ,
Try to use adjustTimeStep in the controlDict. Add below lines in the controlDict :
Code:

adjustTimeStep  yes;
 
maxCo          0.5;
 
maxDeltaT      0.01;

Hope this helps.

Maimouna February 26, 2014 11:56

flow past a circular cylinder
 
Dear Sasan,

I'm try to implement flow past circular cylinder in pimpleFoam solver. I attached the case that I'm looking for (pdf file). I blocked and checked mesh everything was fine. I run the case without any problem. But, when I plotted drag and lift forces (using Matlab), it gave me inconvenience result. I don't know where is my mistake.

Anyway, I attached my case if you could please go through all files and checked please what are my mistakes.

NT: D = 1, Re = 100. I'm trying to fix nu in transportProperties file and change u in the attached file because I didn't know where are my errors so I'm trying to do different ways. Also, might blockMeshDict affects my results if you could check please.

Many thanks in advanced.

sasanghomi February 28, 2014 08:36

Hi,

There is no attached file, honestly!

best regards.

Maimouna February 28, 2014 08:45

2 Attachment(s)
Hi Sasan,

sorry, I attached them again.

Looking forward for your help.

kkpal March 3, 2014 21:24

I think at Re=100, turbulence model will jeopardize your result. In this regime the flow is mainly 2 dimensional and could be regarded as not turbulent.

Quote:

Originally Posted by Maimouna (Post 476958)
Dear Sasan,

I'm try to implement flow past circular cylinder in pimpleFoam solver. I attached the case that I'm looking for (pdf file). I blocked and checked mesh everything was fine. I run the case without any problem. But, when I plotted drag and lift forces (using Matlab), it gave me inconvenience result. I don't know where is my mistake.

Anyway, I attached my case if you could please go through all files and checked please what are my mistakes.

NT: D = 1, Re = 100. I'm trying to fix nu in transportProperties file and change u in the attached file because I didn't know where are my errors so I'm trying to do different ways. Also, might blockMeshDict affects my results if you could check please.

Many thanks in advanced.


Maimouna March 4, 2014 05:00

Dear Kai Zhang,

I'm working in laminar not turbulence model.

Have I changed my solver from pimpleFoam to another solver or that does not affect?

What other changes would be supposed?

Regards

alexeym March 4, 2014 05:17

Quote:

Originally Posted by Maimouna (Post 477891)
I'm working in laminar not turbulence model.

According to your case files, you're working with oneEqEddy LES model for the turbulence. If you'd like to run simulation for laminar case you need to:

1. Put RASModel in constant/turbulenceProperties
2. Put
Code:

RASModel        laminar;

turbulence      off;

printCoeffs    on;

in constant/RASProperties.

Also I'd suggest you to change fvSolution:
Code:

PIMPLE
{
    nOuterCorrectors 10;
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;

    residualControl
    {
        "(U|p)"
        {
            tolarance 1e-4;
            relTol 0;
        }
    }
}

to be sure that you have converged solution on every time step.

Maimouna March 4, 2014 05:51

Dear Alexey,

many thanks for your reply. I did all changes that you supposed. After typing pimpleFoam in the command window, I got this error
[QUOTE]
Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : pimpleFoam
Date : Mar 04 2014
Time : 10:40:09
Host : maimouna-desktop
PID : 3105
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderModified
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Create mesh for time = 0.000000e+00

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model laminar


--> FOAM FATAL IO ERROR:
keyword turbulence is undefined in dictionary "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderModified/constant/RASProperties"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderModified/constant/RASProperties from line 18 to line 82.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 395.

FOAM exiting

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderModified$
What does this error mean?

alexeym March 4, 2014 05:56

Well,

Post your RASProperties file, otherwise I can only suggest that RASProperties file is incorrect ;)

Maimouna March 4, 2014 06:01

This is RASProperties file

Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

RASModel laminar; //oneEqEddy;

delta cubeRootVol;

printCoeffs on;

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


// ************************************************** *********************** //
Regards

alexeym March 4, 2014 06:06

Well, can you please tell me the difference between what you've posted and what I've suggested to put into RASProperties?

Can you create a file with just
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.2                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

RASModel        laminar;

turbulence      off;

printCoeffs    on;


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

?

The error you've got tells you that there's no turbulence keyword in RASProperties files, and in fact there's no such keyword in your file.

Maimouna March 4, 2014 06:11

Dear Alexey,

sorry for that mistakes.

I is running now. I will let you know about the result.

Many thanks

Maimouna March 4, 2014 06:36

1 Attachment(s)
Dear Alexy,

the running is done.
I have two questions please
1. in cotrolDict file (attached)
startTime 0;
endTime 25.0;
deltaT 0.01;

but the running is completed after 1.4, why?
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    pimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        25.0;

deltaT          0.01; //1e-04

writeControl    adjustableRunTime;

writeInterval  0.1; //5.0e-1

purgeWrite      0;

writeFormat    binary;

writePrecision  6;

writeCompression uncompressed;

timeFormat      scientific;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep    yes;

maxCo            0.5;

maxDeltaT        2.0e-3;

functions
{
    probes
    {
        type            probes;
        functionObjectLibs ("libsampling.so");
        enabled        true;
        outputControl  timeStep;
        outputInterval  1;
        probeLocations
        (
            ( 0.05  0.0  0.002 )
            ( 0.05  0.01  0.002 )
            ( 0.05  0.01  0.002 )
            ( 0.05  0.01  0.002 )
            ( 0.05  0.01  0.002 )
            ( 0.05  0.01  0.002 )
            ( 0.05  0.01  0.002 )
        );

        fields
        (
            p
        );
    }

    forces
    {
        type        forceCoeffs;
        functionObjectLibs ( "libforces.so" );
        outputControl timeStep;
        outputInterval 1;
        patches
        (
            walls
        );
            directForceDensity no;

        pName      p;
        UName      U;
        rhoName    rhoInf;
        //log        true;
        rhoInf      994.5;
        CofR        ( 0 0 0 );
        liftDir    ( 0 1 0 );
        dragDir    ( 1 0 0 );
        pitchAxis  ( 0 0 1 );
        magUInf    1.787e-4; //1; //0.54
        lRef        0.04;
        Aref        0.0157;
        Aref1        0.004;
        rhoRef      994.5;
    }

    fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled        true;
        outputControl  outputTime;
        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }
}


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




2. the drag chart is given as attached. Why? I know the drag coefficient figure is tottaly different, whats the wrong?

Best regards

alexeym March 4, 2014 06:58

It seems that you've got diverging solution (at 1.4 s it just blows up). Can you post the output of the solver?

Also I've got several question about your BCs:

1. You set fixed velocity at the outlet and yet you'd like to plot outlet velocity over time. Though you can plot velocity at the inlet boundary.

2. You've got symmetry BC at sides patch, though if you like to simulate flow past ONE cylinder, it should be wall.

3. For some reason you've decided to set symmetry plane also on walls patch (surface of the cylinder), though it again should be wall with non-slip BC.

This is just quick look at the case files. What you've described with your initial conditions and boundary conditions is very different from what you've written in attached PDF file.

Also I'm not quite sure it is good idea to simulate this flow using symmetry BCs as the flow itself is not symmetric (for example http://youtu.be/57-URbKeWME).

Maimouna March 4, 2014 07:42

1 Attachment(s)
Dear Alexey,

I tried to attached all output, but unfortunately the size of the folder doesn’t accepted so I will post for one time step for p file

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

internalField nonuniform List<scalar>
2000
(zY\BAB\DCT1\C0\AC-\91*!1\C0\DCB`m\85 1\C0-\D1kI\A11\C0\B4Ɲ\D9 1\C0 \90\FA\C2R1\C0\B1W\A1J\B8\001\C0O\BFǙm\FD0\C0e/\8B \FD0\C0\86.\C4\CE\D8\FC0\C0 ¯Qr1\C0\89\DB[\F0\EB61\C0?\E0^\A851\C0?\B8n\BE"1\C0QV\E2\E6d1 \C0%\8A{\CEz1\C0\9D\94\99w 1\C0\A7Rt\A3\A8 1\C0v\A5gop1\C0\BD(R1\C0\DB\F3Z\D1\8F1\C0\BA# XGML1\C0\FC\A2\90\9EdJ1\C0\A2\BF\8EO31\C0ܭҞ(1\C0 V\95Z* 1\C0\CFb'\E41\C0\B8~p\D51\C0\E3\A0"\9D\C71\C0 \A47ܗ\C71\C0\F1\A2o\AA1\C0\E15ȶ`1\C0\D0A\AAQ^ 1\C0t\AB\FE \E7B1\C0\BD]r171\C0\EC
:-1\C0\E3\9Bs\BA\A2%1\C0]\8Dv#\971\C0N\ADI T1\C0u^\F0oH1\C0\D4.\BB\8F\94\C31\C0\B1\87\F7.\9 8s1\C0\BD\9B\FDJp1\C0-*{\C1Q1\C0n4\E6\C2\CBD1\C0\A3r\94\C8I91\C01\9Cz 01\C0Gϰ\B1m)1\C0\96\D2+4$1\C0\9DJK\9Ef1\C0\86\E C\C9\DA\D91\C0\9E\E8O!w\841\C0a\A0k\801\C0T\8EH \97]1\C0\AC\F8\*Q1\C0\A4\EF\C6D1\C0u:B1:1\C02\F5\B 1\A0D21\C0/\B0 @#,1\C0,\FC\E2o\B2&1\C0\A4\FC\99[\AB\EC1\C0\F1/t\E9\921\C0\B7\8E\E34\8E1\C0%J\89Kh1\C0*\EF\A8[\D4[1\C0\E7r\BB}UM1\C0Ó\9B\E7\8CB1\C0=\D9\F8[\E591\C0\A4\ACI31\C0\B5\E2~\E7-1\C0\F465

That is not whole but only part of p file because the post doesn't accepted more that 20000 characters. There is something error given in the output files:confused:. Same in other output files.

There are all output which I didn't post them give such that unclear samples. In addition to the attached uniform folder which is given in each timestep.

Maimouna March 4, 2014 07:46

Do you have another way to post large size of files to show you whole output?

Anyway, all output file give the same error (unclear samples). There is something wrong:(. I hope you can help me.

Kind regards

alexeym March 4, 2014 07:59

Actually I don't need whole log file, just lines before the crash, in other word - the output for the last time step.

Also I'd like to know your thoughts about:

Also I've got several question about your BCs:

1. You set fixed velocity at the outlet and yet you'd like to plot outlet velocity over time. Though you can plot velocity at the inlet boundary.

2. You've got symmetry BC at sides patch, though if you like to simulate flow past ONE cylinder, it should be wall.

3. For some reason you've decided to set symmetry plane also on walls patch (surface of the cylinder), though it again should be wall with non-slip BC.

This is just quick look at the case files. What you've described with your initial conditions and boundary conditions is very different from what you've written in attached PDF file. If you've got wrong boundary conditions not solver will get you right results.

Also I'm not quite sure it is good idea to simulate this flow using symmetry BCs as the flow itself is not symmetric (for example http://youtu.be/57-URbKeWME).

Maimouna March 4, 2014 08:43

Dear Alexey,

many thanks for your help. Do you mean now I have to change sides and walls boundary conditions to wall instead of symmetryPlane?

alexeym March 4, 2014 08:53

Well, it depends ;)

If you'd like to simulate the problem you've described in attached PDF (I guess development of von Karman vortex street), then I'd suggest you to create a mesh with a whole cylinder (not just a half of it). Set non-slip boundary conditions of the walls (cylinder and walls of a channel), constant inlet velocity, zero-gradient outlet velocity, constant value of outlet pressure (let's say 0), zero gradient of inlet pressure (and empty BCs for top and bottom planes as you'd like to do 2D simulation).

If you'd like to simulate something else, describe it more precisely.

Currently your boundary conditions describe rather bizarre system.

Maimouna March 4, 2014 09:24

Dear Alexey,

that what I'm looking for exactly. I will try to do all what you post and then I will let you know about the result.

I have one more question please, what is the best way or software to create a mesh with whole cylinder?

alexeym March 4, 2014 09:34

The best software is the one you know how to use ;)

As the mesh if rather simple you can use blockMesh. If you'd like to have a "template" where you just need to correct sizes, you can start with the one I've made some time ago. Though the case files are rather messy, so you just can take a blockMeshDict from there.

If I needed to make the mesh now I'd use Gmsh (http://gmsh.info).

Maimouna March 4, 2014 09:46

Thank you very much Alexey. I will try all possibilities now.:-)

alexeym March 4, 2014 10:11

1 Attachment(s)
Here's a file for Gmsh (I've created rather simple meshing, surely it can be enhanced).

After you open this file in Gmsh it will create channel-with-cylinder.msh file, which then can be converted to OpenFOAM format with gmshToFoam utility.

You can find the names of the boundaries in the file. Maybe after conversion you'll need to correct type of the boundary for walls, top, and bottom patches, cause converter will set type to patch. You can do it with changeDictionary utility and following changeDictionaryDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dictionaryReplacement
{
    boundary
    {
        walls
        {
            type            wall;
        }

        top
        {
            type            empty;
        }

        bottom
        {
            type            empty;
        }
    }
}

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


Maimouna March 4, 2014 10:48

1 Attachment(s)
Dear Alexy,

sorry, I'm still confused about changing the names of the boundaries. Could you try please to mach the boundaries that you suggests and the boundary that I have.

I never used Gmesh to create mesh or any of the software, all meshes that I have before were easy to create without using any program. So, what are these variable mean

CX = 4.5*D;
CY = 0.0;

S = 1.0/Sqrt(2);

N1 = 100;
N2 = 400;

Many thanks for your help.

alexeym March 4, 2014 11:31

1 Attachment(s)
I've attached case files to the message. You need to correct velocity in 0/U to correspond to your case. Allprepare script assumes that you have gmsh in your PATH.

Also to plot drag force you have to wait until the flow develops otherwise you'll get something meaningless. I'd suggest you to run simulation for at least 2*L/U (where L is channel length and U is inlet velocity).

Concerning your questions:

I've tried to reproduce the channel from your PDF. So

1. D is a diameter of the cylinder.
2. CX, CY - coordinates of the center of the cylinder.
3. S is sin(pi/4), I need it for calculation of the coordinates of the points on the surface of the cylinder.
4. N1 and N2 is the densities of the different parts of the mesh.

Actually if you open GEO file in Gmsh, you'll be able to see how I've split the mesh.

Maimouna March 4, 2014 12:03

Dear Alexy,

when executed gmshToFoam 2D-cylinder.geo in the command window it gives this error

Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : gmshToFoam 2D-cylinder.geo
Date : Mar 04 2014
Time : 16:47:48
Host : maimouna-desktop
PID : 5423
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Skipping tag D at line 2

Segmentation fault (core dumped)
maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$
what is the problem in D line 2?

and what do you mean by run simulation for at least 2*L/U?

Many thanks in advanced.

alexeym March 4, 2014 12:05

First you have to convert GEO file to MSH file using Gmsh. Then you can use gmshToFoam. See Allprepare script for the command sequence.

Maimouna March 4, 2014 12:18

Dear Alexey,

Now, the converting to foam is going fine. Then, execution of pimpleFoam gives
Quote:

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ pimpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : pimpleFoam
Date : Mar 04 2014
Time : 17:09:42
Host : maimouna-desktop
PID : 6668
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Create mesh for time = 0

Reading field p



--> FOAM FATAL IO ERROR:
keyword defaultFaces is undefined in dictionary "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField from line 25 to line 46.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 456.

FOAM exiting

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$
What does the problem again please.

alexeym March 4, 2014 12:25

I guess it is funny feature of openfoam-extend-3.0, as with OpenFOAM 2.2.2 there's not defaultFaces patch after conversion of the MSH file.

You can add
Code:

    defaultFaces
    {
        type            empty;
    }

to boundaryField dictionary in 0/p and 0/U files.

Maimouna March 4, 2014 12:33

Again, this error
Quote:

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ pimpleFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0-8d34057e525d
Exec : pimpleFoam
Date : Mar 04 2014
Time : 17:27:33
Host : maimouna-desktop
PID : 6728
CtrlDict : /home/maimouna/foam/foam-extend-3.0/etc/controlDict
Case : /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

Create mesh for time = 0

Reading field p



--> FOAM FATAL IO ERROR:

patch type 'patch' not constraint type 'empty'
for patch defaultFaces of field p in file "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField::defaultFaces from line 51 to line 51.

From function emptyFvPatchField<Type>::emptyFvPatchField
(
const fvPatch& p,
const Field<Type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 100.

FOAM exiting

alexeym March 4, 2014 12:52

Well,

you can add

Code:

        defaultFaces
        {
            type            empty;
        }

to boundary dictionary of changeDictionaryDict. Though I do not understand where is the defaultFaces boundary in the case after conversion as on my desktop there is no such boundary. Maybe you can attach screenshot of paraFoam with this boundary shown?

Maimouna March 4, 2014 13:01

paraFoam command gives the follwing fatal error

Quote:

maimouna@maimouna-desktop:~/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1$ paraFoam
created temporary 'circularCylinderLast1.OpenFOAM'


--> FOAM FATAL IO ERROR:

patch type 'patch' not constraint type 'empty'
for patch defaultFaces of field p in file "/home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p"

file: /home/maimouna/foam/foam-extend-3.0/tutorials/incompressible/pimpleFoam/circularCylinderLast1/0/p::boundaryField::defaultFaces from line 51 to line 51.

From function emptyFvPatchField<Type>::emptyFvPatchField
(
const fvPatch& p,
const Field<Type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 100.

FOAM exiting
it was opened and closed directly.

Maimouna March 4, 2014 15:31

It works perfect in OpenFOAM. I just go to p, U and changeDictionary files and commit
defaultFaces { type empty; }
and the visualization is shown in paraview. But I'm still being confused about lift and drag coefficients for Reynolds number 100? Any idea? What shall I change for Re = 100?


All times are GMT -4. The time now is 20:50.