CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

How to access cell data and how to add impedance outlet BC

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

LinkBack Thread Tools Display Modes
Old   July 2, 2014, 02:08
Question How to add impedance outlet BC
New Member
Join Date: Jun 2014
Posts: 1
Rep Power: 0 is on a distinguished road
Hi everyone!

I am a fresh foamer and my recent work really needs help;

The question is how to implement an impedance/resistance outlet Boundary condition. This boundary condition can be described by a simple equation:


where P is the outlet pressure, F the volume flux at the outlet, R is the resistance. (Taken from the electronic circuit equation U=I*R); If I get the outflow volume flux of a specific outlet, I can calculate the outlet-pressure and then apply it to this outlet.

The main problem is that I don't know how to modify the original fixed-value pressure-outlet as desired, can anybody help?

Last edited by; July 6, 2014 at 21:19. is offline   Reply With Quote

Old   September 24, 2016, 09:38
Rudolf Hellmuth
Join Date: Sep 2012
Location: Galway, Ireland
Posts: 38
Rep Power: 6
rudolf.hellmuth is on a distinguished road
I have the same problem, I am trying to make a resistive outlet BC (p_out = R*Q), that simulates the effect of the tube downstream from the BC. The problem, I suppose, arises from the fact that the pressure BC is softly coupled with the velocity BC, and this generates instabilities, if the inflow conditions (U or p) have a sharp time variation (time derivative). When that happens, the pressure on the outlet BC can become too high, because the velocity field is calculated with the outlet pressure of the previous time step (before pressure correction), resulting in a artificially high outlet flow rate. Then, pressure is updated with p_out = R*Q, to an extremely high value, which causes spurious oscillations of p and U at the outlet. It would be extremely important to either couple U and p (which I suppose is difficult), or penalise oscillations of the velocity field at the outlet (which I don't know how to do).

I am using the plenumPressureFvPatchScalarField as guide to implement the resistiveBC, but it is an one-way explicit coupling, which should also have this backflow instability, because it has a regularisation scheme.

Update of p in the plenumBC:
void Foam::plenumPressureFvPatchScalarField::updateCoeffs()

    const scalarField p_new
        (1.0 - pos(phi))*t*plenumPressure + pos(phi)*max(p, plenumPressure)

    // Relaxation fraction
    const scalar oneByFraction = timeScale_/dt;
    const scalar fraction = oneByFraction < 1.0 ? 1.0 : 1.0/oneByFraction;

    // Set the new value
    operator==((1.0 - fraction)*p_old + fraction*p_new);
The relaxation fraction scheme is working for me, but it is not sufficient, when the inflow variations are too high. In a paper that I read, the authors solved this problem by penalising the flow field instead of the pressure field in the next iteration, when backflow occurs. They suggest that:

U_outlet = U_outlet - b*(1 - pos(phip))*U_outlet , where 0 < b < 0.5.

Does anyone know what I should do to update the velocity field with a backflow penalisation after the pressure field is solved? Any suggestion is very appreciated.

Another question: Can I update the UEqn matrix from my pressure BC code in order to couple the pressure update with velocity?

rudolf.hellmuth is offline   Reply With Quote


cell data, openfoam udf, user-defined bc

Thread Tools
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 On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 08:42.