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

Inlet and Outlet as one sphere???

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2013, 08:38
Default Inlet and Outlet as one sphere???
  #1
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 13
CFDnewbie147 is on a distinguished road
Hello together,

I have some questions on OpenFoam. I've converted a TAU- Mesh into the OF format via Fluent and with TAU we use two spheres to define the near- and farfield around the geometry. We are defining the machnumber and the temperature and pressure and the incoming velocity vectors are all parallel to the flight direction.

My question is: is it possible to define a sphere(farfield) for inlet and outlet in openfoam or have there to be always two faces, one for inlet and one for outlet, like building a mesh via blockmesh?

I hope u know what I mean and you can help me.
Best regards,
CFDNEWBIE147
CFDnewbie147 is offline   Reply With Quote

Old   October 3, 2013, 04:52
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Dear CFDNEWBIE147,

rather than splitting the patch, I suggest that you use a boundary condition which switched automatically from fixedValue to zeroGradient based on the flux.

0/U:

inlet
{
type inletOutlet;
inletValue uniform (1 1 0);
value uniform (1 1 0);
}

0/p:

pressure-far-field-1
{
type zeroGradient;
}

Don't forget to apply inletOutlet on other variables (k, epsilon) in the same manner.

Best Regards,

Henrik
henrik is offline   Reply With Quote

Old   October 9, 2013, 03:39
Default
  #3
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 13
CFDnewbie147 is on a distinguished road
Dear henrik,

thank you for your reply. If I change the 0/U to what you've said, there's an error that OF wants a scalar and not a vector...

What's wrong about this?

And can you please explain, how to apply inletOutlet on the other variables? I don't really know how to do this...

I hope you can help me again.
Best regards,
CFDnewbie147
CFDnewbie147 is offline   Reply With Quote

Old   October 9, 2013, 04:49
Default
  #4
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Hard to say without further information. The error is probably what OpenFOAM says: It needs a vector "(1 0 0)", but it found a scalar "1". Please post the full error message line and the part of the input that OF is referring to in that message.
henrik is offline   Reply With Quote

Old   October 9, 2013, 07:43
Default
  #5
Member
 
skyinventorbt's Avatar
 
Dr. B T KANNAN
Join Date: Jul 2011
Location: CHENNAI (MADRAS), INDIA
Posts: 55
Rep Power: 15
skyinventorbt is on a distinguished road
Quote:
Originally Posted by CFDnewbie147 View Post
Dear henrik,

thank you for your reply. If I change the 0/U to what you've said, there's an error that OF wants a scalar and not a vector...

What's wrong about this?

And can you please explain, how to apply inletOutlet on the other variables? I don't really know how to do this...

I hope you can help me again.
Best regards,
CFDnewbie147
For example you must have used
inletValue uniform (0 0 0);
instead of
inletValue uniform 0:

--
KANNAN
skyinventorbt is offline   Reply With Quote

Old   October 9, 2013, 08:36
Default
  #6
New Member
 
Andreas Groß
Join Date: Sep 2013
Posts: 8
Rep Power: 13
AndreasG is on a distinguished road
In addition to Henriks comment, I would suggest to use outletInlet for the pressure on the farfield where you use inletOutlet for the velocity.

Based on the flux, those two bc switch between Neumann and Dirichlet type.
inletOutlet is fixed value for inflow and zero gradient for outflow (what Henrik suggested for velocity and the other parameters)
outletInlet is the other way round, so it is zero gradient when flux is pointing into the domain and fixed value when the flow is going out of the domain.

so, for 0/p in an incompressible flow:
inlet
{
type outletInlet;
outletValue uniform 0; // the fixed value, when it is an outlet
value uniform 0; // current value (initial guess), will be updated where the flow is into domain
}
AndreasG is offline   Reply With Quote

Old   October 9, 2013, 10:11
Default
  #7
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 13
CFDnewbie147 is on a distinguished road
Hello again,

Here is my polyMesh/boundary file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
8
(
    B_11
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          540;
        startFace       17381367;
    }
    B_10
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          7602;
        startFace       17381907;
    }
    B_13
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          4284;
        startFace       17389509;
    }
    B_12
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          24550;
        startFace       17393793;
    }
    B_2//Farfield
    {
        type            patch;
        nFaces          1442;
        startFace       17418343;
    }
    B_4
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          26742;
        startFace       17419785;
    }
    B_6
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          7286;
        startFace       17446527;
    }
    B_8
    {
        type            wall;
 inGroups 1(GeoWallGroup);
        nFaces          2450;
        startFace       17453813;
    }
)
// ************************************************************************* //
There is my B_2 = Farfield that should be my in- and outlet. I think you don't know exactly what I mean or am I wrong?

