zeroGradient BC for velocity at oulet
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 
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 
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). 
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 
Wow, something very different indeed. Is the inlet velocity boundary condition related to the consumption of fuel (with subsequent density decrease)?

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 
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.

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'. 
5 Attachment(s)
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 
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?

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