groovyBC for coupling of patches
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 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 |
Quote:
Bernhard |
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 |
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 |
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? |
Quote:
Bernhard |
I have a question about this warning.
What does it actually warn me about? Code:
--> FOAM Warning : BC looks like this: Code:
rod1 |
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 |
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? |
Quote:
|
Working with groovyBC jump
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 Benjamin |
Quote:
|
Quote:
|
Quote:
|
Almost there!
2 Attachment(s)
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 |
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 |
Linear function and integral
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 |
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:
|
How to use groovyBCJump?
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!!! Quote:
|
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:
|
Quote:
|
All times are GMT -4. The time now is 20:58. |