CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   RhoSimpleFoam negative pressure (https://www.cfd-online.com/Forums/openfoam-solving/59665-rhosimplefoam-negative-pressure.html)

gzink July 26, 2006 07:31

Hi, I am trying to run a co
 
Hi,

I am trying to run a compressible flow through a nozzle using rhoSimpleFoam, and I keep getting the error:

--> FOAM FATAL ERROR : pressure has become negative
try reducing the p relaxation factor during the start-up phase of the flow evolution

From function rhoSimpleFoam
in file pEqn.H at line 30.

FOAM exiting

I have tried changing the relaxation factors and discretization schemes, as well as starting from an incompressible solution. Doing this, I can make the solution run for over 1000 iterations, but the error always occurs sooner or later.

Does anyone have any advice for how to solve this problem?

Thanks,
Greg Z.

olesen July 27, 2006 05:41

Hi Greg, You may notice fro
 
Hi Greg,

You may notice from another thread that I'm also trying my luck with rhoSimpleFoam.

How compressible is your flow?
What type of bc's are you using?
How do the mass-flux fluctuation look on the inlet/outlet boundaries?
Are your k/epsilon initial values realistic?

For my simple test case, I've found a fixed mass inlet helped.

/mark

gzink July 27, 2006 08:11

Hi Mark, Here are some answ
 
Hi Mark,

Here are some answers to the questions you asked:

How compressible is your flow?

For this particular case, I'm only at about M=0.3, which would imply an incompressible flow. However, for other cases we run here we hit near M=0.8, so I will definitely need compressibility in the future. The current case is almost a test of rhoSimpleFoam so we know if we can use it later on.

What type of bc's are you using?

Atmosphere at inlet/outlet (total pressure and pressureinletoutletvelocity). This is the best way I could find to have a flow driven by a pressure drop through the nozzle, and it seems to work quite well in incompresible (simpleFoam).

How do the mass-flux fluctuation look on the inlet/outlet boundaries?

I haven't been monitoring this... I assume it requires some modification of the code. What I have been doing is calculating mass flow rate in paraFoam, which is a bit tedious: http://www.cfd-online.com/OpenFOAM_D...tml?1148375387 I did a search of the message board and found this, which sounds like a way to monitor mass flux: http://www.cfd-online.com/OpenFOAM_D...tml?1113927929 Is this more like what you do?

Are your k/epsilon initial values realistic?

I think so. I calculated k and epsilon from turbulence intensity and viscosity ratio, which is how we usually specify turbulence in Fluent.

I don't think I can specify the inlet as a fixed mass flux for my problem, as you suggested. Any other ideas or comments you might have would be greatly appreciated, though.

Thanks,
Greg Z.

olesen July 28, 2006 05:11

Hi Greg, I think the first
 
Hi Greg,

I think the first place to look is at what your inflows/outflows are doing. I use the Jarrod's computeMassFlux code. I've modified it slightly to skip walls and provide slightly more verbose information .

Perhaps watching the pressure/velocity changes at the boundaries will give you a cue as to what is happening.

With a simple U-bend test case, I've managed to get a solution for local Ma=0.6-0.75, however I really reduced the pressure relaxation (0.1 -> 0.025) for the higher flows.

I hope not to annoy any of the OpenFOAM people, but I strongly suspect that the density correction are missing from the pressure corrector. I wish that I knew more about OpenFOAM to determine what should be added to the Laplacian in the pEqn.

/mark

olesen July 28, 2006 05:14

Perhaps the upload with work t
 
Perhaps the upload with work this time.
/mark

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif buildGlobalBoundaryList.H and http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif computeMassFlux.H

olesen July 28, 2006 06:00

Hi Greg, For initializing y
 
Hi Greg,

For initializing your velocity fields, the http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif rhoPotentialFoam.tar.gz might help. It is a variant of potentialFoam, but is easier for our purposes in that it accounts for the average density, doesn't write the phi field and automatically insists on at least nNonOrthCorr = 3 (allowing you to use the same fvSolution file).

/mark

adorean August 1, 2006 12:50

Hi Greg, Can you please pos
 
Hi Greg,

Can you please post an example B.C. file/s for a pressure difference driven flow? Total pressure for inlet and static pressure for outlet? i have trouble applying them correctly. For a "simpleFoam" application.
Or, a zipped case?
If you think this board is not suitable for it, then to: eadorean at yahoo.com

Thank you,

Ervin

gzink August 2, 2006 07:50

Hi Ervin, I have also had t
 
Hi Ervin,

I have also had trouble when applying static pressure at the outlet, so I have switched to using a total pressure there also. The best option I have been able to find is to use the "atmosphere" boundary condition found in FoamX (i.e. totalPressure for p and pressureInletOutletVelocity for U) for the inlet and the outlet. Here's an excerpt from my BC files:

pressure...

BC-PressOut
{
type totalPressure;
p0 uniform 101325;
value uniform 101325;
}
BC-PressInlet
{
type totalPressure;
p0 uniform 104531;
value uniform 104531;
}

velocity...

BC-PressOut
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
BC-PressInlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}

There might be better ways to do it, but mine does match Fluent pretty well. Hope this helps!

Greg Z.

adorean August 2, 2006 11:12

Hi Greg, Thank you for shar
 
Hi Greg,

Thank you for sharing this. It works.
I have calculated a simple 3D hex. mesh case.

Now I am trying to apply it to a more complicated, tet. mesh geometry.

Ervin

adorean May 16, 2007 00:25

Hello Greg, Have you used t
 
Hello Greg,

Have you used the above boundary conditions for simpleFoam/rhoSimpleFoam in O.F. 1.4?

I've got this error in OF 1.4 - simpleFoam with a case setup that worked in OF 1.3:

--> FOAM FATAL IO ERROR : keyword U is undefined in dictionary "/home/ervin/OpenFOAM/ervin-1.4/tutorials/simpleFoam/intake-4mm/0/p::p-out"

file: /home/ervin/OpenFOAM/ervin-1.4/tutorials/simpleFoam/intake-4mm/0/p::p-out from line 41 to line 43.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting

My 0/p dictionary:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.3 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class volScalarField;
object p;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions [0 2 -2 0 0 0 0];

internalField uniform 101325;

boundaryField
{
p-in
{
type totalPressure;
p0 uniform 102125;
value uniform 102125;
}

p-out
{
type totalPressure;
p0 uniform 98205;
value uniform 98205;
}

wall
{
type zeroGradient;
}

}


Why is it asking for U, then phi, rho, gamma ... in the 0/p file?

Thanks,

Ervin

frank June 4, 2007 05:35

Hi Greg, you try p-
 
Hi Greg, you try

p-in
{
type totalPressure;
p0 uniform 102125;
U U;
phi phi;
rho none;
psi none;
gamma 1.4;
value uniform 102125;
}

p-out
{
type totalPressure;
p0 uniform 98205;
U U;
phi phi;
rho none;
psi none;
gamma 1.4;
value uniform 98205;
}

Li Q


All times are GMT -4. The time now is 09:15.