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

zeroGradient BC for velocity at oulet

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 7, 2011, 13:24
Default zeroGradient BC for velocity at oulet
  #1
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Hi all,
I am implementing my own solver in OF. I have 1D flow case. The velocity boundary condition at the outlet is zeroGradient. But, the results obtained are contradicting the BCs. Seems, OF is not implementing the BC. Here are the velocity values at time t=0.1s
-------------------
(....
.....
..
(4.91905 0 0)
(4.91905 0 0)
(4.91905 0 0)
(4.91905 0 0)
(4.91905 0 0)
(4.91905 0 0)
(4.9188 0 0)
(4.94397 0 0)
(4.64658 0 0)
(6.06569 0 0)
(2.02726 0 0)-----OUTLET
)
;

boundaryField
{
inlet
{
type timeVaryingUniformFixedValue;
fileName "velocity";
outOfBounds clamp;
value uniform (1.00004 0 0);
}
outlet
{
type zeroGradient;
}
fixedWalls
{
type empty;
}
frontAndBack
{
type empty;
}
}

----------------
Could anyone please tell me where I went wrong?

Thanks,

AV

Last edited by achinta; December 9, 2011 at 03:01.
achinta is offline   Reply With Quote

Old   December 8, 2011, 11:37
Default
  #2
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Hello everyone,
I would like to add some more information. I am using PISO algorithm. The following boundary conditions were given to the unsteady, compressible 1 D pipe/channel flow:
---------
For VELOCITY

inlet
{
type timeVaryingUniformFixedValue;
fileName "velocity";
outOfBounds clamp;
}
outlet
{
type zeroGradient;
}
fixedWalls
{
type empty;
}
frontAndBack
{
type empty;
}
-----------
For PRESSURE:

inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 100000;
}
fixedWalls
{
type empty;
}
frontAndBack
{
type empty;
}

----------------
Please comment whether the boundary conditions are specified correctly for the given case.

Regards,
AV

Last edited by achinta; December 8, 2011 at 12:00.
achinta is offline   Reply With Quote

Old   December 8, 2011, 13:04
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I believe your error is caused by having the fixedWalls as an empty boundary condition. When you say 1D channel flow, I am assuming you mean something like Hagen-Poiseuille flow (unsteady here as you are ramping the outlet velocity).

If fixedWalls are the walls of the pipe, then you currently have no boundary condition there. Empty is used to tell OF not to solve on that region. I would suggest you change the velocity BC to fixedValue (0 0 0) and the pressure BC to zeroGradient on those boundaries.

If I have assumed something different than what you are trying to accomplish we'll need more information to help you with (what OF solver is your new solver most like, what modifications you have made, etc).
mturcios777 is offline   Reply With Quote

Old   December 8, 2011, 15:08
Default
  #4
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Hi,
I am developing a PISO-based algorithm to solve low-mach number reacting flow. Its solves continuity, momentum and scalar transport equation. The density is related to scalar(c=1, if fuel is present, c=0:fuel absent) using an empirical equation. It is similar to 'rhoPisoFoam' without the hEqn and rhoEqn. Extra scalar transport equation is added.

I have to validate my code. I have analytical solution for unsteady,compressible reacting 1 D flow(along axial direction-x axis, not along y-axis) without pressure gradient and viscosity. This is not a pressure driven flow-pressure is constant through out the domain. The fuel burns, density decreases, velocity of fluid increases(to conserve mass) and hence the flow is driven from inlet to outlet.

Hence, to compare analytical solution, i created a rectangular pipe. To avoid the effect of viscosity, i didnt give 'no slip' conditions to fixedwalls. To make it 1D along axis, I gave 'empty' conditions to fixed walls. I gave the boundary condition mentioned in previous post.

Am I following the right procedure?

Thank you very much for your reply.

AV

Last edited by achinta; December 8, 2011 at 17:19.
achinta is offline   Reply With Quote

Old   December 8, 2011, 15:39
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Wow, something very different indeed. Is the inlet velocity boundary condition related to the consumption of fuel (with subsequent density decrease)?
mturcios777 is offline   Reply With Quote

