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

New BC: problems with asking velocity vector

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 9, 2014, 12:02
Default New BC: problems with asking velocity vector
  #1
New Member
 
James B
Join Date: Oct 2013
Posts: 4
Rep Power: 12
james91 is on a distinguished road
Dear foamers

I am making a new boundary condition that depends on the direction of the velocity vector U (if you is going in the positive Y direction, the inlet velocity should be U1 and if it it is going in the negative Y direction, velocity should be U2).
It compiles but gives wrong results ( I think it is because the asked U value is not the velocity vector of the cell just above the boundary?)


Code:
void Foam::myInletOutletWithNormalVel::updateCoeffs() // 
{
    if (updated())
    {
        return;
    }

    const fvPatchVectorField& Up =
        patch().lookupPatchField<volVectorField, vector>(UName_);     //searches value of U
 
    scalarField normal = Up.component(1);       
    scalarField valueFraction =(1-pos((normal)));           

   vectorField::operator=(valueFraction*U1_ + (1.0 - valueFraction)*U2_); //
 
    fixedValueFvPatchVectorField::updateCoeffs();

}
Could someone with some more C++ experience help me out and say what I am doing wrong ?

Thank you!!!
james91 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
How to plot average velocity vs direction vector in fluent hamidhamidhamidhamidhamid FLUENT 0 January 1, 2013 15:13
producing an uniform velocity vector plot phsieh2005 OpenFOAM Post-Processing 0 July 20, 2012 14:52
Results of CFX Simulations Sof_70_Usthb CFX 3 July 9, 2011 07:15
FIDAP/ FIPOST - velocity vector plot question ???? Vitaliy Pavlyk FLUENT 1 April 18, 2001 16:04


All times are GMT -4. The time now is 16:45.