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:
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.
I hope someone finds this useful
PS: swak4Foam development version compiles for OpenFOAM-2.3.x and at least groovyBC is working fine
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 }
PS: swak4Foam development version compiles for OpenFOAM-2.3.x and at least groovyBC is working fine
Total Comments 0