CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

DirectionMixed mixed bc

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

Like Tree28Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   December 12, 2005, 14:33
Default Hi, all! I've got a questio
  #1
Member
 
Efimenko Evgenii
Join Date: Mar 2009
Location: Nizhnij Novgorod, Russia
Posts: 52
Rep Power: 8
evgenii is on a distinguished road
Hi, all!

I've got a question about directionMixed or mixed b.c.
I don't understand how to use it, because I need to specify four values:
refValue
refGradient
valueFraction
value
I haven't met any description of it neither in Programmers Guide, neither in Users Guide(only very brief).
I'll be very grateful if one can give me advice.
Thank you
evgenii is offline   Reply With Quote

Old   December 12, 2005, 18:16
Default Ok, here goes: 1) a mixed b
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Ok, here goes:

1) a mixed boundary condition is a combination of a fixedValue and a fixedGradient boundary condition, controlled by the valueFraction variable.

For valueFraction = 1, the mixed b.c. behaves as fixedValue; for valueFraction = 0 you get the fixedGradient. Values in between are a blend of the two.

2) The mixed b.c. is therefore specified by three fields:

- a refValue field, giving the valud for the fixedValue part
- a refGrad field, giving the gradient for the fixedGradient part
- a valueFraction, telling the mixed b.c. what to do.

So far, so good.

For vectors and tensors in the mixed b.c., the "mix" will be the same on all components of a vector or a tensor.

3) the directionMixed boundary condition is done along the same lines, but it also allows the directional decomposition. Thus, for a vector, the b.c. is decomposed into the normal and tangential component.

For the normal component, the directionMixed b.c. behaves like the mixed condition (above), but only on the normal component. For the tangential component, the condition is always a fixedGradient b.c.

Finally, the value part of the b.c. codes in the current boundary value.

4) If this is not enough for you (there is another possibility), I have written a newDirectionMixedFvPatchField boundary condition, with 4 components. Unlike the above one, this b.c. allows both the normal and tangential condition to be mixed separately between the fixedValue and fixedGradient b.c. with two blending factors. You need this kind of thing for contact problems with friction and large deformation and similar. In my version, the stuff lives in:

OpenFOAM-1.2/applications/solvers/newStressAnalysis/materialModels/newDirectionM ixed

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 15, 2005, 06:18
Default Thank you so much for such a d
  #3
Member
 
Efimenko Evgenii
Join Date: Mar 2009
Location: Nizhnij Novgorod, Russia
Posts: 52
Rep Power: 8
evgenii is on a distinguished road
Thank you so much for such a detailed answer!
I realise that I need 4th possibility, I mean to set conditions on normal and tangential components separately. Unfortunately I don't have the directory you've mentioned. Maybe because I have an old version of OpenFoam. Where can I find this files?

Thank you, Eugene
evgenii is offline   Reply With Quote

Old   February 25, 2009, 06:17
Default Hi..guys, I have a fixed grid
  #4
Member
 
Join Date: Mar 2009
Posts: 39
Rep Power: 8
mehulkumar is on a distinguished road
Hi..guys,
I have a fixed grid over an airfoil naca0012 in o-topology in circular domain.

I want to specify boundary condition farField kind, so depending the velocity with angle of attack, it should decide the inlet and outlet for the case.

I found that patch -> mixed / directionMixed type can help me in such case.

Can you give me suggestion?

Thanks...
mehulkumar is offline   Reply With Quote

Old   February 26, 2009, 08:58
Default Hi ..guys...pls help...I am st
  #5
Member
 
Join Date: Mar 2009
Posts: 39
Rep Power: 8
mehulkumar is on a distinguished road
Hi ..guys...pls help...I am stuck here.
I am not getting how to use these BCs.
Pls guide me.

Thanks
mehulkumar is offline   Reply With Quote

Old   April 15, 2010, 06:28
Default
  #6
Member
 
Francois Gallard
Join Date: Mar 2010
Location: Edinburgh
Posts: 39
Rep Power: 7
fgal is on a distinguished road
Hi,
Is it possible to force zeroGradient and a fixedValue for the temperature field in an inlet for example?
Because I would like to prevent the energy flux go out through a fuel inlet for a combustion and fo fix the temperature of the inlet gases.
Thanks

Francois
mm.abdollahzadeh likes this.
fgal is offline   Reply With Quote

