CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Tutorial: flow around a cylinder

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2018, 13:01
Default Tutorial: flow around a cylinder
  #1
New Member
 
Lukas
Join Date: Jul 2018
Posts: 20
Rep Power: 8
TU_Hiwi is on a distinguished road
Hey i am currently working through this Openfoam tutorial, its about a flow around a cylinder. I generated the mesh using blockMesh, run the case with potentialFoam. If I open paraFoam i cant plot any variables (like u, p). Since there were no errors during potentialFoam i have no idea why there seems to be "no data".


any suggestions what to do?


Greetings
TU_Hiwi is offline   Reply With Quote

Old   August 14, 2018, 17:29
Default
  #2
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
please can you write the output of the "ls" command?

Do you have results directory (at least "0" directory containing p and U files)?

It is possible that paraFoam doesn't show the "0" result (by default in the very new versions)
cyss38 is offline   Reply With Quote

Old   August 14, 2018, 18:04
Default
  #3
New Member
 
Lukas
Join Date: Jul 2018
Posts: 20
Rep Power: 8
TU_Hiwi is on a distinguished road
hey cyss38,

Thank you for your reply.

there are two folders, "0", "0.orig". both contain p and U. "orig" is short for origin and contains something previous, I assume?

I compared the p(U) files to the p(U) files of the cavity case, the cavity case contained data, while the cylinder only contained following. What to do next?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      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
{
    down
    {
        type            symmetryPlane;
    }

    right
    {
        type            fixedValue;
        value           uniform 0;
    }

    up
    {
        type            symmetryPlane;
    }

    left
    {
        type            zeroGradient;
    }

    cylinder
    {
        type            symmetry;
    }

    defaultFaces
    {
        type            empty;
    }
}

// ************************************************************************* //
TU_Hiwi is offline   Reply With Quote

Old   August 14, 2018, 19:00
Default
  #4
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
There is a problem with the potentialFoam solver, because if it runs correctly you must have the result directory "1".

So have you execute the binary "potentialFoam" in the case directory, and if yes what is the output of the "potentialFoam" command?
cyss38 is offline   Reply With Quote

Old   August 15, 2018, 06:09
Default
  #5
New Member
 
Lukas
Join Date: Jul 2018
Posts: 20
Rep Power: 8
TU_Hiwi is on a distinguished road
Hey, while trying to repair it i made it somehow worse, at least i think so. running potentialFoam gives this:


Code:
 --> FOAM FATAL IO ERROR: 
'potentialFlow' not found in dictionary "/home/hgl/OpenFOAM/hgl-v1806/run/tutorials/basic/potentialFoam/cylinder/system/fvSolution"

file: /home/hgl/OpenFOAM/hgl-v1806/run/tutorials/basic/potentialFoam/cylinder/system/fvSolution

    From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
    in file db/dictionary/dictionary.C at line 456.
FOAM exiting
i cant remember whether i ever changed anything here. Anyway, i attached those files. Could you explain to me where i made my mistake?

Greetings
Attached Files
File Type: txt fvSolution.txt (1.3 KB, 24 views)
File Type: txt fvSchemes.txt (1.2 KB, 9 views)

Last edited by TU_Hiwi; August 15, 2018 at 13:52.
TU_Hiwi is offline   Reply With Quote

Old   August 15, 2018, 07:18
Default
  #6
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
it is not the original files of the tutorial... and so it doesn't work.
If you read the error message, you understand that the keyword 'potentialFlow' is not found in file fvSolution.


You can download the good files here : https://github.com/OpenFOAM/OpenFOAM...ylinder/system
cyss38 is offline   Reply With Quote

Old   August 15, 2018, 14:05
Default
  #7
New Member
 
Lukas
Join Date: Jul 2018
Posts: 20
Rep Power: 8
TU_Hiwi is on a distinguished road
Thank you! works like it should.

Another quick question, just assume I want to simulate the same scenario with another solver like simpleFoam. Is there anyway to download another (roughly prepared) fvSchemes and fvSoltions? Or do i have to take a totally different way?
TU_Hiwi is offline   Reply With Quote

Old   August 15, 2018, 16:42
Default
  #8
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
you can use and adapt the fvSolution and fvScheme files of the pimpleFoam tutorials, or just adapt yours.

Read carefully the error/output message of openfoam and in case of error adapt the files.
cyss38 is offline   Reply With Quote

Old   September 18, 2019, 10:35
Default
  #9
New Member
 
Alessia Perilli
Join Date: Sep 2019
Posts: 2
Rep Power: 0
alessiper is on a distinguished road
Hello folks,
I am very new to OpenFOAM, still trying to understand how it works. I have the same problem as TU_Hiwi: in the tutorial "Flow around a cylinder" I don't get the result directory "1/". I checked the files and everything seems to be as it is supposed to. I didn't change anything, I just played a bit with the writeControl and writeInterval parameters but nothing changes. The files I get in the end of the simulation in the 0/ directory are:

