|
[Sponsors] |
December 16, 2010, 07:32 |
groovyBC for coupling of patches
|
#1 |
Member
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 16 |
Hello,
I would like to use groovyBC for a periodic inlet/outlet. I tried the tutorial 4.2.3 on http://openfoamwiki.net/index.php/Contrib_groovyBC. In 0/U phi is taken into account and not U directly. So, I modified the BC to: Code:
inlet { type groovyBC; variables "Uoutlet@outlet=-1*sum(U);"; valueExpression "Uoutlet/sum(mag(Sf()))*normal()"; fractionExpression "1" value $internalField; } outlet { type zeroGradient; } I guess there's something wrong concerning the definition of U=vector and phi. What do I have to change to get the bc running? Thanks for your help, Nico |
|
December 16, 2010, 09:13 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Bernhard |
||
December 22, 2010, 01:09 |
|
#3 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
groovyBC+cyclic patch
hi foamer i have used groovy BC as cyclic patch but i encounter following warning : FOAM Warning : From function PatchResult::getUniformInternal(const label size,bool noWarn) in file PatchResultI.H at line 96 The minimum value -30172 and the maximum 10751.6 differ. I will use the average -22562.9 any one knows whats the problem here ? i have an axiymetric tube with one inlet and one outlet as pressure and tempreture are not cyclic i cant use cyclic boundary condition, another suggestion was direct map boundary condition but it was useless too!!! any suggestion? i want something that work exactly like cyclic boundary condition but i also can change boundary condition for T too? P.S. inlet ----------------------------outlet --------------------------------------- BC : U,alpha are cyclic P are cyclic with pressure jump (pressure gradient is fixed) (dT/dx)inlet = -(dT/dx)outlet |
|
December 22, 2010, 05:46 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
("It is very important to note, that no form of patch-to-patch interpolation of the fields is performed"). This is what the warning is trying to say "I can not emulate a cylic, I only pass averages" So I'm afraid groovyBC can not do what you want to do (I never said that it doesn't have limitations) Bernhard |
||
December 22, 2010, 23:24 |
|
#5 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
hi bernard
as my input and output face and cell are the same i only want a direct map of out let into inlet for u and alpha as the first step so i did: inlet { type groovyBC; variables "alphaOutlet@outlet=alpha1;"; valueExpression "alphaOutlet"; value $internalField; } outlet { type zeroGradient; } but i encounter previous warning, is not possible to do this action with groovyBC? |
|
December 23, 2010, 10:37 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Bernhard |
||
May 7, 2012, 10:54 |
|
#7 |
Member
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 15 |
I have a question about this warning.
What does it actually warn me about? Code:
--> FOAM Warning : From function ExpressionResult::getUniformInternal(const label size,bool noWarn) in file ExpressionResultI.H at line 158 The minimum value (-0.000616714 -0.000208414 0) and the maximum (0.000596458 0.000472639 0) differ. I will use the average (-6.37906e-07 6.94849e-05 0) BC looks like this: Code:
rod1 { type groovyBC; variables "A_rod1a{rod1a}=A;"; valueExpression "A_rod1a"; value $internalField; } rod1a { type zeroGradient; } |
|
May 7, 2012, 15:33 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
"A_rod1a{rod1a}=average(A);" If you need to transfer inhomogenous values then you should consider creating patches as cyclics and either use one of the stock BCs that come with OF or groovyBCJump |
||
May 20, 2012, 12:45 |
|
#9 |
Member
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 15 |
Problem is that there is no simple tutorial how to do this and my skills are so low...
How this groovyBCJump is working? Any example for this? |
|
May 20, 2012, 18:38 |
|
#10 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
It is basically the regular jump-BC but the jumpValue is calculated from an expression. A small demo-case comes with swak under Examples/tests/jumpChannel
|
|
March 11, 2013, 18:04 |
Working with groovyBC jump
|
#11 |
Member
Ronald McDonald
Join Date: Jul 2012
Posts: 38
Rep Power: 14 |
Hi Bernhard,
I looked at some documentation on groovybcjump and it may be what I need. It says this: HTML Code:
**** Boundary condition =groovyBCJump= Boundary condition that imposes a jump in the value on a cyclic boundary condition pair (based on =jumpCyclic=). Only works for scalar values Right now I have this: HTML Code:
bottomcathode { type groovyBCJump; patchType cyclic; jumpExpression "0"; value uniform 0; } Benjamin |
|
March 11, 2013, 18:23 |
|
#12 | |
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 |
||
March 11, 2013, 19:20 |
|
#13 |
Member
Ronald McDonald
Join Date: Jul 2012
Posts: 38
Rep Power: 14 |
Ok, that makes sense. What if I wanted to make a zero flux on both cyclic boundary patches. Anyway to do that? Also, when I assign cyclic am I restricted to only using groovyBCjump or can I use the plethora of groovybc types, including groovybc itself?
|
|
March 12, 2013, 11:11 |
|
#14 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
The reason why you're not making them walls is because all other quantities should be transported across in a "cyclic" way? Problem is that if the patch is cyclic you can't set a "fixedValue" there. Would have to play around with it myself, but I think one way to go would be to make the patches "mapped", set U with fixedValue and "transport" the other stuff by using the mapped functionality
__________________
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 |
|
March 20, 2013, 18:30 |
Almost there!
|
#15 | |
Member
Ronald McDonald
Join Date: Jul 2012
Posts: 38
Rep Power: 14 |
Quote:
So I was able to map patches for one field doing what you said and create a fixedValue for another field. Good news is I am getting the same results as when I used groovyBC, and without the warning message to boot. Bad news is is that they are still incorrect results. What I should be getting is a linear curve (I run plot over line in paraview on the y-axis and just look at my H2O scalarField), but I get linear up to my boundary and then parabolic afterwards. Is there anyway I can get linear throughout the whole domain, like it should be? (Actually if you look at H2 it has a linear result, as it should) I have attached my case file and my solver. They are very basic. I just run blockMesh, waterFoam2 and paraFoam to view it. Hopefully, you can take a quick look to see if is possible to get a linear curve. Sincerely, Benjamin Last edited by mcdonalds; March 20, 2013 at 19:09. |
||
March 21, 2013, 08:25 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Also: this is more about the physics than swak, right? Because the value on the jump is right, the problem occurs on the interior (where the solver is responsible), right? Only thing I can suggest without having looked at the stuff is to check the BC on "the other side" of the parabola
__________________
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 |
||
March 28, 2013, 14:41 |
Linear function and integral
|
#17 |
Member
Ronald McDonald
Join Date: Jul 2012
Posts: 38
Rep Power: 14 |
Hi Bernhard,
I have a two real quick questions about openfoam. 1) I'd like to create a variable, let's say D and make it a function of y. So something like D=5y+6. Is this possible in openFoam? 2) I'd like to integrate over a length in the y-direction. I was going to put my field (let's say jbv) in my time step and use the += function to sum up. However, I would have to also multiply by the size of the cell along the y-direction at each time step (They are uniform in my model). Do you know how to reference the length of the cell in the y-direction? It would look something like this: P += jbv*dy (where dy is the length of the cell in the y-direction) Sincerely, Benjamin |
|
March 29, 2013, 04:45 |
|
#18 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
The long answer is: You're very vague. What is the context? What are you using D for? With y do you mean what? The position? 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 |
||||
October 2, 2014, 03:32 |
How to use groovyBCJump?
|
#19 | ||||
Member
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16 |
I see the example case in Example/tests/jumpChannel/ in the release of swak4Foam.
I tried to understand how they define the pressure jump, because in the example files, they define two jumps, jump1 and jump2 by the following lines: Quote:
So this means that each jump (jump1 and jump2) defines two faces with a pressure difference on the faces, but how do they define the two faces by simply one line, for example, for jump1: Quote:
My domain size is (0 0 -0.001) to (0.22 0.3 0.001) so should I define the jump faces as: Quote:
Quote:
This means that I defined 0 faces as a result!!! But Why??? If somebody can help me to understand this, I will really appreciate them!!! |
|||||
October 2, 2014, 11:49 |
|
#20 | |
Member
Charlie
Join Date: Dec 2010
Location: USA
Posts: 85
Rep Power: 16 |
OK, It's a silly question here, I know how to specify the pressure difference between two cyclic BC now. It turns out that the purpose of using faceSet is to cut the domain to get two cut faces, and it's not necessary for my case, I just need to use groovyBCJump directly on my cyclic BC.
Hope this is useful for other first users of groovyBCJump, like me. :-) Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
Possible bug with stitchMesh and cyclics in OpenFoam | Jack001 | OpenFOAM Pre-Processing | 0 | May 21, 2016 09:00 |
[blockMesh] Merging edge patches | Yosmcer | OpenFOAM Meshing & Mesh Conversion | 11 | November 16, 2014 15:51 |
Cyclic boundaries in OF 21x | morard | OpenFOAM | 25 | May 13, 2013 23:35 |
[swak4Foam] some questions about neibours of patches in groovyBC | immortality | OpenFOAM Community Contributions | 7 | March 3, 2013 12:38 |