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

Boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By herbert

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2010, 03:35
Default Boundary condition
  #1
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 16
OFU is on a distinguished road
Hi all,

For my computations I need to specify a special boundary condition for U at the inner wall, so that I can set Ux and Uy to fixedValue and Uz to zeroGradient. But a I don't have experience in creating new boundary conditions, so at the moment I don't know how to realize this. I found something to read about creating new boundary conditions but nothing about boundary conditions which allow to specify a value for each of the three components of U. Can somebody help me? Or is there already such a boundary condition in OF 1.6?

Thanks,
Jennifer
OFU is offline   Reply With Quote

Old   April 21, 2010, 11:10
Default
  #2
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Jennifer,

I think the directionMixedBC should be able to do this job.

Good luck
Stefan
herbert is offline   Reply With Quote

Old   April 22, 2010, 09:46
Question
  #3
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 16
OFU is on a distinguished road
Hi Stefan,

thanks for your answer. I had a look on directionMixed BCs, but now I don't understand how to use them
Can you perhaps give me an example or explain me how to use this boundary condition?

Jennifer
OFU is offline   Reply With Quote

Old   April 22, 2010, 10:18
Default
  #4
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Jennifer,

this boundary condition is a blending between fixedValue and fixedGradient. The syntax is as follows
Code:
type              directionMixed;
refValue         uniform (ux uy uz);
refGradient     uniform (dUx dUy dUz);
valueFraction  uniform (XX XY XZ YY YZ ZZ);
Meaning of the single terms:
refValue: components of U needed for fixedValue
refGradient: components of gradient needed for fixedGradient
valueFraction: symmetric tensor which indicates if BC for a component is fixedValue (1) or fixedGradient (0)


An easy example: Think about an outlet where you want the normal component of U (e.g. z-Direction) to be zeroGradient but the other components to be zero. Then the syntax is:
Code:
type              directionMixed;
refValue         uniform (0 0 0);
refGradient     uniform (0 0 0);
valueFraction  uniform (1 0 0 1 0 0);
I hope everything's clear now

Good luck
Stefan
utkunun likes this.
herbert is offline   Reply With Quote

Old   July 15, 2010, 10:30
Default directionMixed for symmTensor
  #5
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 16
theory37 is on a distinguished road
Stefan,

Thank you for this concise explanation of directionMixed. I am having some difficulty understanding how this boundary condition might be applied to a symmetric tensor. I'd like to be able set certain components of the tensor to be zeroGradient in the normal direction (Y, in my case), while setting the rest of the components to be fixedValue. I've tried several different variations and searched the forums with little success.

Say I want the XY, YY, and YZ components of my symmTensor to have a fixedValue of 7, while the XX, XZ, and ZZ be zeroGradient. Supposing my tensor started as
Code:
[1 1 1    1 1    1]
for my entire domain. I first tried something like this:
Code:
    
    type            directionMixed;
    refValue        uniform ( 7 7 7   7 7   7 );
    refGradient     uniform ( 0 0 0   0 0   0 );
    valueFraction   uniform ( 0 1 0   1 1   0 );
This yields
Code:
[7 21 7     67 21    7]
when I would have expected
Code:
[1 7 1    7 7    1]
Obviously I am missing something here. I am also confused about why refValue has 6 components rather than just one - I want to set each individual tensor component to one value, not an entire tensor. I've tried several other variations with equally strange results.

Is this even possible to do in the current implementation of directionMixed?

Thank you in advance,

Mike

P.S. - I tried this with a vector and it worked brilliantly:
Code:
    
    type           directionMixed;
    refValue       uniform ( 7 7 7 );
    refGradient    uniform ( 0 0 0 );
    valueFraction  uniform ( 1 0 0 0 0 1 );
If my vector began as [1 1 1] (for the entire domain), this yielded the expected [7 1 7].

Last edited by theory37; July 15, 2010 at 11:18. Reason: Added steps taken and info about vector
theory37 is offline   Reply With Quote

Old   July 15, 2010, 13:23
Default Answered my own question, sort of
  #6
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 16
theory37 is on a distinguished road
After digging in to /src/OpenFOAM/primitives/transform/symmTransform.H I discovered that, when operating on a symmTensor, this boundary condition does the following:

For given symmTensors valueFraction, refValue, and refGradient along with the value of the symmTensorField at this patch ( this->patchInternalField(), which I'll call R for short ), directionMixed will return
Code:

  R(at the boundary patch) = 
  [ valueFraction & refValue & valueFraction.T() ] 
+ [ (I - valueFraction) & gradValue & (I - valueFraction).T() ]
with
Code:
gradValue = R(internalField) - refGradient / dx
with dx being the distance the gradient is calculated over, and of course T() being the transpose and & the inner product.

So, this explains the unexpected results above, but still leaves me wondering if it is possible to achieve the BC I need without writing my own. Any suggestions?
theory37 is offline   Reply With Quote

Old   June 27, 2011, 11:53
Default
  #7
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 16
theory37 is on a distinguished road
UPDATE: It turns out that it is not possible (to my knowledge) to achieve the desired BC using mixedDirection. I am now working on "groovifying" this BC to extend its functionality.

Mike
theory37 is offline   Reply With Quote

Reply


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
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 05:05
How exactly the "pressure outlet" bdry condition compute properties on the boundary? yating9901 FLUENT 3 June 28, 2010 12:26
Transient outlet boundary condition problem jwillie2000 CFX 1 December 7, 2009 17:07
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 11:44
How to resolve boundary condition problem? sam FLUENT 2 July 20, 2003 02:19


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