CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] zerogradient in groovy

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2012, 19:24
Default zerogradient in groovy
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
I want to use zerogradient bc in groovy bc.is it possible?
immortality is offline   Reply With Quote

Old   November 22, 2012, 19:50
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
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
gschaider is offline   Reply With Quote

Old   November 23, 2012, 05:29
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
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.
immortality is offline   Reply With Quote

Old   November 23, 2012, 15:37
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
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
gschaider is offline   Reply With Quote

Old   November 23, 2012, 16:52
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
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?
immortality is offline   Reply With Quote

Old   October 18, 2013, 05:34
Default
  #6
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 14
maalan is on a distinguished road
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
maalan is offline   Reply With Quote

Old   October 18, 2013, 07:02
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
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
gschaider is offline   Reply With Quote

Old   October 18, 2013, 07:11
Default
  #8
Member
 
Join Date: Jun 2011
Posts: 80
Rep Power: 14
maalan is on a distinguished road
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!
maalan is offline   Reply With Quote

Reply

Tags
groovybc, zerogradient


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong Boundary Conditions (maximum number of iterations) in compressibleInterDyMFoam silencebreak OpenFOAM Running, Solving & CFD 0 September 11, 2017 07:05
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Boundary Conditions MtnRunBeachBum OpenFOAM Pre-Processing 1 April 30, 2015 16:33
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 14:16
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 17:08


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