March 12, 2025, 11:01
|
What BC for Poiseuille Flow inletVelocityProfile
|
#1
|
New Member
Daniel
Join Date: Feb 2024
Location: Austria
Posts: 7
Rep Power: 3
|
Hei,
for my laminar flow through a pipe I have to implement a fully developed inlet velocity profile. I couldn't find any preset boundarie conditions. so I found out that I have to use codedFixedValue. Unfortunately near the wall the gradient differs from the rest of the parabola (picture below).
here is my code:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
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 fixedValue;
value uniform (1 0 0);
}
*/
inlet
{
type codedFixedValue;
value uniform (0 0 0);
name inletLaminarProfil;
code
#{
const fvPatch& boundaryPatch = patch(); //generic
const vectorField& Cf = boundaryPatch.Cf(); //generic
vectorField& field = *this; //generic
const scalar yc = 0; // definition of the center y coordinate
const scalar rpipe = 0.00025; // definition of the pipe radius
const scalar Umax = 0.596; // definition of the maximum velocity Re=1
forAll(Cf, faceI) // loop over all the patch faces
{
// const scalar x = Cf[faceI].x(); // x coordinate of the faces i
const scalar y = Cf[faceI].y(); // y coordinate of the faces i
const scalar z = Cf[faceI].z(); // z coordinate of the faces i
const scalar radius = pow((y-yc)*(y-yc)+z*z,0.5); // compute radius from center patch
field[faceI] = vector( Umax *(1-pow(radius/rpipe,2)), 0, 0); // define velocity value on the face i
}
#};
}
outlet
{
type zeroGradient;
}
wall
{
type noSlip;
}
"(front|back)"
{
type wedge;
}
}
// ************************************************************************* //
I wonder if I did something wrong. Can someone help me please?
|
|
|