CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Pressure BC´s simpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/121792-pressure-bc-s-simplefoam.html)

 Tensian August 5, 2013 13:32

Pressure BC´s simpleFoam

Hi everyone,

Anyone knows how to modelate a pressure driven flow in a channel with simpleFoam solver? When I try to specify fixedValue at inlet and outlet( for p) and zeroGradient in the same boundaries (for U) then the results explodes with no physical meaning. I have tried some combinations (pressureInletVelocity, inletOutlet...). I need to know if it´s possible to do and if not, which solver can I use?

Thank you so much

 inf.vish August 5, 2013 22:28

I am also stuck on the same problem. The boundary conditions i put seem correct. fixed value condition for p is correct. for U you need to put pressureInletVelocity at the inlet and zeroGradient at the outlet. But using these BCs my solution won't converge and the results look weird. I will post if i solve the problem correctly.

 Tensian August 6, 2013 11:07

Thanks for the reply,

I am trying new bc´s that involves totalPressure, but nothing seems to run. I got converged results, but without physical meaning.

I will let you know if I find a solution, but I think simpleFoam does not allow this kind of setup (maybe we have to do some C++ programming for obtain a suitable boundary condition in terms of pressure...)

It´s weird, because FLUENT do the calculation without problems....

 jptorol August 6, 2013 11:09

simpleFoam BBCC

Hi there, did you review the "turbulent flow over a backward-facing step" (PitzDaily case)?
Because you are interested in the pressure gradient and not in the pressure itself, you can fix the pressure, e.g p=0 Pa at outlet, the program will calculate the pressure field, and thus, you will have the pressure gradient.
Regards,

JP

 Tensian August 6, 2013 11:31

Hi Juan Pablo,

Thanks for the suggestion, I will review this tutorial. I need to fix pressure gradient between inlet and outlet, because velocity is not known (and I am interested for example in computing flow rate), so is the pressure difference what induces fluid motion.

I´ll try what you suggest, keeping my fingers crossed.

Thank you so much

 Tensian August 6, 2013 11:33

Now I am reading slowly what JP has said. I think his suggestion is suitable if you want to calculate pressure gradient, but this is not my case. The pressure at inlet and outlet is known and fixed!

Thanks anyway!

 inf.vish August 6, 2013 22:47

Hi James,
Yesterday i solved the problem of Poiseuille flow (laminar) using simpleFoam. The problem is that the solution won't converge even after running for 100000 iterations. The solution conforms with Poiseuille's law even though convergence is not reached. If you want i can post my files. I have done it for an axisymmetric wedge.

 Tensian August 7, 2013 05:01

Hi Vishal,

Yes please, let me see the files so I can compare. I am triying to use fixedGradient, pressureInletVelocity, totalPressure...but nothing give me good results, the simulation gives very high values (for a pressure gradient of 20 Pa I expect velocitites of about 4/5 m/s) for velocity and pressure.
I am a beginner to OF so I am not sure if programming is needed for that kind of setup.

Thanks for your help (if you need I can post my files too)

 inf.vish August 7, 2013 23:16

1 Attachment(s)
Hi James,
I am also a beginner. Here is my case. The fluid i have considered is water at 20 degree celcius. The only problem I am having is of convergence. If you can shed some light on it then that would be great.

Attachment 24234

 Tensian August 8, 2013 05:25

Thanks Vishal,

As I expected, we have the same kind of BC´s. The only difference is that I use some nonOrthogonalCorrectors because I have a tetraedral+prism mesh. I´ll continue researching and if I know what´s happening I´ll let you know. I have been reading in the forum and it looks like all the people have some problems with pressure driven flows (many complaints about the big magnitudes of variables when Dirichlet pressure BC´s are applied).
We are in contact, if I find something new I´ll post it here

Cheers,
James

 inf.vish August 11, 2013 23:36

Hi James,
I was able to get convergence on a 3D cylindrical pipe with the same boundary conditions. It takes a lot many iterations (431) as compared to simple velocity driven flow (97).

 Tensian August 12, 2013 06:54

Hi Vishal,

Then it looks like the problems are the complex geometry and maybe the mesh, because I am trying to do this in a complex channel and simulation explodes! I have tried an advise given in the forum: I initialize the internalField for pressure with the same value than I put in the outlet. At first it works fine, but when resiudals are about 1e-02, they start to rise up, and values for pressure and velocity are near of 1e+12.

I´ll make some experiments with cylindrical geometries, because if they work fine then I´ll be sure that the problem is geometry and mesh, not OF model.

Thanks, we are in contact for anything!

 inf.vish August 12, 2013 23:02

Oh. You can try refining your boundary meshes.
Yeah try the same problem on a simple cylinder.
You want to simulate Poiseuille flow but what is the geometry you are using?

 sam.ho January 2, 2014 04:18

Floating Point core dumped

Hi,

I rad the discussion made by you all. And implemented similar boundary conditions to my simulations ( Flow through a ball valve) . But I am getting the following error.
#0 Foam::error::printStack(Foam::Ostream&) in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::multiply<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#6 Foam::incompressible::RASModels::kEpsilon::correct () in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#7
in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/bin/simpleFoam"
#8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9
in "/home/sml5kor/OpenFOAM/OpenFOAM-2.2.1/platforms/linux64GccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)

