CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Natural convection boundary layer flow (https://www.cfd-online.com/Forums/openfoam-solving/228185-natural-convection-boundary-layer-flow.html)

 Sedullo June 22, 2020 12:40

Natural convection boundary layer flow

1 Attachment(s)
Hello everyone, I would like to simulate the boundary layer flow created by natural convection. My scope is to make a 2D simulation of a vertical hot wall using BuoyantBoussinesqPimplefoam. In my simulation I can never see the boundary layer, all the air in the domain is moving upwards, instead I would like to see only the air in the boundary layer moving upwards, and the rest should be at zero velocity. I attached the case folder in case you want to help me to address which my problem is. I think that the problem could be:

1. A mistake in the BC, very likely in p_rgh
2. A mistake in the settings of blockMesh
3. A mistake in the controlDict settings
4. Something else

My main issue was to find the right BC for this problem, I litterally tried to guess, because I could not find anything helpful around.
If any of you know how to set the BC for this kind of problem, it would be already a great help.

 Sedullo June 23, 2020 04:31

Here I post the BC settings, I am quite sure that the problem is here but I do not know where. The shape of the domain is a sort of square, up and down is an open face for output and input, on the left side is also open to simulate the atmosphere, on the center of the right side there is the hot wall, and above and below it there should still be atmosphere.

Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  5                                    | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     object      p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -2 0 0 0 0]; internalField  uniform 0; boundaryField {     hotWall     {         type            fixedFluxPressure;         value          uniform 1e5;     }     atmosphere     {         type            zeroGradient;      }     inlet     {         type            totalPressure;         p0              uniform 0;          }     outlet     {         type            totalPressure;         p0              uniform 0;        }     //#includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  5                                    | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     object      T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 0 0 1 0 0 0]; internalField  uniform 300; boundaryField {     hotWall     {         type            fixedValue;         value          uniform 301;     }         atmosphere     {       type            fixedValue;         value          uniform 300;     }         inlet     {       type            fixedValue;         value          uniform 300;     }     outlet     {         type            fixedValue;         value          uniform 300;     }   // #includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  5                                    | |  \\  /    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 (0 0 0); boundaryField {     hotWall     {         type            fixedValue;         value uniform    (0 0 0);     }     atmosphere     {       type            fixedValue;       value uniform    (0 0 0);     }       inlet     {         type            zeroGradient;      }     outlet     {         type            inletOutlet;         value          \$internalField;         inletValue      uniform (0 0 0);     }   // #includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```

 agustinvo July 1, 2020 15:14

Hello Sedullo,

I have a bit of experience running this flow. I need some information
• Do you have an estimation of your y+ (I see you use kEpsilon, and Jayatilleke WF)? I'd prefer to use a low Re k-epsilon model, or k-w
• Can you attach some flow field pictures?
• Is you idea to perform URANS, or move later on to LES/DNS? One of the problems I found during my simulations was caused by the inlet condition you have
• Reduce the maximum Courant number (it is 2D, the smulation should go fast anyway)
• Check the numerical schemes
• The outlet temperature BC should be zeroGradient, otherwise the fluid cannot pass through.
• I must check my pressure BC

 Sedullo July 2, 2020 09:56

3 Attachment(s)
Hello agustinvo,

Thenk you very much for the reply. My goal is to run a laminar flow, so I just set "laminar" in the turbulenceProperties and paid attention to keep the Grashof number in the laminar range.
I attached the temperature field and the velocity vectors field. But I see two problems:
1. In the temperature field, it seems like the hot air cannot pass the outlet, and it remains inside the domain.
2. In the velocity vectors plot, I see the creation of a sort of circulation in front of the hot wall.

I made some changes in U, T and p_rgh

Code:

```/*--------------------------------*- C++ -*----------------------------------*\   =========                |   \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox   \\    /  O peration    | Website:  https://openfoam.org     \\  /    A nd          | Version:  6     \\/    M anipulation  | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     object      T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 0 0 1 0 0 0]; internalField  uniform 300; boundaryField {     hotWall     {         type            fixedValue;         value          uniform 310;     }         atmosphere     {       type            zeroGradient;     }         inlet     {         type          fixedValue;         value          uniform 300;     }     outlet     {         type          zeroGradient;     }   // #includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\   =========                |   \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox   \\    /  O peration    | Website:  https://openfoam.org     \\  /    A nd          | Version:  6     \\/    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 {     hotWall     {       type            noSlip;           }     atmosphere     {         type            slip;     }       inlet     {         type            outletInlet;         outletValue        uniform (0 0 0);         value          uniform (0 0 0);     }     outlet     {         type            inletOutlet;         inletValue        uniform (0 0 0);         value          uniform (0 0 0);     }   // #includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\   =========                |   \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox   \\    /  O peration    | Website:  https://openfoam.org     \\  /    A nd          | Version:  6     \\/    M anipulation  | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     object      p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -2 0 0 0 0]; internalField  uniform 1e5; boundaryField {     hotWall                         //type              zeroGradient;           // type            fixedFluxPressure;       // rho            rhok;       // value          uniform 0;       {         type            fixedFluxPressure;         value          uniform 1e5;     }     atmosphere     {       type            fixedFluxPressure;       value          uniform 1e5;     }     inlet     {       type            fixedFluxPressure;       value          uniform 1e5;     }     outlet     {       type              totalPressure;         p0                uniform 1e5;         //value          \$internalField;     }     //#includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\   =========                |   \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox   \\    /  O peration    | Website:  https://openfoam.org     \\  /    A nd          | Version:  6     \\/    M anipulation  | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     location    "0";     object      alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -1 0 0 0 0]; internalField  uniform 0; boundaryField {     inlet     {         type calculated;         value uniform 0;     }     outlet     {         type calculated;         value uniform 0;     }     atmosphere     {         type calculated;         value uniform 0;     }     hotWall     {         type            alphatJayatillekeWallFunction;         Prt            0.85;         value          \$internalField;     }     #includeEtc "caseDicts/setConstraintTypes" } // ************************************************************************* //```

 agustinvo July 2, 2020 13:31

Hi,

there is a recirculation as fluid cannot go out.

Please take a look into this
• Temperature: set the atmosphere to 300K as well (if you're far enough from the wall all the fluid should be at this T).
• Velocity: when you set the atmosphere with slip conditions you force the fluid to enter through the bottom and go out through the top. What about the fluid that stays? I'd choose zeroGradient at this stage.
• Pressure: are you using buoyantBoussinesq...? I used for p_rgh fixedFluxPressure at the wall and atmosphere, and zeroGradient at the outlet. I do not set any value for fixedFluxPressure
• alphat: if you are running at the laminar mode you should worry about. I would set everywhere zeroGradient except at the wall.
• What is you y+? Do you use low Reynodls models?

 Sedullo July 3, 2020 09:59

Hi,

I took a look to all the points listed but I still have some questions, because the model is not working well yet:
• I set the velocity BC as zeroGradient for atmosphere, what about inlet and outlet? Are the settings ok?
• I am using buoyantBoussinesqPimpleFoam but honestly I do not know if the Simple one would be better. I set p_rgh fixedFluxPressure at the wall and atmosphere, and zeroGradient at the outlet, but what about the inlet?¨
• What setting is good for alphat at the wall considering that my flow is laminar?
• In the turbulenceProperties I set the simulation type as "laminar", so I am not using any turbulence model, thus I do not know my y+ either. Anyway I am not sure if this choice is correct, probably I should choose a turbulence model even if my flow is laminar.

You told me that you worked on this problem already, can you find your case folder? It would be a big help for me.
Thanks for the help

 agustinvo July 3, 2020 15:27

Hi Sedullo,

here you have an article where I discuss about this topic. My computational domain differs from yours at the leading edge of the plate. I add a volume below the plate to ensure there is flow coming from the bottom. By doing this I sensure the growing of the boundary layer.

In my case I did LES, so I went into unsteady simulations. This is why I asked you about
• What is the objective of the simulation? What do you want to see?
• Is enough with a steady simulation, or you need to perform unsteady simulations?
• The y+ you can check it, independently of using or not any turbulence models (this is a criterion on DNS meshes too)

 Sedullo July 8, 2020 07:46

Hi,

Sorry for the late answer, I read your paper and it is really interesting for the purpose of my reasearch. My objective is to simulate the natural convection boundary layer with laminar flow of a flat vertical wall and then plot how the Nusselt number is varying along the wall, afterwards I should build another vertical wall but this time not flat but wavy, and do the same. At the end I will compare the two plots to see which has "better" Nusselt Number.

Honestly I am quite new in CFD and I do not know if a steady or a transient simulation is good for my purpose.

I will work later on the analysis of the Nusselt Number, my first goal is to simulate the boundary layer flow.

Whatever suggestion you have for the setting up of the domain and of the boundary conditions is very very welcome.

My main questions that I could not understand from your paper are:
• A 2D domain could be enough? because I saw that your domain in the paper was huge, seems millions of cells, and I am afraid it costs so much time to compute.
• I do not understand yet how to set the boundary condition for Inlet and Outlet for U and p_rgh.
• Since my goal is to observe this phenomena in laminar flow, do you think is really necessary to set a LES simulation? I am still afraid it costs a lot of time, and if there is a faster way to simulate this phenomena would be better.

Thank you so much for the help

 Sedullo July 22, 2020 15:57

Hi agustinvo, honestly my knowledge of OpenFOAM is limited, I am not able to calculcate Nusselt Number as you suggested.

At the moment I used the wallheatflux utility because I thought that in some way I could get Nusselt from there, but I do not know yet how to use this results.

I have a couple of question:
1. To calculate the nusselt number I need to know the thermal conductivity, where can I read or change this value? I am using buoyanyPimpleFoam and I guess it is somewhere in the thermophysical properties, please help me.
2. I need to study my problem at different Grashof number, how do you suggest to control this value? I tried first changing the dynamic viscosity in the thermophysical properties, but then I was afraid that this culd affect in some way the thermal conductivity. Then I reduced a lot the length of the wall but in this way the simulation or crashes or give results that do not make sense.

Please let me know what you think

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