
[Sponsors] 
December 7, 2011, 14:24 
zeroGradient BC for velocity at oulet

#1 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
Sponsored Links
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 04:01. 

Sponsored Links 
December 8, 2011, 12:37 

#2 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
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 13:00. 

December 8, 2011, 14:04 

#3 
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 734
Rep Power: 21 
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 HagenPoiseuille 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). 

December 8, 2011, 16:08 

#4 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
Hi,
I am developing a PISObased algorithm to solve lowmach 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 directionx axis, not along yaxis) without pressure gradient and viscosity. This is not a pressure driven flowpressure 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 18:19. 

December 8, 2011, 16:39 

#5 
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 734
Rep Power: 21 
Wow, something very different indeed. Is the inlet velocity boundary condition related to the consumption of fuel (with subsequent density decrease)?


December 8, 2011, 17:37 

#6 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
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 18:37. 

December 8, 2011, 19:08 

#7 
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 734
Rep Power: 21 
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.


December 8, 2011, 19:18 

#8 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
Density and c are related through the formula:
Density=0.6(0.4*tanh(10*(0.5c))); cscalar So, rho is not zero even when c=0. There is no zero density region. c=0 means fuel is completely burntdoesn'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 19:35. 

December 10, 2011, 04:33 

#9 
Member
achinta
Join Date: May 2010
Location: Sydney
Posts: 66
Rep Power: 9 
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 d1density plot at time=0.1s d5density plot at time=0.5s The error in velocity is high is low density region (flat region of the velocity profile) Thanks, AV Last edited by achinta; December 10, 2011 at 04:58. Reason: add more information 

December 16, 2011, 15:00 

#10 
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 734
Rep Power: 21 
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?


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
turbulent jet flow RANS validation  heavy_user  OpenFOAM Running, Solving & CFD  12  December 17, 2015 21:35 
second order schemes  marine  OpenFOAM  66  October 26, 2014 12:10 
Pressure instability with rhoSimpleFoam  daniel_mills  OpenFOAM Running, Solving & CFD  44  February 17, 2011 18:08 
interFoam  andrea.pasquali  OpenFOAM  7  May 30, 2010 12:45 
ZeroGradient pressure Outlet BC prob (adjustPhi.C)  Stylianos  OpenFOAM  3  March 23, 2010 13:28 
Sponsored Links 