# Boundary Condition: "mixed" calculated and gradient

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

 November 12, 2012, 10:05 Boundary Condition: "mixed" calculated and gradient #1 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 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

 November 12, 2012, 10:25 #2 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 581 Rep Power: 20 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

 November 12, 2012, 11:46 #3 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 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

 November 12, 2012, 12:09 #4 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 581 Rep Power: 20 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

 November 12, 2012, 12:11 #5 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 Allright I misunderstood your previous post.. Thanks for sharing your experience! Greetings!

 November 12, 2012, 12:56 #6 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 581 Rep Power: 20 No problem, glad I could help. __________________ Dan Find me on twitter @dancombest and LinkedIn

 November 20, 2012, 11:57 #7 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 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!

 November 20, 2012, 12:08 #8 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 581 Rep Power: 20 The gradient in this BC is in the direction normal to the surface. __________________ Dan Find me on twitter @dancombest and LinkedIn

 November 20, 2012, 12:11 #9 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 So it can only be fixedValue or a zeroGradient, but not a gradient in any prescribed direction?

 November 20, 2012, 12:35 #10 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 581 Rep Power: 20 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

 November 20, 2012, 12:39 #11 Senior Member   Join Date: Nov 2010 Posts: 113 Rep Power: 7 Ok, thanks again for the quick reply! I'll check if the direction mixed BC could somehow work.. Thanks Dan!

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Tom Main CFD Forum 7 August 26, 2014 05:58 STiss OpenFOAM Programming & Development 3 October 11, 2013 02:04 hfc OpenFOAM Running, Solving & CFD 2 May 31, 2012 19:52 adona058 OpenFOAM Running, Solving & CFD 0 September 26, 2007 15:23 Tom Main CFD Forum 0 November 5, 2002 02:54

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