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

[swak4Foam] groovyBC for oscillatory flow

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 14, 2013, 17:29
Default groovyBC for oscillatory flow
  #1
New Member
 
Skywalker
Join Date: Aug 2012
Posts: 1
Rep Power: 0
liybzd is on a distinguished road
Hi Foamers,

I'm using groovyBC for oscillatory flow in a simple rectangular box, it's only a test.
Six boundaries in this case, front, back, top and bottom are all slip.
inlet and outlet are set to groovyBC. The solver is pisoFoam.

The velocity filed on left and right are set as:

inlet
{
type groovyBC;
valueExpression "vector(Um*cos(ome*time()),0,0)";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
value uniform (1.95 0 0);
}
outlet
{
type groovyBC;
valueExpression "vector(Um*cos(ome*time()),0,0)";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
value uniform (1.95 0 0);

In this case, U=1.95*cos(ome*t).

Since -dp/dx=dU/dt=-1.95*ome*sin(ome*t), so the BC of pressure filed is set as:
inlet
{
type groovyBC;
gradientExpression "-Um*ome*sin(ome*time())";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
fractionExpression "0";
value uniform 0;
}
outlet
{
type groovyBC;
gradientExpression "Um*ome*sin(ome*time())";
variables "Um=1.95;ome=2*pi/5.5;";
fractionExpression "0";
timelines ();
value uniform 0;
}


Both velocity and pressure filed blows up in a few seconds, I don't know if there is mistake in it...
liybzd is offline   Reply With Quote

Old   December 15, 2013, 08:08
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,035
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by liybzd View Post
Hi Foamers,

I'm using groovyBC for oscillatory flow in a simple rectangular box, it's only a test.
Six boundaries in this case, front, back, top and bottom are all slip.
inlet and outlet are set to groovyBC. The solver is pisoFoam.

The velocity filed on left and right are set as:

inlet
{
type groovyBC;
valueExpression "vector(Um*cos(ome*time()),0,0)";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
value uniform (1.95 0 0);
}
outlet
{
type groovyBC;
valueExpression "vector(Um*cos(ome*time()),0,0)";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
value uniform (1.95 0 0);

In this case, U=1.95*cos(ome*t).

Since -dp/dx=dU/dt=-1.95*ome*sin(ome*t), so the BC of pressure filed is set as:
inlet
{
type groovyBC;
gradientExpression "-Um*ome*sin(ome*time())";
variables "Um=1.95;ome=2*pi/5.5;";
timelines ();
fractionExpression "0";
value uniform 0;
}
outlet
{
type groovyBC;
gradientExpression "Um*ome*sin(ome*time())";
variables "Um=1.95;ome=2*pi/5.5;";
fractionExpression "0";
timelines ();
value uniform 0;
}


Both velocity and pressure filed blows up in a few seconds, I don't know if there is mistake in it...
Usually setting the velocity on all patches (which you basically do) is not a good idea as the slightest inaccuracies will blow up an incompressible solver (compressible too, but it will take longer).

As it seems to take only a few timesteps to blow up I'd suggest that you write out every timestep and have a look at them. Usually then it becomes painfully clear what the problem is. If it takes a bit longer you can use purgeWrite in the controlDict to keep only the last few.

Another problem can be that you only specify Neuman-conditions for the pressure. Usually OF then needs a reference-pressure from you. I'm not 100% sure but as groovyBC is a mixed-BC it is possible that OF says "Ah. there's a Dirichlet-type BC here. Don't need a reference pressure". Remedy here would be to fix the pressure on one boundary
__________________
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different flow patterns in CFX and Fluent avi@lpsc FLUENT 4 April 8, 2012 06:12
Flow meter Design CD adapco Group Marketing Siemens 3 June 21, 2011 08:33
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
potential flow vs. Euler flow curious ... Main CFD Forum 23 July 21, 2006 07:40
Plug Flow Franck Main CFD Forum 3 September 4, 2003 05:57


All times are GMT -4. The time now is 08:47.