Old   August 17, 2010, 13:54
Default
  #7
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi all,
Could anyone of you give me an example of usage directionMixed type boundary condition ?
I would like to see exemplary syntax .
I tryied for example like that:
{
type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (1000 0 0);
valueFraction 1;
value uniform (1000 0 0);
}

but I got error .

Thanks
ziemowitzima is offline   Reply With Quote

Old   August 19, 2010, 05:33
Default
  #8
New Member
 
pop
Join Date: Feb 2010
Posts: 11
Rep Power: 7
poplar is on a distinguished road
Quote:
Originally Posted by ziemowitzima View Post
Hi all,
Could anyone of you give me an example of usage directionMixed type boundary condition ?
I would like to see exemplary syntax .
I tryied for example like that:
{
type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (1000 0 0);
valueFraction 1;
value uniform (1000 0 0);
}

but I got error .

Thanks

Hi,ziemowit
valueFraction must be symmTensorField, not a scalar.


I have a question on Hrvoje's comment that " For the normal component, the directionMixed b.c. behaves like the mixed condition (above), but only on the normal component.". In directionMixedFvPatchField.C:
....
normalValue = transform(valueFraction_, refValue_);
gradValue = pif + refGrad_/this->patch().deltaCoeffs();
transformGradValue = transform(I - valueFraction_, gradValue);
return (normalValue + transformGradValue - pif)*this->patch().deltaCoeffs();
........

From above codes, normalValue is a vector component normal to transformGradValue. So the normalValue is not normal to B.C., is it right?

and in pressureInletOutletVelocityFvPatchVectorField.C which is derived from directionMixed:
........
valueFraction() = neg(phip)*(I - sqr(patch().nf()));
........
normalValue = transform(valueFraction(), refValue());
transformGradValue = transform(I - valueFraction(), pvf);
operator=(normalValue + transformGradValue);
........

So the valueFraction() is a tensor to calculate the component normal to nf(). Then normalValue[=refV-(n & refV)*n=(I-nn)*refV] is normal to nf() and transformGradValue[=nn*pvf=(n & pvf)*n] is parallel to nf()?

"normalValue" give me the first guess is that it is normal to B.C., but now I am confused by above codes. If "normalValue" is not normal to B.C., then what does tangentialVelocity mean? tangential to nf()?

in pressureInletOutletVelocityFvPatchVectorField.C:
setTangentialVelocity(const vectorField& tangentialVelocity)
{
tangentialVelocity_ = tangentialVelocity;
vectorField n = patch().nf();
refValue() = tangentialVelocity_ - n*(n & tangentialVelocity_);
}

These codes let me confused. If tangentialVelocity_ is tangential to B.C., then it normal to n, so (n & tangentialVelocity_) should be zero. one gets refValue() = tangentialVelocity_. If tangentialVelocity_ is tangential to n, n*(n & tangentialVelocity_) = tangentialVelocity_, then one gets refValue() = 0.

Briefly,my question is:
normalValue is normal to which one, nf() or B.C.?
mm.abdollahzadeh likes this.

Last edited by poplar; August 19, 2010 at 05:58.
poplar is offline   Reply With Quote

Old   September 29, 2010, 08:36
Post help
  #9
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
hi,
what if i need to apply a certain value of a VectorField on one direction only, let's say if:

volVectorField V;

and i need to apply a BC where Vy =0 only;
????


help please
T.D. is offline   Reply With Quote

Old   October 1, 2010, 03:21
Default
  #10
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi TD,
U can use DirectionMixed bc.
here u have working example:

patch_name
{


type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (1000 0 0);
valueFraction uniform (0 0 0 0 0 1);
}

here it means that bc are as follows v=(v1,v2,v3):
1) dv1/dz = 1000 (v1 is tangent vector component to the boundary and z is normal direction to the boundary),

2) dv2/dz = 0 (v2 is second tangent vector component to the boundary and z is normal direction to the boundary)

3) v3=0 (v3 is normal vector component, dirichlet type bc).

In general you have 3 directions and 3 vector component, thats why there is tensor:
valueFraction uniform (0 0 0 0 0 1)

Best
ZM
ziemowitzima is offline   Reply With Quote

