|
[Sponsors] |
July 6, 2020, 12:08 |
Bernolli's Boundary Condition
|
#1 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
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 |
|
July 7, 2020, 05:29 |
|
#2 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
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)(); #}; } 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! |
|
July 8, 2020, 07:59 |
|
#3 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
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. |
|
July 10, 2020, 13:24 |
|
#4 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
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? |
|
July 10, 2020, 15:20 |
|
#5 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
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; } |
|
August 27, 2020, 10:38 |
|
#6 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
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. |
|
August 27, 2020, 13:47 |
|
#7 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
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: One thing that shocks me in the expression you proposed is that the units associated to them don't seem to be consistent. 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. |
|
August 27, 2020, 14:14 |
|
#8 | |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
Quote:
The correct equation is this: 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. |
||
Tags |
boundaries condition, buoyantsimplefoam, openfoam 5.0 |
|
|
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 |