CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   boundary condition: alpha*dp/dt = u&n (

andyru July 22, 2013 05:39

boundary condition: alpha*dp/dt = u&n
Dear Foamers,

normally, on wall boundaries for example, we must guarantee:

0 = U&n
where U is the velocity vector and n is the patch normal surface vector,
and the inner product has to be zero.
On a specific patch, I impose a diriclet boundary condition for the pressure.
For the velocity, I want to have:

alpha*dp/dt = U*n
I'm thinking about treating this patch as a modified free slip wall, but I'm wondering, how I can impose that mentioned boundary condition for U.
A slip wall uses in the end the basicSymmetryFvPatchField method, resulting in 0 = u&n

tmp<vectorField> nHat = this->patch().nf();
00117    const Field<Type> iF(this->patchInternalField());
00119    Field<Type>::operator=
00120    (
00121        (iF + transform(I - 2.0*sqr(nHat), iF))/2.0
00122    );
00124    transformFvPatchField<Type>::evaluate();

For example if the cell value next to patch face is in 2D:
if=(1 1)
and nf is normal patch face vector pointing outward with
nf=(0 1)
Then evaluate returns a vector
(1 0)
resulting from,
((1 1) + transform([1 0;0 1] - [0 0 ;0 2],(1 1)])/2
And then
n&U is zero, hence 0=1*0+0*0
0 = U&n is fullfilled.

But how can

alpha*dp/dt = U*n
be achieved?

Any help will be appreciated!

Best regards,


andyru July 23, 2013 05:59

After a long night... direction mixed boundary condition approach, maybe?!

here my update, maybe things become clearer:

since I want to impose

alpha*dp/dt = U*n
where alpha*dp/dt represents a velocity term for that boundary in normal direction to that face, I was digging in under
where I found directionMixedFvPatchField.C

If I understand it right:
For a vector (like in my case it is velocity U), this boundary condition is decomposed into the normal and tangential component.

I have to set three reference values for that boundary condition (good description under
1) refValue = which will be the value on face in normal direction
2) refGradient = will be enforced in the patch tangential direction
3) valueFraction = which is the symmetrical Tensor, which I have to define for transformation purposes

I think this b.c. is a good starting point for manipulating my boundary condition for U...

Best regards,


All times are GMT -4. The time now is 05:59.