CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)

 immortality November 22, 2012 20:24

I want to use zerogradient bc in groovy bc.is it possible?

 gschaider November 22, 2012 20:50

Quote:
 Originally Posted by immortality (Post 393740) 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

 immortality November 23, 2012 06:29

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.

 gschaider November 23, 2012 16:37

Quote:
 Originally Posted by immortality (Post 393786) 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

 immortality November 23, 2012 17:52

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?

 maalan October 18, 2013 05:34

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

 gschaider October 18, 2013 07:02

Quote:
 Originally Posted by maalan (Post 457606) 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

 maalan October 18, 2013 07:11

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!

 All times are GMT -4. The time now is 00:41.