Can anybody help me ?

My case turbulent parameters are as below
k=0.00036 m2/s2
epsilon = 0.00014 m3/s2
nuT = 1.04 X 10^-7 m2/s
Density = 800 kg/m3
and Inlet presure = 5 bar
outlet pressure = 1 bar (atmospheric pressure)

 vut February 27, 2014 10:10

Boundary conditions for simpleFOAM

Hi,

I want to apply a total pressure at inlet (4 bar) and a pressure outlet (0 bar) boundary conditions.

May you give me some advides?

In fact, I tried the files p and U given in the folder Poiseill's flow but I was unable to run the simulation!

Thanks.

Quote:
 Originally Posted by inf.vish (Post 445306) Oh. You can try refining your boundary meshes. Yeah try the same problem on a simple cylinder. You want to simulate Poiseuille flow but what is the geometry you are using?

 crixman August 29, 2014 16:33

Hi all,
after several tests I was able to get meaningful results for pressure-driven fluxes in a duct using:
p
Inlet: fixed Value uniform 10000 (inlet pressure - remember to divide it by density!)
outlet: fixed value uniform 0

U
inlet: fixed Value uniform (10 0 0)
outlet: fixed value uniform (10 0 0)

with the same fixed value you will force mass conservation and results are ok. this make sense if inlet and outlet have the same area.
if different area (such as pitzdaily,)
try
U
outlet:
type inletOutlet;
inletValue uniform (10 0 0); //or different velocity, try to estimate it from inelt/outlet ratio and mass conservation formulas;
value uniform (10 0 0);

Let me know if it works and if this approach is correct, that's the only way I could get meaningful physical results!

 alvariten April 23, 2015 12:19

Pressure BC´s simpleFoam

Hi people,

I know has been a long time since last post. I have the same problem with simpleFoam and the pressure driven flow. I'd like to know if you solved the problem (if still remember). I have tried everything, even what Vishal suggested. And whatever I do it diverges always just after the first iteration.

Code:

```Starting time loop Time = 1 smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.000640509, No Iterations 2 smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.000755479, No Iterations 2 #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2  in "/lib/x86_64-linux-gnu/libc.so.6" #3  Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #4  Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #5  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/simpleFoam" #8   in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/simpleFoam" #9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #10   in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/simpleFoam" Floating point exception (core dumped)```
The parameters that I used are exactly the same PitzDaily tutorial but with different boundary values (and the geometry)

p
Code:

```dimensions      [0 2 -2 0 0 0 0]; internalField  uniform 0; boundaryField {     front     {         type            empty;     }     back     {         type            empty;     }     inlet     {         type            fixedValue;         value          uniform 1000;     }     outlet     {         type            fixedValue;         value          uniform 0;     }     sym     {         type            symmetryPlane;     }     wall1     {         type            zeroGradient;     }     wall2     {         type            zeroGradient;     } }```
U
Code:

```dimensions      [0 1 -1 0 0 0 0]; internalField  uniform (0 0 0); boundaryField {     front     {         type            empty;     }     back     {         type            empty;     }     inlet     {         type            fixedValue;         value          uniform (8.3 -5 0); //      type        pressureInletVelocity; //      value        uniform (0 0 0);     }     outlet     {         type            fixedValue;         value          uniform (10 0 0); //        type            zeroGradient; //        type            inletOutlet; //        inletValue      uniform (0 0 0); //        value          uniform (0 0 0);     }     sym     {         type            symmetryPlane;     }     wall1     {         type            fixedValue;         value          uniform (0 0 0);     }     wall2     {         type            fixedValue;         value          uniform (0 0 0);     } }```
Regards

 Lisl February 5, 2016 06:27

Hey Alvaro,

Did you solve that Problem?

I have the same Problem and can't find an answer..

Thanks!!

 Manojmech March 1, 2017 10:17

With Hydrogen simpeFoam

Hi all,

I have a question almost similar to this case with simpleFoam. I searched other forum but found this was the closest to my problem.

I have a case , consider a simple MICRO channel with hydrogen as fluid. Density of hydrogen is very less - 0.0824 kg/m3.

My inlet pressure is 2bar and outlet pressure is 1.5bar. If I want to divide pressure by density as said by OpenFoam then I think its nearly INLET- 2427184.46 and accordingly the outlet. This value is very high and when I run simpleFoam , continuity error increases nearly to the order e+12 and results are not physical.

My values

0/p

internalField uniform 0; I did change this to 100000 but dint work out.

INLET type fixedValue 2427184.4; Accordingly OUTLET BC.

0/U
INLET type pressureInletVelocity;
value uniform(0 0 0);

OUTLET type inletOutlet;
inletValue uniform(0.0001 0 0);
value uniform(0.0001 0 0);

WALL type noslip;

I am expecting the velocity to be very low because we know it should be laminar.

Please let me know if I am going wrong somewhere. Also let me know if you need more information.

Regards,
Manoj

 All times are GMT -4. The time now is 01:07.