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/)
-   -   Turbulent flow through a pipe with variable inlet velocity (http://www.cfd-online.com/Forums/openfoam-solving/99093-turbulent-flow-through-pipe-variable-inlet-velocity.html)

lobstar March 26, 2012 06:22

Turbulent flow through a pipe with variable inlet velocity
 
Hi everyone,

I am a new user of OpenFoam and I'm taking my time to get to grips with it. I am trying to run a simulation of a flow through a pipe where the inlet and outlet pressures are known and the velocities are calculated from them. However I am having trouble with the boundary conditions. I have tried using the pressureInletVelocity bc and the pressureInletOutletVelocity bc in case of back flow but both return a floating point exception error. Can anyone provide any guidance on how to set up the case to get a result. I have tried the case with with a zeroGradient inlet pressure and an arbitrary inlet velocity (10m/s) and it was produced an answer so I don't think the problem is with the other bcs but as I said I'm new to this. Also the mesh was imported from gambit. Not sure if this bears any relevance but thought I'd mention it.

Thanks for any help guys.

lobstar March 27, 2012 05:56

I have just seen someone with the same issue get a response this morning. Issue appears to be because there is nothing creating movement in the system, need to use a fixed pressure gradient if you want velocity to be calculated. Just in case anyone looks at my post and has the same problem.

lobstar March 27, 2012 08:18

This has not worked. If anyone can suggest other solutions would be greatly appreciated!

kid March 28, 2012 01:58

Hi Lobstar,
The floating point error generally and most of the time , is thrown because of
some formulation error in boundary condition files.

Note 1: In your case you said pressure is known at both inlet and outlet. Please check , have you used, type fixedValue and given scalar value. This has to be done in 0/p file.
And Value both at inlet and outlet patch should be the known value you mentioned.

Also for U file. Use zeroGradient type with no value, both for inlet and outlet.

Note 2: Also pasting contents of both p and U file would help us, if the above does not
remove your error.

Regards,
CFDkid

lobstar March 28, 2012 04:40

Thank you for the advice CFDkid. Unfortunately it hasn't worked. I had used fixed value for the pressure bcs with scalar values given. I also tried using zeroGradient for the velocity bcs but still no luck. I apologise for not pasting the bcs before, I'm new to the forum as well as Openfoam and still learning the etiquette. Please find my original 0/p and 0/U files pasted below. I realise I also haven't fully described the simulation. I'm using simpleFoam with the k-epsilon turbulent model to simulate flow going from a wide pipe into a thinner pipe and out of it. Thanks again for your help.

0/U
boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}

inlet
{
type pressureInletUniformVelocity;
value uniform (0 0 0);

}

outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);



0/p
boundaryField
{
wall
{
type zeroGradient;

}

inlet
{
type fixedValue;
value uniform 10416.666666667;
}

outlet
{
type fixedValue;
value uniform 520.83333333333;
}

kid March 28, 2012 05:02

Modified U

0/U
boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}

inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform (0 0 0);


modified p

boundaryField
{
wall
{
type zeroGradient;

}

inlet
{
type fixedValue;
value uniform 10416.666666667;
}

outlet
{
type zeroGradient;
}

Try this set up. It should work, there was an error in my previous reply.
Also if this set up does not work try the below set up.

0/U
boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}

outlet
{
type zeroGradient;
}

intlet
{
type fixedValue;
value uniform (0 0 0);


modified p

boundaryField
{
wall
{
type zeroGradient;

}

outlet
{
type fixedValue;
value uniform 520.83333333333;;
}

inlet
{
type zeroGradient;
}

Hope it helps.

Regards,
CFDkid

lobstar March 28, 2012 05:56

Thanks CFDkid! your second suggestion seems to be working fine (no error just yet). I wanted to ask if you know why my set up wasn't working? In your suggestion only one pressure bc is known. Could you (or anyone) make any suggestions on how to simulate a certain pressure drop with an incompressible flow? Thanks again, i really appreciate the quick replies!

kid March 28, 2012 06:10

Good.
I hope some senior member could comment better on later explanation. OpenFOAM expects us to provide any gradient to start the solution, once the flow is developed or converged, the final result should give us other missing values ( in this case).

Regards,
CFDkid

lobstar March 28, 2012 11:15

Ok, I think I have a better understanding of what is expected now. Thanks kid I'll continue to fiddle around and see what I can conjure up. I would really appreciate it if anyone who has a working example of a flow using the pressureInletVelocity boundary condition could share their set up, it'd really help!


All times are GMT -4. The time now is 04:59.