Some Problems about the Boundary Conditions in OpenFoam
Dear all,
How many kinds of boundary conditions (BCs) in OpenFoam? What are they? And how can I denote them in a BCs file of OpenFoam? The above are some general problems I want to know. However, I faced a specific problem in practice. When I calculated the 2D flow over a 2D cylinder, I did not how to denote the boundary conditions for the cylinder wall and the external boundary which enclose the physical domain, though I knew the meaning of these BCs mathematically and how to set them in commercial software. In particular, how can I set pressure BC for a wall in OpenFoam, if there is no need to set value pressure or pressure gradient to the wall in advance? And how can I set velocity BC for a pressure outlet boundary, if there is no need to set value velocity to it in advance? Thanks in advance! Why |
Hi Why,
there are many types of BC, right. But they are all set in the fieldvariables in your first time-dictionary. A simple pipe for example would have a inlet, outlet and fixed walls, when you defined the boundaries right during mesh-generation. In the time-dictionary /0 must be for example the file of the pressure variable: /0/p In that file there is a entry for the initial state: internalField uniform 100000;and a sub-dictionary for the boundaries: boundaryFieldFor the velocity at the inlet, there is a BC called pressureInletOutletVelocity which calculates the velocity depending on the pressure. Take a look at the OF-UserGuide chapter 5.2 especially page U-133 bye Axel |
Hi,Axel.
Thank you for your help. However, I tried to set new boundary conditions (BCs) again and re-calculate my problem with icoFoam solver. In these cases, OpenFoam could not conduct calculation correctly. I read the chaper you suggested, and I have some questions. Firstly, there is one kind of boundary, on which mathematically just one quantity is needed to set, for example, just velocity is needed to set and pressure will be calculated by the velocity field. How can I set this kind boundary condition for pressure and velocity boundary files in OpenFoam, i.e. p file and U file? The second question is about the selection of the solver in OpenFoam. Do you think I am right if I choose the icoFoam solver for the problem of fluid flow over a 2D cylinder, which is a classical external fluid flow problem? If not, which one solver would you like to suggest to me? Thanks. Why |
yes , me too , i have the same problem ,, I have a velocity data and i want to put them in the inlet of my domain as a boundary condition
any one can help thanks |
Hello Why,
I don't know if it would help a lot, but I show you the way I solved it at my problem: A chamber with only one inlet, where the pressure raises over time. The pressure-boundary is in the file "p" There used the timeVaryingUniformFixedValue to get the pressure growing over time. It loads the file "inlet_p.dat", which I created in this syntax:dimensions [1 -1 -2 0 0 0 0]; This file needs a strikt format, I think. So don't insert extra spaces or something like that. Just time and pressure.( The keyword outOfBounds says what to do when you enter a timestep which is not listet in the dat-file. There "warn" will hold the last value of the specified range and give you a warning message. Other options are error, clamp and repeat. Then I defined my "U"-file in this way: ThepressureInletOutletVelocity can also be used when the flux can change direction, when you are shure that you will always have a inflow, the pressureInletVelocity would do it either.dimensions [0 1 -1 0 0 0 0]; I don't know why there must be specified a value for the inlet, because it's calculated, but it won't run without. I hope I was able to point you in the right direction about that. Good luck! Axel |
normal velocity
hello,
I try to determine the normal velocity at each point on the boundary which declared as zerogradient, how can I do that? Thanks in advance. |
fixed value + alternating BC boundary condition = ??
Hi Folks,
i am running a case with reactingFoam. I use steady BC, but the BC vary with each time Step :eek:.. WHHYYY ?? My BC are: Code:
pressure: When I check velocity with sample i get different results for each timstep: (I use sample from (0 0 0) to (0 0.15 0) which should be exactly my (2D) inlet) The Geometry is a box, with 2 adverce faces asigned the inlet and outlet, 2 adverse faces are declared empty, one face assigned symmetry and the other "wall"(here all BCs are assiged zeroGradient) One of my favourite results: (location Ux Uy Uz) Code:
0 2.31962e-20 -0.308472 65.1918 It does not go along with my understanding of "fixedValue" used for BC. When I use calcMassflow on that Patch i get corresponding(same cracyness) results. can anyone give me a hint on that, plz!? regards ! |
hi openfoamers
i have doubt in my problem like that
I have pipe flow problem ok so i enter the fluid inside the pipe so i give the velocity inlet values now i know that at inlet pressure is 1 pascal so and at the outlet pressure outlet condition is there so plz tel me at inlet how can i set the pressure? |
Quote:
My case is i know inlet T, P...also outlet P.... Hoever i want to let the openfoam to calculate the Inlet Velocity ...I tried to use oulet { type pressureInletOutletVelocity; value uniform (0 0 0); } but i dont know if this information is enough?! } |
Hi foamers !
Sorry to dig up this post, but i'm facing the same problem here.. I have a flame in the open, where i've imposed inlet velocity (because i have the velocity datas) and outlet pressure (atm. pressure, because it's in the open) At first i've put a zeroGradient condition on the outlet velocity, but my domain is too short so the solver can't respect both conditions, a zerogradient velocity and a pressure that still have a gradient at the outlet.. So it seems like i also have to let openfoam calculate outlet velocity based on the pressure gradient at the outlet. Anyway, does anyone knows why we can't just put a "calculated" type for the outlet velocity and (0 0 0) for initial value? I get Quote:
I've tried type pressureInletOutletVelocity and pressureInletVelocity types, but it doesn't change anything. (I use OF 2.0.x) |
urgent help
Hi eveybody,
I am the new user of the openFoam and nowadays tried to learn how i can use it. For one example i have used multiphase solver and apllied it to the 2-D symmetric nozzle which surface has been created in Star-CD and converted to OpenFoam. My question is that how can change the velocity values. You can see P and V BC are set as follow. Thanks in advance for help. object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0]; internalField uniform 300e5; boundaryField { Default { type totalPressure; U U; phi phiv; rho rho; psi none; gamma 1; p0 uniform 2e5; } Default_5 { type fixedValue; value uniform 1e5; } Default_10 { type zeroGradient; } } object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0]; internalField uniform (0 0 0); boundaryField { Default { type zeroGradient; value uniform (0 0 0); } Default_5 { type zeroGradient; value uniform (0 0 0); } Default_10 { type fixedValue; value uniform (0 0 0); } Default corresponds to Inlet default_5 ==> outlet Default?10==> walls |
Hi to all
Someone know how velocity is obtained from pressure in pressureInletOutletVelocity? thank to all |
Boundary condition for sphere in OpenFOAM
1 Attachment(s)
Hi,
I am trying to solve the sphere problem in the attachment. I have solved the problem with a fixedValue at the boundary but do not know what to do with this boundary conditions. The challenge in the boundary is the direction of the normal vector. if it is in the positive X- direction then have a value of +1 but if it in the negative X-direction then the value is -1. Similarly for Y and Z axis. FYI: The sphere is created from an .stl file and using blockMesh for a hexagon and the snappyHexMesh has been used to generate the mesh. Desperatly looking for help thanks claire |
normal velocity
Is there possibility in openfoam to specify outlet velocity as normal ?
|
Did you get to figure this out?
I would like to set BC that are a function of space. Is there a way to set the BC with a function such that I do not have to write out the value at each mesh size. In other words, I want the code to be reusable. Thanks. |
Greetings to all!
@Sandra: I'm going to use part of the PM you sent me to answer your question, since the two topics are related: Quote:
Code:
tcath(pos().y) Code:
fields Best regards, Bruno |
I tries po().y and it didn't help.
IN my polyMesh, I have "convert to microns" but I input my data in meters just as in the blockMeshDict. Does it mean that I should use microns in my data file? |
Quote:
Code:
convertToMeters 0.000001; Code:
( |
changed the data file as suggested and still tcath is fixed at the initial value/ value in groovyBC.
:-( |
OK, run this command:
Code:
checkMesh -constant Code:
Checking geometry... |
HERE'S what i get
Checking geometry... Overall domain bounding box (0 0 0) (0.0001 0.00057 5e-05) Mesh (non-empty, non-wedge) directions (1 1 0) Mesh (non-empty) directions (1 1 0) All edges aligned with or perpendicular to non-empty directions. Boundary openness (2.34216e-17 0 4.68431e-17) OK. Max cell openness = 1.0982e-16 OK. Max aspect ratio = 43.6937 OK. Minimum face area = 1.14433e-10. Maximum face area = 5e-09. Face area magnitudes OK. Min volume = 1.14433e-14. Max volume = 5.72165e-14. Total volume = 2.85e-12. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 0.197788 OK. Coupled point location match (average 0) OK. Mesh OK. End |
Then shouldn't the file "tcath.dat" have these values?
Code:
( Code:
Overall domain bounding box (0 0 0) (0.0001 0.00057 5e-05) |
i am checking the last time step in paraview. and i have this for my .dat file
Code:
((0e-6 4) i also tried Code:
( i am checking the last time step in paraview. and i have this for my .dat file Code:
((0e-6 4) Code:
( I notice that you use a name different from the .dat file name as I do. COuld that be causing my problems? |
Hi Sandra,
Quote:
Code:
( Quote:
Try running this command inside the case folder: Code:
find -name tcath.dat If this doesn't help, then I strongly suggest that you take a step back and test with another test case, preferably one of OpenFOAM's tutorial cases. I say this because sometimes there are certain details that we only see when we look at them from a different perspective. Best regards, Bruno |
Quote:
|
Quote:
If you used blockMesh, check how you defined the blocks. For example, in the tutorial case "incompressible/icoFoam/cavity", the following definitions were used: Code:
convertToMeters 0.1; |
oh, my resolution is 100micronx5.7micronx50micron
|
Hi Sandra,
I hope you've figured out what the problem was. If not, we need a common example to work with, in order to make it easier to diagnose what it is the exact problem. Otherwise we'll be going back and forth with a guessing game for which I don't have enough time for. If you can share your case at least privately, send me a PM with a download link for the case on DropBox or similar file sharing service. If not, then please use one of OpenFOAM's tutorials as a base for creating a similar case structure and then share it here. That way it's a lot easier to figure out what the exact problem is. Best regards, Bruno |
will PM you
|
what did you set as your internalField at 0/U?
It seems that mine only reads the internalField. Sandra Quote:
|
Hi Sandra,
I've finally managed to take a look into this today. Quote:
Quoting from the PM you sent me: Quote:
For example, since the fields "pang" and "tang" are used only for conventional calculations and are not part of equations, then their boundary conditions aren't updated and are used as-is after loading. In order to force the update you need to call the method "correctBoundaryConditions()". For example, for the field "pang" you need to call this method right after loading it: Code:
Info<< "Reading pang\n" << endl; If you do this for all of the relevant fields, then things should finally work as intended. Best regards, Bruno |
Hi Bruno,
I did try your suggestion but it seems that it's still only reading the internal field. I PMed you the revised solver (and case). Best, Sandra |
1 Attachment(s)
Hi Sandra,
I have to say that I feel a bit lost on where I should look at to see the problem. Here are the steps I took:
Code:
( If you follow these same steps, are you able to see the same results? What is the exact problem I should be looking for? Best regards, Bruno |
how do I get the "represented field" and "time" to show in the plot?
|
Quick question: Are you referring to a 2D plot or a 3D view?
|
2D plot view
|
Quote:
i have run 2 cases (icoFOam and nonNewtonian Icofoam). I see you are defining the initial conditions in your p and u files as individual scalars. All of my are x,y,x component of u or p at that boundary. How are you describing x,y,x with just an individual value? |
1 Attachment(s)
Greetings to all!
@Sandra: Quote:
Notice 3 important details on the left side of the image, inside the "Properties" tab:
@LeeRuns: Quote:
Code:
value uniform 1e5; Code:
value nonuniform 234(1e5 1e5 .... 1e4 ... 1e5); In order to set values depending on X, Y, Z positions, you can use funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields Best regards, Bruno |
boundary condition
hello guys,
I am confused with the boundary conditions. I want to simulate nozzle flow with water as fluid. I have these values- velocity at inlet = 1.46m/s total pressure = 6 Bar simpleFoam with either kepsilon or kOmega I set the conditions as velocity - inlet (fixedValue 1.43), outlet (zeroGradient) pressure - inlet (zeroGradient), outlet (fixedValue uniform 0) when I see it in the paraview, the pressure at the inlet shows 2000 pascal, but the actual value is around 5 Bar. Actually I am confused with the pressure boundary conditions. Whether in simpleFoam, pressure in 0/p takes static or dynamic or total pressure ?. please can anybody suggest appropriate boundary condition for my case ? thank you Bharadwaj |
> total pressure = 6 Bar
I think you mean the pressure difference between inlet and outlet. You may set this difference and calculate the velocity or set the velocity and calculate the pressure difference. If you have measured values and the results of your calculation differ, you have a good example to learn how OF needs to be set and which degree of accuracy can be reached with fluid simulations. Please keep in mind: When simulating incompressible, OF takes the kinematic pressure. |
All times are GMT -4. The time now is 19:33. |