Old   December 8, 2011, 16:37
Default
  #6
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Hi,
The product of density and velocity is a constant. Density depends on scalar(c). Hence, velocity boundary condition at inlet depends on scalar. But, the time varying boundary conditions for velocity and scalar(c) are given in "Scalar.dat" and "velocity.dat" files. The boundary condition for 'c' is similar to velocity BC.

Here is the BC for 'c':
inlet
{
type timeVaryingUniformFixedValue;
fileName "Scalar";
outOfBounds clamp;
}
outlet
{
type zeroGradient;
}
fixedWalls
{
type empty;
}
frontAndBack
{
type empty;
}

-------------------
The values in "Scalar" and "velocity" files are calculated from the analytical formula at x=0.

Should I change BC for pressure to get correct results? Which is the best way to make sure that pressure is constant throughout the domain? In the OpenFOAM results, pressure changes considerably near inlet and product of density and velocity is not constant near the inlet. please suggest some methods.

Regards,
AV

Last edited by achinta; December 8, 2011 at 17:37.
achinta is offline   Reply With Quote

Old   December 8, 2011, 18:08
Default
  #7
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I'm taking that you are concerned with that sudden changes in velocity before the outlet. Its difficult for me to tell without knowing the equations you are trying to solve. I'm curious how your a PISO solver handles zero density where there is no fuel. Is this a model you have developed or is there some literature I could see to have a better idea.
mturcios777 is offline   Reply With Quote

Old   December 8, 2011, 18:18
Default
  #8
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Density and c are related through the formula:
Density=0.6-(0.4*tanh(10*(0.5-c))); c-scalar

So, rho is not zero even when c=0. There is no zero density region. c=0 means fuel is completely burnt-doesn't mean there is no fluid.

I am solving standard unsteady,compressible continuity and momentum equations. The code also includes scalar transport equation for 'c'.

Last edited by achinta; December 8, 2011 at 18:35.
achinta is offline   Reply With Quote

Old   December 10, 2011, 03:33
Default
  #9
Member
 
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 15
achinta is on a distinguished road
Hello,
I observe differences between analytical and OF results (please find the attached files).I had assumed zeros pressure gradient(dp/dx=0) while deriving analytical solution. In openFoam, its difficult to maintain zero pressure gradient through the domain. Are these errors due to the dp/dx=0 assumption?

The attachments are:
v1- velocity plot at time=0.1s
v5- velocity plot at time=0.5s
v10- velocity plot at time=1s

d1-density plot at time=0.1s
d5-density plot at time=0.5s

The error in velocity is high is low density region (flat region of the velocity profile)

Thanks,
AV
Attached Images
File Type: jpg v5.jpg (43.5 KB, 48 views)
File Type: jpg v1.jpg (43.2 KB, 29 views)
File Type: jpg v10.jpg (47.3 KB, 33 views)
File Type: jpg d1.jpg (42.5 KB, 24 views)
File Type: jpg d3.jpg (42.4 KB, 27 views)

Last edited by achinta; December 10, 2011 at 03:58. Reason: add more information
achinta is offline   Reply With Quote

Old   December 16, 2011, 14:00
Default
  #10
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Since the shape of the velocity profile is similar to the analytical solution, I think your boundary conditions are okay. When you say unsteady flow, what part of the solution is unsteady in the analytical version? Your analytical solution appears constant in time for both density and velocity. If you leave the solver to run for longer than 1s (simulation time I assume), does the flat region of the velocity profile keep growing?
mturcios777 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
second order schemes marine OpenFOAM 67 April 11, 2022 18:19
interFoam andrea.pasquali OpenFOAM 8 February 23, 2021 12:06
turbulent jet flow RANS validation heavy_user OpenFOAM Running, Solving & CFD 12 December 17, 2015 20:35
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 17:08
ZeroGradient pressure Outlet BC prob (adjustPhi.C) Stylianos OpenFOAM 3 March 23, 2010 12:28


All times are GMT -4. The time now is 09:12.