CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to access cell data and how to add impedance outlet BC (https://www.cfd-online.com/Forums/openfoam-programming-development/138300-how-access-cell-data-how-add-impedance-outlet-bc.html)

xiaotian.ding@gmail.com July 2, 2014 02:08

How to add impedance outlet BC
 
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:

P=F*R;

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?

rudolf.hellmuth September 24, 2016 09:38

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:
Code:


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);
    fixedValueFvPatchScalarField::updateCoeffs();
}

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?

Thanks,
Rudolf


All times are GMT -4. The time now is 17:46.