Old   October 1, 2010, 04:40
Default
  #11
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
Quote:
Originally Posted by ziemowitzima View Post
Hi TD,
U can use DirectionMixed bc.
here u have working example:

patch_name
{


type directionMixed;
refValue uniform (0 0 0);
refGradient uniform (1000 0 0);
valueFraction uniform (0 0 0 0 0 1);
}

here it means that bc are as follows v=(v1,v2,v3):
1) dv1/dz = 1000 (v1 is tangent vector component to the boundary and z is normal direction to the boundary),

2) dv2/dz = 0 (v2 is second tangent vector component to the boundary and z is normal direction to the boundary)

3) v3=0 (v3 is normal vector component, dirichlet type bc).

In general you have 3 directions and 3 vector component, thats why there is tensor:
valueFraction uniform (0 0 0 0 0 1)

Best
ZM
hi thanks a lot,
but can you specify please what each term means and inside brackets in
refValue uniform (0 0 0);
refGradient uniform (1000 0 0);
valueFraction uniform (0 0 0 0 0 1);

why dv1/dz=1000 ? shouldn't be dv1/dx=1000 ?

help

thanks
T.D. is offline   Reply With Quote

Old   October 1, 2010, 08:34
Default
  #12
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi,
This was just example I used to work with.
It could be dv1/dx as well, depending what ones need.
for detailed description see hjasak post at the top.

ZM
ziemowitzima is offline   Reply With Quote

Old   October 1, 2010, 10:37
Smile thanks
  #13
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 193
Rep Power: 6
T.D. is on a distinguished road
thanks a lot
T.D. is offline   Reply With Quote

Old   November 4, 2010, 20:08
Default
  #14
New Member
 
Amin
Join Date: Oct 2010
Location: Notre Dame, US
Posts: 6
Rep Power: 6
AcfdO is on a distinguished road
Hi everyone,

