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

swak4foam - linear inlet velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 8, 2014, 11:22
Default swak4foam - linear inlet velocity profile
  #1
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 5
eRzBeNgEl is on a distinguished road
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 07:22.
eRzBeNgEl is offline   Reply With Quote

Old   January 9, 2014, 05:32
Default
  #2
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 5
eRzBeNgEl is on a distinguished road
any idea? my results are not right, so there must be a mistake
eRzBeNgEl is offline   Reply With Quote

Old   January 9, 2014, 16:20
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,837
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by eRzBeNgEl View Post
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
gschaider is offline   Reply With Quote

Old   January 10, 2014, 04:56
Default
  #4
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 5
eRzBeNgEl is on a distinguished road
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
File Type: jpg Figure1.jpg (38.7 KB, 12 views)
File Type: jpg Figure2.jpg (40.7 KB, 9 views)
File Type: jpg Figure3.png;.jpg (8.0 KB, 9 views)
eRzBeNgEl is offline   Reply With Quote

Old   January 11, 2014, 17:10
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,328
Blog Entries: 32
Rep Power: 72
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings to all!

@eRzBeNgEl: There are several details here that are either missing or that you are not taking into account:
  1. 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: studying a valve case post #12
  2. 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.
  3. 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.
  4. You can set the whole domain to have the desired flow, by using funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields
  5. 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
wyldckat is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting outlet velocity profile from one case to another case's inlet tonggysun OpenFOAM 2 September 13, 2013 04:19
Velocity profile at inlet siw CFX 2 May 3, 2012 09:30
Export & Import Velocity profile as Inlet eRzBeNgEl STAR-CCM+ 6 March 26, 2012 05:16
using profile to specify inlet VOF and velocity yf FLUENT 8 June 2, 2005 05:40
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 02:13


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