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/)
-   -   simpleFoam for laminar pipe parabolic flow (https://www.cfd-online.com/Forums/openfoam-solving/99902-simplefoam-laminar-pipe-parabolic-flow.html)

Goutam April 15, 2012 10:48

simpleFoam for laminar pipe parabolic flow
 
Dear All,

I am trying to add parabolic flow at the inlet. The p and U files are given below. I am not getting satisfactory results. Can anyone tell me where is the problem.

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0;
}
outlet
{
type zeroGradient;
}
Walls
{
type zeroGradient;
}
}

---------------------------

FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type codedFixedValue;
value $internalField;
redirectType ramp;
code
#{
scalar U_0=0.001934;
scalar r=0.02595;
fixedValueFvPatchVectorField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=vector(2*U_0*(1-Foam::pow(this->patch().Cf()[i].x(),2)/pow(r,2)),0,0);
}
operator==(myPatch);
#};
}
outlet
{
type zeroGradient;

}
Walls
{
type fixedValue;
value uniform (0 0 0);
}
}

kallone April 24, 2012 18:38

Hi Goutam,

I am also modeling laminar 3D pipe flow. I've found that a poor quality mesh can lead to results that do not match the analytical solution. You may want to try refining your mesh and see if that helps. Also I would suggest switching your inlet and outlet pressure BCs.

Goutam April 25, 2012 07:08

Dear Kallone,

I have checked my mesh and its fine. Since, I am using parabolic BC at the inlet, so I am expecting the same pattern throughout the length and constant centerline velocity profile. I am not getting this at all. I didn't find the problem. Did you get the correct result ???

Thanks.

Goutam

Goutam April 25, 2012 09:02

1 Attachment(s)
I am using simpleFoam solver. Please see the attached file. I attached all the files that is necessary to run the problem.

Thanks

Goutam

april0100 April 25, 2012 09:08

Hi Goutam,

I am using a constant velocity profile at the inlet but obtain correct results for this scenario using SimpleFoam.

Have you tried switching the pressure BCs? That is, specify p = 0 at the outlet and zero gradient at the inlet. You cannot fix both the velocity and the pressure at the inlet at the same time.

Goutam April 25, 2012 09:16

hi april

I have used a constant velocity at the inlet and I also got the correct results using simpleFoam. I will change the pressure Bcs and hope it will work !!!


All times are GMT -4. The time now is 14:22.