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

Flow around a square cylinder

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2021, 19:30
Default Flow around a square cylinder
  #1
New Member
 
Gabriel
Join Date: Aug 2021
Posts: 29
Rep Power: 2
ifrit54 is on a distinguished road
Hi, im a beginner at cfd, im trying to simulate flow around a square cylinder in 2d, for this i used as template motorbike, is there a better template for this?, i have to use k-omega sst, steady state and simple algorithm, i made a blockMeshDict, but i don´t know what to do next, i get the following error:

blockMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

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

convertToMeters 0.01;

vertices
(
    (0 0 0) // 0
    (40 0 0) // 1
    (40 40 0) // 2
    (0  40 0) // 3
    (0 0 1) // 4
    (40 0 1) // 5
    (40 40 1) // 6
    (0 40 1) // 7
    (17.5 17.5 0) // 8
    (22.5 17.5 0) // 9
    (22.5 22.5 0) // 10
    (17.5 22.5 0) // 11
    (17.5 17.5 1) // 12
    (22.5 17.5 1) // 13
    (22.5 22.5 1) // 14
    (17.5 22.5 1) // 15
);

blocks
(
    hex (0 1 9 8 4 5 13 12) (10 10 1) simpleGrading (1 1 1)
    hex (1 2 10 9 5 6 14 13) (10 10 1) simpleGrading (1 1 1)
    hex (11 10 2 3 15 14 6 7) (10 10 1) simpleGrading (1 1 1)
    hex (0 8 11 3 4 12 15 7) (10 10 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    frontAndBack
    {
        type empty;
        faces
        (
            (0 1 9 8)
            (1 2 10 9)
            (11 10 2 3)
            (0 8 11 3)
            (4 5 13 12)
            (5 6 14 13)
            (15 14 6 7)
            (4 12 15 7)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (4 7 3 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (5 6 2 1)
        );
    }
    bottom
    {
        type wall;
        faces
        (
            (5 4 0 1)
        );
    }
    top
    {
        type wall;
        faces
        (
            (6 7 3 2)
        );
    }
    obstacle
    {
        type wall;
        faces
        (
            (13 12 8 9)
            (13 14 10 9)
            (14 15 11 10)
            (12 15 11 8)
        );
    }
);

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

#include        "include/initialConditions"

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

internalField   uniform $pressure;

boundaryField
{
    //- Set patchGroups for constraint patches
    #includeEtc "caseDicts/setConstraintTypes"

    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           $internalField;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    motorBikeGroup
    {
        type            zeroGradient;
    }

    #include "include/frontBackUpperPatches"
}

// ************************************************************************* //
running simpleFoam error:

Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 9-12bcf7429695
Exec   : simpleFoam
Date   : Sep 13 2021
Time   : 18:21:36
Host   : "Mint19"
PID    : 9624
I/O    : uncollated
Case   : /home/gabriel/OpenFOAM/gabriel-9/run/motorBike_1
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


SIMPLE: No convergence criteria found

Reading field p



--> FOAM FATAL IO ERROR: 
inconsistent patch and patchField types for 
    patch type empty and patchField type slip

file: /home/gabriel/OpenFOAM/gabriel-9/run/motorBike_1/0/p/boundaryField/frontAndBack from line 16 to line 16.

    From function static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 157.

FOAM exiting
ifrit54 is offline   Reply With Quote

Old   September 13, 2021, 22:12
Default
  #2
New Member
 
Gabriel
Join Date: Aug 2021
Posts: 29
Rep Power: 2
ifrit54 is on a distinguished road
so i combined the motorbike with the tutorial from https://www.youtube.com/watch?v=Udt3RhkbgKw, now i have to analyze the results but for now it kinda works.


Cheers.
ifrit54 is offline   Reply With Quote

Old   September 14, 2021, 05:16
Default
  #3
Member
 
Said CATALBAS
Join Date: Feb 2020
Location: Türkiye
Posts: 53
Rep Power: 4
saidc. is on a distinguished road
Hi Gabriel,


Please try change this #include "include/frontBackUpperPatches" to this


frontAndBack
{
type empty;
}


Because your patch type is empty but you set the bc as slip condition. In motorbike tutorial, that patch is not empty it is defined as face. By the way, I think it's always better to start with a pitzDaily.


Kind regards,
Said.
saidc. is online now   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Flow Past A Square Cylinder: Re=20,000, no clear vortex shedding LewisLeonard STAR-CCM+ 2 November 4, 2021 04:54
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 06:40
grids for flow over a square cylinder student Main CFD Forum 4 April 21, 2009 06:50
Inviscid Drag at subsonic, subcritical Mach # Axel Rohde Main CFD Forum 1 November 19, 2001 12:19
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 21:31


All times are GMT -4. The time now is 07:53.