|
[Sponsors] |
June 30, 2014, 11:21 |
Boundary conditions for internal flow
|
#1 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
I want to compare FLUENT calculation results and openFOAM results.
I have calculations got from FLUENT, so I need now apply correct BC for openFOAM. In FLUENT it needs only total pressure and temperature for inlet and static pressure for outlet. How sets up similar BC in openFOAM? The case geometry is simple pipe. Solver is rhoSimplecFoam; I have tried to apply follow BC: Pressure: Code:
internalField uniform 1.9e5; boundaryField { front { type wedge; } back { type wedge; } inlet { type totalPressure; U U; phi phi; rho none; psi none; p0 2e5; gamma 1.4; } outlet { type fixedValue; value uniform 1.8e5; } bottom { type zeroGradient; } top { type zeroGradient; } } Code:
internalField uniform (0 0 0); boundaryField { front { type wedge; } back { type wedge; } inlet { type zeroGradient; } outlet { type zeroGradient; } bottom { type fixedValue; value uniform (0 0 0); } top { type fixedValue; value uniform (0 0 0); } } Code:
internalField uniform 300; boundaryField { front { type wedge; } back { type wedge; } bottom { type fixedValue; value uniform 300; } outlet { type zeroGradient; } inlet { type fixedValue; value uniform 300; } top { type fixedValue; value uniform 300; } } Code:
Floating point exception P. S. Sorry for my English. |
|
July 1, 2014, 03:59 |
|
#2 |
Senior Member
|
Hi,
For the inlet in U file you may want to use: Code:
type pressureInletVelocity; value uniform (0 0 0); Tom |
|
July 1, 2014, 05:38 |
|
#3 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Tom,
Thank you for advice. The error appears much farther, but it appears anyway. I found out that in the first steps develops very strange flow at inlet: I think that it isn't normal, and it may be reason of the problem. Maybe I should apply another variant of BC? |
|
July 1, 2014, 06:06 |
|
#4 |
Senior Member
|
Hi,
Please explain what is the inlet and what is the outlet in this picture? I think it would also help if you can show your mesh. Please also use the cell data when looking at results for debugging, not the interpolated point data. Are your wedges defined correctly? Maybe you should also use this for your totalPressure on the inlet in the p file? Code:
inlet { type totalPressure; U U; phi phi; rho rho; psi psi; p0 2e5; gamma 1.4; } Tom |
|
July 1, 2014, 06:45 |
|
#5 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Yes, of course. That is correct image:
Two visible patches are top and front. (Top patch is above and front patch in the front) Larger part of corner: Here is my mesh: Lareger left part of mesh The case archive: http://tuqaiyurts.com/case.zip P. S. If I set Code:
inlet { type totalPressure; U U; phi phi; rho rho; psi psi; p0 2e5; gamma 1.4; } Code:
--> FOAM FATAL ERROR: rho or psi set inconsistently, rho = rho, psi = psi. Set either rho or psi or neither depending on the definition of total pressure. Set the unused variable(s) to 'none'. on patch inlet of field p in file "/home/kamil/cases/alphaTest2/0/p" From function totalPressureFvPatchScalarField::updateCoeffs() in file fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C at line 210. |
|
July 1, 2014, 07:08 |
|
#6 |
Senior Member
|
Ok, I found this in src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H:
Code:
The modes of operation are set via the combination of \c phi, \c rho, and \c psi entries: \table Mode | phi | rho | psi incompressible subsonic | phi | none | none compressible subsonic | phi | rho | none compressible transonic | phi | none | psi compressible supersonic | phi | none | psi \endtable From your figures it seems like you want to have a radial inflow? But I do not really see walls that are wedge shaped. Is this correct? Or do you want to have a straight 2D flow? In that case you must use empty and not wedge. |
|
July 1, 2014, 08:06 |
|
#7 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Yes, I want to simulate radial inflow. It seems hard to understand geometry, so I draw it:
So geometry is the pipe with 0.2m inner radius and 0.21m outer radius, and gas flows between them. So mesh is wedge with 1º corner. In the picture with meshes I forget to include patches front and back with wedge boundary condition. So you can see them in this picture: From tho other side: I hope that it will help you. I try to run case with follow BC for pressure, but I got the same result: Code:
Floating point exception |
|
July 1, 2014, 09:04 |
|
#8 |
Senior Member
|
Hi,
It is getting clear now, I assumed it was just one complete cylinder, not two concentric cylinders. My guess would be that you can best ramp the total pressure on the inlet in a couple of iterations, or alternatively ramp down the static pressure on the outlet. That way there is no discontinuity in the pressure field, that can cause problems. I am not completely sure about the syntax, but I believe you can find it on the forum as well. Good luck, Tom |
|
July 1, 2014, 09:30 |
|
#9 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
My English isn't so good, so think that I don't understand you completely. I have to ask you one more time.
Do you suggest me to decrease pressure difference between inlet and outlet for several iterations? |
|
July 1, 2014, 10:27 |
|
#10 |
Senior Member
|
Yes that is what I meant, start with everything fixed at 1.8e5, than linearly increase total pressure @ inlet to 2e6 in say 500 iterations.
|
|
July 1, 2014, 11:21 |
|
#11 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
I have try it, but results is bad: calculation is going very slowly(about 1 min for each iteration) and finally appears error.
Moreover, to test your idea I have run case with follow test boundary and initial conditions: Pressure: inlet - 1.1e5 (static) outlet - 1e5 (static) initial field - using (funkySetFields -field p -expression '11000-pos().x*1000' -time 0) I have set up linear gradient of pressure Velocity: inlet - zero gradient outlet - zero gradient initial field - I have approximate mean velocity for this case, and set initial field as (25 0 0) In this case there is no discontinuity of pressure, and minimum discontinuity of velocity. The results of calculation is better, but after about 100 iteration it returns Floating point exception and the fields is very strange at the last iteration: pressure: velocity: a few steps before near inlet: Why pressure and velocity fields have so great gradient near inlet even when initial discontinuity of fields is small? |
|
July 1, 2014, 11:34 |
|
#12 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
I think it will be good to show test case with several last steps:
http://tuqaiyurts.com/testCase.zip |
|
July 2, 2014, 05:04 |
|
#13 |
Senior Member
|
Hi,
I had a short look at your case. It looks like you are using OpenFOAM version 2.0.1? I think you should consider upgrading to the latest version (2.3.x). There have been many bug fixes since than, which may or may not be related to your problems. Besides that, I found two things which may help you. First you have in fvSolution, SIMPLE subdict: Code:
transonic yes; Next, you have used stable, bounded schemes, but maybe you want to limit the gradients by using this: Code:
gradSchemes { default cellLimited Gauss linear 1; } I think these are all the things I can come up with right now. Good luck, Tom |
|
July 2, 2014, 07:22 |
|
#14 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Thank you very much, Tom.
I will check it. Kamil. |
|
July 2, 2014, 11:30 |
|
#15 |
New Member
kamil
Join Date: Jun 2014
Posts: 11
Rep Power: 12 |
Almost everything is ok.
At least there is no error and the flow is look realistic. I don't know what changes is solve problem, but I think that it was openfoam update or changing epsilon and k wall function values in the inlet patch. There is one problem, but it isn't connected with this topic. One more time thanks to Tom. Kamil. |
|
Tags |
boundary conditions, internal flow |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary conditions low Mach number flow | lost.identity | Main CFD Forum | 0 | November 28, 2010 05:44 |
3-D Compressible Flow Boundary Conditions | Tyler | FLUENT | 4 | February 5, 2009 20:58 |
boundary conditions for boundary layer flow | A. Al-zoubi | CFX | 0 | November 3, 2007 08:11 |
Internal flow simulation boundary conditions | Kishore | FLUENT | 1 | July 10, 2007 12:42 |
Please help with flow around car modelling! | Tudor Miron | CFX | 17 | March 19, 2004 20:23 |