# swak4foam - linear inlet velocity profile

 Register Blogs Members List Search Today's Posts Mark Forums Read

January 8, 2014, 12:22
swak4foam - linear inlet velocity profile
#1
Senior Member

Join Date: Dec 2010
Posts: 135
Rep Power: 9
Hi guys,

i want to create a linear velocity profile at the inlet patch for simulating couette flow in a channel with less computational effort, therefore I tried following code:

Quote:
 inlet { type groovyBC; variables "maxVel=1;yp=pts().y;minY=min(yp);maxY=max(yp) ;"; valueExpression "((maxY-minY)/maxVel)*normal()*time();"; value uniform (1 0 0); }
Is this right? I already set the maximal velocity in the U description of a moving wall (velocity = 1 m/s). Is there an option to link the groovyBC (maxVel part) with this boundary condition, eg: "maxVel=mag(U)@movingWall";

Last edited by eRzBeNgEl; January 9, 2014 at 08:22.

 January 9, 2014, 06:32 #2 Senior Member   Join Date: Dec 2010 Posts: 135 Rep Power: 9 any idea? my results are not right, so there must be a mistake

January 9, 2014, 17:20
#3
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,020
Rep Power: 43
Quote:
 Originally Posted by eRzBeNgEl Hi guys, i want to create a linear velocity profile at the inlet patch for simulating couette flow in a channel with less computational effort, therefore I tried following code: Is this right? I already set the maximal velocity in the U description of a moving wall (velocity = 1 m/s). Is there an option to link the groovyBC (maxVel part) with this boundary condition, eg: "maxVel=mag(U)@movingWall";
I'm not completely clear what you exactly want to do. You mean something like "maxVel{movingWall}=max(U)"? ( see http://openfoamwiki.net/index.php/Co...al_expressions or the incomplete reference guide)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

January 10, 2014, 05:56
#4
Senior Member

Join Date: Dec 2010
Posts: 135
Rep Power: 9
Hi,

in general I will produce a linear gradient velocity profile at my inlet in y-direction

This is my test setup

1. I tried by groovyBC but I failed -

2. I changed the hard coded parabolicVelocity.C File of HJasak and got the profile at figure 1. - it seems to be right
BUT
if i calculate further I got wiggles at the corner on bottom. How can I avoid them?(see Figure 2 & Figure 3) and in Couette there should be no velocity gradient in y-direction, but there is!

and in general, how can I set this profile to whole domain and not just to the inlet?

Here is my Member Function of the linear velocity profile:
Code:
```void linearVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}

// Get range and orientation
boundBox bb(patch().patch().localPoints(), true);

vector ctr = (bb.max() + bb.min());

const vectorField& c = patch().Cf();

// Calculate local 1-D coordinate for the linear profile
scalarField coord = ((c - ctr) & y_)/((bb.max() - bb.min()) & y_);

//n=flow direction, maxValue=peakVelocity
vectorField::operator=(n_*maxValue_*(1.0-sqr(coord)));```
Attached Images
 Figure1.jpg (38.7 KB, 25 views) Figure2.jpg (40.7 KB, 23 views) Figure3.png;.jpg (8.0 KB, 17 views)

 January 11, 2014, 18:10 #5 Super Moderator   Bruno Santos Join Date: Mar 2009 Location: Lisbon, Portugal Posts: 10,036 Blog Entries: 39 Rep Power: 110 Greetings to all! @eRzBeNgEl: There are several details here that are either missing or that you are not taking into account: The correct way to be properly that the values are as you want them, is to see the cell data, not the point data. See this post for more information: http://www.cfd-online.com/Forums/ope...tml#post446469 post #12 You are not telling us what boundary conditions you are using for the walls, namely the ones that are perpendicular to the inlet. Or at least, I did not understand it from your description. I have not understood why you need to use this boundary condition for the inlet. Because a simple modification to the cavity tutorial could give you the couette flow, without any special boundary conditions. You can set the whole domain to have the desired flow, by using funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields The code you've provided does not seem to have been modified. It's still a parabolic flow, because of this specific detail: Code: `1.0-sqr(coord)` Best regards, Bruno __________________ OpenFOAM: FAQ | Getting started Forum: How to get help, to post code/output and forum guide What am I doing/planning: blog/wiki Read this before sending me PM

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post tonggysun OpenFOAM 2 September 13, 2013 04:19 siw CFX 2 May 3, 2012 09:30 eRzBeNgEl STAR-CCM+ 6 March 26, 2012 05:16 yf FLUENT 8 June 2, 2005 05:40 R P CFX 2 October 26, 2004 02:13

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