CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Boundary Condition for Variable Velocity

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Taataa

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2018, 15:34
Default Boundary Condition for Variable Velocity
  #1
New Member
 
Join Date: Dec 2017
Posts: 5
Rep Power: 8
Hyllon is on a distinguished road
Hello, I'm new to OF. I'm running an axi-symmetric case. It's just a pipe.

Geometry: https://imgur.com/a/YsK1o

The problem is: The velocity varies according to an equation.

This is the equation: https://imgur.com/a/8jDCc

The ONLY variable is ' r ', which is the distance between the center of the tube and any cell in y direction.

I need a boundary condition for that. Any help is appreciated.

Sorry for bad english.
Attached Images
File Type: png Geometry.png (16.6 KB, 14 views)
File Type: png Equation.png (4.5 KB, 10 views)
Hyllon is offline   Reply With Quote

Old   April 19, 2018, 05:17
Default
  #2
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12
RobertHB is on a distinguished road
You might take a look at the codedFixedValue boundary conditon or the vectorCodedSource entry for the fvOptions dictionary. But i haven't work with any of those and can't tell you if it will work or not.
RobertHB is offline   Reply With Quote

Old   April 19, 2018, 05:20
Default
  #3
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 94
Rep Power: 15
einstein_zee is on a distinguished road
Quote:
Originally Posted by Hyllon View Post
Hello, I'm new to OF. I'm running an axi-symmetric case. It's just a pipe.

Geometry: https://imgur.com/a/YsK1o

The problem is: The velocity varies according to an equation.

This is the equation: https://imgur.com/a/8jDCc

The ONLY variable is ' r ', which is the distance between the center of the tube and any cell in y direction.

I need a boundary condition for that. Any help is appreciated.

Sorry for bad english.
Hey,

A subtle way is discussed here. "https://www.youtube.com/watch?v=K-nAF3qAPTc"
einstein_zee is offline   Reply With Quote

Old   April 19, 2018, 13:22
Default
  #4
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 13
Taataa is on a distinguished road
Here is the code that you can put in U file:

Code:
inlet
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        redirectType    parabolaProfile;
        
        code
        #{
            const fvPatch& boundaryPatch = patch();
            const vectorField& Cf = boundaryPatch.Cf();
            
            vectorField& field = *this; 
            scalar Ut = 1;
            scalar C  = 1;
            scalar R0 = 1;
            scalar nu = 1;
            scalar n  = 1;
            
            scalar vel;

            forAll(Cf, faceI)
            {
                scalar dis = Cf[faceI].y() < R0 ? Cf[faceI].y() : Cf[faceI].y() - R0;
                vel = Ut*C*pow(dis*Ut/nu, n);
                field[faceI] = vector(vel, 0, 0);
            }
        #};
    }
Change the variables based on your dimensions. Keep it mind that I assumed that your equation is written considering the origin is at the center of the pipe but you mesh origin is at the bottom of the pipe. If the mesh origin matches the origin of the equation you use the original form of the equation which changes is straight forward.
Rvadrabade likes this.
Taataa is offline   Reply With Quote

Old   April 19, 2018, 13:47
Default
  #5
New Member
 
Join Date: Dec 2017
Posts: 5
Rep Power: 8
Hyllon is on a distinguished road
Thanks so much for your help, guys. Im gonna take a look.
Hyllon is offline   Reply With Quote

Old   April 20, 2018, 03:11
Default Another option is to use swak4foam/groovyBC
  #6
Member
 
Rahul Vadrabade
Join Date: Apr 2018
Posts: 46
Rep Power: 8
Rvadrabade is on a distinguished road
This is very interesting implementation.
If you are familiar with swak4foam/groovyBC ( if not i recommend you/Everyone must learn) .

I am assuming that flow direction is x and radial is y.

Just look at implementation, images are attached.

One can correct mistakes if any.
All the best.

(If swak4foam not compiled, then ask)
Attached Images
File Type: png 1.PNG (38.4 KB, 15 views)
File Type: png 2.PNG (54.6 KB, 16 views)
Rvadrabade 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 11:20
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 05:13
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 22:18


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