And this is my 0/U file, which i adopted to what you've said:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 1 -1 0 0 0 0];
internalField   uniform (50 0 0);
boundaryField
{
    B_2
    {
        type            inletOutlet;
 inletValue  uniform (1 1 0);
 value   uniform (1 1 0);
    }
    }
    GeoWallGroup
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
   
}
// ************************************************************************* //
Is this right or did I some failures? And what do I have to do with the other files in 0/*?

I hope you can help me,
CFDnewbie147
CFDnewbie147 is offline   Reply With Quote

Old   October 9, 2013, 10:49
Default
  #8
New Member
 
Andreas Groß
Join Date: Sep 2013
Posts: 8
Rep Power: 13
AndreasG is on a distinguished road
There is one and maybe a second error:
There is one red curly bracket, which shouldn't be there, as boundaryField {...} should be closed after GeoWallGroup{...}.
The maybe-error is the difference in the values for internalField and inletValue. I guess, the flow velocity is 50 m/s in x-wise direction, so you should set both, value and inletValue to (50 0 0). But thats only a guess ;-)
Code:
internalField   uniform (50 0 0);
boundaryField
{
    B_2
    {
        type            inletOutlet;
        inletValue  uniform (1 1 0);
        value   uniform (1 1 0);
    }
    }
    GeoWallGroup
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}
To your second question:
As Henrik and me wrote above, use inletOutlet for U and other fields like turbulence parameters, temperature, density, etc. on the farfield.
For the pressure I would use outletInlet for the pressure
Code:
inlet
    {
        type outletInlet;
        outletValue     uniform 0; // the fixed value, when it is an outlet
        value           uniform 0; // current value (initial guess), will be updated where the flow is into domain
    }
AndreasG is offline   Reply With Quote

Old   October 9, 2013, 20:11
Default
  #9
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
I agree:

- the 'red' bracket is definitely wrong
- the different values will slow down convergence, but the BC will win.
- Other variables are k, epsilon, omega, ... treat like velocity (so inletOutlet), but with a sensible scalar value
- outletInlet on p - yes, another option - Should not be very different

Additional comments:

You may want to use $internalField in the BC. See

$FOAM_TUT/compressible/rhoPimpleFoam/angledDuct/0/T

None of this explains the error message which you are reporting. If it prevails, please post the complete message together with the relevant sections of the file it refers to.

Ah, and pressure should be 100000 in case you are running a variable density solver.
henrik is offline   Reply With Quote

Old   October 15, 2013, 02:41
Default
  #10
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 13
CFDnewbie147 is on a distinguished road
Hello again,

thank you for your answers. I will try what you've said and post what's going on with the simulation.

Best regards,
CFDNewbie147
CFDnewbie147 is offline   Reply With Quote

Old   October 15, 2013, 10:58
Default
  #11
Member
 
Join Date: Jul 2013
Posts: 62
Rep Power: 13
CFDnewbie147 is on a distinguished road
Back again.

It worked, but not as I would it should work. Here are my 0/ files:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 1 -1 0 0 0 0];
internalField   uniform (50 0 0);
boundaryField
{
    B_2
    {
        type            inletOutlet;
 inletValue  uniform (50 0 0);
 value   uniform (50 0 0);
    }

    GeoWallGroup
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
   
}
// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 2 -2 0 0 0 0];
internalField   uniform 100000;
boundaryField
{
    B_2
    {
        type           outletInlet;
 outletValue uniform 100000;
 value  uniform 100000;
    }
    GeoWallGroup
    {
        type            zeroGradient;
    }
}
// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 2 -1 0 0 0 0];
internalField   uniform 0.14;
boundaryField
{
    B_2
    {
        type            inletOutlet;
 inletValue uniform 0.14;
 value  uniform 0.14;
    }
    GeoWallGroup
    {
        type            fixedValue;
        value           uniform 0;
    }
}
// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 2 -1 0 0 0 0];
internalField   uniform 0.14;
boundaryField
{
    B_2
    {
        type            inletOutlet;
 inletValue uniform 0.14;
 value  uniform 0.14;
    }

    GeoWallGroup
    {
        type            nutUSpaldingWallFunction;
        value           uniform 0;
    }
}
// ************************************************************************* //
I guess I did what you've said but it doesn't work correctly.
I think I have to fix the direction of the velocity with a main vector with 50m/s only in x- direction?

How can I do this?
Hope you can help again,
best regards,
CFDNewbie147
CFDnewbie147 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
define BCs at inlet and outlet for natural ventilation simulation jjz2013 Main CFD Forum 0 January 29, 2013 16:50
Pulsatile pressure inlet with pressure outlet a.lynchy FLUENT 3 March 23, 2012 14:45
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
VOF Outlet boundary condition in cfd - ace JM Main CFD Forum 0 December 15, 2006 09:07
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 02:32.