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

Inlet velocity profile using swak4Foam

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

Inlet velocity profile using swak4Foam

Posted February 16, 2017 at 05:29 by kindle

The problem of this is that groovy can impose an inlet profile but cannot take data downstream (this is the main difficulty) and then rescale to the entry. Adding fluctuation is straight forward.

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 Pre-processing
Views 622 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

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