CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Boundary conditions for hydraulically developed flow in buoyantSimpleFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/155470-boundary-conditions-hydraulically-developed-flow-buoyantsimplefoam.html)

buffi July 1, 2015 10:05

Boundary conditions for hydraulically developed flow in buoyantSimpleFoam
 
Hi,

I want to set up a case where the flow is hydraulically developed, but the fluid enters the domain with a constant temperature. This means that I need
  • cyclic patches at the inlet and at the outlet,
  • a fan boundary condition for the pressure,
  • a cyclic boundary condition for the velocity and
  • fixedValue/zeroGradient (or equivalent) boundary conditions for the temperature.
The walls will have no-slip/constant temperature BCs. Here are my files from the 0/ directory:


p:

Code:

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

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

internalField  uniform 1e5;

boundaryField
{
  "walls"
  {
    type        zeroGradient;
  }
  "front|back"
    {
        type empty;
    }
  inlet
  {
      type        fan;
      patchType    cyclic;
      f List<scalar> 1(-22.058);
      value        uniform 0;
  }
  outlet
  {
      type        fan;
      patchType    cyclic;
      f List<scalar> 1(-22.058);
      value        uniform 0;
  }

}

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

p_rgh:
Code:

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

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

internalField  uniform 1e5;

boundaryField
{
  "walls"
  {
    type        zeroGradient;
  }
  "front|back"
    {
        type empty;
    }
  inlet
  {
      type        fan;
      patchType    cyclic;
      f List<scalar> 1(-22.058);
      value        uniform 0;
  }
  outlet
  {
      type        fan;
      patchType    cyclic;
      f List<scalar> 1(-22.058);
      value        uniform 0;
  }
}

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

U:
Code:

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

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

internalField  uniform (0.1 0 0);

boundaryField
{
    walls
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    front
    {
        type            empty;
    }
    back
    {
        type            empty;
    }
    inlet
    {
        type            cyclic;
    }
    outlet
    {
        type            cyclic;
    }
}


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

T:

Code:

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

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 293;

boundaryField
{
  "walls"
  {
    type        fixedValue;
    value uniform 300;
  }
  "front|back"
    {
        type empty;
    }
  inlet
  {
    type fixedValue;
        value uniform 293;
  }
  outlet
  {
        type zeroGradient;
  }

}

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

constant/thermophysicalProperties:
Code:

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

thermoType
{
    type            heRhoThermo;
    mixture        pureMixture;
    transport      const;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleEnthalpy;
}

mixture
{
    specie
    {
        nMoles          1;
        molWeight      18.02;
    }
    thermodynamics
    {
        Cp              4185;
        Hf              0;
    }
    transport
    {
        mu              1e-03;
        Pr              7;
    }
}


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

buoyantSimpleFoam complains about
Code:

--> FOAM FATAL IO ERROR:
inconsistent patch and patchField types for
    patch type cyclic and patchField type fixedValue

which does not really surprise me, but do I circumvent it? I'm also not sure about p and p_rgh, which BCs should I use for those? They both have fan BCs above, but I don't think that's correct.

The flow is a 2D channel flow in horizontal direction, with heated walls (see T). I know that I should probably use a constant heat flux BC for T on the walls, but that's not the problem now.

Can anyone shed some light on this?

Regards

Christoph

ajonuz September 5, 2015 10:09

Hi Christoph,

did you manage to find a solution to your problem? I'm experiencing quite similar issue at the moment.

Best regards
Admir

mm66 August 22, 2019 10:38

I know it might be quite late to reply to this thread but for future reference, the boundary condition for T should include:

Code:

    Inlet
    {
        type            fixedValue;
        patchType        cyclic;
        value            uniform 298.15;
    }



All times are GMT -4. The time now is 16:11.