I have read all the posts but I am still confused about mixed and directionMixed boundary conditions. I would be grateful if anyone could help me understand this matter by simply give an example about how I can set only du/dy=0 (I don't want to set other gradients to zero)
velocity field is ( u, v,w)
direction is: (x,y,z)
Thank you
Amin
AcfdO is offline   Reply With Quote

Old   July 14, 2011, 08:35
Default directionMixed b.c.
  #15
New Member
 
G.Paulo
Join Date: Jul 2011
Location: Delft, Netherlands
Posts: 4
Rep Power: 6
gpextra is on a distinguished road
Dear Foamers,

During the last two days I have intensively struggled to understand the role of the valueFraction keyword in the directionMixed boundary condition. I have read all the posts about it, I have run several cases with the most diverse situations but no, the role of each one of the 6 components of valueFraction remains a mystery.

Posts from Jasak and Malecha, above, have been of great help, but did not entirely clarified the matter. Also similar requests from other users have been systematically ignored.

So, is it possible to someone kindly post exactly how this tensor-like valueFraction should be set for any case? Or, in other words, which values correspond to the normal component, which correspond to the tangential components?

To be even more specific, my case is of an impermeable wall (zero normal velocity) but with a given shear-stress (i.e., given velocity gradient). During my several tries I noticed that, even when the results seem to be +/- correct, there are streamlines dying at and originating from the wall, which is unexpected.

Regards.
G.Paulo.
gpextra is offline   Reply With Quote

Old   July 14, 2011, 13:57
Default
  #16
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 568
Rep Power: 19
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi G. Paulo,


I occasionally use directionMixed for stress simulations where I want a fixedValue (displacement) in the patch normal direction and some fixedGradient (traction) in the patch tangential direction.

So to achieve a fixedValue in the normal direction, and a fixedGradient in the tangential direction on a patch, then the valueFraction (which is a symmTensor, where the components of a symmTensor are (xx xy xz yy yz zz) ) should be set:
valueFraction = symm(n*n)
where n is the patch normal.

If your patch faces all have the same normal then you can calculate symm(n*n) by hand and put it in your initial conditions, eg:
for a patch with n = ( 1 0 0 )
then the valueFraction = symm( (1 0 0)(1 0 0) ) = ( 1 0 0 0 0 0)
then refValue will be enforced in the patch normal direction and refGradient will be enforced in the patch tangential direction.

If your patch faces have all different normals then you will have to set the patch valueFraction in the solver (using refCast etc.) to be symm(n*n).

So to sum up, if you want a fixedValue in the patch normal direction and a fixedGradient in the patch tangential direction then it looks like this:
refValue uniform (fixed_value_you_want)
refGradient uniform (shear_gradient_you_want)
valueFraction uniform (symm(n*n))

directionMixed can also be used for other situations:
it can act just like a fixedValue BC if valueFraction = (1 0 0 1 0 1),

Or, it can act just like a fixedGradient BC if valueFraction = (0 0 0 0 0 0).

If you look at the directionMixed BC source code, you can see it calculates it.


Hope it helps,
Philip
ubald, sina.s, songwukong and 2 others like this.
bigphil is offline   Reply With Quote

Old   July 15, 2011, 02:40
Default directionMixed b.c.
  #17
New Member
 
G.Paulo
Join Date: Jul 2011
Location: Delft, Netherlands
Posts: 4
Rep Power: 6
gpextra is on a distinguished road
Thank you for your post, Philip. Things are clear now.

G.Paulo.
gpextra is offline   Reply With Quote

Old   October 19, 2011, 23:46
Default
  #18
Member
 
ubald's Avatar
 
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 47
Rep Power: 8
ubald is on a distinguished road
Hi Philip, Thank you for your great post. I would like to fix different gradient value on each tangential direction. Is it possible to do that with directionMixed or an other tool in OpenFoam. Or should I make a new mixed boundary condition to do something like this ??

Or maybe, I just need to change the value of refGradient to achieve this.

Thanks in advance for the answer

Nicolas L.
ubald is offline   Reply With Quote

Old   October 20, 2011, 05:58
Default
  #19
Senior Member
 
bigphil's Avatar
 
Philip Cardiff
Join Date: Mar 2009
Location: Dublin,Ireland
Posts: 568
Rep Power: 19
bigphil will become famous soon enoughbigphil will become famous soon enough
Hi Nicolas,

Yes it is possible, using directionMixed, to give every face on a boundary patch a different gradient in the tangential direction. I would do something like this in a header file at the start of a time-step (although it might be possible to use groovyBC but I am not sure):

Code:
label patchID = mesh.boundaryMesh().findPatchID("patchOfInterest");
if(patchID == -1)
 {
    Info << "patch not found" << endl;
    return 0;
 }

directionMixedFvPatchVectorField& Upatch =
        refCast<directionMixedFvPatchVectorField>
        (
         U.boundaryField()[patchID]
         );

//- patch face normals      
vectorField n = mesh.boundary()[loadingIndex].nf();
      
//- set value fraction so as to have fixed value in patch normal direction
Upatch.valueFraction() = symm(n*n);

//- set fixed value
Upatch.refValue() = vector (0, 0, 0); //- put what ever vectorField you want here

//- set fixed gradient (as a function of position and time as an example)
const vectorField& patchFaceCentres = mesh.boundaryMesh()[patchID].faceCentre();
Upatch.refGradient() = patchFaceCentres * runTime.value();
By the way, "U" is my solution variable above.

Hope this helps,
Philip
ubald and mm.abdollahzadeh like this.
bigphil is offline   Reply With Quote

Old   October 20, 2011, 09:59
Default
  #20
Member
 
ubald's Avatar
 
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 47
Rep Power: 8
ubald is on a distinguished road
Thank you for the fast answer. I will try it in a new Boundary condition. Base on directionMixed this is very nice of you.

An other question: In the constructors is it possible to call the "grand mother" constructor instead of the mother constructor in order to fix a default value for the mother class ???

For example in a class that depend on fixed Gradient I put

fvPatchFieldScalar(p, iF, dict),
gradient_(dict.lookupOrDefault<scalar>("gradient",0))

instead of

fixedGradientFvPatchScalarField(p, iF, dict),

in one of the constructor.

Regards

Last edited by ubald; October 20, 2011 at 10:27.
ubald is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mixed difference Shuo Main CFD Forum 1 September 3, 2008 01:25
mixed convection sumesh FLUENT 0 March 7, 2008 01:00
Mixed CPU/GPU computing Joe Main CFD Forum 4 September 20, 2006 12:04
Direction mixed bc evgenii OpenFOAM Pre-Processing 1 November 30, 2005 05:37
mixed convection raj calay Main CFD Forum 6 April 21, 1999 22:33


All times are GMT -4. The time now is 21:12.