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

[swak4Foam] groovyBC for oscillatory flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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,225
Rep Power: 51
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

Old   November 10, 2018, 17:32
Default
  #3
Senior Member
 
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 119
Rep Power: 10
dewey is on a distinguished road
Hi, i want to simulate the pulsatile flow in the brain, and i took the syntaxis from here.


We define the vector velocity with his components, but I want to use a velocity normal to the inlet surface or flow rate, because my inlet geometry is not only in one plane.


could you help me please!







inlet

{
type groovyBC;
valueExpression "vector(R*(1+(A1*cos(2*1*pi*ome+B1))+(-A2*cos(2*2*pi*ome+B2))+(A3*cos(2*3*pi*ome+B3))+(A4 *cos(2*4*pi*ome+B4))+(A5*cos(2*5*pi*ome+B5))),0,0) ";
variables "A1=0.29244;A2=0.5908;A3=0.2726;A4=0.198;A5=0.1124 ;B1=4.027;B2=6.509;B3=1.913;B4=1.461;B5=0.074;Te=0 .75;R=0.3324;ome=time()/Te;";
timelines ();
value uniform (0.093 0 0);
}
dewey is offline   Reply With Quote

Old   November 11, 2018, 13:19
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 dewey View Post
Hi, i want to simulate the pulsatile flow in the brain, and i took the syntaxis from here.


We define the vector velocity with his components, but I want to use a velocity normal to the inlet surface or flow rate, because my inlet geometry is not only in one plane.


could you help me please!







inlet

{
type groovyBC;
valueExpression "vector(R*(1+(A1*cos(2*1*pi*ome+B1))+(-A2*cos(2*2*pi*ome+B2))+(A3*cos(2*3*pi*ome+B3))+(A4 *cos(2*4*pi*ome+B4))+(A5*cos(2*5*pi*ome+B5))),0,0) ";
variables "A1=0.29244;A2=0.5908;A3=0.2726;A4=0.198;A5=0.1124 ;B1=4.027;B2=6.509;B3=1.913;B4=1.461;B5=0.074;Te=0 .75;R=0.3324;ome=time()/Te;";
timelines ();
value uniform (0.093 0 0);
}

In groovyBC the function normal() gives you the unit vector normal to each patch face. So by multiplying it (watch the sign) with your velocity you should get what you need
__________________
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 11, 2018, 14:46
Default
  #5
Senior Member
 
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 119
Rep Power: 10
dewey is on a distinguished road
Thrank you my friend, now I am trying this:


{
type groovyBC;
valueExpression "R*(1+(A1*cos(2*1*pi*ome+B1))+(-A2*cos(2*2*pi*ome+B2))+(A3*cos(2*3*pi*ome+B3))+(A4 *cos(2*4*pi*ome+B4))+(A5*cos(2*5*pi*ome+B5)))";
variables "A1=0.29244;A2=0.5908;A3=0.2726;A4=0.198;A5=0.1124 ;B1=4.027;B2=6.509;B3=1.913;B4=1.461;B5=0.074;Te=0 .75;R=0.3324*normal();ome=time()/Te;";
timelines ();
value uniform (0.093 0 0);
}



I am multiplying the R*normal(), but could you explainme what the sign mean?


What will be the result with (-) or (+), I will try both.
dewey is offline   Reply With Quote

Old   November 12, 2018, 08:53
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 dewey View Post
Thrank you my friend, now I am trying this:


{
type groovyBC;
valueExpression "R*(1+(A1*cos(2*1*pi*ome+B1))+(-A2*cos(2*2*pi*ome+B2))+(A3*cos(2*3*pi*ome+B3))+(A4 *cos(2*4*pi*ome+B4))+(A5*cos(2*5*pi*ome+B5)))";
variables "A1=0.29244;A2=0.5908;A3=0.2726;A4=0.198;A5=0.1124 ;B1=4.027;B2=6.509;B3=1.913;B4=1.461;B5=0.074;Te=0 .75;R=0.3324*normal();ome=time()/Te;";
timelines ();
value uniform (0.093 0 0);
}



I am multiplying the R*normal(), but could you explainme what the sign mean?


What will be the result with (-) or (+), I will try both.

Exactely. I keep forgetting whether normal() points in or out. So I leave finding the correct sign as "an exercise for the reader" (that is the usual formulation if a textbook author isn't sure about the details)
__________________
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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
Different flow patterns in CFX and Fluent avi@lpsc FLUENT 4 April 8, 2012 07:12
Flow meter Design CD adapco Group Marketing Siemens 3 June 21, 2011 09:33
potential flow vs. Euler flow curious ... Main CFD Forum 23 July 21, 2006 08:40
Plug Flow Franck Main CFD Forum 3 September 4, 2003 06:57


All times are GMT -4. The time now is 22:27.