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

[swak4Foam] linear inlet velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2014, 12:22
Default linear inlet velocity profile
  #1
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 15
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 08:22.
eRzBeNgEl is offline   Reply With Quote

Old   January 9, 2014, 06:32
Default
  #2
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 15
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, 17:20
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 05:56
Default
  #4
Senior Member
 
Join Date: Dec 2010
Posts: 135
Rep Power: 15
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, 35 views)
File Type: jpg Figure2.jpg (40.7 KB, 38 views)
File Type: jpg Figure3.png;.jpg (8.0 KB, 28 views)
eRzBeNgEl is offline   Reply With Quote

Old   January 11, 2014, 18:10
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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: http://www.cfd-online.com/Forums/ope...tml#post446469 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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Velocity inlet BC profile antonio.c FLUENT 1 November 1, 2017 15:22
atmBoundaryLayerInletVelocity - Velocity Profile not continuous through domain sdfij6354 OpenFOAM Running, Solving & CFD 3 July 26, 2017 17:16
extracting outlet velocity profile from one case to another case's inlet tonggysun OpenFOAM 2 September 13, 2013 05:19
Export & Import Velocity profile as Inlet eRzBeNgEl STAR-CCM+ 6 March 26, 2012 06:16
[swak4Foam] Scale discrete inlet velocity profile with groovyBC cboss OpenFOAM Community Contributions 1 June 20, 2010 14:02


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