|
[Sponsors] |
March 9, 2014, 12:02 |
New BC: problems with asking velocity vector
|
#1 |
New Member
James B
Join Date: Oct 2013
Posts: 4
Rep Power: 13 |
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(); } Thank you!!! |
|
|
|
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 |