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

 November 22, 2012, 20:24 zerogradient in groovy #1 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 20 I want to use zerogradient bc in groovy bc.is it possible?

November 22, 2012, 20:50
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,019
Rep Power: 43
Quote:
 Originally Posted by immortality I want to use zerogradient bc in groovy bc.is it possible?
Code:
```gradientExpression "0";
fractionExpression "0";```
but the question is "why?" when zeroGradient can do it just as well
__________________
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

 November 23, 2012, 06:29 #3 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 20 I want to simulate a cube like cavity but top wall is opening to an environment.the known properties of environment are p0 and T0 only and not velocity.therefore in cells that see outer field the pressure must be replaced in stagnations from inside of the domain as the characteristics and riemann invarient says.after some calculation the velocity of entering fluid can be achieved If I correct. Now I think if I write formulas in groovy and can replace inner pressure the problem can be solved. If I write pressure BC as zerogradient without groovyBC and write velocity with formulas including pressure will it replace from neighbouring cells in the domain and is this ok? Thank you for attention and sorry for long saying.

November 23, 2012, 16:37
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,019
Rep Power: 43
Quote:
 Originally Posted by immortality I want to simulate a cube like cavity but top wall is opening to an environment.the known properties of environment are p0 and T0 only and not velocity.therefore in cells that see outer field the pressure must be replaced in stagnations from inside of the domain as the characteristics and riemann invarient says.after some calculation the velocity of entering fluid can be achieved If I correct. Now I think if I write formulas in groovy and can replace inner pressure the problem can be solved. If I write pressure BC as zerogradient without groovyBC and write velocity with formulas including pressure will it replace from neighbouring cells in the domain and is this ok? Thank you for attention and sorry for long saying.
Sorry. I'm not quite sure what you're saying. Is your problem that you want either a fixed value or a fixed gradient for p depending on whether the velocity goes "in" or "out"? Can be done with groovyBC: with the fractionExpression you can switch a face from fixedValue (1) to fixedGradient (0).

Also check out the "advanced" BCs in OpenFOAM (pressureInletVelocity etc). Maybe what you want is there
__________________
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

 November 23, 2012, 17:52 #5 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 20 ok.if I say very clear Its only p0 and T0 conditions from flow that is known.not velocity nor other things except direction of the flow that is normal to boundary.and since the condition changes to moving wall according to a time function I have to use groovyBC.briefly the problem is "how can simulate p0 and T0 boundary conditions in groovyBC?" can you give me a suggestion please?

October 18, 2013, 05:34
#6
Member

Join Date: Jun 2011
Posts: 79
Rep Power: 8
Quote:
 but the question is "why?" when zeroGradient can do it just as well
Hi Bernhard!!

I have a flow past a 2d cylinder inside an O-type mesh. The point is I would like to specify the zeroGradient to be in the freestream direction. Is it possible??

Thanks!!
Best

October 18, 2013, 07:02
#7
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,019
Rep Power: 43
Quote:
 Originally Posted by maalan Hi Bernhard!! I have a flow past a 2d cylinder inside an O-type mesh. The point is I would like to specify the zeroGradient to be in the freestream direction. Is it possible?? Thanks!! Best
That is called "slip" and already built into standard-OpenFOAM
__________________
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 18, 2013, 07:11
#8
Member

Join Date: Jun 2011
Posts: 79
Rep Power: 8
Quote:
 That is called "slip" and already built into standard-OpenFOAM
I meant I wanted to impose it as outlet patch (a half of the boundary cicumference)... not as a wall.

Thanks!