U.orig
UA
U
streamFunction
p.orig
Phi
phi
p
error



Does anybody have any idea of what's going on? What can it be the problem?
Thank you all!
alessiper is offline   Reply With Quote

Old   September 18, 2019, 10:50
Default
  #10
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
can you display the standard output of the Allrun command (or of the solver used) and attach your controlDict file?
cyss38 is offline   Reply With Quote

Old   September 19, 2019, 04:51
Default
  #11
New Member
 
Alessia Perilli
Join Date: Sep 2019
Posts: 2
Rep Power: 0
alessiper is on a distinguished road
So this is the log.potentialFoam file (not sure this is what you asked for):



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


Create time

Create mesh for time = 0

Reading velocity field U

Constructing pressure field p

Constructing velocity potential field Phi

No MRF models present


Calculating potential flow
Using dynamicCode for functionObject error at line 53 in "/home/alessiap/OpenFOAM/alessiap-dev/run/cylinder/system/controlDict/functions/error"
Creating new library in "dynamicCode/error/platforms/linux64GccDPInt32Opt/lib/liberror_8d7789146a57fafafadf6156cb75f06a0fe8e37b. so"
Invoking "wmake -s libso /home/alessiap/OpenFOAM/alessiap-dev/run/cylinder/dynamicCode/error"
wmake libso /home/alessiap/OpenFOAM/alessiap-dev/run/cylinder/dynamicCode/error
ln: ./lnInclude
wmkdep: functionObjectTemplate.C
Ctoo: functionObjectTemplate.C
ld: /home/alessiap/OpenFOAM/alessiap-dev/run/cylinder/dynamicCode/error/../platforms/linux64GccDPInt32Opt/lib/liberror_8d7789146a57fafafadf6156cb75f06a0fe8e37b. so
GAMG: Solving for Phi, Initial residual = 1, Final residual = 0.00645988, No Iterations 5
GAMG: Solving for Phi, Initial residual = 0.0126268, Final residual = 6.6182e-05, No Iterations 4
GAMG: Solving for Phi, Initial residual = 0.00260623, Final residual = 2.0189e-05, No Iterations 3
GAMG: Solving for Phi, Initial residual = 0.000910968, Final residual = 3.41138e-06, No Iterations 4
Continuity error = 0.000135471
Interpolated velocity error = 1.18729e-05

Calculating approximate pressure field
GAMG: Solving for p, Initial residual = 1, Final residual = 0.00462909, No Iterations 4
GAMG: Solving for p, Initial residual = 0.0659642, Final residual = 0.000285859, No Iterations 5
GAMG: Solving for p, Initial residual = 0.0131468, Final residual = 9.02039e-05, No Iterations 3
GAMG: Solving for p, Initial residual = 0.00414426, Final residual = 3.4852e-05, No Iterations 4
Looking up field U

Reading inlet velocity uInfX

U at inlet = 1 m/s
Cylinder radius = 0.499614 m

Evaluating analytical solution
Writing relative error in U to "/home/alessiap/OpenFOAM/alessiap-dev/run/cylinder/0/error"
ExecutionTime = 0.03 s ClockTime = 10 s

End



while the controlDict isattached.
Attached Files
File Type: txt controlDict.txt (3.7 KB, 21 views)
alessiper is offline   Reply With Quote

Old   September 19, 2019, 11:30
Default
  #12
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
ok, i see 2 problems.
The first one is that you have an error compiling your functionobject. You have to look in detail why...

The second one : You use potentialFoam. This solver is suitable to generate initial conditions for more advanced solvers. That explains why you have no solution at time "1". You just solve a potential flow: https://openfoamwiki.net/index.php/PotentialFoam


Try looking at wiki tutorials to find a similar one to your problem : https://wiki.openfoam.com/Tutorials
cyss38 is offline   Reply With Quote

Old   May 29, 2020, 08:35
Default Tutorial: flow around a cylinder
  #13
Senior Member
 
Asmaa
Join Date: Mar 2016
Posts: 102
Rep Power: 10
foamiste is on a distinguished road
For simplified simulation of flow around a cylinder using OpenFoam and postprocessing in paraview, please check:

https://www.youtube.com/watch?v=YfK53PKpdgE
foamiste is offline   Reply With Quote

Reply


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
Drag force coefficient too high for a flow past a cylinder using komega sst Scabbard OpenFOAM Running, Solving & CFD 37 March 21, 2016 17:16
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
flow around a cylinder pXYZ Main CFD Forum 14 July 25, 2011 11:05
1 Was FSI for a flow over a cylinder vmlxb6 CFX 17 May 16, 2011 03:29


All times are GMT -4. The time now is 06:46.