|
[Sponsors] |
[swak4Foam] groovyBC: using gradientExpression instead of valueExpression |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 29, 2011, 12:03 |
groovyBC: using gradientExpression instead of valueExpression
|
#1 |
New Member
Gregory N de Boer
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
Hello,
I am attempting to emulate a BC using groovyBC. I require pure Neumann BC's and so I believe I should employ gradientExpression rather than valueExpression? By simply changing fractionExpression simply to "0" does this mean I do not need to specify valueExpression given what is mentioned here about the use of valueExpression and value? http://openfoamwiki.net/index.php/Co...s_in_the_patch As in I specify the gradient at the boundary and let the value be solved for (initialised with uniform 0 or whatever). Any help would be very much appreciated. Cheers, Greg |
|
December 29, 2011, 15:23 |
|
#3 |
New Member
Gregory N de Boer
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
I require near-periodicity, that is very similar to a cyclic BC but with a specified pressure difference across the domain.
|
|
December 29, 2011, 18:42 |
|
#5 |
New Member
Gregory N de Boer
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
It seems to me that the cyclic fan applies the pressure difference across a patch given what I've read here:
http://www.tfd.chalmers.se/~hani/kur...ningReport.pdf I require the pressure difference from inlet to outlet across the domain not at a specific location. The flow in my problem is driven by a moving wall where the pressure and velocity profiles are specified at inlet or outlet as a result of periodicity and a pressure difference. Can I achieve this with cyclic fan BC's at both inlet and outlet? |
|
December 29, 2011, 19:22 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
The business with value vs valueExpression was a bit confusing in the section you mentioned due to a misformatting. Basically value is only used as a standin in certain situations where for technical reasons valueExpression can't be used |
||
December 29, 2011, 21:52 |
|
#7 |
New Member
Gregory N de Boer
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
Excellent, thanks.
Does this mean that when using gradientExpression the variable specified by value is the gradient for the 1st iteration or the actual value for the 1st iteration? I require zero here in either case so probably best to leave out value unless I get an fpe? |
|
December 30, 2011, 03:13 |
|
#8 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
when you specify a fan boundary condition, you have to specify the neighbor patch for each of the patch you have declared as fan. Eg:
inlet { type cyclic; nFaces 240; startFace 62080; matchTolerance 0.0001; neighbourPatch outlet; } outlet { type cyclic; nFaces 240; startFace 62320; matchTolerance 0.0001; neighbourPatch inlet; } It will then apply whatever pressure drop you mention between inlet and outlet. i.e Poutlet-Pinlet = specified value. So I believe fan BC should serve your purpose even though the two patches are separated by a distance. |
|
December 30, 2011, 07:38 |
|
#9 |
New Member
Gregory N de Boer
Join Date: Dec 2011
Posts: 12
Rep Power: 14 |
Thanks for the reply, unfortunately I need more control over the solution than the cyclic fan BC seems to provide. Probably should have mentioned that I am looking into a Fluid Structure Interaction problem where eventually I will be scaling velocities at inlet and outlet according to strain (deformation). Effectively I need access to the nodal values of velocity and pressure at inlet and outlet so that I can apply my CFD BC's. This is the reason for my enquiries into groovyBC.
|
|
January 1, 2012, 18:08 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
September 13, 2013, 05:01 |
|
#11 | |
Member
Join Date: Jun 2011
Posts: 80
Rep Power: 15 |
Quote:
I had a look into the Examples/groovybc folder looking for an example of gradientExpression but I did not find anything that helps... the point is I would like to set the next BC: "normal()&grad(J)=-h&k", being h and k vectors. Up to the moment I tried unsuccessfully: Code:
type groovyBC; variables "gradJ=grad(J);"; gradientExpression "normal()&gradJ+h&k"; value uniform 0; fractionExpression "0"; Best! Last edited by maalan; September 17, 2013 at 06:28. |
||
September 16, 2013, 16:11 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Hold on: "grad(J)". That works? Anyway. The thing you want (gradient of J in normal direction) would be done better with "snGrad(J)"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
September 17, 2013, 04:18 |
|
#13 | |
Member
Join Date: Jun 2011
Posts: 80
Rep Power: 15 |
Quote:
Thanks in advance!! Best! |
||
September 17, 2013, 06:26 |
|
#14 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
September 20, 2013, 07:08 |
|
#15 |
New Member
kob
Join Date: Nov 2011
Posts: 28
Rep Power: 15 |
Hello everyone
I need set a boundary condition similar to maalan's: Code:
"normal()&grad(J)=-h&k", being h and k vectors. Up to the moment I tried unsuccessfully: Code: type groovyBC; variables "gradJ=grad(J);"; gradientExpression "normal()&gradJ+h&k"; value uniform 0; fractionExpression "0"; Code:
d(ephi)/dn=(U^M)&n I set it as: Code:
Outlet { type groovyBC; gradientExpression "gradephi"; variables "gradephi=(U^M)&normal();"; value uniform 0; fractionExpression "0"; } I think the problem lies at this boundary condition because when I change the boundary condition to : Code:
outlet { type zeroGradient; } I am not sure can I set the boundary using GroovyBC since U is a variable I need solve. Thank you for your suggestion! regards! bryant |
|
September 20, 2013, 09:03 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
Tags |
groovybc, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC for oscillatory flow | liybzd | OpenFOAM Community Contributions | 5 | November 12, 2018 08:53 |
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam | dani2702 | OpenFOAM Community Contributions | 0 | November 17, 2016 04:30 |
[swak4Foam] groovyBC - non uniform gradient problem | marluc | OpenFOAM Community Contributions | 0 | May 5, 2015 17:40 |
[swak4Foam] nonuniform "valueExpression" in groovyBC | Thamali | OpenFOAM Community Contributions | 2 | October 11, 2014 12:16 |
[swak4Foam] Boundary condition with a non-uniform gradient - groovyBC? | STiss | OpenFOAM Community Contributions | 3 | October 11, 2013 03:04 |