internal flow BCs: pressure driven versus velocity driven
this is what I have in my p and U files for a flow driven by velocity. it seems to run fine:
for velocity: SDuctWallface1 { type fixedValue; value uniform (0 0 0); } SDuctWallface2 { type fixedValue; value uniform (0 0 0); } SDuctInletface1 { type surfaceNormalFixedValue; refValue uniform -20.000000; } SDuctOutletface1 { type zeroGradient; } for pressure: SDuctWallface1 { type zeroGradient; } SDuctWallface2 { type zeroGradient; } SDuctInletface1 { type zeroGradient; } SDuctOutletface1 { type fixedValue; value uniform 0.000000; } now, trying on a case where I want to run a flow driven by the difference between inlet total pressure and outlet pressure: for velocity: SDuctWallface1 { type fixedValue; value uniform (0 0 0); } SDuctWallface2 { type fixedValue; value uniform (0 0 0); } SDuctInletface1 { type pressureInletVelocity; } SDuctOutletface1 { type zeroGradient; } for pressure: SDuctWallface1 { type zeroGradient; } SDuctWallface2 { type zeroGradient; } SDuctInletface1 { type totalPressure; value uniform 100000.000000; } SDuctOutletface1 { type fixedValue; value uniform 0.000000; } error: --> FOAM FATAL IO ERROR: keyword gamma is undefined in dictionary "/home/cadne /run/sductpres/0/p::boundaryField::SDuctInletface1" file: /home/cadnexus/OpenFOAM/cadnexus-2.1.0/run/sduc DuctInletface1 from line 51 to line 52. From function dictionary::lookupEntry(const word& in file db/dictionary/dictionary.C at line 400. I'm running simpleFoam so it's incompressible. |
It's complaining because there are more components required to define the totalPressure boundary condition you have set at the inlet. You might have meant fixedValue, like this:
SDuctInletface1 { type fixedValue; value uniform 100000.000000; } |
Quote:
to me it seems there would be too many unknowns to establish the flow field. |
You might need to set your velocity inlet as zeroGradient.
|
it's worth a try.
|
that didn't yield good results. At all.
Can anyone give me a good example of a total pressure BC and extra parameters set up? |
Quote:
https://udrive.oit.umass.edu/kmooney...nElbowFlow.jpg |
is this one of the tutorials? if so, which one?
thanks! |
It's the elbow tutorial (modified) for icoFoam. I changed the BC's to be pressure driven. I put zeroGradient U BC's on inlets and the outlet, no slip on the walls. I assigned a pressure drop of 10 Pa.
|
Quote:
Thanks! |
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | | \\ / O peration | Version: 1.6-ext | | \\ / A nd | Web: www.extend-project.de | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { wall-4 { type zeroGradient; } velocity-inlet-5 { type fixedValue; value uniform 10; } velocity-inlet-6 { type fixedValue; value uniform 10; } pressure-outlet-7 { type fixedValue; value uniform 0; } wall-8 { type zeroGradient; } frontAndBackPlanes { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM Extend Project: Open Source CFD | | \\ / O peration | Version: 1.6-ext | | \\ / A nd | Web: www.extend-project.de | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { wall-4 { type fixedValue; value uniform (0 0 0); } velocity-inlet-5 { type zeroGradient; } velocity-inlet-6 { type zeroGradient; } pressure-outlet-7 { type zeroGradient; } wall-8 { type fixedValue; value uniform (0 0 0); } frontAndBackPlanes { type empty; } } |
this is the velocity driven flow, not pressure driven.
|
I've assigned a fixed deltaP between the inlets and the outlets. Dirchlet BC's are assigned for U at the walls only as no slip, no penetration. Von Neumann conditions at the inlet and outlet for U.
Please explain your reasoning for describing this as a velocity driven flow. |
my bad, since the patches were named velocity, didn't look at the header properly :)
sorry thanks |
I think you just missed to specify a value for gamma, in case of using totalpressure, you also have to set a value for gamma, the boundary conditions that you sent in your first posts seem right.
|
Quote:
I also had to change value uniform to p0 uniform. it's running now with inlet specifying total pressure. keep your fingers crossed. |
Quote:
Cheers, Saba |
from what i understand, it has to do with the way pressure is transmitted via waves. if you set both inlet and outlet to fixed pressures you are overconstraining the problem.
i think if you set fixed inlet you have to set wavetransmissive at the outlet. with total pressure,it adjusts itself i guess. not sure :) my solution even with total pressure at inlet has a singularity and i am trying to figure out if the mesh is causing it or something else. |
What does gamma stand for in openFOAM?
|
Hi all,
for the totalPressure BC there are different ways for calculation. It depends on the initialization of the BC. But first to your question @lobstar. gamma = Heat capacity ratio That is the important code for totalPressure: Code:
if (psiName_ == "none" && rhoName_ == "none") In the constructors you find the way how to set this bc correct and if you do not set an value which value would be set instead - an example that works: Code:
Code:
operator==(p0p - 0.5*(1.0 - pos(phip))*magSqr(Up)); Tobi |
Since you are using simpleFoam just add the following:
type totalPressure; gamma 1.0; p0 uniform 0; value uniform 0; You should be O.K now. |
BC Total Pressure
Dear OpenFoamers,
I would like to set up my study case: a water flow through a channel by simpleFoam. I want to set boundary conditions as total pressure: (1 bar at inlet and 0 bar at outlet). Now I have: ================================================== ==== p ================================================== ==== inlet type fixedValue uniform 100 ? for simpleFoam pressure = pressure/mass density, right? outlet type fixedValue uniform 0 ================================================== ==== U ================================================== ==== inlet type pressureInletVelocity uniform (0 0 0) outlet type zeroGradient It does not work when I ran simpleFoam! It stops after several iterations. I really don't understand what happened. Do you known why, rather why not? I am looking to hear from you all... Regards, T Quote:
|
Thank MBA for your answer.
That's for p, right? And for both inlet and outlet? Preciously, I change in constant/transportProperties nu = 1e-6 to simulate water. It's OK? May you give me more details... That's would be useful. |
All times are GMT -4. The time now is 00:09. |