Bulk flow controller / spatial average plugin

Hello,

I´m using the code from the supplementary material of https://doi.org/10.1017/jfm.2019.520 for channel flow simulations.
Could you please provide a sample ini file, to see which parameters are necessary / available for the bulk_flow_controller and spatial_average plugins, to adjust a constant bulk velocity and get y-dependent statistics like u_rms ?

Regards,
Marius

Hi Marius,

I have a branch of PyFR that does recirculation with body forcing to maintain a constant bulk velocity :

https://github.com/tarikdzanic/PyFR-RC

The forcing is controlled by the following parameters in the .ini file:

[soln-plugin-inletforcing]
inletname = ‘periodic_0_l’
area = 9.01441
mdotstar = 1

‘Inletname’ is the inlet (or outlet) boundary name in the mesh file (which has to be a periodic boundary condition), ‘area’ is the total inlet area, and mdotstar is the desired mass flow rate normalized by area.

Best,
Tarik

Hello Tarik

Is it possible to use your recirculation plugin in the newest version of pyfr?

When trying to add the plugin as is, I get the following error: 'Mass flow rate exceeds 10%% error which seemingly has to do with the fact that periodic B.C seems to not be recognized (bc not in mesh) and self.hasinlet = False. What else needs to be adapted?

Many thanks
Eitan

Hi Eitan,

That code is quite outdated by now. I would recommend just using a body-force on the streamwise velocity (or streamwise momentum and energy if running compressible) to achieve a similar effect.

Thank you for the reply.

Do you mean to use a constant body force stream-wise velocity equal to the bulk velocity throughout the whole domain or only in a thin slice of it similar to what you have implemented in your plugin ?

Truth is I began by using a body force on the stream-wise velocity throughout the whole domain, doing this seems to cause the solution to explode after a while (and velocities to be much higher than they should be). When running the case without the body force no such problem occurs and results are much better (but the flow of course is decaying over time). This made me conclude that something about using a body force on the stream wise velocity, is not correct (though I don’t completely understand how the velocity body force works and thus can’t be sure of my conclusion).

My case is an urban canopy flow (flow over a surface with attached bluff bodies), with lateral periodic B.C and I need some kind of forcing term to move the flow (constant mass flow/ pressure gradient) and correspond to a given experimental bulk velocity. Any suggestions on how to overcome this problem will be appreciated…

Eitan

I’m referring to a constant body force – in fact, the old bulk flow controller also used a constant body force (calculated by the mass defect between the inlet and outlet) on the x-momentum equation. This is a standard practice for channel flows (see https://how5.cenaero.be/sites/how5.cenaero.be/files/WS2_ChannelFlowRe550.pdf under the Governing Equations section) to enforce a certain Re_tau via an additional pressure gradient (body force). The body force you apply should balance the viscous forces to maintain a constant mass flow – this may not be easy to calculate a priori for more complex flows and might require some tuning of the body force value. What likely happened to you is that the body force you used was too large so the velocity kept increasing to try to balance out the body force with the viscous stresses.

That clears thing up a bit.

If I understand correctly, you recommendation is adding a constant body force, which would be equivalent to adding a constant pressure gradient. I now understand that the x-velocity source term adds a regular constant source term to the Navier Stokes equations and not as I mistakenly understood a forcing term driving the solution to some velocity (If this is really the case, then yes, my problem is that I used a source term which is much too high).

Though I know it is commonly seen as identical to adding a constant pressure gradient, I am still interested in adding a driving the force with a constant flow rate, (where the forcing term is expected to change in time), for comparison of the two, and I was hoping to base on your code for that…

In any case thank you very much for your support, it has been very helpful.
Eitan

I realize that what you’re looking for is slightly different than what a constant pressure gradient can give. I roughly implemented the bulk flow controller in the most recent version of pyfr now (GitHub - tarikdzanic/PyFR at feature/recirculating_inflow). I haven’t tested it much and not in parallel (the partitioner code may need debugging) but it does seem to preserve a constant mass flow rate for a simple channel flow.

Wow, thank you so much, I really appreciate all your help

Eitan

1 Like