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

Boundary Condition: "mixed" calculated and gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2012, 10:05
Default Boundary Condition: "mixed" calculated and gradient
  #1
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Hi Foamers!

Is it possible to have a boundary condition that combines both, a "calculated" and a gradient (e.g. zero- or fixedGradient) BC?
What I would like to have is, that it "acts" like a calculated BC until a certain value (of a variable within the solver) is reached, and then switch to a gradient BC. And it should also be possible to switch back.

I had a look at the mixed BC as it looked as if it is quite close to what I want, but I do not understand how the "fraction" can be adjusted within the solver. I did not find any helpful explanations.

Thanks in advance for any advices!
Lindstroem
lindstroem is offline   Reply With Quote

Old   November 12, 2012, 10:25
Default
  #2
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Have a look at inletOutlet derived boundary condition. Changing the value fraction from 0 to 1 will do what you would like. And for reference...I would look at

http://www.cfd-online.com/Forums/ope...tml#post185688

good luck.
chegdan is offline   Reply With Quote

Old   November 12, 2012, 11:46
Default
  #3
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Hi chegdan,

thanks for your help! I think I could work directly with the mixed-BC. But I don't get the functions of the BC in my solver.
First I include the Header, then loop through my boundaries until I find my desired patch. Now how can i actually call for example the valueFraction() from the mixedBC? Do I need the "refCast" first?

thanks again in advance
Lindstroem
lindstroem is offline   Reply With Quote

Old   November 12, 2012, 12:09
Default
  #4
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Just as a little tip, I would create a derived class from mixedBC the way inletOutlet is constructed. This way you don't need to mess with the templating and bang your head on the table. I did this about a month ago and it ended up to be really simple if I just made a derived class and derived BC.
chegdan is offline   Reply With Quote

Old   November 12, 2012, 12:11
Default
  #5
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Allright I misunderstood your previous post..

Thanks for sharing your experience!

Greetings!
lindstroem is offline   Reply With Quote

Old   November 12, 2012, 12:56
Default
  #6
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
No problem, glad I could help.
chegdan is offline   Reply With Quote

Old   November 20, 2012, 11:57
Default
  #7
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Hi again,

It's progressing

But one further question: If I want to use the refGradient for a mixedFvPatchScalarField, I need to prescribe a scalar. But how do I interpret this scalar because I would intuitively prescribe a vector..

Thanks!
lindstroem is offline   Reply With Quote

Old   November 20, 2012, 12:08
Default
  #8
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
The gradient in this BC is in the direction normal to the surface.
chegdan is offline   Reply With Quote

Old   November 20, 2012, 12:11
Default
  #9
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
So it can only be fixedValue or a zeroGradient, but not a gradient in any prescribed direction?
lindstroem is offline   Reply With Quote

Old   November 20, 2012, 12:35
Default
  #10
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
The only thing that I know of for changing direction is between normal and tangential direction changed via http://www.cfd-online.com/Forums/ope...tml#post316165

and further posts in that thread.

If I think of anything on the subject...I'll post back.
chegdan is offline   Reply With Quote

Old   November 20, 2012, 12:39
Default
  #11
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 16
lindstroem is on a distinguished road
Ok, thanks again for the quick reply! I'll check if the direction mixed BC could somehow work..

Thanks Dan!
lindstroem 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
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 06:58
[swak4Foam] Boundary condition with a non-uniform gradient - groovyBC? STiss OpenFOAM Community Contributions 3 October 11, 2013 03:04
help with velocity boundary condition potentialFoam hfc OpenFOAM Running, Solving & CFD 2 May 31, 2012 20:52
Calculated gradient boundary condition similar to gammaContactAngle adona058 OpenFOAM Running, Solving & CFD 0 September 26, 2007 16:23
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 02:54


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