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

Boundary Condition: "mixed" calculated and gradient

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

Reply
 
LinkBack Thread Tools 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: 6
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
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 543
Rep Power: 18
chegdan 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

DirectionMixed mixed bc

good luck.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   November 12, 2012, 11:46
Default
  #3
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
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
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 543
Rep Power: 18
chegdan 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.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   November 12, 2012, 12:11
Default
  #5
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
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
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 543
Rep Power: 18
chegdan will become famous soon enough
No problem, glad I could help.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   November 20, 2012, 11:57
Default
  #7
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
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
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 543
Rep Power: 18
chegdan will become famous soon enough
The gradient in this BC is in the direction normal to the surface.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   November 20, 2012, 12:11
Default
  #9
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
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
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 543
Rep Power: 18
chegdan will become famous soon enough
The only thing that I know of for changing direction is between normal and tangential direction changed via DirectionMixed mixed bc

and further posts in that thread.

If I think of anything on the subject...I'll post back.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   November 20, 2012, 12:39
Default
  #11
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
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

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
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
Boundary condition with a non-uniform gradient - groovyBC? STiss OpenFOAM Programming & Development 3 October 11, 2013 02:04
help with velocity boundary condition potentialFoam hfc OpenFOAM Running, Solving & CFD 2 May 31, 2012 19:52
Calculated gradient boundary condition similar to gammaContactAngle adona058 OpenFOAM Running, Solving & CFD 0 September 26, 2007 15:23
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 02:54


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