CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Boundary conditions for outlet (http://www.cfd-online.com/Forums/openfoam-solving/60144-boundary-conditions-outlet.html)

sung April 11, 2005 01:13

Does anyone have the experienc
 
Does anyone have the experience dealing with outlet boundary condition by setting zero pressure gradient and zero velocity gradient. Some sigular point always arise and my job gets killed.

henry April 11, 2005 03:32

How are you setting the pressu
 
How are you setting the pressure-level given that the outlet no longer sets it? Do you have a reference cell in the domain? What code are you running?

sung April 11, 2005 13:09

I create a solver based on ico
 
I create a solver based on icoFoam.C by adding a piece of code before the pressure solution used to scale the flux on the outlet boundary to satisfy
global continuity (refered to Dr. Hrvoje Jasak's dissertation, thanks Hrv!).

I do not use reference cell in the domain.

henry April 11, 2005 13:15

If you have zero-gradient boun
 
If you have zero-gradient boundary conditions for p over all the boundaries and you are not using a reference cell how are you stopping the pressure level float?

sung April 11, 2005 13:36

Thanks Henry, Probably this
 
Thanks Henry,
Probably this is the reason my job get killed. Is there any similar code in the OpenFoam package I could follow to set the reference cell?

henry April 11, 2005 13:41

All the solvers include code l
 
All the solvers include code like:

fvScalarMatrix::reference pRef = pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
pEqn.unsetReference(pRef);

Which sets the pressure reference if necessary as dictated by the set of pressure boundary conditions.

sung April 11, 2005 15:01

Oh, I do keep this part of cod
 
Oh, I do keep this part of code from icoFoam.C. So the problem is where should I provide the reference cell label and value? Is it in the file of 0/p or some where else? The default values seem to be pRefCell=0 and pRefValue=0.

henry April 11, 2005 15:16

The default is 0 and 0 but it
 
The default is 0 and 0 but it shouldn't matter what location or value you choose if the purpose is simply to stop the pressure level floating. However you can change them if you wish to; they are read from the PISO or SIMPLE sub-dictionaries of fvSolution.

sung April 11, 2005 15:41

Hi Henry, Yes, I do not reall
 
Hi Henry,
Yes, I do not really care where is the reference zero pressure. I will just keep it to be default value. When I apply my solver to a simple 3 dimensional straight duct flow problem with one inlet and one outlet, it always get stuck when set the outlet to be zero pressure gradient.

henry April 11, 2005 15:52

You might find it useful to st
 
You might find it useful to study the operation of the adjustPhi(phi, U, p) call in simpleFoam which I implemented to adjust the inlet and outlet fluxes to obey continuity during the solution of stready-state cases when the outlet pressure BC is not fixed-value. You will probably find it can be included directly into your icoFoam-based code for your case in the same way as it is used for simpleFoam. If you would like to look at the source for this function it is in OpenFOAM-1.1/src/cfdTools/adjustPhi.

sung April 12, 2005 13:30

Hi Henry, Thanks for offering
 
Hi Henry,
Thanks for offering me so much help.

In the tutorial's simpleFoam directory, there is a sample case "pitzDaily", the geometry is quite similar to my problem. The outlet pressure BC is "fixedValue, uniform 0" in the tutorial, it runs perfect with simpleFoam. Now I change it to be zeroGradient, it get stuck. Here is the erro message:
--> FOAM FATAL ERROR : Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.

Function: adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p
in file: adjustPhi/adjustPhi.C at line: 108.

FOAM exiting

henry April 12, 2005 13:47

What is the initial value for
 
What is the initial value for U? If it is (0 0 0) try either restarting from the solution you obtained with the fixedValue p outlet or set it to the inlet value.

sung April 12, 2005 14:25

Yes, the initial U was (0 0 0)
 
Yes, the initial U was (0 0 0). After I restart it from the solution of fixedValue p, it works;) So, can we conclude that the zeroGradient pressure BC is quite sensitive to the initial condition? Now a new problem arise;( if I have a multi-outlet domain, eventually, all of the outlets need to be set as zeroGradient pressure. How can I set the fixed pressure value for every outlets to get "predictor solution", all to be the same of zero?

henry April 12, 2005 14:30

The problem is that the outlet
 
The problem is that the outlet flux cannot be scaled to obey continuity if it's value is zero. If you want to use a continuity-adjusted outlet condition you need a sensible flow-field on which it can operate and a sensible choice is to start from is the potential-flow solution or at the very least some kind of mean value or the inlet value.

sung April 19, 2005 15:18

Hi Henry Thanks for so many i
 
Hi Henry
Thanks for so many informative responses.
I am running the simpleFoam for a pipe with multiple outlets. Can I still set all of the outlets to be zeroGradient pressure and velocity? Some strange result is obtained when I do that. One outlet branch's flux is almost zero which is wrong.

henry April 19, 2005 18:45

I am not sure if the problem i
 
I am not sure if the problem is well-posed if you specify zeroGradient pressure and velocity on multiple outlets without further specification. I seem to remember people also specifying the outflow split for multiple outflows, are you familar with doing this? Have you run such cases with other codes?

sung April 20, 2005 01:35

I have not done the outflow sp
 
I have not done the outflow split stuff before. We run the same geometry with Fidap, it works. However, in Fidap, users only need to specify the velocity BCs for inlet and outlets (fixed flux for inlet and zeroGradient for outlets in our case).

hjasak April 20, 2005 01:40

You definitely need the outflo
 
You definitely need the outflow split, otherwise the split from the first iteration of the solver will be preserved. Since the solution after the first iteration is pretty bad, your solution probably looks silly.

Specifying just inlet and outlet gives you a class of equivalent solutions and nothing to correct it so you need additional specification. Other codes behave in various ways: Star uses outflow split and I am pretty sure Fidap uses pressure outlet oundary where this issue does not occur.

Enjoy,

Hrv

sung April 20, 2005 02:35

Hi Hrv, Thanks. Could you poi
 
Hi Hrv,
Thanks. Could you point out a reference dealing with the outflow split for me?

henry April 20, 2005 03:11

Could you please explain in mo
 
Could you please explain in more detail the outlet boundary conditions you used in Fidap for both velocity and pressure because it is not clear from what you have written.


All times are GMT -4. The time now is 23:16.