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

Sudden contration

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 1, 2018, 08:48
Default Sudden contration
  #1
Member
 
Anders Dyhr Nørløv
Join Date: Aug 2018
Posts: 32
Rep Power: 7
MrAndersDk is on a distinguished road
Hello

I'm trying to learn to use OpenFOAM. For that purpose I tried to simulate a sudden contration of a circular pipe. I go from 80 mm to 40 mm see image below (clipped trough the half), where the inlet is the 80 mm.

geometry.PNG

When i run it runs fine, but when i check the results in paraview I get a pressure drop of 50. Converting it to bar using the density of water of 998, I get a pressure drop of 0.5 bar. When I try to calculate the pressure drop in a manual way (fx. using http://www.pressure-drop.mobi/0303.html) i get a pressure drop of 0.13 bar.

Changing the inlet velocity I always get roughly a factor of 4 between the two methods. I suspect that I'm doing something completely wrong in my simulation, but I don't know what it is.

I know one of the difficult things with CFD is to choose sensible parameters, so maybe that is where i'm going wrong. Any help is much appreciated.

Iøve created teh mesh with salome and used ideasUnvToFoam to create the mesh in OpenFOAM, you can see my mesh here (I know it is a bit coarse, but I thought it would still give a sensible result):

mesh.PNG

I've tried to setup the simpleFoam solver with the following parameters:

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       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    channel_closed_solid_inlet
    {
        type            fixedValue;
        value           uniform (0 2 0);
    }

    channel_closed_solid_outlet
    {
        type            zeroGradient;
    }

    channel_closed_solid_walls
    {
        type            fixedValue;
		value			uniform (0 0 0);
    }
}

// ************************************************************************* //
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
{
    channel_closed_solid_inlet
    {
        type            zeroGradient;
    }

    channel_closed_solid_outlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    channel_closed_solid_walls
    {
        type            zeroGradient;
    }
}

// ************************************************************************* //
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;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0.024576;

boundaryField
{
    channel_closed_solid_inlet
    {
        type            fixedValue;
        value           uniform 0.024576;
    }
    channel_closed_solid_outlet
    {
        type            zeroGradient;
    }
    channel_closed_solid_walls
    {
        type            kqRWallFunction;
        value           uniform 0.024576;
    }
}


// ************************************************************************* //
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;
    location    "0";
    object      epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0.113;

boundaryField
{
    channel_closed_solid_inlet
    {
        type            fixedValue;
        value           uniform 0.113;
    }
    channel_closed_solid_outlet
    {
        type            zeroGradient;
    }
    channel_closed_solid_walls
    {
        type            epsilonWallFunction;
        value           uniform 0.113;
    }
}


// ************************************************************************* //
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;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    channel_closed_solid_inlet
    {
        type            calculated;
        value           uniform 0;
    }
    channel_closed_solid_outlet
    {
        type            calculated;
        value           uniform 0;
    }
    channel_closed_solid_walls
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}


// ************************************************************************* //
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       dictionary;
    location    "constant";
    object      turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType RAS;

RAS
{
    // Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2f,
    // ShihQuadraticKE, LienCubicKE.
    RASModel        kEpsilon;

    turbulence      on;

    printCoeffs     on;
}


// ************************************************************************* //
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       dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

transportModel  Newtonian;

nu              nu [0 2 -1 0 0 0 0] 1e-6;

CrossPowerLawCoeffs
{
	nu0		nu0 [0 2 -1 0 0 0 0] 1e-6;
	nuInf	nuInf [0 2 -1 0 0 0 0 ] 1e-6;
	m		m [0 0 1 0 0 0 0] 1;
	n		n [0 0 0 0 0 0 0] 1;
}

BirdCarreuCoeffs
{
	nu0		nu0 [0 2 -1 0 0 0 0] 1e-6;
	nuInf	nuInf [0 2 -1 0 0 0 0 ] 1e-6;
	k		k [0 0 1 0 0 0 0] 0;
	n		n [0 0 0 0 0 0 0] 1;
}

// ************************************************************************* //
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       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         2000;

deltaT          1;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;


// ************************************************************************* //
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       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         	none;
    div(phi,U)      	Gauss upwind;
    div(phi,k)      	Gauss upwind;
    div(phi,epsilon) 	Gauss upwind;
    div(phi,R)     		Gauss upwind;
    div(R)				Gauss linear;
	div(phi,nuTilda)	Gauss upwind;
	div((nuEff*dev2(T(grad(U)))))	Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method meshWave;
}


// ************************************************************************* //
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       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          1e-06;
        smoother        GaussSeidel;
		nPreSweeps		0;
		nPostSweeps		2;
		cacheAgglomeration on;
		nCellsInCoarsestLevel 10;
		mergeLevelse	1;
    }

    "(U|k|epsilon|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          1e-06;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
    fields
	{
		p	0.3;
	}
		
	equations
	{
		U 		0.3;
		k 		0.3;
		epsilon 0.3;
		R 		0.3;
		nuTilda 0.3;
	}
}


// ************************************************************************* //
MrAndersDk is offline   Reply With Quote

 


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
[ANSYS Meshing] pipe with different diameters (steady and sudden expansion) Raiz ANSYS Meshing & Geometry 0 October 12, 2015 06:18
Interface between a stator-rotor with sudden change in flowpath of the turbine mitra22 CFX 2 May 19, 2015 04:07
how to apply an sudden displacement or Force of a cylinder with solid solver? allenfieldin OpenFOAM Running, Solving & CFD 11 February 15, 2015 20:37
Sudden crash caused by k-epsilon vainilreb OpenFOAM Running, Solving & CFD 23 August 20, 2013 15:09
sudden perturbations adarsh Main CFD Forum 0 June 11, 2002 12:08


All times are GMT -4. The time now is 10:30.