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

Bernolli's Boundary Condition

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

Like Tree1Likes
  • 1 Post By crubio.abujas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2020, 12:08
Default Bernolli's Boundary Condition
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 197
Rep Power: 8
gu1 is on a distinguished road
Hello,

I was reading a work of natural convection and the author performed a LES simulation using the OF and in one of the boundary conditions he comments that he used the ''Bernolli's boundary condition" and explaining that it occurs in the form of p = -0.5v.
Could someone teach me how this can be set in OpenFOAM?

OF5.0
solver: buoyantSimpleFoam

Thanks
gu1 is offline   Reply With Quote

Old   July 7, 2020, 05:29
Default
  #2
Senior Member
 
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 8
crubio.abujas is on a distinguished road
It seems like a custom boundary condition. If you only need it once you can try with a codedFixedValue boundary. The following code should do the work.

Code:
    inlet
    {
        type            codedFixedValue;
        value           uniform 0;
        name            BernoilliBC;
        code
        #{
            const volVectorField& U = db().lookupObject<volVectorField>("U");

            const vectorField& U_p = U.boundaryField()[patch().index()];

            // Set the equation on each face of the patch 
            scalarField& field = *this;
            field = -0.5*magSqr(U_p)();
        #};

    }
The code is pretty straight. It recovers the U field from the objectRegistry (a kind of library of the field employed) and then get the velocity field on the current patch. Then it just apply on each of the faces of the cell the formula you mentioned. magSqr will return the value of |U|.
If you need to do more extensibe usage of this boundary condition you may want to create a custom BC with this code.

I hope it this helps!
crubio.abujas is offline   Reply With Quote

Old   July 8, 2020, 07:59
Default
  #3
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 197
Rep Power: 8
gu1 is on a distinguished road
Thank you very much, I will test today.
I believe that the idea of the work that I referred to is a mathematical/physical approach and not real... even because an inviscid flow is a hypothesis.
gu1 is offline   Reply With Quote

Old   July 10, 2020, 13:24
Default
  #4
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 197
Rep Power: 8
gu1 is on a distinguished road
Hi,

I have another question,

''The thermal boundary condition for the vertical wall is: −kf ∂T/∂n = hf (T − Tf )."

Based on the information above, I could write BC similar to the way you taught me?
gu1 is offline   Reply With Quote

Old   July 10, 2020, 15:20
Default
  #5
Senior Member
 
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 8
crubio.abujas is on a distinguished road
I think this is a much more standard condition, so you don't need to code it yourself. Try with externalWallHeatFluxTemperature. Here I've attached an example for a 600k wall and h equals to 10 W/m2K.

Code:
wall1
{
    type            externalWallHeatFluxTemperature;
    mode            coefficient;       // Other methods are: power and flux
    Ta              constant 600;      // Ambient temperature
    h               uniform 10.0;      // Value of the hfilm coefficient
    value           uniform 300;       // Default value
    kappaMethod     fluidThermo;       
}
gu1 likes this.
crubio.abujas is offline   Reply With Quote

Old   August 27, 2020, 10:38
Default
  #6
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 197
Rep Power: 8
gu1 is on a distinguished road
Quote:
Originally Posted by crubio.abujas View Post
It seems like a custom boundary condition.
Hi Carlos,

I apologize for opening the topic again but you show to have a great facility with code implementation and I need a boundary condition for epsilon. According to the study I read, the BC is simple:

epsilon = nu1 * k1 / yn

where 'k1' and 'nu1' are the values of the turbulent kinetic energy and kinematic viscocity calculated at the first node of the mesh near the wall and 'yn' is the distance of the first node in relation to the wall.

I believe that when I set the Dirichlet BC (fixedValue) to 'k' on the wall, k1 is equal to that value (but I'm not sure I can say that). nu1 I leave the boundary condition of 'calculated'.

I tried to implement BC, but it didn't work... if you can help me.

Best.
gu1 is offline   Reply With Quote

Old   August 27, 2020, 13:47
Default
  #7
Senior Member
 
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 8
crubio.abujas is on a distinguished road
Hi again!

What you're dealing with looks like a wall function. I am aware that OF have already implemented some functionalities to deal with this. You may want to check epsilonWallFunction boundary condition. In this boundary conditon two possible values of espilon are possible, depending on where the value of y+ is in the laminar region, or on the logarithmic one:

\epsilon_{vis} = 2 w k \frac{\nu_w}{y^2}

\epsilon_{log} = w C_\mu \frac{k^{3/2}}{\nu_{t_w} y}

One thing that shocks me in the expression you proposed is that the units associated to them don't seem to be consistent.

\epsilon = \frac{\nu k}{y_n}

If the units are:

|epsilon| = m2/s3
|k| = m2/s2
|nu| = m2/s
|y_n| = m

On your expression you got that |epsilon| = m3/s3 which does not correspond with the original dimension of the field. Are you sure that the equation is correct?

If you still want to apply it you may adapt the code under Foam::epsilonWallFunctionFvPatchScalarField::calcu late to your needs.
crubio.abujas is offline   Reply With Quote

Old   August 27, 2020, 14:14
Default
  #8
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 197
Rep Power: 8
gu1 is on a distinguished road
Quote:
Originally Posted by crubio.abujas View Post
Hi again!

What you're dealing with looks like a wall function. I am aware that OF have already implemented some functionalities to deal with this. You may want to check epsilonWallFunction boundary condition. In this boundary conditon two possible values of espilon are possible, depending on where the value of y+ is in the laminar region, or on the logarithmic one:

\epsilon_{vis} = 2 w k \frac{\nu_w}{y^2}

\epsilon_{log} = w C_\mu \frac{k^{3/2}}{\nu_{t_w} y}

One thing that shocks me in the expression you proposed is that the units associated to them don't seem to be consistent.

\epsilon = \frac{\nu k}{y_n}

If the units are:

|epsilon| = m2/s3
|k| = m2/s2
|nu| = m2/s
|y_n| = m

On your expression you got that |epsilon| = m3/s3 which does not correspond with the original dimension of the field. Are you sure that the equation is correct?

If you still want to apply it you may adapt the code under Foam::epsilonWallFunctionFvPatchScalarField::calcu late to your needs.
Sorry,

The correct equation is this:

\epsilon = k_1 \frac{\nu_1}{y_n^2}

But I didn't understand how I could adapt it (Foam::epsilonWallFunctionFvPatchScalarField::calcu), do you talk about creating a new wall function? If you can teach me.
gu1 is offline   Reply With Quote

Reply

Tags
boundaries condition, buoyantsimplefoam, openfoam 5.0

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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44


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