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

directionMixed b.c

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2009, 01:04
Post directionMixed b.c
  #1
New Member
 
Alessio Alexiadis
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 15
Rep Power: 17
sersunzo is on a distinguished road
Hi everybody,

I try to figure out the use of directionMixed b.c.

I want a b.c. with the normal velocity =0 and the tangential velocity zeroGradient.
The way I understood the directionMixed is something like this

type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (0 0 0);
valueFraction 1;
value uniform (0 0 0);

the refValue=uniform (0 0 0) means that I want a 0 normal velocity
the refGradient=uniform (0 0 0) means that I want a 0 gradient normal velocity
the valueFraction=1 means that the way I mix the two previous b.c (in my case only the first apply, if it were valueFraction=0 would be only the second)
The value=uniform (0 0 0) specify what to do with the gradient of the tangential component, no mixing this time only the gradient.

Thus I have three points
1) Is it correct my understanding?
2) There is a mistake somewhere, because the solver complains about the valueFraction 1; "Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 51 the label 1" Line 51 is valueFraction 1. But I do not understand what it is happening;why is it expected a '(' valueFraction is not a scalar?
3) There is another way for forcing a 0 normal velocity plus a zeroGradient tangential velocity?

Thanks in advance
Alessio
sersunzo is offline   Reply With Quote

Old   April 15, 2009, 11:43
Default same problem!
  #2
New Member
 
remi de reynal
Join Date: Apr 2009
Location: ottawa
Posts: 8
Rep Power: 17
remi is on a distinguished road
Hello sersunzo!

I am actually facing the exact same problem, with the very same answer from the compiler...
In addition to the questions you just asked, could someone please tell if the refValue can be accessed and changed during runtime?

Thank you very much in advance!
remi is offline   Reply With Quote

Old   April 16, 2009, 15:28
Default
  #3
New Member
 
remi de reynal
Join Date: Apr 2009
Location: ottawa
Posts: 8
Rep Power: 17
remi is on a distinguished road
Hi everybody!

I just realized, after many tries, that the acceptable syntax for valueFraction in directionMixed b.c seems to be a symmetric tensor, ie six components between brackets.
The question following this discovery is: why is it so, and what do the component stand for?
My goal is to have a fixedValue bc on the normal component of velocity, and a zeroGradient on the tangential component.
Thanks for any hint one may have!

By the way, happy easter to all!
remi is offline   Reply With Quote

Old   April 17, 2009, 13:44
Default
  #4
New Member
 
Alessio Alexiadis
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 15
Rep Power: 17
sersunzo is on a distinguished road
Hi remi,

I believe that the following syntax would give a 0 normal velocity with 0 gradient in the tangential direction

top
{
type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (0 0 0);
valueFraction (0 0 0 1 1 1);
value uniform (0 0 0);
}

This is just an empirical observation. I still did not get the answers to my previous questions.

Ciao
Alessio
sersunzo is offline   Reply With Quote

Old   April 17, 2009, 14:17
Default
  #5
New Member
 
remi de reynal
Join Date: Apr 2009
Location: ottawa
Posts: 8
Rep Power: 17
remi is on a distinguished road
Thank you Alessio!

I managed to get the desired behaviour (fixedValue for normal component, zero gradient for the rest) by putting valueFraction=(1 0 0 0 0 0).
Very empirical as well....
Struggling to modify the refValue during runtime, the syntax is opaque to me!

Good luck for your simulation!
cheers,

remi
remi is offline   Reply With Quote

Old   April 17, 2009, 18:09
Default
  #6
New Member
 
Alessio Alexiadis
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 15
Rep Power: 17
sersunzo is on a distinguished road
Strange...
with your settings I get exactly the opposite. The tangential velocity is zero, the normal is not zero (and I suppose grad=0).
In my case the normal velocity is Vx. I do not know if it makes any difference tough...

Alessio
sersunzo is offline   Reply With Quote

Old   April 21, 2009, 10:16
Default modify refValue for directionMixed?
  #7
New Member
 
remi de reynal
Join Date: Apr 2009
Location: ottawa
Posts: 8
Rep Power: 17
remi is on a distinguished road
Thank you Alessio for the fast answer!
however, there is a problem to modify the boundary value of Ux velocity on runtime.
When doing U.boundaryField()[inletPatchID][faceI].component(0)= new value, you can check on the output file that the "value" part of directionMixed has been changed.
Nevertheless, it's got no impact at all on the value Ueqn is gonna solve for...

And i tried something like:

directionMixedFvPatchField& buffer=
refCast<directionMixedFvPatchField>(U.boundaryFiel d()[inletPatchID]);

scalarField& Ux = buffer.refValue().component(0);

but it doesn't compile....

good luck for you and thanks for your help!
remi is offline   Reply With Quote

Old   April 24, 2009, 10:43
Default modifying refValue for directionMixed
  #8
New Member
 
remi de reynal
Join Date: Apr 2009
Location: ottawa
Posts: 8
Rep Power: 17
remi is on a distinguished road
Hello all!

Finally the correct syntax to access the refValue of a directionMixed bc during runtime is through casting, by the following piece of code:

directionMixedFvPatchVectorField& buffer= refCast<directionMixedFvPatchVectorField>(U.bounda ryField()[f_in]);
vectorField& U_refValue = buffer.refValue();


then it seem to take a loop over the patch face to modify the values:

forAll (directionMixedPatchID, faceI)
{U_refValue[faceI]= whatever vector;}


Goodbye!
remi is offline   Reply With Quote

Old   September 9, 2009, 07:56
Default
  #9
New Member
 
Wolfgang Betz
Join Date: Mar 2009
Posts: 6
Rep Power: 17
wbetz is on a distinguished road
Hi,

if you want to set a fixed value for normal velocity and a fixed gradient in the tangential direction, the tensor of valueFraction is the outer product of the unit vector normal to the boundary with itself.
wbetz is offline   Reply With Quote

Reply

Tags
directionmixed


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
Confusion between 'non-slip' and 'slip' B.C jinwon park Main CFD Forum 7 March 6, 2008 04:56
how to set such B.C. in Fluent? Sherri FLUENT 1 January 12, 2006 12:32
Urgent! Help on UDF to set B.C. of 3rd type Ray Hong FLUENT 0 December 28, 2005 19:35
How to set B.C. of the 2nd or 3rd type in UDS? Ray Hong FLUENT 0 December 28, 2005 06:03
Non-Reflecting B.C. in NSC2KE Zou Chu Main CFD Forum 2 May 27, 1999 21:26


All times are GMT -4. The time now is 17:27.