CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Inlet velocity profile for turbulent pipe flow using swak4Foam

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

Inlet velocity profile for turbulent pipe flow using swak4Foam

Posted September 14, 2017 at 06:29 by kindle

This is for the outer layer PowerLaw

Quote:
Originally Posted by zordiack View Post
Hi, I wanted a fully developed inlet velocity profile for my 3D-case and I decided to implement it using swak4Foam since I couldn't figure out how to do it with native OpenFOAM tools. So, I thought I'd share my solution here since it took me a while to figure it out.

Please note that in my case the inlet pipe centerline run along the y-axis, but it should by easy enough to modify for other cases too. Turbulent velocity profile is calculated using the power law formulation.

Code:
        pipe_inlet
        {
              type groovyBC;
              value uniform (0 0 0);
              variables (
                "n=7;"  //power law coefficient n
                "d=0.125;"  //pipe diameter
                "volFlowRate=0.1;"  //volumetric flow rate
                "Umean=volFlowRate/(pi*pow((d/2),2));"   //calculate mean velocity
                "Umax=Umean*(((n+1)*(2*n+1))/(2*pow(n,2)));"  //calculate max velocity
                "profile=Umax*pow(1-sqrt(pow(pos().x,2)+pow(pos().z,2))/(d/2),(1/n));"
                //calcucate power law velocity profile Umax*(1-r/R)^(1/n)
                );
              valueExpression "normal()*-profile";
              //apply to boundary, normal() is surface normal vector and minus is needed for inflow
        }
I hope someone finds this useful

PS: swak4Foam development version compiles for OpenFOAM-2.3.x and at least groovyBC is working fine
Posted in Uncategorized
Views 1642 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 03:30.