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

[swak4Foam] time-dependent inletOutlet with groovyBC?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 29, 2013, 08:44
Default time-dependent inletOutlet with groovyBC?
  #1
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 13
letzel is on a distinguished road
Dear Foamers,

given a measured time series of patch-normal velocity Un, is it possible with groovyBC and timelines or lookuptables to set time-dependent inletOutlet boundary conditions on that patch?
I want to set up the following scenario:
  • in case of inflow (say Un >= 0), set inflow boundary condition (value of Un uniform over patch),
  • in case of outflow (say Un < 0), set zeroGradient pressure boundary condition.
Regards,
Marcus
letzel is offline   Reply With Quote

Old   October 29, 2013, 11:08
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 letzel View Post
Dear Foamers,

given a measured time series of patch-normal velocity Un, is it possible with groovyBC and timelines or lookuptables to set time-dependent inletOutlet boundary conditions on that patch?
I want to set up the following scenario:
  • in case of inflow (say Un >= 0), set inflow boundary condition (value of Un uniform over patch),
  • in case of outflow (say Un < 0), set zeroGradient pressure boundary condition.
Regards,
Marcus
Yep. Assuming you have a timeline Un defined
Code:
valueExpression "-normal()*Un";
fractionExpression "Un<0 ? 0 : 1";
__________________
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 30, 2013, 02:37
Default
  #3
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 13
letzel is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Yep. Assuming you have a timeline Un defined
Code:
valueExpression "-normal()*Un";
fractionExpression "Un<0 ? 0 : 1";
Excellent. That means the U boundary condition on that patch is done.

Follow-up question: How do I have to set the corresponding pressure boundary condition on that patch? I would expect that a similar case distinction depending on the sign of Un needs to be implemented for p.
letzel is offline   Reply With Quote

Old   October 30, 2013, 05:18
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 letzel View Post
Excellent. That means the U boundary condition on that patch is done.

Follow-up question: How do I have to set the corresponding pressure boundary condition on that patch? I would expect that a similar case distinction depending on the sign of Un needs to be implemented for p.
That depends on your physics. But any switching here can be done in a similar fashion (of course you can use Un inside a pressure condition 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 4, 2013, 11:43
Default
  #5
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 13
letzel is on a distinguished road
Sorry, the description of my scenario given above was not precise. Let me try to clarify. Basically I am planning to mimick "inletOutlet", the patch field type derived from mixed (table 5.4 in OF 2.2.2 user guide) using the patch-normal velocity component Un:
  • in case of inflow (Un >= 0),
    • for pressure use zeroGradient, and
    • for U use valueExpression "-normal()*Un"
  • in case of outflow (Un < 0),
    • for pressure use fixedValue, and
    • for U use zeroGradient.
My question is how to implement this pressure boundary condition with the help of fractionExpression "Un<0 ? 0 : 1" or
fractionExpression "Un<0 ? 1 : 0".

Whether or not this pressure boundary condition will work well in this case, this will be the next question...
letzel is offline   Reply With Quote

Old   November 4, 2013, 19:08
Default
  #6
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 letzel View Post
Sorry, the description of my scenario given above was not precise. Let me try to clarify. Basically I am planning to mimick "inletOutlet", the patch field type derived from mixed (table 5.4 in OF 2.2.2 user guide) using the patch-normal velocity component Un:
  • in case of inflow (Un >= 0),
    • for pressure use zeroGradient, and
    • for U use valueExpression "-normal()*Un"
  • in case of outflow (Un < 0),
    • for pressure use fixedValue, and
    • for U use zeroGradient.
My question is how to implement this pressure boundary condition with the help of fractionExpression "Un<0 ? 0 : 1" or
fractionExpression "Un<0 ? 1 : 0".

Whether or not this pressure boundary condition will work well in this case, this will be the next question...
I'd say the second one. I'm not quite sure what your problem is: the meaning of the ?:-operator or fractionExpression. Because if you understand these two it should be quite clear
__________________
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   December 10, 2013, 08:47
Default
  #7
Member
 
Marcus Letzel
Join Date: Sep 2012
Location: Bremen
Posts: 35
Rep Power: 13
letzel is on a distinguished road
Thank you, Bernhard, the second one worked out fine.

As a follow-up question, I should now compare this with a conditional totalPressure boundary condition in case of outflow as follows:
  • in case of inflow (Un >= 0),
    • for pressure use zeroGradient, and
    • for U use valueExpression "-normal()*Un"
  • in case of outflow (Un < 0),
    • for pressure use totalPressure, and
    • for U use zeroGradient.
Does the groovyBC syntax allow for this? If so, how?
letzel is offline   Reply With Quote

Old   December 11, 2013, 15:08
Default
  #8
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 letzel View Post
Thank you, Bernhard, the second one worked out fine.

As a follow-up question, I should now compare this with a conditional totalPressure boundary condition in case of outflow as follows:
  • in case of inflow (Un >= 0),
    • for pressure use zeroGradient, and
    • for U use valueExpression "-normal()*Un"
  • in case of outflow (Un < 0),
    • for pressure use totalPressure, and
    • for U use zeroGradient.
Does the groovyBC syntax allow for this? If so, how?
U we've already got covered I think.

p shouldn't be a big problem either. The catch is that you've got to specify the total pressure as an expression. You can't use the readymade BC
__________________
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

Reply


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
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 41 August 23, 2023 02:48
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
[solidMechanics] solidMechanics gear contact in rotation nlc OpenFOAM CC Toolkits for Fluid-Structure Interaction 3 January 11, 2015 06:41
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58


All times are GMT -4. The time now is 21:29.